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 in Latex blocks is still active #1911

Open
liviu- opened this issue Nov 19, 2016 · 3 comments
Open

Markdown in Latex blocks is still active #1911

liviu- opened this issue Nov 19, 2016 · 3 comments

Comments

@liviu-
Copy link

liviu- commented Nov 19, 2016

Hi,

In a Jupyter notebook cell if I want to add a block equation as follows:

$$ a^* = hello $$

hello appears italic while editing text due to the star, even if it was part of the Latex syntax. If I just do $a^* = hello$ (i.e. inline Latex), hello does not appear italic anymore. Is this the intended behaviour?

Screenshot:
2016-11-19-171847_149x53_scrot
(I also tried a^{*} but the behaviour is the same.)

Using Jupyter 4.1.1

Also, thanks for the great project! 😛

@takluyver
Copy link
Member

The highlighting while you're editing markdown is provided by Codemirror's markdown mode, which doesn't know about the $math$ bits, as that's an ad hoc extension to markdown syntax. When you render the cell, it should show up correctly. So it's not exactly intended behaviour, but it's a limitation we know about.

Someone may be able to write an extended Markdown mode for Codemirror which knew about this syntax. I think we'd be happy to include the code if someone did that, but it's not high on our priority list.

@liviu-
Copy link
Author

liviu- commented Nov 19, 2016

I see -- many thanks for your quick response!

@joined
Copy link
Contributor

joined commented Mar 1, 2017

It looks like the extension @takluyver is talking about is already in use: https://github.com/jupyter/notebook/blob/666ecbf35c3310335a3c8c182e8f53441c991c14/notebook/static/notebook/js/codemirror-ipythongfm.js

In the extension both $ and $$ are declared as delimiters. The problem, as the comment in the code says, seems to be that defining $ as a delimiter for the LaTeX mode causes the $$ to be interpreted as two consecutive $ delimiters instead of a single $$ one.

I will investigate the possibility of a workaround.

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

No branches or pull requests

4 participants