>> I added the following to the Lyx external_templates file:
>>
>> Template Python
>> GuiName "Python: $$AbsOrRelPathParent$$Basename"
>> HelpText
>> Python diagram.
>> HelpTextEnd
>> InputFormat "*"
>
> I think you need to define an input format and a .py -> .pdf converter which
> runs the python interpreter on your file.
>
>> FileFilter "*.py"
>> AutomaticProduction true
>> Preview Graphics
>> Format PDFLaTeX
>> Product "\\includegraphics{$$AbsPath$$Basename.pdf}"
>> Requirement "graphicx"
>> UpdateCommand "python $$AbsPath$$Basename.py"
>
> I haven't seen any description for "UpdateCommand" anywhere. Where does that
> come from? It's not in the documentation, or?
>
>> UpdateFormat pdf
>> UpdateResult "$$AbsPath$$Basename.pdf"
>> Requirement "graphicx"
>> ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
>> FormatEnd
>> TemplateEnd
>>
>> However, when I insert the Python script in Lyx, it draws a box that says
> "Error converting to loadable
>> format".
>
> Yes, because LyX doesn't know how to convert a python file to a graphics
> file.
> Try the way I described above: defining the file format and converter under
> the
> menu : Tools> Preferences...> File Handling.
OK I tried this. I defined a new Python file format with extension .py in Lyx,
and then created a Python -> PDF (pdflatex) converter that runs the command:
python $$i $$o
But when I try exporting the document to PDF I get the following error:
"No information for converting python format files to png. Define a converter
in the preferences."
Why is it trying to convert to PNG?
J
_________________________________________________________________
Browse profiles for FREE! Meet local singles online.
http://clk.atdmt.com/NMN/go/150855801/direct/01/