-
-
Notifications
You must be signed in to change notification settings - Fork 253
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
Math expressions #8
Comments
My suggestion is that you write MathJax in a syntax of
And use custom renderer to deal with this special block code. |
Using In that PR, math expressions are treated as first class ones which use their special renderer. I think this is the correct way of math expression support, and I want it to be merged. But I think introducing a simple option for preventing lexer from analyzing inner text of |
I second adding support for math but I suggest making it independent from the backend for rendering (e.g. MathJax). This requires extending the parser and the renderer to have dedicated parse/render math methods. Alternative renderers could embed the formulas as static images in applications where MathJax is an overkill or javascript is not allowed. I like Pandoc's approach on syntax: http://johnmacfarlane.net/pandoc/README.html#math The dollar sign is used, as in LaTeX, to mark an inline equation but the beginning dollar cannot be followed by spaces and the closing one cannot be preceded by spaces. This way you can use |
Here is an attempt of implementation for Math: ipython/ipython#6028 @takluyver is implementing it in IPython. |
My implementation, which seems to be working so far: It's fairly straightforward, but it did require subclassing everything. I don't think it will handle block-context maths ( Of course, I'd be very happy for this to end up integrated into mistune. BTW, do you have an estimate for when the next release will be? Because my implementation depends on the changes in #11, we can't merge it until there's a new release of mistune so our tests can pass. |
@takluyver Version 0.3.0 is released. |
I believe this issue is again there in mistune v2. Is there a way to avoid parsing markdown within |
Usage of math expressions in Markdown text is quite common. I've found this PR markedjs/marked#180 in
marked
which brings this feature. Main issue with current implementation occurs in cases like this:That inner part of
$
s must not be rendered as a normal piece of Markdown text. Actually, mentioned PR is not merged yet but I think supporting this expressions only needs exclusion of$
s content. For example, output of this simple case:Is completely compatible with
MathJax
which renders that as its equivalent expression.The text was updated successfully, but these errors were encountered: