yzane / vscode-markdown-pdf

Markdown converter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=yzane.markdown-pdf
Other
1.01k stars 206 forks source link

Problem with Latex #212

Open yukiumi13 opened 4 years ago

yukiumi13 commented 4 years ago

This extension cannot convert latex

JackeyLea commented 4 years ago

you need to add mathjax code in the header of markdown files , then you can convert markdown file to pdf with latex correctly.

felbinger commented 4 years ago

How do I add the MathJax code in the header of my markdown file? I tried adding the mathjax.js framework like this inside the file:

<script>
// content from https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js
...
...
</script>
# Test
## This is a test
Testing for latex support: $\sqrt{5^{n+1}}$

Unfortunately this doesn't work...

JackeyLea commented 4 years ago

I add those content to my file on line 1.

<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 i can export pdf file with latex format.

The attachment file is an example for vscode1.50.1 and Markdown PDF1.4.4 test.zip

Samonitari commented 3 years ago

There is this pull request #198 that would solve this.

There are 3 open (and a closed) practically identical issues already, @MechanicModel (and @bhomaidan1990, and @icheft) you are not helping by opening another.

@JackeyLea thanks, but that script is a half solution only, not inlined formulas are not supported by this. I much prefer this globally set solution - which I found in the exisiting #21 issue's timeline, by the way: another point for search before filing an issue...

Kuo-TingKai commented 2 years ago

Thanks, it works!