Escaping dollar sign in ipython notebook

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 10:54:56

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)

Add a backward slash before the dollar sign: \$

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 $.

Yuki Liu

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

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

Did you try using the equivalent HTML entity instead?:

e.g.

While the answers on this page will allow the rendering of the dollar sign, all the other markdown that follows the dollar sign within the same cell will not have the special formatting when in edit mode. The markdown will still render correctly, but if the special formatting is useful, you may use the html entity &#36; within the code tags.

<code>&#36; your other code here<code>

I was not able to get most of these solutions working. One that did work, though, is explained here. It refers to a SO question here and is as simple as:

<span class="tex2jax_ignore">$900 vs $4,500</span>

Hope this helps someone!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!