shd101wyy / vscode-markdown-preview-enhanced

One of the "BEST" markdown preview extensions for Visual Studio Code
https://shd101wyy.github.io/markdown-preview-enhanced
Other
1.46k stars 173 forks source link

Issue with Pandoc and Katex #1505

Open nialltc opened 6 years ago

nialltc commented 6 years ago

Thank you very much for a great package.

I am having an issue using Pandoc with Katex. I am on Atom 1.31.1, MPE 0.15.7, Katex 0.10.0-rc.1 and Pandoc 2.2.1 on macOS10.13.6.

I would like to use Katex with Pandoc for preview. With Use Pandoc Parser ticked I have tried --katex in both Pandoc Options: Command Line Arguments and in a header as pandoc_args: ['--katex']. I have also tried --katex=/Users/USER/.atom/packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/dependencies/katex/.

It seems that if I use Pandoc it always uses Mathjax. Is there a way to get around this? Katex without Pandoc, using Markdown-it, works fine. In the terminal pandoc --katex works fine.

I have attached what comes out after Opening in Browser and Saving Source in browser - with .txt on filename because of Github.

Much thanks

pandoc_trying_katex_option.html.txt no_pandac_Katex.html.txt pandoc_trying_katex_header.txt pandoc_nothing_selected.html.txt no_pandoc_mathjax.html.txt

Opdoop commented 5 years ago

Same problem, did you solved it?

rongcuid commented 3 years ago

This might be a Pandoc issue. Pandoc's katex output doesn't seem to actually work with the KaTeX JS. However, the --mathjax output does work with KaTeX. I use this workaround both in the plugin, and in my Hakyll website (which is also powered by Pandoc)