Comments on Why doesn't \$ work?
Parent
Why doesn't \$ work?
Post
The following users marked this post as Works for me:
User | Comment | Date |
---|---|---|
DNB | (no comment) | Jan 17, 2022 at 08:52 |
You need to use \\$
, like this: \$1.
The reason is that MathJax is interpreted in the browser, while Markdown is interpreted in the server.
If you write \$
, then Markdown sees the backslash and therefore puts the dollar sign literally into the output (which it would have done anyway), without the slash. That's what is served to the browser, where MathJax then sees it as starting math content.
If you write \\$
, then Markdown sees the first backslash as escaping the second backslash, therefore the output contains \$
. This gets sent to the browser where MathJax then interprets the single backslash as taking the dollar sign literally instead of interpreting it as starting or ending math content.
0 comment threads