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.44k stars 172 forks source link

Using additional package of Latex in math-block #1542

Open moriyas1984 opened 6 years ago

moriyas1984 commented 6 years ago

To render bold characters represents vectors, we need to add a package (bm) to the latex document. For example,

$$ \usepackage{bm}

\bm{a} $$

But it does not seem to be able to use the function in this atom/vscode package. How should we do to use additional packages in math blocks?

Thanks.

syockit commented 6 years ago

MPE does not use LaTeX engine, so \usepackage is not supported. The math equation is supported via either KaTeX or MathJax, as mentioned in the documentation. According to KaTeX though, \bm is already supported with need of any packages.

neighthan commented 5 years ago

If you do need full-on LaTeX, try using a code block like

```latex {cmd = True}
\documentclass{standalone}
\usepackage{bm}
\begin{document}
  $$
  \bm{a}
  $$
\end{document}```

This will require more setup, though, and involves a lot of boilerplate. I'm posting an issue now to see if at least the boilerplate part of that can be lessened.