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

Problem with certain characters when using LaTeX in code cells #14

Open
susanxia1006 opened this issue May 28, 2018 · 1 comment
Open

Comments

@susanxia1006
Copy link

Some characters do not appear to be escaped correctly when using the Math class from IPython.display.

Example:
the output cell of

from IPython.display import Math
Math(r"""\begin{eqnarray}
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = & \frac{4\pi}{c}\vec{\mathbf{j}} \\
\nabla \cdot \vec{\mathbf{E}} & = & 4 \pi \rho \\
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = & \vec{\mathbf{0}} \\
\nabla \cdot \vec{\mathbf{B}} & = & 0 
\end{eqnarray}""")

gives error

400 Client Error: Bad Request for url...

But it works fine after taking out all the & characters.

@parente
Copy link
Contributor

parente commented Jul 28, 2018

Assuming Math() emits a mimetype bundle, we need to escape special characters just like we do with MathJax embedded in Markdown.

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