-
Notifications
You must be signed in to change notification settings - Fork 50
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Context
I use Latex in my Markdown, then it is rendered with MathJax (in Jupyter Notebook).
But now mdformat
reformats my Latex code as follows:
$$
- "\\begin{equation}\n",
+ "\\\\begin{equation}\n",
- "d(x, y) = \\sqrt{\\sum_{i = 1}^n (x_i - y_i)^2}\n",
+ "d(x, y) = \\\\sqrt{\\\\sum\\_{i = 1}^n (x_i - y_i)^2}\n",
- "\\end{equation}\n",
+ "\\\\end{equation}\n",
$$
So after formatting it stops to be valid Latex and renders as string.
Proposal
Escape Latex notation in mdformat.
- Easy way - just escape (left as is) everything inside
$$ ... $$
block (and maybe in$ ... $
block). But this is error prone =( - Harder way - borrow parser ideas from Jupyter, MathJax, etc. This requires some research.
Tasks and updates
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request