set -eux cat < $1.tex \documentclass[varwidth=13.1cm, border={0.0cm 0.0cm 0.0cm 0.0cm}]{standalone} \usepackage{minted} \setminted[python]{breaklines, linenos, frame=lines, framesep=2mm, fontsize=\huge, numbersep=5pt} \standaloneenv{minted} \begin{document} \begin{minted} EOF echo "{$2}" >> $1.tex cat $1 >> $1.tex cat <> $1.tex \end{minted} \end{document} EOF pdflatex -shell-escape -output-directory=output $1.tex pdflatex -shell-escape -output-directory=output $1.tex pdflatex -shell-escape -output-directory=output $1.tex