KLatexFormula Documentation

Tips and Tricks

Tagging and Categorizing Equations in the Library

In the equation library, you can add categories and tags to your rendered formulas. Select the equation, fill in the category and tags, hit ENTER and the equation will be automatically copied in the Archive tab of your library.

Re-Open saved PNG, PDF and TeX files

You can re-open equations saved to disk in PNG, PDF and LaTeX format by dragging the file onto the latex input field.

Copying & Pasting into Adobe Illustrator and Adobe InDesign

Adobe Illustrator can nicely paste vector graphics, and can even allow you to change the color / swatches / etc. after you have pasted your equation.

Currently, you need to group the pasted equation manually (Ctrl+G or Cmd+G) after pasting, otherwise the different elements of the equation are not automatically grouped together.

There are two options for pasting vector graphics into Adobe InDesign. You may paste PDF, which works well but leaves the equation itself uneditable (for example, you cannot change the colors). You may however also paste using the “AICB” format, in which case the equation will be editable in InDesign, and you will be able to set swatches etc.

Feynman diagrams with feynmf/feynmp

You can generate pretty Feynman diagrams with the feynmf LaTeX package using KLatexFormula:

image/svg+xml

To do so you need to select the FeynMF Wrapper user script (in the Script tab in expanded window mode). Then, enter the code for the diagram in the main latex input field:

Screenshot of Feynman diagram example

To get started with an example, download the following PDF file, and then drag the downloaded file into KLatexFormula’s latex field: feynmp-example.pdf.

Trouble pasting into Thunderbird?

If you can’t directly paste an HTML fragment into Thunderbird, consider doing the following.

Choose the export format “More HTML fragments” › “HTML fragment (PNG), as text”. Copy the equation.

In Thunderbird composer, select “Insert” › “HTML”, and paste in the text field. This should paste the HTML source. Hit “Insert”, and the image should now appear in the e-mail you’re composing.

Using klatexformula in Command Line Mode

KLatexFormula has a command-line interface. Prior to version 3.1, two separate programs klatexformula and klatexformula_cmdl took care separately of graphical and command-line interfaces, respectively; beginning version 3.1, they are reunited in the program klatexformula with klatexformula_cmdl being a symlink to it (except on windows, where klatexformula_cmdl runs inside a console window).

For example, you can straigtforwardly get an image of an equation (dont forget to escape any special shell characters):

klatexformula  \
    --latexinput '\delta(x) = \frac{1}{2\pi} \int e^{ikx}\,dk' \
    --dpi 300 --output dirac-delta.png

will give you:

Example equation

It is also possible to instruct klatexformula to run interactively, or to communicate with an existing running application instance (except on Windows), with the --interactive flag:

klatexformula --interactive --latexinput 'a+b=c'

A full description of all options and what they do is given in the help text:

klatexformula --help

Image Effects

Never thought the Lagrangian of QED could get any hotter? Try this:

Or perhaps you would rather give it a twist?

There are a set of effects you can play with, provided as an export type user script. Compile an equation as usual (with normal appearance), and then select the copy/drag export type “Effects → On Fire Effect” (or your preferred effect). Then copy the equation as usual. Note that some effects can be very slow to run, so it is normal that KLatexFormula hangs for a couple seconds before copying the image to the clipboard. Paste it wherever you like, and voilà!

Note that effects require user scripts to run, and a working installation of ImageMagick’s convert utility. On Windows, make sure Python is installed.

More Tips & Tricks

If you think of more tips & tricks, don’t hesitate to contact me in order to add them here.