How to convert Markdown into A5-sized PDF (printed on A4 paper) using Pandoc?

By Matthias Schaub
rm ./*.pdf
for file in ./*.md; do
    pandoc \
    -f markdown \
    -t latex \
    --pdf-engine = xelatex \
    -V pagestyle = empty \
    -V papersize = A5 \
    -V geomertry:left = 18.565mm -V geometry:right = 18.565mm \
    -V geometry:top = 17.5mm -V geometry:bottom = 35.0mm \
    -o "$file.pdf" \
    "$file"
done
pdfjam ./*.pdf --outfile a5.pdf
pdfjam --nup 2x1 --landscape a5.pdf --outfile a4.pdf

Margins I took from margins for the rest of us.