Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code Latex Syntax in Markdown

I am currently writing a document with pandoc markdown and therefore use latex syntax.

How can I get Latex support (autocomplete, syntax highlighting, etc.) while writing in a .md file?

The Latex Workshop extension works fine for .tex files but I couldn't find an option to add file types.

Thanks in advance.

like image 388
ValeKnappich Avatar asked Mar 05 '26 14:03

ValeKnappich


2 Answers

After being troubled by this problem for a long time, I have found a solution.

  1. Install Latex Workshop Extension https://github.com/James-Yu/LaTeX-Workshop

    • This extension provides a set of language grammar called markdown_latex_combined, defined at https://github.com/James-Yu/LaTeX-Workshop/blob/master/package.json#L158, which does exactly what you are looking for.
  2. Switch the Language Mode (right corner in your vscode) of your markdown files from Markdown to markdown_latex_combined.

  3. Profit :D

like image 112
Kato Avatar answered Mar 08 '26 04:03

Kato


Markdown All in One provides LaTeX (in fact KaTeX) autocomplete, syntax highlighting.

like image 45
user8682688 Avatar answered Mar 08 '26 05:03

user8682688



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!