#!/bin/bash files=$(ls *.md) OIFS="$IFS" IFS=$'\n' for file in $files; do tmpfile=.$(basename "${file%.*}").html outfile=$(basename "${file%.*}").pdf pandoc -f markdown+emoji -t html -o $tmpfile $file pandoc -f html -t pdf -o $outfile $tmpfile --pdf-engine=lualatex -V geometry:margin=2.5cm -V mainfont="DejaVu Sans" done IFS=$OIFS