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

The leading \ in an escaped dollar sign is displayed when \$ is used in a code block. #4754

Closed
ngoldbaum opened this issue Jan 2, 2014 · 3 comments
Milestone

Comments

@ngoldbaum
Copy link
Contributor

I commonly use $ in bash code blocks to denote the prompt in an interactive session. Something like:

$ rm -rf /

Github displays this just fine, but IPython needs $ to delimit inline LaTeX math expressions (c.f. #3427 and #3428).

In most places, IPython does the right thing and only displays $ when a user enters \$. However, in a code block, IPython will display something like:

\$ grep foo

When I really want it to look like:

$ grep foo

even though I actually entered \$ in the input to the markdown cell. Like this:

ipy_example

I need to escape the $ in the code block since MathJax interprets it as the beginning of an inline math sequence, even though it's part of a code block.

@ngoldbaum
Copy link
Contributor Author

Shoot, I just tried again in master and it looks like this has been fixed. The solution is to not escape the $.

@iandin
Copy link

iandin commented Nov 21, 2016

It seems it was not fixed for all languages. For bash it's ok but Javascript code blocks still cannot escape the $ sign.

@ngoldbaum
Copy link
Contributor Author

probably best to open a new issue

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

2 participants