> John K writes:
>> 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?
I saw it in another posting to this list, and there's a few other similar
examples that use it on the web:
http://www.google.com.au/#hl=en&q=lyx+%2BUpdateCommand
>> 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.
I can define a new Python file format, but strangely, no matter what I do the
"Add" button
in the converters section is greyed out. I can only create the converter by
editing
and saving over an existing converter in the list.
> Once you have that I believe it will work. In fact once you have that you
> could
> simply use the graphics inset in the usual way to insert your .py file, that
> is,
> no need for an external material template.
Makes sense, but then what are the external material templates actually meant
to be used for?
J
_________________________________________________________________
Get the latest jobs delivered. Sign up for SEEK Jobmail.
http://clk.atdmt.com/NMN/go/157639755/direct/01/