In order to generate the .tex file from the python script you need to run: python image5.py > image.tex The include image.tex in the container file. Would be possible to generate alternative versions of image.tex running: python image.py > image.tex python image2.py > image.tex python image3.py > image.tex