top | item 33169334

(no title)

omnster | 3 years ago

I'd guess you have to first convert markdown to tex with --natbib flag, then compile the tex (assuming the input is input.md and you want input.tex at the output)

`pandoc -f markdown -t latex -o input.tex --natbib input.md`

It is perhaps not unexpected that the capabilities of such a simple thing as markdown are not too overwhelming. Pandoc does not extend markdown as a markup language, it can only convert markdown to pretty much whatever you want. If you have rather precise requirements such as natbib for citations, it may be better to start with latex right away.

I usually use pandoc to produce simple short documents. Occasionally I use it to do the peer review for journals, when from a single markdown source, pandoc builds me a plain text file with latex commands substituted with unicode symbols, and also a pdf.

This all can be simplified with pandocomatic (a thing that automates calls to pandoc) and entr (a thing that invokes a command upon file update).

In the simplest form, `ls input.md | entr pandoc -o output.pdf input.md` will call pandoc each time the file input.md is updated.

discuss

order

No comments yet.