Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you convert Open Office (ODT) documents to tex files? I have made a report using libre office. Now I wish to continue editing the document using lyx (latex front end). So the ODT file needs to be saved as some .tex file.

I don't see an option to do this in File menu (export/save as). So is there any other plugin to do this?

share|improve this question
up vote 8 down vote accepted

OpenOffice used to have a LaTeX export functionality, which was later removed, I guess. Nevertheless, there is a LaTeX writer:

sudo apt-get install openoffice.org-writer2latex writer2latex

Or, if your distribution uses LibreOffice, use libreoffice-writer2latex instead of the above.

Just confirm all messages with y. After installing, you can use it with w2l

w2l your-document.odt

which will create a .tex file with the same name. The formatting is pretty basic, but I think it gets the job done.

If you wish to edit it in Lyx after that, just concatenate the commands, something like that:

w2l your-document.odt && /usr/bin/env lyx your-document.tex &

I tested the conversion on Ubuntu 11.04 with the default LibreOffice installation

share|improve this answer
    
The package is now called libreoffice-writer2latex, at least in fedora. – Harpy Jan 24 '13 at 9:33
    
On Debian Squeeze, the package seems to be called writer2latex. At least, that package provides a w2l that does the job. – Michael Kjörling Feb 12 '13 at 13:49

Libreoffice has a writer2latex extension that you can load simply by double-clicking on the .oxt file or by getting the package from apt ( I assume also yum )

Link to extension: http://writer2latex.sourceforge.net/index14.html

Once you install the extension, you can use File->Export to .tex.

But:

  • I was unable to get Libreoffice 4.0x to run the extension against a complex document.

  • LO 3.4.4 ran the extension just fine, but lost almost all formatting, lost all tables and pictures.

Bottom Line:

I gave up. You'd be better off just exporting to text, and starting over. It appears to me as a complete NOOB to Lyx and Latex, that many document settings don't have an equivalent, and simply can't be translated. However I'd be delighted to be shown that I am wrong.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .