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?
1 Answer
Please don't abandon LibreOffice just for this. You can insert LaTeX formulas directly using the TexMaths extension.
Installation:
Download the extension at https://extensions.libreoffice.org/extensions/texmaths-1
Open LibreOffice Writer, go to
Tools -> Extension Manager
, and select the file (*.oxt) just downloaded.Close all instances of LibreOffice and start it again.
You'll see a new toolbar:
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:
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 theTexMaths
system configuration, I'd suggest Ctrl+h and Ctrl+k since there is no predefined shortcut for this keyboard combination in LibreOffice.
-
3Just 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.– norok2Oct 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?– dKabNov 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 codeV_\text{ц}
. Press "LaTeX" button (sometimes you have to resize the dialog window to see the button).– alfCMay 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.– alfCMay 21, 2018 at 18:38
-
2Thanks 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
Edit
on wikipedia, then you will see the equivalentLaTeX
code.