15

So in Jekyll and Markdown, I can't type $ or its HTML equivalent code, and not \$ nor $\$$. How should I type the dollar sign?

4 Answers 4

16

To prevent MathJax from using the dollar sign as a delimiter, you can put it in a span, like so:

<span>$</span>

Alternatively, you can enable processEscapes and then you can use the backslash escape \$ for the dollar sign.

Sign up to request clarification or add additional context in comments.

3 Comments

what is processEscapes? please!
you can add it to the html file <script></script> section
The span trick isn't working for me--the end tag is interpreted as text in math mode. :-(
8

Enable processEscapes:

MathJax.Hub.Config({
  tex2jax: {
    inlineMath: [['$','$'], ['\\(','\\)']],
    processEscapes: true
  }
});

Then you can simply use \$ to get a plain $.

1 Comment

If using Jekyll, you will need to escape the \\, too, so \\$ will produce a plain $.
1

I disable dollar signs completely: my settings (in a script tag) are:

MathJax = {
  tex: {
    inlineMath: [['\\\\(', '\\\\)']],
    displayMath: [['\\\\[', '\\\\]']]
  },
  svg: {
    fontCache: 'global'
  }
};

so that I have to use \(...\) or \[...\] rather than $x$ and $$y$$.

1 Comment

View the source of w.allsup.co/sandbox/MathJax as an example -- note that dollar signs appear as is, but \(...\) and \[...\] are handled by MathJax. (That site is my personal wiki that I use as a note-taking system ala Obsidian.)
0

I used mathjax's dollar symbol in that paragraph. It works.

enter image description here

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.