Markdown to PDF with Pandoc


apt install pandoc lmodern texlive-latex-base texlive-fonts-recommended pandoc-citeproc
apt install texlive-xetex texlive-lang-cyrillic
apt install texlive-plain-generic

PDF documents and slides

We’re using a combination of command line arguments and a LaTeX preamble.

Command lines:


Tips & tricks

Given input markdown as such

some title

this regex makes the trick to happend the links after a carriage return on the resulting PDF

sed -r 's@^([^#h$-].+)@\1 \\@' >


! Package graphics Error: Division by 0.

==> Latex needs headers. It does not matter whether the image is online or local. Its size does not matter either.

Graphics division by zero

Pandoc-generated PDF contains large images, how can I make them fit into the page?

[WARNING] Missing character: There is no я in font [lmroman10-regular]:mapping=tex-text;!

==> use an appropriate font as shown above.


Pandoc User’s Guide

Installing pandoc

Index of /demo

Tutorial 17.3 - Markdown and Pandoc

Academic Pandoc template

Easy LaTeX with Markdown and Pandoc

pandoc: Conversion between markup formats

enable citations



alternative with Markdown -> HTML -> PDF


How to remove figure label?


Cyrillic in (La)TeX

pdflatex and some fonts

line breaks

Preserve line breaks in title using pandoc

Allow multiline Markdown headers #82

Multi line titles with pandoc

Preserve line breaks in title using pandoc

Extension: escaped_line_breaks