#!/bin/bash # run xelatex only once in case of failure set -e [[ -z $1 ]] && echo markdown document? && exit 1 md=$1 tex=${md%\.md}.tex pdf=${md%\.md}.pdf echo -n preamble... cat > $tex <> $tex && echo done # we don't need lstlisting nor lstinline # verbatim displays well and \texttt is also fine #| sed -r 's/\\passthrough\{/\\colorbox{mygray}{/' \ cat >> $tex <