Libreoffice Calc hide page breaks


Tools menu -> Options… -> Libreoffice Calc / View tab -> Visual Aids section -> “Page breaks” checkbox
LibreOffice Options window open to LibreOffice Calc/View tab

The story

I run in to this on occasion, and here the solution. Sometimes upon opening a file, and certainly after printing, my spreadsheet will retain the additional dashed lines that show how many cells will fit on a printed page. These additional lines annoy me, so I wanted to know how to turn them off. After some Internet searching, I found the answer.

spreadsheet showing a random dashed line interrupting some data


Internet searches

libreoffice calc hide page breaks


Ripped from How to hide default print range/page break lines after clearing a print range? – Ask LibreOffice

Libreoffice is not using my gtk theme

LibreOffice was not using my gtk theme (on my devuan netinst, fluxbox, with xfce4-settings-manager, chtheme, and manually written .config/gtk-3.0/settings.ini).

basic interface for libreoffice writer
No theming for Writer

Turns out you simply need to install an additional package:

sudo apt-get install libreoffice-gtk3
libreoffice writer with gtk3 theming
Writer with gtk3 theme applied

Devuan also has a libreoffice-gtk2 package, which I didn’t try.
I haven’t tried a Fedora minimal/net install with Fluxbox and LibreOffice, so I don’t know if the libreoffice-gtk3 rpm is necessary there, but it’s in the repos.

sudo dnf install libreoffice-gtk3

I was impressed by this behavior. Just install an extra .so file, and boom, LibreOffice integrates with your desktop theme. LibreOffice is some great stuff!


Ripped off from How to change themes [closed] – Ask LibreOffice

Insert filename in Libreoffice Calc spreadsheet ods file in Linux

In LibreOffice Writer, you can use the “Insert Field” tool to easily insert the filename into the document. In Calc, it’s a little different, but still possible. You can access the raw filename and sheet with CELL(“filename”). To make it pretty, use a longer formula.



  2. search libreoffice calc insert filename

Grep odt file


In the GNU/Linux world, you spend a lot of time on the command line. Searching a text file is a piece of cake:
grep -iE "expression" file1

You might even use a gui, and inside that gui you might even use an open-source office suite for all those times that plain text isn’t enough. But what about when you want to search one of those odt files you vaguely remember is some form of xml?

Easy. You use unoconv or odt2txt (look those up in your package manager) and then grep the outputted file. Or you can use the –stdout option.

unoconv -f txt foo.odt

unoconv -f txt --stdout foo.odt | grep -iE "Joe Schmoe"


I first started tackling this problem by figuring out how to access the xml inside. I learned an odt file is zipped, but a tar xf didn’t help. Turns out it was some other compression, that unzip manages.

I also had to actually learn the tiniest bit of perl, as regular GNU grep (and I inferred sed) doesn’t do non-greedy wildcard matching.

So I got this super-complicated one-liner going before I decided to try a different approach and discovered the unoconv and odt2txt applications.

time unzip -p foo.odt content.xml | sed -e 's/\([^n]\)>\n(.*)<\/\1>/\2/;s/<text:h.*?>(.*)<\/text:h>/\1/;' -e 's/<style:(font-face|text-properties).*\/>//g;' | sed -e "s/'/\'/g;s/"/\"/g;s/<text:.*break\/>//g;"




  1. Unzipping an odt file
  2. Perl non-greedy wildcard matching