Markdown To Pdf With Pandoc And Miktex (Windows)
1 min readJul 17, 2021
The aim of this tutorial🔍 is to go through the steps needed to convert markdown into pdf using pandoc and miktex.
1. install pandoc with chocholatey
- install from Chocolatey Software — Pandoc 2.12
choco install pandoc
2. install miktex for pdf engine
- install from Getting MiKTeX
- test run with
pandoc -V geometry:"top=2cm, bottom=1.5cm, left=2cm, right=2cm" -f markdown-implicit_figures -o <output_name>.pdf <input_name>.md
3. remove page numbering
- add the following at the top of the markdown file
\pagenumbering{gobble}
4. resize images
- when merging add
{ width=70% }
after the image link to have - the following is a link_attribute of latex
{ width=70% }
5. adding the title
- I want to start the section with a larger title
- add the following to the top of the merged markdown file to have 01–2021 as the section title
% 01-2021
6. change fonts
- checking the list of fonts in The LaTeX Font Catalogue — Front Page
- adding YAML header to the top of the merged file
pandoc -V fontfamily:Alegreya -V geometry:"top=2cm, bottom=1.5cm, left=2cm, right=2cm" -f markdown-implicit_figures -o <output_name>.pdf <input_name>.md
7. link colors
- as for colors, see https://pandoc.org/MANUAL.html#variables-for-html
- I recommend to use one of the basic colors listed in CSS/Properties/color/keywords — W3C Wiki
pandoc -V colorlinks=true -V linkcolor=teal -V urlcolor=teal -V toccolor=gray -V geometry:"top=2cm, bottom=1.5cm, left=2cm, right=2cm" -f markdown-implicit_figures -o cv.pdf index.markdown