Experimenting with Mathjax on my site, I face a problem when I type in
$1<x<2$
The outcome will be as follows
This, for example, has no issues.
$x<1\text{ or }x>2$
How do I make the first one display normally?
I have attached the issue at http://teach.sg/mathematics/additional-mathematics/mathjax/.
Since <
is used to start a tag in HTML, the browser considers 1<x
to be a 1
followed by a tag beginning <x
, and everything up to the next >
becomes part of that tag. This happens long before MathJax has a chance to look for mathematics on the page, so MathJax is not able to process this math as you intended it.
You have already identified one solution (using \lt
and \gt
) You can also just use spaces in most cases: $1 < x < 2$
.