I have a certain template file for LO Writer.
How can I edit that file directly, i.e. not by creating a new .odt
file and saving it as a .ott
file again?
This question is based on the following experience: under Windows, it is possible to right-click the file and choose something along the lines of Edit this file, which then open the .ott
-file itself instead a blank new document.
Like most LibreOffice file formats, the .ott file is just a compressed archive. Rename it to
filename.zip
and open it with the archive manager. You will find several files and folders in it. Most likely you want to edit thecontents.xml
file. When you're done, compress the files and rename the file tonewfilename.ott
. Unless you have made a mistake somewhere, you can open this file with LibreOffice. LibreOffice is not very lenient towards errors in the XML markup, and will refuse to open the file if you forget to close a tag, for instance.LibreOffice supports the
-o
command line parameter which does exactly this:Unfortunately there is no shortcut in the file manager to access this functionality. But I guess you could add your own
.desktop
file which does this; or you could edit/usr/share/applications/libreoffice-writer.desktop
and manually add the-o
parameter to theExec=
line.Alternatively you can run
libreoffice -o MyTemplate.ott
command in Terminal to edit theMyTemplate.ott
file.Select
File -> Templates -> Manage
Click on the template of interest.
Click the 'Edit' button that appears in step 2).
If your template doesn't appear in the list of templates then you may need to import it.
File -> Templates -> Manage
Click the 'Import' button.
The best solution I've found is to open the template file you want to edit; this gives you an "Untitled 1" document.
However, you can edit this and save it over the old template file.
It's not as slick as using Microsoft Word on Windows, but it accomplishes essentially the same thing.