10
\documentclass{article}
%\usepackage{amsmath} It does Not work !
\begin{document}
\[
x\lt y \gt z
\]
\end{document}

What library do I have to use such that the document can render \lt and \gt as less than and greater than signs, respectively?

Edit

I am using MathJax library in my site under Asp.net Mvc 3. Web application is vulnerable to XSS and XSRF attacks so < and > should be avoided as the input from the users.

My database will save LaTeX commands that can be rendered by both LaTeX compiler and MathJax. Therefore, I need \gt and \lt that already work in MathJax.

Source:

enter image description here

Rendered:

enter image description here

5
  • Why are you not just use < and >?
    – Martin Scharrer
    Mar 3 '11 at 7:16
  • In general have a look at “How to look up a math symbol?” for ideas how you can easily find a particular symbol.
    – Martin Scharrer
    Mar 3 '11 at 7:19
  • @Martin: I cannot use them in my site. They are vulnerable to XSS and XSRF attacks.
    – LaTeX
    Mar 3 '11 at 7:20
  • 1
    So you are using LaTeX on a webserver with user input or what? You should mention such things in the question.
    – Martin Scharrer
    Mar 3 '11 at 7:22
  • @Martin: see my update.
    – LaTeX
    Mar 3 '11 at 7:25
14

If that's all you want, add

\newcommand{\lt}{<}
\newcommand{\gt}{>}

to the preamble (before begin{document}). This should allow you to use \ltand \gt.

1
  • 1
    +1, and if you don't want this in the main document put it into your own .sty file and load that using \usepackage.
    – Martin Scharrer
    Mar 3 '11 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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