(Note: these are the comments appended to my original article, which I had to put in a separate page when I switched from Drupal to WordPress)

Just came to your site…

Just came to your site following a link from linuxtoday. Wow! This opens windows of opportunities! Somehow I’ve totally missed out on the fact that odt documents are just zip files. I’ve been reading a bit through some content.xml files. And it seems that it should be possible to use openoffice from a text editor just as fine.

I made my thesis in OpenOffice, but only after convincing myself that it wasn’t worth it to invest a lot of time in learning (La)tex. There are always these small things that just change when working on a big file. With my current understanding, it would make perfect sense to write a document in a text editor, and then put it into some file of which I like the lay-out. Use OpenOffice as a mark-up language. And that is just frigging awesome!

I haven’t started to really research or test the opportunities, I just want to express my enthusiasm. Maybe you could shed a light on how to use openoffice as a true mark-up language?

Thanks a lot!


On ODF as a markup language

My answer:


first of all, thanks a lot for your appreciation of my work. There is no doubt that you can create OpenDocument (not openoffice!) files only using a plain text editor like notepad, emacs, Vim and so on. However, I would avoid doing so because it is very boring, time consuming and error-prone. One of the articles I have in the pipeline is how to write text in a much simpler and faster markup language liketxt2tags and then generate the OpenDocument version of the text with a script.

Another way to improve the zip/unzip part of this script…

….has been kindly suggested by Sander at lxer.com (thanks, Sander!):

_The script will lead to an ODF file with an invalid mimetype. Creating an ODF file using the zip command on the commandline is only slightly more complicated. See this article on my blog_

Useful improvement

Soren Roug just suggested an improvement through the ODF-discuss list:

It's somewhat of a brute force solution. The main issue is that the mimetype
has to be the first element in the zip-file and not be compressed in order to
comply fully with the specification

Since the my_template.odt file already complies, it is much easier to take out
only content.xml and then stuff it back in.

cp my_template.odt new_$FILENAME.odt
unzip new_$FILENAME.odt content.xml
sed ... content.xml >custom_content.xml
mv custom_content.xml content.xml
zip -f new_$FILENAME.odt content.xml

Thanks, Soren!