KyleKing / mdformat-obsidian

Format Markdown for Obsidian including Callouts (Admonitions)
MIT License
0 stars 0 forks source link

Add support for MathJax and the LaTeX notation #2

Closed powerman closed 2 weeks ago

powerman commented 1 month ago

Current version breaks example from https://help.obsidian.md/Editing+and+formatting/Advanced+formatting+syntax#Math:

 $$
-\begin{vmatrix}a & b\\
+\\begin{vmatrix}a & b\\
 c & d
-\end{vmatrix}=ad-bc
+\\end{vmatrix}=ad-bc
 $$

Was: изображение Now: изображение

KyleKing commented 1 month ago

mdformat-myst appears to support dollar math. If you have a chance, it might be worth trying: https://github.com/executablebooks/mdformat-myst (See: https://myst-parser.readthedocs.io/en/latest/syntax/math.html#dollar-delimited-math)

If mdformat-myst works, we can either incorporate a small portion of the logic into mdformat-obsidian or making mdformat-myst an optional extra when users need to render math

powerman commented 1 month ago

Well, myst works. It conflicts with footnote plugin and a bit differently format %% block commens. Still, using it for this reason (obsidian math support) feels like a real overkill.