On a site where math mode is available by using a dollar sign—as well as on a site where math mode is not available—you can write a range of five to ten dollars by escaping each dollar sign with a backslash (\$5-\$10
). You will see the symbols that you intended.
- Result on this site: $5-$10
However, on a site where math mode is available by using a dollar sign, if you don't use a backslash before each dollar sign ($5-$10
), you see the sequence five, dash, one, zero. The five and the dash get formatted in math mode.
- Result on this site: $5-$10
Recall that, when expressing a numeric range, you may wish to use a typographic en dash, rather than a hyphen-minus character. One way to specify that is an XML-style character reference (\$5–\$10
).
- Result on this site: $5–$10
On a site where math mode is available by using a dollar sign, by accidentally using the XML-style character reference in math mode $5–$10
, you would produce an error.
- Result on this site: $5–$10
We can clarify what's happening, by investigating a little further. Spoiler: We won't find useful techniques in this direction.
Recall that, in math mode, there is an escape command (\text{xyz}
). Escaped text in math mode will be formatted as text.
- Result on this site: $\text{xyz}$
Escaped text in math mode clearly has an appearance that is clearly different from formatting as mathematics, the formatting that occurs when the escape command is not used ($xyz$
). When formatted as mathematics, letters display in italics. They are spaced differently from letters as text.
- Result on this site: $xyz$
Inside that escape command, neither LaTeX syntax for the en dash (--
) nor XML-style syntax for the en dash (–
) will be understood. If you try them ($5\text{--7–}$10
), those constructs will be treated only as text character data inside math mode.
- Result on this site: $5\text{--7–}$10
\$
as formula delimiters, so on those sites the lone $ will render normally. But on most, $ is a MathJax delimiter.