Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I wish to convert a .tex file into an .odt file.
Can you suggest a good step-by-step solution?

share|improve this question
@Naruto: I assume it's a LaTeX document. – Nathan Osman Nov 25 '11 at 20:33
Note that for all answers below: your success rate will depend on the latex packages used, and math will never be typeset as nicely as in latex. – David LeBauer Nov 26 '11 at 3:03
up vote 19 down vote accepted

Believe it or not, with complex documents and lots of packages included, I got much better results with LaTeX2HTML than with LaTeX2RTF, Pandoc or TeX4ht.

latex2html texfile.tex -split 0 -no_navigation -info "" -address "" -html_version 4.0,unicode

This will generate a folder with the same texfile name, so you'll be able to convert the generated HTML to ODT:

libreoffice --headless --convert-to odt:"OpenDocument Text Flat XML" texfile/index.html

This will produce a index.odt file. Take a look at this answer to check how to use LibreOffice's convert filters.

share|improve this answer
For complex documents with lots of additional packages, files and commands LaTeX2HTML fails. I'm trying to convert my thesis to HTML and than to ODT in order to give it to someone for comments and correction, who is not familiar with LaTeX. Even without custom commands this tool fails. Tikz package for some reason is one of the main culprits. – rbaleksandar Jul 18 '14 at 8:10
There's no ideal solution @rbaleksandar, specially depending of the packages you're using. I would suggest Pandoc for you. It won't keep all formats, but it is capable of ignoring some structures and build a final document, at least. – vmassuchetto Jul 18 '14 at 11:28
Doesn't work with pagebreaks. – Hi-Angel Jul 26 '15 at 17:40
Documents are never perfect with the presented solutions in this question. It is very disappointing that the only way I found to generate a perfect document is using the PDF output from LaTeX with Adobe Acrobat Pro. – vmassuchetto Aug 6 '15 at 22:50

There is a tool in the repositories that changes LaTeX to's XML format: tex4ht Install tex4ht

TeX4ht is a highly configurable TeX-based authoring system for producing hypertext. It interacts with TeX-based applications through style files and postprocessors, leaving the processing of the source files to the native TeX compiler. Consequently, TeX4ht can handle the features of TeX-based systems in general, and of LaTeX in particular.

TeX4ht can be used both for authoring HTML using TeX/LaTeX input files, or for converting existing TeX input files (in any format) into HTML, with (usually) only minor modifications. Other varieties of hypertext can also be produced, including XML, XHTML, MathML and the format of XML.

Command line...

  1. latex filename.tex
  2. bibtex filename.aux
  3. mk4ht oolatex filename.tex

Should end up with an compatible file.

share|improve this answer
Thank you. BTW, it appears the main maintainer of the package has sadly died two years ago. – Tal Galili Nov 25 '11 at 19:27
damn that's a pity :( – Rinzwind Nov 25 '11 at 19:47
I agree - I wish a more active community would have taken upon itself to continue this work... – Tal Galili Nov 27 '11 at 2:57
+1 for command line example. I did not have time to read the documentation, but the example above is quite easy to follow. – antmw1361 Jun 5 '13 at 13:39
Doesn't work with pagebreaks. – Hi-Angel Jul 26 '15 at 10:05

Another solution is provided from the package pandoc Install pandoc

As an example, you can do:

pandoc -f latex -t odt -o output.odt input.tex

If the input file is latin1 encoded, like my tex files, the solution is:

iconv -f ISO-8859-1 input.tex | pandoc -f latex -t odt -o output.odt

I report part of the description of the package:

Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses this library. It can read

  • markdown and
  • subsets of
    • reStructuredText,
    • HTML, and
    • LaTeX

and it can write

  • plain text,
  • markdown,
  • reStructuredText,
  • HTML, -LaTeX, -ConTeXt,
  • RTF,
  • DocBook XML,
  • OpenDocument XML,
  • ODT,
  • GNU Texinfo,
  • MediaWiki markup,
  • EPUB,
  • Textile,
  • groff man pages,
  • Emacs Org-mode, and
  • Slidy or
  • S5 HTML slide shows.
share|improve this answer
At least version doesn't work with pagebreaks. – Hi-Angel Jul 26 '15 at 9:57

It can be done in 2-steps. Go to and use the tools provided to convert first from Latex to RTF and then from RTF to ODT.

Hope it helps.

share|improve this answer
Doesn't work at all 😂 With the minimal example it was hanging for a minute with 100% CPU usage. I don't think it would ever end the work, so I interrupted it. – Hi-Angel Jul 26 '15 at 10:15
Okay, I managed it to work — perhaps it doesn't work well with macros — and found that it also doesn't e.g. work with a table of contents. So no, not an option. – Hi-Angel Jul 26 '15 at 17:29

If you've the tex4ht Install tex4ht package installed, the command oolatex filename converts the .tex into .odt (for more on tex4ht, see here).

Another way would be the latex2rtf Install latex2rtf package, using RTF als intermediate format.

share|improve this answer
oh - sorry, haven't seen the other replies... – tohuwawohu Nov 25 '11 at 16:57
Not a problem since you added a link to latex2rtf and that was not in any of the other 2 answers ;) – Rinzwind Nov 25 '11 at 16:59

Sorry might be late for this one and I am new to askubuntu.

Abiword seems to open latex documents. I use gnumeric to generate my tables in latex.

Hope it helps.

share|improve this answer
Abiword opens latex like an usual text file. I.e. if I choose «save as .doc», it saves everything like a plain text — comments, macros, etc. – Hi-Angel Jul 26 '15 at 13:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.