You know what? You may see a surprising result when a bare < or > is typed outside math mode, especially with older pdfLaTeX font encodings. The exact output depends on the engine, encoding, and fonts; it is not a universal Overleaf behavior.
When compiled with pdflatex, these characters are not mapped to the appropriate comparisons signs, even when they appear inside text mode. So, how do you produce a less-than symbol in LaTeX?
In text, use \textless or \textgreater when you need explicit text symbols. In mathematics, use < and > inside math mode. Modern engines and font packages can also make literal characters work in text, which is why two projects may render the same source differently.
But what about within math mode? That’s another matter entirely.
Comparison symbols in math mode
In this article, I will explore the various symbols that can be produced via LaTeX, including the basic less than symbol (<) and its variants (such as ≤, ≪, etc.), each with their own commands and outputs.
Using LaTeX’s math mode, it’s quite easy to render a series of comparison symbols, like A < B, A > B, A ≤ B, A ≥ B, A ≪ B, and A ≫ B. For each of these, you need to place the appropriate command within a pair of $ delimiters.
Overleaf’s symbol palette
Overleaf also provides symbol discovery and autocomplete features. The exact interface and plan availability can change, so use Overleaf's current help documentation rather than assuming that a particular palette is restricted to a paid plan. Some symbols require packages such as amssymb; the inserted command or documentation should identify that dependency.
So, while typing the less than symbol isn’t really problematic in terms of producing a valid document, it’s definitely something that you should know about if you’re using a text editor rather than an IDE or an editor with spell checking features.
As far as generating the actual less than symbol, however, it doesn’t get much easier than just entering it directly, but if you’d prefer to generate it using one of the other methods described above, there are several options available to you.
Code examples
Finally, here are the LaTeX code examples that show the difference between the two approaches:
A < B
A > B
A \leq B
A \geq B
A \ll B
A \gg B
Note that all six of these statements were generated inside math mode using the $ delimiter.