9
$\begingroup$

I was writing an answer where I ended up using two dollar signs to indicate amounts of money. The text in between the two dollar signs became formatted, although I did not want the formatting I was just discussing money. Is there a way to get rid of the formatting given by symbols?

Example:

I have $10. With my $10 I am going to buy apples.

I have $10. With my $10 I am going to buy apples. 
$\endgroup$
2
  • $\begingroup$ They should make ¤, ¥, 元, £, ₤, €, ₡, ₢, ₣, ₥, ₦, ₧, ₨, ₩, ₪, ₫, ₭, ₮, ₯, ₰, ₱, ₲, ₳, ₴, ₵, ₶, ₷, ₸, ₹, ₺, ₻, ₼, ₽, ₾, and even ₿ do formatting as well, so as not to single out users of $. Although I think ¢ should format just like \$ but very tiny. $\endgroup$
    – JDługosz
    Commented Jun 12, 2018 at 7:43
  • $\begingroup$ But that also offers a couple effective work arounds: Write instead “I have 1000¢” or “I have €8,48.” $\endgroup$
    – JDługosz
    Commented Jun 12, 2018 at 7:46

1 Answer 1

16
$\begingroup$

The formatting is MathJax and is pretty useful for complex math. If you want to use a normal dollar sign you have to "escape" the symbol. This means that you tell the interpreter "You know, the following is just a normal character. Not some formatting stuff like 'I want this italic', or 'I want this bold' or 'I want this in fancy math-whatever style'".

To escape the dollar sign simply use a backslash in front of it.

\$ will produce $.

I have \$10. With my \$10 I am going to buy apples. produces

I have \$10. With my \$10 I am going to buy apples.


As I said in the text this can also be useful to turn off other formatting stuff. For example \* to get * instead of italic. This also means you need to write \\ to get \, as \ is the special character for escaping special characters.

For more examples about using MathJax you can also look on Meta How do I add mathematical notation using Latex MathJax?.

$\endgroup$
0

You must log in to answer this question.

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