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 >? Commented Mar 3, 2011 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. Commented Mar 3, 2011 at 7:19
  • @Martin: I cannot use them in my site. They are vulnerable to XSS and XSRF attacks.
    – LaTeX
    Commented Mar 3, 2011 at 7:20
  • 2
    So you are using LaTeX on a webserver with user input or what? You should mention such things in the question. Commented Mar 3, 2011 at 7:22
  • @Martin: see my update.
    – LaTeX
    Commented Mar 3, 2011 at 7:25

1 Answer 1

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. Commented Mar 3, 2011 at 7:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .