Site under construction...
OOoLatex is a set of OpenOffice.org macros designed to integrate LaTeX equations. It contains two main modules: The first one, OOoLatexEquation, allows to insert Latex equations into Writer and Impress documents as png, eps or emf images while the second one, OOoLatexInline, can be used for simpler equations by expanding Latex code in the appropriated symbol characters.
With OOoLatexEquation, the equations are created and can be edited through an intuitive GUI while the informations (including the latex code, the characters size and the equation type) are stored in the image attribute and saved in the file. It is thus possible to edit these equations later.
To use OOoLatexEquation you need a Latex distribution and the program Ghostscript to create and process the equation. Some additional softwares are required to convert the image to png, eps or emf file format (see section Installation).
OOoLatex runs under Linux, MacOSX and Windows/Cygwin.
A call to the macro OOoLatexEquation displays the main window (Type “ctrl-m” in Writer or in Impress, see Shortcut configuration)
Here, you can enter the latex code, select the size of the characters and the equation type.
The
button Latex
will produce an image of the equation and insert it in the document.
Here is an example in Writer (emf format) :
Note: It's not possible to attach images to text layout in Impress. The inline mode of OOoLatexEquation will produce floating images contrarily to Writer.
The other module, OOoLatexInline, can be used to expand simple latex expression into the appropriate symbol characters. A call to the macro OOoLatexInline (type “ctrl-l” see Shortcut configuration) opens the inline macro input.
You can enter simple Latex code. Click on OK and the latex code is converted to appropriated characters. As OOoLatexInline converts latex code to symbol characters, it is not possible to convert code like \frac{}{} and so on... but you can use subscript “_{}” or upperscript “^{}”...
To edit an equation, just select it and call the main input window (For example “crtl-m”).
To open the configuration dialog, click on Config from the OOoLatexEquation input window.
The Apply button closes the dialog keeping the configuration only for the current session while the Save button closes the dialog before saving the configuration to file. The Default button resets the configuration and the Load button, sets the configuration from the latest saved one.
OOoLatexEquation can use three file formats to integrate equations into OpenOffice.org documents. Each one has his advantages and disadvantages.
Here is an example of transparent images on a bicolor background. From left to right, png (at 600 dpi with bg color set to '255,255,0') and emf images :
OOoLatex uses the package color. The default foreground \fg and background \bg colors are set in the configuration dialog window but you can use any command from the color package (predefined colors). For example :
To use the OOoLatex you need at least the package OOoLatexMacro which can be found here. This package contains the OpenOffice.org macros OOoLatexEquation and OOoLatexInline as well as a shell script, OOoLatex called by the macro OOoLatexEquation to process the image of the equation.
To unarchive the package (tar.gz file) use the command tar zxvf nom_du_fichier.tar.gz in a terminal.
To use the module OOoLatexInline, you need to install some TrueType fonts. By default, OOoLatexInline needs the MathType fonts for the grec letters and some specials symbols and the Bakoma fonts for a wide range of other special mathematical characters and symbols. You should probably read the MathType Fonts License before using these fonts. The MathType fonts are directly available here.
The module OOoLatexEquation requests a standard Latex installation with ghostscript to process the equation. OOoLatexEquation has been tested with ESP Ghostscript 8.15 and AFPL Ghostscript 8.51.
The macro uses the shell script OOoLatex (see below for installation) to make the dvi file of the equation and to convert it to other formats. By default, the macro looks for the script in your ${home}/bin directory for Unix/Linux users and in c:\cygwin\bin for windows users, but you can put it in an other location depending of your system configuration and tell OOoLatex where the script is located (c.f. configuration window). For each of the supported file formats, you need some specific programs or font files:
The macro OOoLatexEquation uses the layer of the Draw module to import the image of the equation into the document. As a consequence, you need to install the Draw module and all the image format filter in addition to Writer and/or Impress.
For the users unfamiliar with the cygwin and/or the unix world, there is now a step-by-step procedure, on the help forum, for the installation of a minimal system to be able to use OOoLatexEquation. See here.
An Ubuntu package have been developed by Toufik for the installation of OOoLatex and the dependancy on the Ubuntu Dapper and Edgy distributions (i386). See the post on the Ubuntu forum for more information.
Copy the script OOoLatex from the directory
OOoLatexMacro-[xxx]/bin/ to an appropriate location.
For Linux/MacOSX users, copy it in a binary directory, as for example, in
${home}/bin or in /usr/local/bin.
For Cygwin users, the script should be copied in the binary directory at the root of
the cygwin installation (probably c:\cygwin\bin).
Note: The cygwin installation tree must be at the root of the c:,
d: or e: drive to be properly detected by
the macro (this limitation will be removed in future release).
To check your installation, you can run the script independently of OpenOffice in a terminal.
You can test the script with the following example,
\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
%%%
\usepackage{color}
\definecolor{bg}{RGB}{255,255,255}
\definecolor{fg}{RGB}{0,0,0}
\pagecolor{bg}
\color{fg}
%%%
\pagestyle{empty}
\begin{document}
\[\iint\cos\theta(\vec r) dx dy \]
\end{document}
Save it in the file test.tex and run the
following command in a terminal OOoLatex -e png test.tex.
If there is no problem, the file test.png will be created in the
current directory.
Run OOoLatex -h for more options.
To install the OOoLatex macros, launch OpenOffice, open the "marco organizer" from the menu Tools>Macro, button Organizer and select the tab "Libraries". There is a button "Append" which allows you to select the file script.xlb from the directory OOoLatexMacro-[xxx]/macro1.1.x/ for OpenOffice-1.1.x and from OOoLatexMacro-[xxx]/macro2.0/ for OpenOffice-2.x.
Now, you can assign keys to the macros (for example “crtl-m” and “crtl-l”).
From the menu Tools>Customize go to the tab Keyboard and select the macro “main” of the module OOoLatexEquation and OOoLatexInline. Choose a short cut and click on Modify.
Last update : 17/04/2007 [gpiroux]