# Command for > and < in mathmode [closed]

I am using LaTeX but embedded in XML. I would like to not have to use > and < directly inside the LaTeX parts.

On the other hand, I would like to not have to write them as HTML entities (&gt; and &lt;) either. This is such that I can take the LaTeX portions directly and compile them without having to convert the HTML entities into the characters > and <.

Is there are standard LaTeX command for the symbols > and < in math mode?

• You can define them: \let\lt< and \let\gt> will allow you to use \lt for < and \gt for >. But I don't know whether you're able to make those definitions anywhere in your XML... Mar 9 '16 at 17:21
• @Werner Defining them in that way is inadvisable in a LaTeX document, since \let is a TeX primitive command. It is better practice to use \newcommand{\lt}{<}, etc. Mar 9 '16 at 19:00
• I'm voting to close this question as off-topic because it is about MathJax. It understands some defaults that are not part of default (La)TeX, like \lt and \gt. Mar 9 '16 at 19:13

You can insert any specific Unicode character via \symbol{"####}, where U+#### is the character code. Looking here, I found that the codes for < and > are 003C and 003E, respectively. I used a \newcommand to make referring to these much simpler.

\documentclass{article}

\newcommand{\lt}{\symbol{"3C}}% Less than
\newcommand{\gt}{\symbol{"3E}}% Greater than

\begin{document}

If $a \lt b$ and $b \lt c$, then $c \gt a$.

\end{document}

• given your comment under the question saying not to use \let as it's a primitive, a bit odd to use \char, the latex command would be \symbol{"3C} Mar 9 '16 at 19:46
• @DavidCarlisle I haven't seen \symbol{} before... \char was the only command I could find when researching for my answer. I have updated it with that change. Thanks for the tip! Mar 9 '16 at 19:55