Is it possible to compile .tex files to PDF with 'pandoc'?
Asked Answered
Z

1

11

Is it possible to compile a .tex file with pandoc?

I'm currently taking my class notes in MultiMarkdown with MacVim. That way, when I get home, I can just mmd2tex and compile the .tex file to PDF using TexShop. It works great but the process is actually quite time consuming.

I'd like to know if there would be a way to achieve virtually the same thing using pandoc from the command line. I tried to convert my original .txt file directly to PDF with pandoc but I'm getting all sort of errors...

Anyone have a solution for this? Or maybe suggesting another workflow for notetaking?

Zaneta answered 28/1, 2015 at 17:43 Comment(1)
@SoumyaR please don't use inline code to highlight random terms.Gloriane
M
18

If you just want to convert a .tex file to PDF you don't need pandoc, it's better to use a LaTeX processor directly (instead of using pandoc which will call pdflatex in turn, but will pass along only a subset of all LaTeX commands):

pdflatex test.tex

To create a PDF from markdown, pandoc is the right tool. It also uses LaTeX under the hood by default:

pandoc test.md -o test.pdf
Matney answered 1/2, 2015 at 15:49 Comment(3)
Note that this will work for latex to pdf conversion too e.g.,: pandoc samplefile.tex -o test.pdfRexer
And it work better with pandoc by default if you have no knowledge of texYakka
@DimitriKopriwa I updated my answer to make it more clear why in 99% of the cases you should call pdflatex instead of pandoc when going from .tex to pdf.Matney

© 2022 - 2024 — McMap. All rights reserved.