LaTeX to OpenOffice

I thought I read that converting Latex documents into Open Office documents was possible, but I had trouble figuring it out today.  The bottom line was that I was using the wrong program to do so, and I didn’t have dvipng installed.

Where is oolatex?

When I typed oolatex on the command-line, the system couldn’t find the program.  It turns out that oolatex just isn’t on the path.  It is installed with the tex4ht system.  When installed, it is located at:

/usr/share/tex4ht/oolatex

You can install it with:

apt-get install tex4ht

To compile a document you could use:

/usr/share/tex4ht/oolatex MyDoc.tex

Using htlatex

The command-line for htlatex is a little more complex, but it works.  You can use htlatex to convert a document like this:

htlatex MyDoc.tex 'xhtml,ooffice' 'ooffice/! -cmozhtf' '-coo' '-cvalidate'

Using mk4ht

Mk4ht is  much simpler.  You can use mk4ht like this:

mk4ht oolatex MyDoc.tex

Images

I noticed this in the output:

sh: dvipng: not found

To fix it, I installed dvipng with:

sudo apt-get install dvipng

Then, the images worked fine.

Resources

2 thoughts on “LaTeX to OpenOffice

Leave a Reply to Joshua R Smith Cancel reply

Your email address will not be published. Required fields are marked *