Jex - a Java Equation Editor for Open Office [OO 1.1x version]

by David K. Levine

Jex is an equation editor designed to insert and edit equations in Open Office. It is similar to the Design Sciences Mathtype editor, a version of which also ships as the default equation editor with Microsoft Word. Installation and downloads are below. Jex is a wysywig editor that supports both TeX and MathML. This version will only work with openoffice 1.1x and not with 1.0 or 1.9+, and you should use at least a 1.4 version of Sun's Java j2sdk or jre. If you want the current version for openoffice 1.9+ click here.

jex screenshot

equation in openoffice

Downloads: Final Public Domain, Openoffice <1.9 version (stable version 9) (Note that the jar files contain the source code along with the executables.) Installation instructions are below. Rename the file to jex.jar.

Changelog

Copyright: This version and all earlier versions are placed in the public domain.

Compiling: The source files are contained in the jar file. To compile, change the jar extension to zip and unzip the file. The java files should be in a directory called jex, the images in a subdirectory of that directory called images. The support files must be in your class path. From the superdirectory of the jex directory issue the command javac jex/Jex.java. You can then run the program by java jex/Jex and put it in a jar file using jar jar cvfm jex.jar jex/jmainclass.txt jex. If you want to make modifications, it would be useful if you changed the data in ver.txt to show that this is a different version.

Usage: To insert a new equation in Openoffice, use the keyboard accelerator ctrl-m. To edit an existing equation, select it, and use the keyboard accelerator ctrl-m. In both cases a Jex window will open. The first time Jex runs it will take a while to load, so be patient. However, even when all Jex windows are closed, Jex will remain running until Openoffice closes, so subsequent window openings will be reasonably fast.

Equation editing uses keystroke bindings similar to Mathtype or Scientific Workplace; in particular control-j inserts a sub/superscript and control-g make the next character greek. You can find a complete list of keyboard accelerators under the help menu. To insert something into the "User" menu, copy it to the clipboard, then click on the target using any mouse button except the usual one. When you are done editing your equation, save it, or use the ctrl-m keystroke accelerator from within Jex to save the equation and close the window.

If you are editing an equation, the "save" operation replaces the equation in openoffice with your edited equation. Otherwise the new equation is inserted at the cursor in openoffice. Note that the font size of the equation inserted into openoffice is determined from the font size of the text that precedes the equation. If you change font sizes in the Openoffice document, simply edit your equation and resave it to get the font size reset.

Jex speaks a dialect of both MathML and of LaTex. LaTex is the default format. The paste operation will read the clipboard to determine if it contains TeX or MathML. You can also type TeX directly into equations by hitting \ in the editor. Be aware that hitting the space key will insert your TeX and exit TeX mode. Exactly what LaTex is and is not supported by Jex is documented here. MathML support is "more experimental" than TeX support, and is not yet documented. Jex can be used to convert from supported TeX to MathML and vice versa.

Jex supports two command line options. You may use the option --server and also the path to a configuration file. If you specify a configuration file, the configuration will be loaded from that file, and configuration changes will be saved to that file (it will be created if it does not already exist). The default installation uses a file called conf.jex in the same directory you installed Jex into. The --server option will try to edit whatever is selected in Openoffice when Jex first starts up, and will cause Jex to remain resident until all Jex windows are closed and Openoffice closes. This is the default option. If you do not use the --server option, Jex will start up without trying to get an equation from Openoffice, and it will close as soon as all Jex windows are closed.

Known Limitations:

Fonts: Use the Design Science Euclid fonts, which you can download here. You should first read the licensing agreement.

Installation

Step 1: Install java if you have not already done so. Install Java2 jdk or jre at least 1.4.
Step 2: Install Openoffice if you have not already done so. Install at least version 1.1.
It is recommended that you install Java first so that it will be recognized by openoffice, but this is not mandatory, and it is not required that java be installed to work with openoffice.
Step 3 [Windows Only]: If you do not have Mathtype installed, install the Truetype Euclid fonts from Design Science.

Step 4. Create a directory and put the files jex.jar, support.zip
and euclid.zip in it. Unzip the support.zip file. When you unzip the support.zip file, a file called install.sxw will be created.
Step 5. As root or adminstrator open the install.sxw/.odt file. When the dialog asks if it is OK to run macros, answer yes. Click on the box "As root or administrator click here to activate port listening in Openoffice." Close all running instances of Openoffice - in windows this includes closing the openoffice quickstarter.
Step 6. As the user who will use Jex, again open install.sxw/.odt
, and again allow macros to run. Click on the box "As an ordinary user click here to install Jex into Openoffice." Leave Openoffice running.
Step 7. As root or administrator, run Jex. Either double-click the jar file, or use the command line java -jar jex.jar. Select "Install Office Fonts" and "Install Java Fonts" from the "Install" submenu of the "Tools" menu. Close Jex.
Step 8. As the user who will use Jex again run Jex. Select "Install for Office" from the "Install" submenu of the "Tools" menu in Jex. Exit Jex and Openoffice - in windows this includes closing the openoffice quickstarter.

Upgrading

If you upgrade Openoffice or Java you should repeat the installation routine above, except that you can obviously skip steps 1-3. If you want to change to a different version of Jex, simply replace the jex.jar file with the jex.jar file of your choice (for example, to replace the current version with the stable version, or vice versa). If you upgrade from oo 1.x to oo 2.0 you should redo the entire installation and use the current version of Jex.

What the Installation Routines Do

What the port activation routine does
What the ordinary user installation routine does
What “Install Office Fonts” does in Jex
What “Install Java Fonts” does in Jex
What the “Install for Office” does in Jex

What is in the support files?

The support.zip contains the necessary java support files from openoffice 1.1 needed to control openoffice from Java. They are probably already installed on your system but are a pain to locate, so I have provided a set of copies and bound the jar file to copies that are in the same directory as the jar file. The support.zip file also contains the install.sxw file.