gpoore / pythontex

A LaTeX package that executes Python and other code in LaTeX documents, and includes the output
873 stars 98 forks source link

Pythontex and TikZ externalization #184

Open Nnomis opened 3 years ago

Nnomis commented 3 years ago

Is it possible to externalize TikZ pictures ? I read on stack that it seems like the answer is no. I'm using pycode and pysub everywhere to write exercices. Can I hope a solution ? It would be so amazing. Currently the only things that really make my compilations slow down are the tikzpictures, and I'm kind of desperate about that... I'm using subfiles waiting for a better solution...

gpoore commented 3 years ago

PythonTeX is not currently compatible with TikZ externalization. It may be possible to add support for that at some point in the future, so I will leave this issue open for now.

Possible workaround: If you are generating the TikZ code using Python, you could save the TikZ code to its own separate file and then use Python's subprocess.run() to create a PDF from this.