Difference between revisions of "OOoLatex"

From ArchWiki
Jump to: navigation, search
Line 9: Line 9:
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. Opening 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. Open the "oxt" file with OpenOffice or LibreOffice, the extension manager should take care of the rest of the installation.  
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://ooolatex.sourceforge.net/- project website] under the name OOoLatexFonts.zip.
To install the fonts, follow the wiki guide on [[fonts]]  
To install the fonts, follow the wiki guide on [[fonts]]. For example,

Revision as of 16:56, 23 October 2011

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 harnish the power LaTex in typesetting and inserting formula.

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.


The easiest way to obtain OOoLatex macro package is from the - 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 of the installation.


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,

mkdir OOoLatexFonts cd OOoLatexFonts wget http://mesh.dl.sourceforge.net/sourceforge/ooolatex/OOoLatexFonts.zip unzip OOoLatexFonts.zip cd .. sudo mv OOoLatexFonts /usr/share/fonts/truetype/. sudo fc-cache -f /usr/share/fonts/truetype

The last step may take a while before finishing

(Optionnal) Install binaries for EMF If you want to use emf format (i.e. scalable pictures of the equations ==> I recommend), you need one more dependency: the latex2emf program.The easiest way to install it is to grab the binaries directly from the OOoLatex website: http://sourceforge.net/project/showf...roup_id=150801 If you have Ubuntu i386 or 64bits choose latex2emf_Linux_i386_binary.tar.gz If you have Ubuntu PPC choose latex2emf_Linux_PPC_binary.tar.gz If you have something else, you'll need to compile from source (grab OOoLatexEmf_noarch_src.tar.gz)

Once downloaded, go to the directory where you've downloaded: Code:

tar -xzvf latex2emf_Linux_i386_binary.tar.gz cd latex2emf_Linux_i386_binary/ sudo ./install.sh

Install OOoLatex And finally, you can now install the extension!! Remarks that if you're just upgrading the extension, you need only this final step! But first download the extension here: http://sourceforge.net/project/showf...roup_id=150801 At the time of writing this post, the latest one was 4.0.0-beta2 --> file OOoLatex-4.0.0-beta-2-linux.oxt

There are two types of installation. The administrator one is useful when installing for a lot of users but each user is not allowed to modify the configuration (most notably the shortcuts), only root can do that. Therefore I recommend, for normal user, to install the single-user type. For each type ther are two ways to make the install:

   Terminal :
   /usr/lib/openoffice/program/unopkg.bin add OOoLatex-4.0.0-beta-2-linux.oxt
   sudo /usr/lib/openoffice/program/unopkg.bin add --shared OOoLatex-4.0.0-beta-2-linux.oxt
   Graphical :
   Open OpenOffice (writer or impress). Tools > Package Manager > Add > Select the oxt file you've downloaded
   Not recommended, see terminal method

Note that you'll have to accept the licence.

Usage After installation, try <Control>+M and <Control>+K (the default shortcuts). You can also add the OOoLatex Toolbar: View > Toolbars > OOoLatex

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.

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.

In summary: use Equation for ... equations and Expand for some in-text characters

Make sure that fonts are installed, otherwise you will see only rectangles:

# pacman -S ttf-dejavu artwiz-fonts

Download the base for stable and/or beta and/or devel:

# pacman -S libreoffice 

Since version 3.4.2rc1, LibreOffice has been split. The install will give you a menu prompting for which components to install. As the language pack for en-US is no longer included by default, you will need to install at least 1 language pack. The default language is Afrikaans (because it is alphabetically the first provider of libreoffice-langpack), the previous default (en-US) is at number 22:

[user@home ~]# pacman -S libreoffice
:: There are 11 members in group libreoffice:
:: Repository extra
   1) libreoffice-base  2) libreoffice-calc  3) libreoffice-common  4) libreoffice-draw
   5) libreoffice-gnome  6) libreoffice-impress  7) libreoffice-kde4  8) libreoffice-math
   9) libreoffice-sdk  10) libreoffice-sdk-doc  11) libreoffice-writer

Enter a selection (default=all): 
resolving dependencies...
:: There are 103 providers available for libreoffice-langpack:
:: Repository extra
   1) libreoffice-af  2) libreoffice-ar  3) libreoffice-as  4) libreoffice-ast  5) libreoffice-be
   6) libreoffice-bg  7) libreoffice-bn  8) libreoffice-bo  9) libreoffice-br
   10) libreoffice-brx  11) libreoffice-bs  12) libreoffice-ca  13) libreoffice-ca-XV
   14) libreoffice-cs  15) libreoffice-cy  16) libreoffice-da  17) libreoffice-de
   18) libreoffice-dgo  19) libreoffice-dz  20) libreoffice-el  21) libreoffice-en-GB
   22) libreoffice-en-US  23) libreoffice-en-ZA  24) libreoffice-eo  25) libreoffice-es
   26) libreoffice-et  27) libreoffice-eu  28) libreoffice-fa  29) libreoffice-fi
   30) libreoffice-fr  31) libreoffice-ga  32) libreoffice-gl  33) libreoffice-gu
   34) libreoffice-he  35) libreoffice-hi  36) libreoffice-hr  37) libreoffice-hu
   38) libreoffice-id  39) libreoffice-is  40) libreoffice-it  41) libreoffice-ja
   42) libreoffice-ka  43) libreoffice-kk  44) libreoffice-km  45) libreoffice-kn
   46) libreoffice-ko  47) libreoffice-kok  48) libreoffice-ks  49) libreoffice-ku
   50) libreoffice-lo  51) libreoffice-lt  52) libreoffice-lv  53) libreoffice-mai
   54) libreoffice-mk  55) libreoffice-ml  56) libreoffice-mn  57) libreoffice-mni
   58) libreoffice-mr  59) libreoffice-my  60) libreoffice-nb  61) libreoffice-ne
   62) libreoffice-nl  63) libreoffice-nn  64) libreoffice-nso  65) libreoffice-oc
   66) libreoffice-om  67) libreoffice-or  68) libreoffice-pa-IN  69) libreoffice-pl
   70) libreoffice-pt  71) libreoffice-pt-BR  72) libreoffice-ro  73) libreoffice-ru
   74) libreoffice-rw  75) libreoffice-sa-IN  76) libreoffice-sat  77) libreoffice-sd
   78) libreoffice-sh  79) libreoffice-si  80) libreoffice-sk  81) libreoffice-sl
   82) libreoffice-sq  83) libreoffice-sr  84) libreoffice-ss  85) libreoffice-st
   86) libreoffice-sv  87) libreoffice-sw-TZ  88) libreoffice-ta  89) libreoffice-te
   90) libreoffice-tg  91) libreoffice-th  92) libreoffice-tn  93) libreoffice-tr
   94) libreoffice-ts  95) libreoffice-ug  96) libreoffice-uk  97) libreoffice-uz
   98) libreoffice-ve  99) libreoffice-vi  100) libreoffice-xh  101) libreoffice-zh-CN
   102) libreoffice-zh-TW  103) libreoffice-zu

Enter a number (default=1):
Note: A common mistake is to install libreoffice-uk, which is the Ukrainian language pack, instead of libreoffice-en-GB.

Alternatively, you can install it this way:

# pacman -S libreoffice-common libreoffice-{base,calc,draw,impress,math,writer,gnome,kde4,sdk,sdk-doc}
Note: Both ways work and you need libreoffice-kde4 or libreoffice-gnome only if you care about qt or gtk visual integration - see Theme section below.

Check the recommended optional dependencies pacman suggests e.g. install a Java Runtime Environment (optional, highly recommended). See: Java


For Qt integration

# pacman -S libreoffice-kde4 

For GTK integration

# pacman -S libreoffice-gnome 

Extension management

Arch is shipping some additional extensions. We currently ship these extensions: pdfimport presentation-minimizer presenter-screen report-builder wiki-publisher ct2n hunart numbertext oooblogger typo watch-window diagram.

  • If you find any of them useful install it
# pacman -S libreoffice-extension-nlpsolver libreoffice-extension-foo ...

Check the built-in LibreOffice Extension manager or Get extensions Online if you want to install more extensions.

Language Aids

Spell checking

For spellchecking you will need hunspell and a language dictionary for hunspell (like hunspell-en for English, hunspell-de for German, etc).

# pacman -S hunspell hunspell-en hunspell-de ...

Hyphenation rules

For hyphenation rules you will need hyphen and a language hyphen rule set (hyphen-en for English, hyphen-de for German, etc).

# pacman -S hyphen hyphen-en hyphen-de ...


For Thesaurus option you will need mythes and a mythes language thesaurus (like mythes-en for English, mythes-de for German, etc)).

# pacman -S libmythes mythes-en mythes-de ...

Grammar checking

For Grammar checking you will need to install an extension such as LanguageTool, which can be found in the AUR: libreoffice-extension-languagetool or the LanguageTool Website.

Other grammar tools can also be found on the Libre Office Extension Page or OpenOffice's Website (warning, not all OpenOffice extensions are guaranteed to work with libreoffice)

Installing Macros

In most Linux distros, the default path for macros is:


The path for this directory for LibreOffice in Arch Linux is:


Another thing to note is that if you intend to use macros, you must have a JRE enabled, use of a JRE is default behaviour; but disabling it's use is listed in the speed tweaks below.

Running LibreOffice

If you want to run a specific module of LibreOffice (instead of the libreoffice (soffice is still included for fallback reasons) default Startcenter), for example the word processor (Write), spreadsheet application (Calc) or presentation program (Impress), check for the following script front-ends:

Writer (Text processor)

 /usr/bin/libreoffice --writer or /usr/bin/soffice --writer

Calc (Spreadsheet editor)

 /usr/bin/libreoffice --calc

Impress (Presentation editor)

 /usr/bin/libreoffice --impress

Draw (Vector graphics editor)

 /usr/bin/libreoffice --draw

Math (Formula Editor)

 /usr/bin/libreoffice --math

Base (Database frontend)

 /usr/bin/libreoffice --base

Speed up LibreOffice

Some settings may improve LibreOffice's loading time and responsiveness. However, some also increase RAM usage, so use them carefully. They can all be accessed under Tools > Options.

  • Under Memory:
    • Reduce the number of Undo steps to a figure lower than 100, to something like 20 or 30 steps.
    • Under Graphics cache, set Use for LibreOffice to 128 MB (up from the original 20MB).
    • Set Memory per object to 20MB (up from the default 5MB).
    • If you use LibreOffice often, check LibreOffice Quickstarter.
  • Under Java, uncheck Use a Java runtime environment.
Note: For a list of functionality which depends on OpenOffice Java support, see this page: http://wiki.services.openoffice.org/wiki/Java - Still needed?


Font substitution

These settings can be changed in the LibreOffice options. From the drop-down menu, select Tools > Options > LibreOffice > Fonts. Check the box that says Apply Replacement Table. Type Template:Codeline in the font box and choose your desired font for the Replace with option. When done, click the checkmark. Then choose the Always and Screen only options in the box below. Click OK. You will then need to go to Tools > Options > LibreOffice > View, and uncheck "Use system font for user interface". If you use a non-antialised font, such as Arial, you will also need to uncheck "Screen font antialiasing" before menu fonts render correctly.



$ echo "Xft.lcdfilter: lcddefault" | xrdb -merge

To make the change persistent, add "Template:Codeline" to your Template:Filename file. [1].

If this doesn't work you can also try adding "Template:Codeline" to your Template:Filename. If you do not have this file, you will have to create it.

Spell checking problems

As of openoffice 3.0.0-2, various dictionaries may be buggy due to a character encoding problem. To solve this issue, follow the following instructions.

Find where the particular openoffice distribution places its dictionary files; e.g., Template:Codeline. Most distibutions follow the convention of installing these to Template:Filename. Once the directory has been found, assign it to a shell variable:


Install Template:Package Official and Template:Package Official packages in order to be able to extract the dictionary files:

pkg=$(pacman -T unzip zip) || pacman -S $pkg

For reference, get a list of languages whose dictionary files are packaged with the base distribution:

cd "$droot" && ls | sed -rn 's,^dict-(..)\.oxt$,\1,p'

Define a list of languages whose dictionary files are to be fixed:

lang="en es"

Extract the target languages' dictionary files and convert the erroneous encoding to UTF-8:


mkdir "$tmp"
cd "$tmp"

for i in $lang; do
	unzip "$i" -d oxt.tmp
	iconv -f ISO-8859-15 -t UTF-8 oxt.tmp/dictionaries.xcu > dict.tmp
	mv dict.tmp oxt.tmp/dictionaries.xcu
	(cd oxt.tmp && zip -r "$i" .)

rm -rf "$tmp"

Finally, use the openoffice extension manager (available through the Tools menu) to install the dictionary from the resulting Template:Filename file(s).

Dark GTK themes, Icons and gtk-qt-engine

For a quick fix, see openoffice-dark-gtk-fix or if you have go-openoffice see go-openoffice-dark-gtk-fix on the AUR. This also sets 'OOO_FORCE_DESKTOP=gnome'. Another fix is to export SAL_USE_VCLPLUGIN=gen (generic X11). See for more info

In newer version of OO (3.2.0) and Libre, the fixes mentioned above do not seem to work. If you use a dark GTK theme, you will be unable to change the icons from “high-contrast”. The colors can be configured manually in Options -> Appearance, but Impress and Calc (maybe others too) will stay dark unless you disable automatic detection of high contrast themes first. The problem is with the default setting of “Automatically detect high contrast mode of operating system”. To change the default setting and allow the selection of icons and custom colors with a dark GTK theme, edit the following option:

Tools > Options... > Accesibility > Uncheck:   [ ] Automatically detect high contrast mode of operating system

Now the colors can be configured in Options -> Appearance.

Hanging when using NFS shares

If OpenOffice hangs when trying to open/save a document located on a NFS share, try prepending the following lines with a "#" in /usr/lib/openoffice/program/soffice (/usr/bin/soffice if using go-openoffice):

# file locking now enabled by default

Original post here

Note: Only NFSv3 is affected. NFSv4 works well with OpenOffice.

Fixing Java Framework Error

You may get the following error when you try to run OpenOffice.

[Java framework] Error in function createSettingsDocument (elements.cxx).
javaldx failed!

If so, give yourself ownership of Template:Codeline like so:

sudo chown -vR username:users ~/.config

Post on Arch Linux Forums

Fixing Java Not Found Errors

After a fresh install, when using the jre/jdk packages in the community repo, you may receive a notice "Could not find a Java Runtime Environment!" or the following from the shell:

javaldx: Could not find a Java Runtime Environment! 
Warning: failed to read path from javaldx

The issues seems to be a lack of support for jre-7. This can be fixed by removing jre and/or jdk [pacman -R jre jdk] and will likely require you to remove libreoffice. Once uninstalled, you can install the support jre6 and jdk6 packages.

LibreOffice doesn't detect my certificates

If you can't see the certificates when trying to sign a document, you will need to have the certificates configured in Firefox (or Thunderbird). If after that LibreOffice still doesn't show them, set the MOZILLA_CERTIFICATE_FOLDER environment variable pointing to your Firefox (or Thunderbird) folder.

export MOZILLA_CERTIFICATE_FOLDER=$HOME/.mozilla/firefox/XXXXXX.default/

Certificate Detection

Error while loading shared libraries: libdb-5.2.so

If running LibreOffice returns the following error:

/usr/lib/libreoffice/program/soffice.bin: error while loading shared libraries: libdb-5.2.so: cannot open shared object file: No such file or directory

You can fix this by installing Template:Package Official from [core].