Post History
Answer
#2: Post edited
- 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 sight 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.
- 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.
#1: Initial revision
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 sight 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.