vscode-markdown-pdf
vscode-markdown-pdf copied to clipboard
how to export pdf with latex
Also I add the js
<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>
in template.html, can export correct html ,but not pdf
Markdown+Math (https://github.com/goessner/mdmath) uses KaTex (https://khan.github.io/KaTeX/) to format markdown with latex to html5. Would be nice to have this in markdown-pdf as an optional pre-processing step before node-html-pdf (https://github.com/marcbachmann/node-html-pdf).
+1 for KaTeX support.
I also use the extension vscode-markdown that supports KaTeX, so it'd be nice to implement it into vscode-markdown-pdf, especially since the only export option vscode-markdown has is to html.
Update: It looks like this was implemented in #36 but there are conflicts preventing it from being merged.
I just insert $\sum_{i=0}^{n}i^2$
,after the show of the plugin "Markdown All in One", it revievs good.
But this plugin can not print it, it just print "$\sum_{i=0}^{n}i^2$"
How can I use Latex-format showed in pdf via markdown-pdf? If I can't get pdf with Latex-format, that means I need to download another export prog, which means markdown-pdf is not useful enough.
Any updates? Still the same problem with V1.2
Add it, end of the your markdown (.md
) file to generate PDF with latex
Also I add the js
<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>
in template.html, can export correct html ,but not pdf
Also I add the js
<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>
in template.html, can export correct html ,but not pdf
I have found a problem. Some of the equation symbols are not recognized when exporting to either html or PDF, e.g. $\bar{a}$.
Yeah this is fixed by editing /Users/<username>/.vscode/extensions/yzane.markdown-pdf-1.4.1/template/template.html
.
Just add these 2 lines at the bottom of the file, and it should be able to export to 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>
Yeah this is fixed by editing
/Users/<username>/.vscode/extensions/yzane.markdown-pdf-1.4.1/template/template.html
.Just add these 2 lines at the bottom of the file, and it should be able to export to 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>
I can only get the inline formula converted correctly by doing this, the display formulas using '$$ $$' are still converted incorrectly.
I have the same problem: some '$$ ...... $$' are still converted incorrectly. CANNOT convert '\' to newline
This is developed for github md files, it also works with markdown-pdf : (1) type in you formula here: link, without $$ signs, coy the output in the markdown file (2) You get something like this:
I know this is a makeshift solution but it does the job.
guys, have you ever tried this solution on matrix? they still seem not printed correctly
$$R_y(\theta)=\begin{bmatrix}cos\theta&0&sin\theta\ 0&1&0\ -sin\theta&0&cos\theta\ \end{bmatrix}$$ and it previews as
and it printed as
guys, have you ever tried this solution on matrix? they still seem not printed correctly
$$R_y(\theta)=\begin{bmatrix}cos\theta&0&sin\theta
0&1&0
-sin\theta&0&cos\theta
\end{bmatrix}$$ and it previews asand it printed as
Try \\
at the end of each row instead of \
. It might work
guys, have you ever tried this solution on matrix? they still seem not printed correctly
$$R_y(\theta)=\begin{bmatrix}cos\theta&0&sin\theta
0&1&0
-sin\theta&0&cos\theta
\end{bmatrix}$$ and it previews asand it printed as
I have the same problem. Seems like the extension dosen't support multi-line formula?
guys, have you ever tried this solution on matrix? they still seem not printed correctly
$$R_y(\theta)=\begin{bmatrix}cos\theta&0&sin\theta 0&1&0 -sin\theta&0&cos\theta \end{bmatrix}$$ and it previews as
and it printed as
I have the same problem. Seems like the extension dosen't support multi-line formula?
Hi, I used //// at the end of each row instead of //. it works in the output of PDF.
$$ R_y(\theta)= \begin{bmatrix} cos\theta&0&sin\theta\\ 0&1&0\\ -sin\theta&0&cos\theta \end{bmatrix} $$
I have a similer problem
$$D^2_N = \left\{\begin{array}{c}
D^2_{N-1} + 2D_{N-1} + 1\\
or\\
D^2_{N-1} - 2D_{N-1} + 1
\end{array}\right. \tag{6.7}$$
preview is
pdf is
Awesome!
guys, have you ever tried this solution on matrix? they still seem not printed correctly
$$R_y(\theta)=\begin{bmatrix}cos\theta&0&sin\theta 0&1&0 -sin\theta&0&cos\theta \end{bmatrix}$$ and it previews as
and it printed as
I have the same problem. Seems like the extension dosen't support multi-line formula?
Hi, I used //// at the end of each row instead of //. it works in the output of PDF.
$$ R_y(\theta)= \begin{bmatrix} cos\theta&0&sin\theta\ 0&1&0\ -sin\theta&0&cos\theta \end{bmatrix} $$
Thanks !! It worked well for me !!
Also I add the js
<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>
in template.html, can export correct html ,but not pdf
That worked for me.
Also I add the js
<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>
in template.html, can export correct html ,but not pdf
Cannot print \{
and \}
in Katex.
The formula of Katex in Markdown
$$
E_{CFG} = \{ \langle G \rangle | G \text{ is a CFG and } L(G) = \emptyset \}
$$
Preview of VSCode
Result of PDF
As we can see, \{
and \}
disappear.
Also I add the js
<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>
in template.html, can export correct html ,but not pdf
Cannot print
\{
and\}
in Katex.The formula of Katex in Markdown
$$ E_{CFG} = \{ \langle G \rangle | G \text{ is a CFG and } L(G) = \emptyset \} $$
Preview of VSCode
Result of PDF
As we can see,
\{
and\}
disappear.
This also solved by adding '\' one more time I don't know how to solve VSCode Preview but it works in PDF
MD code (1)
$$
D^2_N = \left\\{\begin{array}{c}
D^2_{N-1} + 2D_{N-1} + 1 = 10\\\\
or\\\\
D^2_{N-1} - 2D_{N-1} + 1 = 20\\
\end{array}\right.
\tag{6.7}
$$
Previous of VSCode (1)
Result of PDF (1)
MD code (2)
$$
E_{CFG} = \\{ \langle G \rangle | G \text{ is a CFG and } L(G) = \emptyset \\}
$$
Previous of VSCode (2)
Result of PDF (2)
@ichisemasashi @hwhsu1231
I've already managed to export PDF with latex formula(I added the javascript code to the html document and thank god it worked), but only by default conversion mode. When I tried to implement another style, say Turing Style(a document which codes this format and was downloaded on Typora webpage), I can only get a PDF document IN STYLE but Latex lines unrecognized.
How can I fix this?