Open amirtadayon opened 1 year ago
Hello,
This is not a perfect solution, but maybe this can help :
edit the file (on Windows) :
C:/Users/<username>/.vscode/extensions/yzane.markdown-pdf-<version>/template/template.html
replace <username>
and <version>
with your own username on your PC and version of your markdown-pdf
append these two lines to the end of the file :
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: {inlineMath: [['$', '$']]}, messageStyle: "none" });</script>
then try Export (pdf)
again...
same solution, it also works on mac with path
/Users/<username>/.vscode/extensions/yzane.markdown-pdf-<version>/template/template.html
or just append these lines to your markdown file
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: {inlineMath: [['$', '$']]}, messageStyle: "none" });
</script>
你好,
这不是一个完美的解决方案,但也许这可以帮助:
编辑文件(在 Windows 上):
C:/Users/<username>/.vscode/extensions/yzane.markdown-pdf-<version>/template/template.html
将
<username>
和替换<version>
为您在 PC 上的用户名和版本markdown-pdf
将这两行附加到文件末尾:
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: {inlineMath: [['$', '$']]}, messageStyle: "none" });</script>
然后再试
Export (pdf)
一次...
这种方法无法应对多行latex公式
same solution, it also works on mac with path
/Users/<username>/.vscode/extensions/yzane.markdown-pdf-<version>/template/template.html
or just append these lines to your markdown file
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: {inlineMath: [['$', '$']]}, messageStyle: "none" }); </script>
This method cannot cope with multi-line latex formulas
I found a solid workaround, works fine for me. First, add displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
to above mentioned file.
Then, as the extension treats every \
as an escaping char, add two of them for every occurrence of the backslash char \
So your e.g. parentheses matrix has to look like this:
$$\begin{pmatrix}
1 & 2 & 3 \\\\
4 & 5 & 6
\end{pmatrix}$$
Final html code to everyones convenience:
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: {inlineMath: [['$', '$']], displayMath: [ ['$$','$$'], ["\\[","\\]"] ]}, messageStyle: "none" });
</script>
When insert a LaTeX expression in the Markdown document and export it into a PDF file, those expressions are not shown nicely. Here is an example
However, when previewing it on VSCode, it looks fine.
Any suggestion, workaround is very much appreciated.
Thanks