Escaping dollar sign in ipython notebook

前端 未结 7 1698
借酒劲吻你
借酒劲吻你 2020-12-15 15:21

I have a markdown cell in iPython that contains four dollar signs. iPython interprets anything between dollar signs as a MathJax expression, which is not what I want. How do

相关标签:
7条回答
  • 2020-12-15 15:46

    Put two backslashes in front of dollar signs. For example:

    Some prices: \\$3.10, \\$4.25, \\$8.50.

    (running Jupyter notebook server 5.7.0)

    0 讨论(0)
  • 2020-12-15 15:46

    I'm aware that this topic is old, but it's still somehow the first google result and its answers are incomplete.

    You can also surround the $ with `backticks`, the same way that you would display code in Jupyter.

    So $ becomes `$`, and should display without error

    0 讨论(0)
  • 2020-12-15 15:48

    If you use <span>$</span>, MathJax won't process it as a delimiter. You should be able to enter that in Markdown. For example, I've used that here: $ This is not math $.

    0 讨论(0)
  • 2020-12-15 15:59

    Add a backward slash before the dollar sign: \$

    0 讨论(0)
  • 2020-12-15 15:59

    Did you try using the equivalent HTML entity instead?:

    e.g.

    0 讨论(0)
  • 2020-12-15 16:02

    You can escape $ with math mode by using a backslash. Try $\$$

    0 讨论(0)
提交回复
热议问题