58

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?

2
  • 2
    try and press Edit on wikipedia, then you will see the equivalent LaTeX code.
    – nickpapior
    Dec 18, 2013 at 10:35
  • I don't know where the problem is in LO Math with GausJordan. Have you tried this: left (matrix{1 # 5 ## 2 # 4} ~ mline ~ matrix{7 ## 9} right )
    – user61915
    Sep 5, 2014 at 4:17

1 Answer 1

86

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

Installation:

  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

Configuration:

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.

Usage:

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.
9
  • 3
    Just a note: this plugin is quite fragile in LibreOffice so be prepared to save frequently. For example: the default SVG format produces objects that can be selected individually in LibreOffice and if you accidentally do so, the whole formula becomes uneditable.
    – norok2
    Oct 13, 2017 at 13:35
  • First of all, thanks! This is really cool extension. One problem though - I'm unable to use non ASCII characters in my LaTeX formulas. For example I try to do V_ц which should compile to V with little ц at the bottom and to the right of V, but the compiled image doesn't show ц at all. I guess the underlying packages don't know how to handle Cyrillic alphabet properly. Any idea how to fix this?
    – dKab
    Nov 27, 2017 at 17:09
  • @dKab, yes there is a way, go to TexMaths options, add this to the preamble \usepackage[utf8]{inputenc} \usepackage[T2A]{fontenc}, now add an equation with the code V_\text{ц}. Press "LaTeX" button (sometimes you have to resize the dialog window to see the button).
    – alfC
    May 21, 2018 at 18:36
  • Great answer, TeXMaths is pretty decent if you have to use LO. Sometimes you have to resize the dialog window to see the "Compile to LaTeX" button. XeLaTeX compilation doesn't work for me but the preamble option is pretty powerful. TeXMaths alignment (vertical and horizontal) is even better than with the official LibreOffice Math.
    – alfC
    May 21, 2018 at 18:38
  • 2
    Thanks for the answer! Just a small piece of info to those installing it for the first time - I got errors such as "please check your configuration" and "can't find file tmpfile.bsl". Turns out I had set the paths wrongly. Here is an image of my configuration in case anyone else also faces the same issue - TexMathsConfiguration. (I use Ubuntu 20.0.4 and LibreOffice 6.4.7.2; I also ran sudo apt-get install libreoffice-texmaths while debugging; don't know if that helped or not) Dec 25, 2021 at 7:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .