Markdown, latex, and pdf

#1

Is there any package, or combination of packages, that will render latex in markdown and allow for some sort of export to pdf for printing?

0 Likes

#2

The pandoc-convert package provides a set of commands to use the open-source conversion software pandoc. If you want even more powerful functionality, I recommend also getting process-palette and learning how to use the pandoc CLI.

0 Likes

#3

I don’t understand what you are trying to do.

LaTeX will produce PDF directly.

0 Likes

#4

I’m talking about writing a markdown file, and within that markdown file, including some LaTeX formatting. Atom can render the Markdown (with Latex), but I don’t see how to then convert that into something that can be printed.

0 Likes

#5

How does pandoc-convert work for you?

0 Likes

#6

When you say:

Atom can render the Markdown (with Latex)

how do you do that and what output do you get?

0 Likes

#7

Markdown Preview Plus

0 Likes

#8

Yup, that works.

1 Like

#9

I have a marrkdown file with this line

$$ RMSE = {\sqrt{\sum_{i=1}^n(y_i - \hat y_i)^2 \over n}} $$

In my markdown preview panel I can see the math properly formatted.

image

But when I convert to pdf I get the raw code.

image

I’m using Markdown Preview Plus and markdown to PDF

0 Likes

#10

markdown-preview-plus requires some front matter (yaml) which pandoc refers to for setting up print to pdf.

1 Like

#11

Is there any documentation for this?

0 Likes

#12

When I last looked at markdown-preview-plus some months ago there was considerable help on setting up custom pandoc. But the documentation now seems to be much reduced. Then I realised that I have been using markdown-preview-enhanced instead of markdown-preview-plus.

Here is the documentation.

Refer to Pandoc > Front Matter.

And Pandoc > Custom.

You can uninstall Markdown to PDF and Markdown Preview Plus.

p.s. You need to right click on the preview window to see the output options.

2 Likes

#13

+1 for https://atom.io/packages/markdown-preview-enhanced.

1 Like

#14

Thanks all,

I installed markdown-preview-enhanced and it seems to do a better job of previewing right out of the box.

However, though there are many options to generate pdfs, none of them seem to be enabled. I could not generate a pdf out of the box.

I had to install several other packages on my system to get it working using pandoc. The official version for my system was too old so I had to download it from github. https://pandoc.org/installing.html

I also had to install several other bits. After installing the following it’s now working very well.

sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-latex-recommended

So my problem is solved and I would recommend everyone to use markdown-preview-enhanced. It seems very powerful.

0 Likes