2

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?

closed as off-topic by Werner, user13907, Svend Tveskæg, Zarko, Mensch Mar 9 '16 at 20:23

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    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... – Werner 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. – Tony Mottaz Mar 9 '16 at 19:00
  • 4
    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. – Werner Mar 9 '16 at 19:13
1

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} – David Carlisle Mar 9 '16 at 19:46
  • 1
    @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! – Tony Mottaz Mar 9 '16 at 19:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.