Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown - trying to escape two dollar symbols #4244

Open
billtubbs opened this issue Nov 29, 2018 · 3 comments
Open

Markdown - trying to escape two dollar symbols #4244

billtubbs opened this issue Nov 29, 2018 · 3 comments

Comments

@billtubbs
Copy link

billtubbs commented Nov 29, 2018

I am trying to add dollar symbols '$' to a markdown cell in a jupyter notebook using the escape character '\'. Adding one is fine but when you add the second something strange happens to the text in between. Images below show two cells in edit mode and published mode.

screen shot 2018-11-29 at 09 15 02

screen shot 2018-11-29 at 09 14 50

Am I doing something wrong or is this a bug?

@syockit
Copy link

syockit commented Nov 30, 2018

Using double backslashes solved the problem for me.

@tk3369
Copy link

tk3369 commented Dec 23, 2018

Adding double backslashes works for the notebook itself but the extra slash gets in the way when converting to Latex/PDF. Is there any other workaround?

@kwon8543
Copy link

In iPython Jupyter notebooks I find that whether you need one backslash vs two backslashes is also dependent on what you've done in the enclosing markdown. e.g. Headings created with the ## tag at the beginning of the line, need two backslashes to escape, say, a dollar sign, whereas headings created using the <h1> html tag only need one backslash to escape, the dollar sign, for example.

So maybe tk3369, you can try avoiding the ## markdown syntax and just use HTML syntax for your comments?

Both of these markdown examples below work fine in Jupyter notebooks:

<h1>19. Model performance on products that cost between \$50 and \$100 </h1>

## 20. Model performance on products that cost between \\$100 and \\$200

Interestingly, just while writing the second example, the editor autodetects the double backslash as a URL in the tooltip (even though it's not a URL, it's escaping a dollar sign)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants