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

三世轮回 提交于 2020-01-03 14:48:44

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!