I am trying to auto-generate a diagram from a Python script in my Lyx document using the "External Material" function. I have created a Python script called "myscript.py" which generates a diagram and saves it to "myscript.pdf". I am trying to make Lyx run my script to generate the diagram when I export my document to PDF.
I added the following to the Lyx external_templates file:
However, when I insert the Python script in Lyx, it draws a box that says "Error converting to loadable format". If I try exporting to PDF using pdflatex, I get the following error:
Missing $ inserted. Missing { inserted.
I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed.
If I export to Latex using pdflatex, it seems to export correctly, and my text file contains something like this: