Developer: Ulrich Küttler
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
KFormula is used to layout formulas.
Table of Contents
KFormula is used to write formulas. It doesn't evaluate anything. All it does is print them.
KFormula was designed for your editing pleasure. It makes it delightful to enter Greek letters, fractions and all the stuff that makes a formula look like a formula.
But most of the time you won't want to use KFormula itself. Instead you might choose to use it from within KWord or any other KOffice application. That is KFormula is not a useful application on its own but an extension to all the other KOffice applications you've fallen in love with.
Where ever KFormula gets embedded, it will behave the same.
A new (empty) KFormula document looks like a small blue square. This square stands for the central idea of KFormula. It represents an empty list. The idea of KFormula is to have different elements arranged in lists. An element in this respect might be a single char or a root symbol or something like that. The lists are put together so that they form a formula. That is there are lists for indexes, lower and upper bounds and so on. And of course there is the main list, which we've already seen.
Writing a formula means to fill the empty list with letters, figures and mathematical symbols. That is straightforward: use your keyboard. As soon as you type something the “empty” symbol will vanish and you will see whatever you have inserted instead. New characters are always put at the current cursor position.
There is a toolbar called Add that allows you to create more complex elements. There are indices, fractions, roots and matrices to name a few. All these elements consist of at least one list, you can move the cursor into and insert new items.
Below is a typical formula entry in KFormula. To enter the partial derivatives and Greek letters click on the symbol combo box, on the right, and select the appropriate symbol. The symbol combo box, in the figure below, has the word “Cap” on it. Click on the return key symbol to the right of it, to enter a symbol.

The Greens formula above can be printed to a PostScript® file. To do that choose File->Print and configure print as shown below:

Here is what the the resulting PostScript® file should look like:

See the Mathematical Fonts section for font installation details. You must install the esstix fonts to get these results
Creates a new KFormula document
Opens a previously saved document
displays a selection of recently saved documents you can open
Saves the document
Saves the document with a name you provide
Prints the document
Shows how the printed document will appear
Provides a dialog box where you can enter your name, e-mail address and a short description about the document
Invokes Kmail so you can e-mail the file. Note: You still have to attach the file to the e-mail
Closes the current document
Quits KFormula
Undoes an action. You can revert to the state that existed before your last change
Undoes an undo. Reverse the action of Undo. This will restore the change you originally made
Cuts a highlighted piece of text from the KFormula screen.
Copies a highlighted piece of text from the KFormula screen.
Pastes the text you selected with Cut or Copy to the KFormula screen.
Highlights all the text in the KFormula screen for either Cut or Copy.
Removes enclosing braces, brackets or absolute value bars. This action takes place on the braces just outside the cursor.
Converts a Latin character to a Greek symbol.
Brings up an editor where you can edit the existing formula.
See the Advanced editing section for details.
Inserts the square root.
Inserts a fraction.
Inserts a pair of brackets, i.e. ( ). You can also just type ( to insert a pair of brackets.
Inserts a fraction.
Inserts the integral sign.
Inserts the summation sign (sigma).
Inserts the product sign.
Inserts a matrix. A dialog box pops up, with the default size being 3x3. You can specify the number of rows and columns in this box.
Inserts a two rowed column vector.
Adds an upper index like so: 
Adds a lower index: 
See the Definite Integrals and Indices section for details about indices.
Inserts a small space.
Inserts a space that is one and a half times wider.
Inserts a double space.
Inserts a quadruple wide space.
Inserts a column in an existing matrix. The column is inserted where the cursor is at.
Appends a column to an existing matrix. The column is appended on the right.
Removes a column from an existing matrix. Removal occurs where the cursor is positioned.
Inserts a row in an existing matrix. The row is inserted where the cursor is at.
Appends a row to an existing matrix. The row is appended on the bottom.
Removes a row from an existing matrix. Removal occurs where the cursor is positioned.
Allows insertion of various delimiters i.e. (, {, and [.
Allows insertion of various delimiters i.e. ), }, and ].
Inserts the symbol, selected in the symbol toolbar.
Here you can choose how KFormula is configured. You can select the toolbars you want displayed or the type of fonts to be used.
Checking this item determines if the numbers will be displayed in color
Toggles the toolbar that contains clickable icons for new, open and save files. Print and print preview are here also.
Toggles the edit toolbar.Here are clickable icons for cut and paste as well as Undo and Redo.
This toolbar contains all the mathematical elements such as Sum, Integral, Exponent etc..
This toggles the combo box that contains Del, the partial derivative symbol, limit arrows, boolean operators and other mathematical symbols.
This toggles the matrix toolbar. It contains clickable icons that pertain to matrix creation and editing.
The Settings->Configure Shortcuts... allows you to specify key bindings
Below is an example of how to configure a short cut for making a thick space.

Click on the custom button.
Next click on the primary button.
Do CTRL Space and the dialog should disappear. The keybinding is now entered.

Pressing the keys CTRL Space now produces a thick space.
The Settings->Configure Toolbars... Is used to add additional buttons to the toolbars.

To add a button to the File toolbar,

make sure File <KOfficeShell> is displayed in the top combo box.
Click on one of the items in the left hand pane. This item will now have a blue background showing that it has been selected.
Next click on the Right arrow button to place it in the right pane.
Click on Apply and then click on OK
The new Item should be in the toolbar. 
The Settings->Configure KFormula... is where the font sizes are selected and additional fonts are installed.
The Formula section allows you to select fonts and font highlight colors.
The Fonts section allows you to install additional fonts. See the Additional Math Fonts section.
Invokes the KDE Help system starting at the KFormula help pages. (this document).
Changes the mouse cursor to a combination arrow and question mark. Clicking on items within KFormula will open a help window (if one exists for the particular item) explaining the item's function.
Opens the Bug report dialog where you can report a bug or request a “wishlist” feature.
This will display version and author information.
This displays the KDE version and other basic information.
A special feature is the name insertion. The blue square you type into is actual a list. Furthermore, that list can contain other lists. When you type a backslash (\) you get a new empty list right away. But this one is special. It uses a different font and is meant to insert things like function names. There is, however, a second idea here. Your keyboard only has a limited number of keys. The wealth of mathematical symbols on the other side is overwhelming. To get one of those you can type its name and press the space key afterwards. The name you typed will be replaced by the symbol then. In this context, the Space key means “get out of here”, that is move the cursor to the containing list. The cursor will be positioned at the end of what you just entered but will also enclose part of the original formula, after pressing the space bar.
Another thing you might want to insert are spaces. We all know, printing formulae is all about the right spacing. And you can do just that using a “name list”.
Inside the blue square do: \ , SPACE to get a small space.
Do: \ < Space to get a medium space.
Do: \ ; Space to get a thick space.
Do: \ quad Space to get a quadruple wide space.
In the same way, specific mathematical symbols can be inserted. \ oint Space inserts the path integral about a closed contour. Below is the result of \ oint Space:

The Edit->Edit Formula String allows the user to edit the ASCII formulas that have been copied from other applications, such as Scilab, and transform them directly into mathematical type. An example will make this clear. Below is a screenshot of INRIA Scilab.

Copy and paste the text beginning with x*sin(30*x) into the formula editor as shown below:

If you click on OK, the editor will complain about aborted parsing. It cannot recognize one of the symbols in the formula. The displayed formula would show that the Pi symbol is not correctly rendered. This means that the % must be deleted. Do this and KFormula will render the mathematical font properly, as shown below.

The formula editor will accept most C language mathematical expressions, like the formulas from a Runge-Kutta program below:
void derivs(float x, float y[], float dydx[])
{
dydx[1] = y[2];
dydx[2] = -0.8*x*y[2] - sin(x)*y[1];
}Here dydx[1] is the first order derivative and dydx[2] is the second order derivative. After copying the formula, you will have to edit the derivatives with KFormula. Here is how it is done. First copy and paste the bottom expression into the formula editor.

Next remove the [ ], leaving just y's.

Now click OK and place the cursor by a y and delete it. Insert the appropriate symbols as shown below.

Not every expression that KFormula is capable of translates into a valid C expression. For example the superscript expression:

is displayed as ()**(), which is not a valid C statement for exponentiation. Similarly the 1 by 2 matrix displays as ()/(). This is not a valid array in C.
A definite integral is made by using Ctrl+U for the upper limit of integration and Ctrl+L for the lower limit of integration.

Reposition the cursor in front of the integral after making the first of the limits.
The upper or lower index can be positioned by highlighting the desired
text. In this example, an arrow is needed above the P, in dP. Using Ctrl+U places the desired vector
symbol in the wrong place; namely above the “d”.
The problem is solved by
highlighting only the P in
and then entering Ctrl+U. Here is the correct
result.
In order to print postscript files from KFormula, you need to get the esstix fonts. These fonts can be obtained from ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip
After downloading the fonts, install them into a folder called esstix. You can unpack them with the KDE application Ark. Right click on esstix.zip and select Extract here.... Then start the KDE font installer by going to the K menu and selecting the command Control Center->System-> Font Installer You should get the following screen:

You will need to run the font installer with root privileges. Click on the button Administrator Mode and enter your root password. Click on the button Change Folder. This should bring up a pane from where you can select the folder your fonts are stored in. In this example they are stored in /home/poincare/esstix.

Click on the the folder esstix and then click on the OK button. You should obtain the following result.

Click on the top font entry. Holding down the Shift key, click on the last esstix font, at the bottom. Your selection should look like this.

You should use the native AFM files. Set up your Settings->System as shown below. The Generate AFM's, with box should be unchecked:

Return to the Fonts tab. Click on the Install button. The fonts will install. After this you must click on the Apply button. the following splash will appear:

Answer Yes to the Apply system changes now dialog. You are done installing the esstix fonts.
Additional math fonts can be installed with Settings->Configure Kformula... Math Fonts

First install the desired fonts with the Font Installer, in KControl. This will make them available to your computer. Next enter the Math Fonts section and add them using the Right arrow, as shown above. The Euclid Symbol fonts, that were added above, are now available in the Insert Symbol combo box.
KFormula copyright Ulrich Küttler
Co-developer: Andrea Rizzi
Documentation copyright 2002 Jonathan Drews <j.e.drews@att.net>
This documentation is licensed under the terms of the GNU Free Documentation License.
This program is licensed under the terms of the GNU General Public License.
KFormula is part of the KDE project http://www.kde.org/.
KFormula can be found in the koffice package on ftp://ftp.kde.org/pub/kde/, the main FTP site of the KDE project.
KFormula is part of KOffice on The KFormula home page You must have KOffice installed. KFormula will not work without the rest of KOffice
In order to compile and install KFormula on your system, type the following in the base directory of the KFormula distribution:
% ./configure % make % make install
Since KFormula uses autoconf and automake you should have no trouble compiling it. Should you run into problems please report them to the KDE mailing lists.