by David K. Levine
Jex is an equation editor designed to insert and edit equations in Openoffice. It is similar to the Design Sciences Mathtype editor, a version of which also ships as the default equation editor with Microsoft Word, and has features similar to the Microsoft Word add-ons tex2word and word2tex. Installation and downloads are below. Jex is a wysywig editor that supports TeX, MathML and Mathtype. This program will only work with Openoffice 1.9+. A version that works with Openoffice 1.1+ is here. You should use at least a 1.4 version of Sun's Java j2sdk or jre.
What is new: Alignment
of equations in variable spaced text works properly in Openoffice 2.0.
The major
new features are the ability to read Mathtype embedded equations, to
export entire documents to TeX, to import entire documents from TeX,
and to operate on entire Openoffice documents.
![]() |
Downloads: Stable Binary(version 12) Latest Binary(version 126) . Installation zipfile. (Note that the jar files contain the source code along with the executables.) Installation instructions are below. If you use the stable version, you should rename jex-stable.jar to jex.jar.
Copyright: Stable version 9 and current version 85 and earlier are placed in the public domain. All subsequent versions are released under the GPL version 2.
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 supporting jar files in jex-install.zip 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.
In addition to opening Jex equations, Jex can open and edit Mathtype equations. The document must be saved in .odt format. Using the ctrl-m macro will open the Mathtype equation in Jex. WARNING: when you save the equation back to the document it will be saved in Jex format and not in Mathtype format. At this time there is no capability of writing Mathtype compatible equations.
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, and from Mathtype to both formats, but conversion into Mathtype format is not supported.
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. The configuration file is a plain text file in the standard win.ini key=variable format and may be edited with any text editor.
Using Jex to Generate TeX Documents: Choose "Export TeX" from the Jex File|Entire Document menu. This will convert the current open document in Openoffice (including .doc, .sxw, .odt) into a .tex document of the same name in the same directory. If you have a previous installation of Jex make sure that the files writer2latex.jar and xmergefix.jar from jex-install.zip are in the file containing the Jex executable. The export makes use of the fine LPGL java program writer2latex written by Henrik Just. If you wish, you should be able to update the writer2latex.jar and xmergefix.jar files with his latest versions. You may use writer2latex configuration files; in your jex configuration file add or edit a line jex.xml=/path/to/writer2latex/conf and Export TeX Document will use /path/to/writer2latex/conf for the writer2latex configuration file. A sample configuration file jex.xml suitable for use with Jex is included in jex-install.zip. Note that Export TeX Document will convert Mathtype equations embedded in word documents, providing functionality similar to word2tex.
Using Jex to Import TeX Documents: For this to work you must have latex2html installed. By default it is assumed that latex2html is in your command path so that if you issue latex2html from a console the program will execute. If you need a qualified path such as c:/progs/latex2html or latex2html has some other name, you can fix this by changing the latex2html= option in your configuration file (conf.jex). Choose "Import TeX" from the Jex File|Entire Document menu. The selected TeX file will be opened in a new document. You can then convert the graphic images of equations using "Update Equations" or "Embed All Objects".
Using Jex to Work with Openoffice Documents: The functions "Update Equations" and "Embed All Objects" from the File|Entire Document menu perform operations on the entire document currently open in Openoffice. "Update Equations" is equivalent to opening each equation in the document and saving it again - for example, because you have changed the size of the text fonts; or because you want to convert a bunch of mathtype equations to Jex format. "Embed All Objects" is similar, but in addition graphical objects that cannot be identified as equations and are links to external graphical files are embedded into the document. This is useful if you are importing a document from LaTeX/html using latex2html, and want to make the .odt self-contained without links to external files.
Using Jex with Presentation, Spreadsheet and Drawing Programs: Jex does not work with these programs. Experimentation with the presentation program shows that it pointless to modify Jex to do so: the presentation program does not support objects or pictured flowed in text, only as independent objects on the slide - a setup that is not appropriate for equations. The workaround is to embed Openoffice writer boxes rather than text boxes. [This should work with the spreadsheet and drawing programs as well.] That is, choose Insert|Object|OLE Object and from the dialog box, select Openoffice.org 2.0 Text Document. The ctrl-m macro will enable you to insert and edit equations in the embedded text document. Warning: RC3 is unstable. When I tried this it crashed Openoffice. The recovered document contained the inserted equation, and I was able to edit it without a further crash.
Known Limitations:
The jex-install.zip contains the necessary java support files from openoffice 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 jex-install.zip file also contains the install.odt file, and the necessary writer2latex .jar files to convert documents to LaTeX.