joostkremers / pandoc-mode

An Emacs minor mode for interacting with Pandoc.
https://joostkremers.github.io/pandoc-mode/
177 stars 14 forks source link

How do I create pdfs with pandoc via latex? #74

Open dahanbn opened 6 years ago

dahanbn commented 6 years ago

Manually I can create a pdf with pandoc with the following command:

pandoc  file.md -o file.pdf --pdf-engine=lualatex --template=scrlttr2dh.latex

But I can't achieve that via pandoc-mode? What would be the output setting? (write . "latex")? But I don't want a latex file, I only want the pdf file. PDF isn't in the menu for the output format options.

Secondly, I can only set the old and not anymore supporte --latex-engine from pandoc-mode. I see the new pdf-engine option but it is grey and disabled, so I can't set it.

I use pandoc 2.0.2 64 bit on Windows 10 64 bit, with Emacs 25.3.1 64-bit. Pandoc-mode 20171204.1441.

joostkremers commented 6 years ago

PDF isn't in the menu for the output format options.

No, because pdf isn't an output format. Pandoc actually has a number of options for creating pdfs, though currently the only ones that pandoc-mode supports are those that Pandoc 1 also supports. I intend to fix this, but I currently have very little time to work on pandoc-mode.

Anyway, to answer your question: the second option in the menu is "Create PDF", that's the one you should use.

Secondly, I can only set the old and not anymore supporte --latex-engine from pandoc-mode. I see the new pdf-engine option but it is grey and disabled, so I can't set it.

That's because there was a bug in the code, which should now be fixed.

BTW, if you use the text-based menu (C-c /), you won't be confronted with options being greyed out.

dahanbn commented 6 years ago

Only the change from —latex-engine to —pdf-engine is new. The rest of the command is the same with pandoc < v2.x.

Although I have to admit I hadn’t used that call with pandoc-mode before. I will try your create pdf option and I will see if it works.

Sent with GitHawk