[Tex/LaTex] How to insert LaTeX formulas in LibreOffice


I am using Libreoffice normally, but I need have Gauss Matrix (http://en.wikipedia.org/wiki/Gaussian_elimination) in Libreoffice . I found that Latex can do that. I installed Lyx on Ubuntu. How can I write Gauss Matrix in Lyx? Also how can I export it to Libreoffice Writer?

Best Answer

Please don't abandon LibreOffice just for this. You can insert LaTeX formulas directly using the TexMaths extension.


  1. Download the extension at https://extensions.libreoffice.org/extensions/texmaths-1

  2. Open LibreOffice Writer, go to Tools -> Extension Manager, and select the file (*.oxt) just downloaded.

  3. Close all instances of LibreOffice and start it again.

You'll see a new toolbar:

enter image description here


TexMaths supports two image formats, PNG and SVG. In practice, PNG resolution is quite poor, you need to install the dvisvgm converter for SVG.

On Ubuntu, it's as simple as:

$ sudo apt-get install texlive-extra-utils

and on Fedora, it's:

$ sudo dnf install texlive-dvisvgm

After you install it, go to TexMaths system configuration and provide the paths for latex, dvipng and dvisvgm. See the screenshot below for reference:

enter image description here

Finally, set the preferences to use SVG by default.


The new toolbar is pretty simple, discover it by yourself. There are a few tips I would like to share to improve productivity though.

  • To edit a previously inserted formula, click on the image and on the correspondent toolbar button.
  • Define shortcuts in the Shortcuts tab of the TexMaths system configuration, I'd suggest Ctrl+h and Ctrl+k since there is no predefined shortcut for this keyboard combination in LibreOffice.