Geoffs tip with \textless
and \textgreater
will work well for you. However, you could type these symbols < and > directly in your editor and they would be correctly printed if you use the recommended font encoding, Cork resp. T1:
\usepackage[T1]{fontenc}
Have a look at the T1 encoding table, search for the symbols < and >. Afterwards, open the OT1 encoding table, which is the default. At the two corresponding places you will find the upside down exclamation resp. quotation mark. That should explain it.
For further reasons, why you should use T1 encoding, have a look at this question: Why should I use \usepackage[T1]{fontenc}?
You should use a font supporting T1. For instance use the very good Latin Modern font, derived from the standard fonts:
\usepackage{lmodern}
Or install the cm-super
package which provides the standard Computer Modern fonts with T1 support.
To quote from the Comprehensive Symbols List (which has these symbols listed as ”frequently requested”):
The characters “<”, “>”, and “|” do
work as expected in math mode,
although they produce, respectively,
“¡”, “¿”, and “—” in text mode when
using the OT1 font encoding.
The following are some alternatives for
typesetting “<”, “>”, and “|”:
- Specify a document font encoding other
than OT1 (as described on page 8).
- Use the appropriate symbol commands
from Table 2 on page 9, viz.
\textless
, \textgreater
, and \textbar
.
- Enter the symbols in math mode
instead of text mode, i.e.,
$<$
, $>$
,
and $|$
.
Note that for typesetting
metavariables many people prefer
\textlangle
and \textrangle
to
\textless
and \textgreater
; i.e., “〈filename〉” instead of “<filename>”.
From page 8 (with strong recommendations that you should use this):
One note that appears a few times in
this document, particularly in Section
2, indicates that certain symbols do
not exist in the OT1 font encoding
(Donald Knuth’s original, 7-bit font
encoding, which is the default font
encoding for LaTeX) and that you
should use fontenc
to select a
different encoding, such as T1 (a
common 8-bit font encoding). That
means that you should put
“\usepackage[ encoding ]{fontenc}
” in
your document’s preamble, where
encoding
is, e.g., T1
or LY1
. To limit
the change in font encoding to the
current group, use “\fontencoding{ encoding }\selectfont
”.
As Will notes in the comments, a good solution to this is to put
\usepackage[T1]{fontenc}
\usepackage{lmodern}
into your preamble.
Alternatively, using XeLaTeX or LuaLaTeX with the fontspec
package also makes these symbols (and many more) work correctly.
Best Answer
That's not possible (unless you write the greater than symbol followed by the less than symbol).
You can find a comprehensive list of LaTeX symbols here.
EDIT:
For something that looks like an horizontal X, check out
\times
and\openJoin
in the document.For one over the other, check
\lessgtr
, from comments I think that's what you're looking for :