-
Notifications
You must be signed in to change notification settings - Fork 7
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
extension for \begin{...}, \end{...} latex math blocks #13
Comments
I don't know anything about the details here, I don't know what css class names are used at the moment. However just reading this I got a initial thought on the class names. Isn't both "math" and "display" very wide names (or so to speak) that might create issues? That is collisions with css names created by the end user. I'm thinking that some kind of prefix of the css class name might be beneficial, especially if those class names are always machine generated (since the length of the machine generated names does not effect the end user, while using name they might also use can create hard to find bugs). As far as I know in normal css the namespace is always global, that's why these collisions might happen. Mdl for example prefixes all their css classes with |
@Scorpiion I think that is a good point, the current behaviour of md_proc is that it adds the classes For my personal project, I don't need any class names, it just has to be escaped from the regular markdown parser. Mathjax will search for the latex the math delimeters, not for a class name. |
Okay, yeah I think a css prefix might be good then. It might not be an issue for smaller projects, especially in the beginning, however the bigger the project gets the bigger the risk is that someone will run into this. It could also be that you are using the css of another third party, that you don't control, and that one uses one of more names that collide. I might have "hijacked" this issue a little bit, so I created a separate issue (#14) for the potential of adding a css class name prefix to md_proc. I suggest any further thoughts or discussion on css prefixes could be done there instead. Would like to hear what you think about css classes @dikmax when you have some time to spare. |
@kasperpeulen I don't quite understand why you may want to use What is supposed HTML-output for such blocks? If it just escaping then I think code block already support it. |
BTW, Pandoc also have raw_tex extension. But it strips all TeX-blocks from HTML-output. |
@dikmax This is not really about having complete LaTeX syntax. It is only for the math LaTeX blocks. For example this how it works in math.stackexchange.com: But in my editor it works now like this: The markdown is not escaped. So basically for math.stackexchange.com they use a markdown flavour that escapes everything between those
Those are the environment blocks that mathjax accepts. But I guess it would be easier to just escape any environment block.
So I think that this:
Should be converted to:
The |
Btw about class names, it could make sense, to give all math blocks http://docs.mathjax.org/en/latest/options/tex2jax.html?highlight=tex2jax_process I think then the extension may be called |
@kasperpeulen I've checked how Pandoc handles raw TeX. <p>This is the identity matrix:</p>
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 &1 \\
\end{pmatrix} I think, I'll do same. |
@dikmax sorry for the late reply, but that would work fine for my use case :) |
Fixed in 0.8.1. Please tell me it some of blocks aren't parsed correctly. |
@dikmax I'm using your math extension now on my website, works great 👍
I have one other feature request. Many mathematicians also use
\begin{...} \end{...}
kind of code blocks. For example \begin{matrix}, \begin{align} etc. Those are supported by some markdown flavours, for example the one used at math.stackexchange.com.Would be great if md_proc could also escape markdown for those blocks (and mark as
<span class="math display">
).A workaround that is now possible, is to use
$$...$$
around the equation, see:http://kasperpeulen.github.io/mathedit/#/gist/097f6d551598a3a8487f
But I think people are so used to not having to do that from standard latex, math.stackexchange etc., so an extension would be great.
The text was updated successfully, but these errors were encountered: