Difference between revisions of "Ooolatex"

From ArchWiki
Jump to: navigation, search
(Installation)
(Installation)
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
[[Category:Mathematics and science]]
 +
[[Category:TeX]]
 
From [http://ooolatex.sourceforge.net/ - OOoLatex]:
 
From [http://ooolatex.sourceforge.net/ - OOoLatex]:
  
 
:''OOoLatex is a set of macros designed to bring the power of LaTeX into OpenOffice. It contains two main modules: the first one, Equation, allows to insert LaTeX equations into Writer and Impress documents as png or emf images while the second one, Expand, can be used for simpler equations to expand LaTeX code into appropriated symbol characters and insert them as regular text. ''
 
:''OOoLatex is a set of macros designed to bring the power of LaTeX into OpenOffice. It contains two main modules: the first one, Equation, allows to insert LaTeX equations into Writer and Impress documents as png or emf images while the second one, Expand, can be used for simpler equations to expand LaTeX code into appropriated symbol characters and insert them as regular text. ''
  
The macro is especially useful for the preparation of presentations with a lot of mathematical formula. Instead of using beamer class in LaTex, one can enjoy the flexibility of Impress in organizing texts and graphs while at the same time harnish the power LaTex in typesetting and inserting formula.  
+
The macro is especially useful for the preparation of presentations with a lot of mathematical formula. Instead of using beamer class in LaTeX, one can enjoy the flexibility of Impress in organizing texts and graphs while at the same time harness the power of LaTeX in typesetting and inserting equations.  
  
 
==OOoLatex in Arch Linux==
 
==OOoLatex in Arch Linux==
Line 9: Line 11:
  
 
==Installation==
 
==Installation==
The easiest way to obtain OOoLatex macro package is from the [http://ooolatex.sourceforge.net/ - project's website]. Select the package according to the system architecture. Open the "oxt" file with OpenOffice or LibreOffice, the extension manager should take care of the rest.
+
The easiest way to obtain OOoLatex macro package is from the [http://ooolatex.sourceforge.net/ project's website]. Select the package according to the system architecture. Then, open the "oxt" file with OpenOffice or LibreOffice, the extension manager should take care of the rest.
  
 
==Fonts==
 
==Fonts==
To render the equations correctly, one must have the required fonts installed in the system. The collection of fonts is available from the [http://ooolatex.sourceforge.net/- project website] under the name OOoLatexFonts.zip.
+
To render the equations correctly, one must have the required fonts installed in the system. The collection of fonts is available from the [http://sourceforge.net/projects/ooolatex/files/latest/download?source=files- project website] under the name OOoLatexFonts.zip.
  
To install the fonts, follow the wiki guide on [[fonts]]. For example, a system-wide installation (available for all users) can be performed by unzipping and moving the fonts folder to the {{Filename|/usr/share/fonts/}} directory.  
+
To install the fonts, follow the Wiki guide on [[fonts]]. For example, a system-wide installation (available for all users) can be performed by unzipping and moving the fonts folder to the {{ic|/usr/share/fonts/}} directory.  
  
 
Then one needs to update the font cache: (from within the fonts folder)
 
Then one needs to update the font cache: (from within the fonts folder)
Line 21: Line 23:
  
 
==EMF support==
 
==EMF support==
EMF format allows a better rendering of the equations by the use of scalable graphics. It performs much better than a png/jpeg rendition and is strongly recommended for serious works.  
+
EMF format allows better rendering of the equations by the use of scalable graphics. It performs much better than a "png" rendition and the resultant image can be re-sized without compromising visual quality.  
  
To enable the EMF support, one needs to install the latex2emf binary. The binary is again available in the [http://ooolatex.sourceforge.net/- project website]. Select the right package according to the system architecture. Note that the package "latex2emf_Linux_i386_binary.tar.gz" is equally useful for both i386 and 64 bits users. One can also compile from source by selecting the "OOoLatexEmf_noarch_src.tar.gz" package.
+
For the EMF option to work, it is particularly important to install the "libstdc++5" dependency:
  
Unzip the file and perform the installation by running (as root or sudo) the install.sh script:
+
# pacman -S libstdc++5
 +
 +
For 64 bit users, in addition to the above package, one also needs
  
  # sudo ./install.sh
+
  # pacman -S lib32-libstdc++5
  
 +
==Initial setup==
 +
After installation, one can start the macro by choosing Tools > Macros... > Run Macros and selects the required routine from within a document. Also, an OOoLatex toolbar should be available which allows easy insertion of equations. (If it is not automatically enabled, check OOoLatex in View > Toolbars > OOoLatex.)
  
 +
To successfully compile the LaTeX code, one needs to supply the paths to LaTeX and ghostscript (gs) binaries to OOoLatex in the "Config" tab. The usual location for both of these are in
 +
 +
# /usr/bin
  
 
==Usage==
 
==Usage==
After installation, try <Control>+M and <Control>+K (the default shortcuts). You can also add the OOoLatex Toolbar: View > Toolbars > OOoLatex
+
One can invoke the Macro by selecting the "Equation" tab in the toolbar. The module transform the relevant LaTeX code into a graphical image. For the graphical image, one can choose between ".png" and ".emf". The ".emf" format is more preferrable in that it is scalable, instead of pixelized image in the case of ".png".
 +
 
 +
Start by typing
 +
 
 +
<pre>
 +
F = ma
 +
</pre>
 +
 
 +
with "display" type in the "Equation" module. Press "Latex" to run the code. The resultant image should scale nicely if one chooses "emf" as output format.
 +
 
 +
For more information on how to use the macro, consult the [http://ooolatex.sourceforge.net/  project's website].
  
The module Equation transform a LaTeX code into an image. Two formats are proposed: .png and .emf. You probably know PNG, this is a kind of "normal" image. If you rescale it, you'll see pixel. A way to circumvent this problem is to increase the resolution (dpi) but you'll get larger files! Or to use the EMF format which is a scalable image: the equation is vectorised and don't loose resolution when you rescale it! This is probably the better choice but you need then some binaries (see above). Selecting an equation and opening the equation dialog box allows editing of the equation.
+
==References==
  
The module Expand was first called Inline in the first versions of OOoLatex. Basically, it transforms (expands) the LaTeX special characters into ones that are usable by OpenOffice. This is done (partly) via the STIX general fonts. The interests of Expand is to include LaTeX characters directly in a sentence without requiring the insertion of an image (as in Equation). Evidently, not all LaTeX code can be expanded (e.g. a fraction bar with something above and under is not a character!), that's why a list is offered in the dialog box.
+
* [http://ubuntuforums.org/showthread.php?t=334218  OOoLatex for Ubuntu]
 +
* [http://ooolatex.sourceforge.net/  project's website]

Revision as of 11:54, 14 August 2012

From - OOoLatex:

OOoLatex is a set of macros designed to bring the power of LaTeX into OpenOffice. It contains two main modules: the first one, Equation, allows to insert LaTeX equations into Writer and Impress documents as png or emf images while the second one, Expand, can be used for simpler equations to expand LaTeX code into appropriated symbol characters and insert them as regular text.

The macro is especially useful for the preparation of presentations with a lot of mathematical formula. Instead of using beamer class in LaTeX, one can enjoy the flexibility of Impress in organizing texts and graphs while at the same time harness the power of LaTeX in typesetting and inserting equations.

OOoLatex in Arch Linux

This article explains how to install OOoLatex for Arch Linux, assuming one has a working Latex system and Ghostscript package installed.

Installation

The easiest way to obtain OOoLatex macro package is from the project's website. Select the package according to the system architecture. Then, open the "oxt" file with OpenOffice or LibreOffice, the extension manager should take care of the rest.

Fonts

To render the equations correctly, one must have the required fonts installed in the system. The collection of fonts is available from the project website under the name OOoLatexFonts.zip.

To install the fonts, follow the Wiki guide on fonts. For example, a system-wide installation (available for all users) can be performed by unzipping and moving the fonts folder to the /usr/share/fonts/ directory.

Then one needs to update the font cache: (from within the fonts folder)

# fc-cache -vf

EMF support

EMF format allows better rendering of the equations by the use of scalable graphics. It performs much better than a "png" rendition and the resultant image can be re-sized without compromising visual quality.

For the EMF option to work, it is particularly important to install the "libstdc++5" dependency:

# pacman -S libstdc++5

For 64 bit users, in addition to the above package, one also needs

# pacman -S lib32-libstdc++5

Initial setup

After installation, one can start the macro by choosing Tools > Macros... > Run Macros and selects the required routine from within a document. Also, an OOoLatex toolbar should be available which allows easy insertion of equations. (If it is not automatically enabled, check OOoLatex in View > Toolbars > OOoLatex.)

To successfully compile the LaTeX code, one needs to supply the paths to LaTeX and ghostscript (gs) binaries to OOoLatex in the "Config" tab. The usual location for both of these are in

# /usr/bin

Usage

One can invoke the Macro by selecting the "Equation" tab in the toolbar. The module transform the relevant LaTeX code into a graphical image. For the graphical image, one can choose between ".png" and ".emf". The ".emf" format is more preferrable in that it is scalable, instead of pixelized image in the case of ".png".

Start by typing

F = ma

with "display" type in the "Equation" module. Press "Latex" to run the code. The resultant image should scale nicely if one chooses "emf" as output format.

For more information on how to use the macro, consult the project's website.

References