Converting markdown to pdf via pandoc.
Based on the official pandoc/latex Dockerfile, extended with the following typefaces:
- IBM Plex
-
Add the following lines to the beginning of your md file (modify as you will):
--- title: Some Title fontfamilyoptions: sfdefault mainfont: IBM Plex Sans monofont: IBM Plex Mono monofontoptions: Colour=0070c0 toccolor: Emerald urlcolor: DarkOrchid linkcolor: DarkOrchid --- -
Create
script.shwith the following content (adapt to match your desired input md and output pdf files).#!/bin/sh pandoc --pdf-engine=xelatex --toc --number-sections -V geometry:margin=1in -o file.pdf file.md -
Make it executable, and add it to the directory where the md file resides.
-
Run:
docker run --volume "`pwd`:/data" --entrypoint "/data/script.sh" anastop/mdtopdf
and file.pdf will be generated.