问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/28198900/is-it-possible-to-compile-tex-files-to-pdf-with-pandoc