Giter VIP home page Giter VIP logo

Comments (22)

yemreak avatar yemreak commented on June 1, 2024 78

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

from vscode-markdown-pdf.

shivgodhia avatar shivgodhia commented on June 1, 2024 53

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>

from vscode-markdown-pdf.

ThomasBeauduin avatar ThomasBeauduin commented on June 1, 2024 28

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).

from vscode-markdown-pdf.

Yeba avatar Yeba commented on June 1, 2024 24

I just insert $\sum_{i=0}^{n}i^2$ ,after the show of the plugin "Markdown All in One", it revievs good.
re
But this plugin can not print it, it just print "$\sum_{i=0}^{n}i^2$"

from vscode-markdown-pdf.

hwhsu1231 avatar hwhsu1231 commented on June 1, 2024 9

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

image

Result of PDF

As we can see, \{ and \} disappear.

image

from vscode-markdown-pdf.

LouvenYoung avatar LouvenYoung commented on June 1, 2024 7

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.

from vscode-markdown-pdf.

HsunGong avatar HsunGong commented on June 1, 2024 6

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.

from vscode-markdown-pdf.

blackTay avatar blackTay commented on June 1, 2024 6

Any updates? Still the same problem with V1.2

from vscode-markdown-pdf.

liuxiang0 avatar liuxiang0 commented on June 1, 2024 2

I have the same problem: some '$$ ...... $$' are still converted incorrectly. CANNOT convert '\' to newline

from vscode-markdown-pdf.

jiang-du avatar jiang-du commented on June 1, 2024 1

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}$.

from vscode-markdown-pdf.

Mekahou avatar Mekahou commented on June 1, 2024 1

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
image
and it printed as
image

Try \\ at the end of each row instead of \. It might work

from vscode-markdown-pdf.

GeorgeWildboarman avatar GeorgeWildboarman commented on June 1, 2024 1

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
image
and it printed as
image

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} $$

from vscode-markdown-pdf.

juanmamaffei avatar juanmamaffei commented on June 1, 2024 1

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.

from vscode-markdown-pdf.

miercat0424 avatar miercat0424 commented on June 1, 2024 1

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

image

Result of PDF

As we can see, \{ and \} disappear.

image


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)

image

Result of PDF (1)

image

MD code (2)

$$
E_{CFG} = \\{ \langle G \rangle | G \text{ is a CFG and } L(G) = \emptyset \\}
$$

Previous of VSCode (2)

image

Result of PDF (2)

image

@ichisemasashi @hwhsu1231

from vscode-markdown-pdf.

brandoningli avatar brandoningli commented on June 1, 2024

+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.

from vscode-markdown-pdf.

Mekahou avatar Mekahou commented on June 1, 2024

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:

f(x) = x^2

I know this is a makeshift solution but it does the job.

from vscode-markdown-pdf.

VEWOXIC avatar VEWOXIC commented on June 1, 2024

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
image
and it printed as
image

from vscode-markdown-pdf.

Sumsky21 avatar Sumsky21 commented on June 1, 2024

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
image
and it printed as
image

I have the same problem. Seems like the extension dosen't support multi-line formula?

from vscode-markdown-pdf.

ichisemasashi avatar ichisemasashi commented on June 1, 2024

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
preview

pdf is
pdf

from vscode-markdown-pdf.

WenboKou avatar WenboKou commented on June 1, 2024

Awesome!

from vscode-markdown-pdf.

shimamorieiki avatar shimamorieiki commented on June 1, 2024

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
image
and it printed as
image

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 !!

from vscode-markdown-pdf.

HippoGrasshopper avatar HippoGrasshopper commented on June 1, 2024

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.

image

How can I fix this?

from vscode-markdown-pdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.