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

Support parsing latex style (math) equations as in pandoc #694

Open
jeroen opened this issue Nov 3, 2021 · 0 comments
Open

Support parsing latex style (math) equations as in pandoc #694

jeroen opened this issue Nov 3, 2021 · 0 comments

Comments

@jeroen
Copy link

jeroen commented Nov 3, 2021

We would be very interested in the ability to parse latex-style math equations in the same syntax as understood by pandoc.

I understand that actually rendering math is out of scope for most implementations, but it would be useful if equations are recognized in the AST. This would make it easy to render them in a subsequent step.

For example, below some markdown that is understood by pandoc. It would be super helpful if the cmark parser would at lest be able to mark the math blocks in the xml representation of the ast, or the html output.

## R Markdown

This is a test

Inline: $E=MC^2$.

## In DisplayMode

Equation 1

$$
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} \equiv 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
$$

$$
\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)
$$

## Other examples

With aligned:

\begin{aligned}
\dot{x} & = \sigma(y-x) \\ 
\dot{y} & = \rho x - y - xz \\ 
\dot{z} & = -\beta z + xy 
\end{aligned}

With pmatrix:

\begin{pmatrix} 
a_{11} & a_{12} & a_{13}\\ 
a_{21} & a_{22} & a_{23}\\ 
a_{31} & a_{32} & a_{33} 
\end{pmatrix}
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