Chapter 3. Developer's guide to KLatexFormula 2.0.1

Table of Contents

KLFBackend - the backend utility
Tweaking the latex_symbols file

KLFBackend - the backend utility

One of the great innovations of version 2 of KLatexFormula is its new architecture. What was before in one monolithical object is now divided into three parts:

  • KLFBackend (library) - the backend work. The base work is done here. This is a library that doesn't need KDE to compile - it will compile with Qt 3 or Qt 4 and run in console or gui mode. This library mostly provides one function that is KLFBackend::getLatexFormula(...) that gives you an image from a latex string. It handles "latex", "dvips", "gs", as well as "epstopdf" in the background, in a completely transparent way. For more information, you should look at the KLFBackend doxygen api documentation, which you can generate from the Doxyfile provided in the source tarball of KLatexFormula 2.0.1.

  • klatexformula_cmdl (executable) - the command-line interface to KLFBackend. This isn't a mountain. It translates command-line options to parameters to KLFBackend and prints result to stdout or file. Check out "klatexformula_cmdl --help" for info or have a look at the source code (file src/klfcmdl_main.cpp). Note that klatexformula_cmdl needs full KDE, although it can run without X.

  • klatexformula (executable) - the big graphical interface, integrated to KDE, providing syntax highlighting, a history browser, a latex symbol palette, drag and drop, copy/paste, save to disk, etc.

If you're interested to use the KLFBackend functionality in your applications, feel free to link to the library, include the header, et voilà!