User scripts are a simple means of adding some peripheral functionality to klatexformula.
User scripts may be used to provide an alternative work flow for compiling the equation
(for example, in the case of Feynman diagrams via feynmf/feynmp
), or for providing
alternative export image formats (for example, SVG
format via dvisvgm
or inkscape
).
Note: The user scripts provided with KLatexFormula require Python to run. Python is installed by default on Linux and Mac OS X, but on Windows you’ll have to download and install python manually.
User scripts may currently be invoked in two different contexts.
The user script selection in the Scripts tab in expanded window mode provide an alternative workflow for generating the equation image (e.g. for Feynman diagrams). These user scripts override how LaTeX is called, what LaTeX code is used, and may possibly also invoke different helpers. (These are called backend engine user scripts.)
The second context is when saving the equation to a file, or when copying/dragging the equation. User scripts allow to export the equation in additional data formats (such as SVG, EMF, …). They work by converting one of the readily available formats (e.g. PNG, EPS or PDF) into additional custom types. (These are called export type user scripts.)
Note: The user scripts provided with KLatexFormula require Python to run. Python is installed by default on Linux and Mac OS X, but on Windows you’ll have to download and install python manually.
For user scripts to run, you may need to specify additional configuration, located in the window expanded mode › Settings › Scripts.
The script interpreters may be selected in the Interpreters tab on the lower part of the
settings pane. Currently all user scripts are written in Python, so you may have to
specify the location of the python
executable if it hasn’t been located automatically.
In case in the future bash scripts are added as well (or if you want to develop such
scripts yourself), you may also specify the bash executable at this point.
Individual user scripts may also require additional configuration. For example, the
inkscapeformats
user script invokes inkscape
, and needs to know where the Inkscape
program is located. It attempts to detect it automatically, but if you installed Inkscape
in a non-standard location you may need to specify the path manually. Select the user
script from the list, and click on the Script Settings
tab. The same applies to the
other user scripts which rely on a third-party program.