I added the following to the Lyx external_templates file:
Code: Select all
Template Python
GuiName "Python: $$AbsOrRelPathParent$$Basename"
HelpText
Python diagram.
HelpTextEnd
InputFormat "*"
FileFilter "*.py"
AutomaticProduction true
Preview Graphics
Format PDFLaTeX
Product "\\includegraphics{$$AbsPath$$Basename.pdf}"
Requirement "graphicx"
UpdateCommand "python $$AbsPath$$Basename.py"
UpdateFormat pdf
UpdateResult "$$AbsPath$$Basename.pdf"
Requirement "graphicx"
ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
FormatEnd
TemplateEnd
If I export to Latex using pdflatex, it seems to export correctly, and my text file contains something like this:Missing $ inserted. Missing { inserted.
I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed.
Code: Select all
\begin{document}
\includegraphics{C:/Documents and Settings/MyUsername/Desktop/myscript.pdf}
\end{document}
Any ideas what I am doing wrong? I am running Lyx 1.6.3 on Windows XP.