KLatexFormula Documentation

LaTeX fonts

The font used to render the LaTeX formula can be selected using a selection box in expanded mode. The font selection box is in fact a shortcut for additional definitions which are inserted in the preamble.

The possible selections in the selection box are defined in XML files. Check out src/conf/latexfontdefs.d/defaultfontdefs.xml in the source code for an example. The XML files are searched for in directories named conf/latexfontdefs.d under

  • in the shared data directory (e.g., /usr/share/klatexformula/conf/latexfontdefs.d/);

  • under the user’s .klatexformula directory ($HOME/.klatexformula/conf/latexfontdefs.d/).

XML file structure

The root XML element is <latex-font-defs-list>:

<?xml version='1.0' encoding='UTF-8'?>
<latex-font-defs-list version="1.0" minklfversion="3.3.0alpha">
  <font-def>
    <identifier>...</identifier>
    <title>...</title>
    <latexdefs>...</latexdefs>
  </font-def>
  [...]
</latex-font-defs-list>

The child nodes of <latex-font-defs-list> must be <font-def> nodes, each with one of <identifier>, <title> and <latexdefs> nodes which specify an internal identifier for the font definition, a title to display to the user, and definitions to add to the LaTeX preamble.