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

Math not being processed as expected #229

Open
fluffy-critter opened this issue Jul 17, 2018 · 0 comments
Open

Math not being processed as expected #229

fluffy-critter opened this issue Jul 17, 2018 · 0 comments

Comments

@fluffy-critter
Copy link

Summary

The documentation on how to use EXT_MATH and EXT_MATH_EXPLICIT could be a lot more clear, especially regarding single- vs. multi-line contexts and \\ linebreaks.

Details

I'm using hoedown via Misaka, and the docs could be more clear about how the math tags are supposed to work. The documentation only refers to $ and $$ delimiters, but the tests also show the use of \\( ... \\) and \\[ ... \\] for math (presumably for use with MathJax, and the use of the EXT_MATH vs. EXT_MATH_EXPLICIT tags could also be better explained.

With both EXT_MATH and EXT_MATH_EXPLICIT enabled, the following text:

If Adam has $20 and Bernice has $30, how much money do they have together?

gets converted to:

If Adam has \(20 and Bernice has \)30, how much money do they have together?

which tells me that I don't actually want EXT_MATH_EXPLICIT enabled for text where there can be multiple $s in an ordinary paragraph (unless I want to write \$ a lot, anyway).

And on the other hand, the more structured delimiters don't seem to be handled at all; for example, in a multi-line context using \\[ ... \\] the \\ newline separator is being converted to a single \:

\\[
\begin{bmatrix}
A_x & A_y & A_z \\
B_x & B_y & B_z \\
C_x & C_y & C_z
\end{bmatrix}
\\]

converts to:

\[
\begin{bmatrix}
A_x & A_y & A_z \
B_x & B_y & B_z \
C_x & C_y & C_z
\end{bmatrix}
\]

causing the matrix elements to all appear on a single line. To get the line breaks to remain I instead need:

\\[
\begin{bmatrix}
A_x & A_y & A_z \\\\
B_x & B_y & B_z \\\\
C_x & C_y & C_z
\end{bmatrix}
\\]

This also occurs if I use $$ as a delimiter.

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

1 participant