TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
%\usepackage{amsmath} It does Not work !
x\lt y \gt z

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


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.


enter image description here


enter image description here

share|improve this question
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
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
up vote 10 down vote accepted

If that's all you want adding:


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

share|improve this answer
+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 posting your answer, you agree to the privacy policy and terms of service.

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