I need to convert a LaTeX document to OpenOffice -> Word in order to allow cooperation with non-LaTeX users.

I've tried two commands:

oolatex foo.tex 


mk4ht oolatex foo.tex

In both cases tex4ht failed to produce the ODT or SWX file, but a number of temp files were produced (foo.4ct, 4od, 4oo, 4tc, foo-manifes.4of, foo-meta.4ot, foo-setting.4os, foo-styles.4oy). From my study of .env file of TeX4ht it became obvious that those files should have been later converted into the OO file.

Has anyone else encoutered that problem and found a solution?


After using Lian Tze's suggestion I changed all the path in tex4ht.env file, but still no go, the error I received now is somehow connected to java which is completely outside my league.

C:\Users\Wojtek\Documents\My Dropbox\INSiK\Raporty\Artykuł problemowy>t4ht docum
ent  -cooxtpipes -coo -ec:\tex4ht\texmf\tex4ht\base\win32\tex4ht.env -cvalidate

t4ht.c (2009-01-31-07:34 kpathsea)
t4ht document
(C:/Program Files (x86)/MiKTeX 2.8/tex4ht/base/win32/tex4ht.env)
Entering document.lg
System call: move document.4oo document.tmp
        1 file(s) moved.
System return: 0
System call: java -classpath  c:\Program Files (x86)\MiKTeX 2.8\tex4ht\bin\tex4h
t.jar xtpipes -i c:\Program Files (x86)\MiKTeX 2.8\tex4ht\xtpipes\ -o document.4
oo document.tmp
Exception in thread "main" java.lang.NoClassDefFoundError: Files
Caused by: java.lang.ClassNotFoundException: Files
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Files.  Program will exit.
--- Warning --- System return: 1
System call: mkdir sxw-document.dir\Pictures
System return: 0
System call: move  document-settings.4os                  sxw-document.dir\setti
        1 file(s) moved.
System return: 0
System call: move  document-styles.4oy    sxw-document.dir\styles.xml
        1 file(s) moved.
System return: 0
System call: mkdir sxw-document.dir\META-INF
System return: 0
System call: move  document-manifest.4of sxw-document.dir\META-INF\manifest.xml
        1 file(s) moved.
System return: 0
System call: move  document-meta.4ot    sxw-document.dir\meta.xml
        1 file(s) moved.
System return: 0
System call: cd    sxw-document.dir & zip -r -m  document.zip * & cd ..
  adding: META-INF/ (164 bytes security) (stored 0%)
  adding: META-INF/manifest.xml (164 bytes security) (deflated 66%)
  adding: meta.xml (164 bytes security) (deflated 58%)
  adding: Pictures/ (164 bytes security) (stored 0%)
  adding: settings.xml (164 bytes security) (deflated 46%)
  adding: styles.xml (164 bytes security) (deflated 91%)
System return: 0
System call: move sxw-document.dir\document.zip document.odt
        1 file(s) moved.
System return: 0
System call: del document.4od
System return: 0
System call: if exist sxw-document.dir rmdir /Q /S sxw-document.dir
System return: 0

C:\Users\Wojtek\Documents\My Dropbox\INSiK\Raporty\Artykuł problemowy>

Here is the log of the last converting operation...

  • We are going to need more details here, I think. Which TeX system are you using, and can we see an example document>
    – Joseph Wright
    Aug 15, 2010 at 20:26
  • I've tested it on both TexLive2009 and Miktex 2.8, the document was plain article class with two sections and few subsection containing plain text. The key might be Windows 7 (64bit). Aug 15, 2010 at 20:40

5 Answers 5


Not sure if your problem is the same as mine, but I got oolatex etc to work under Windows XP by editing <texmf>\tex4ht\base\win32\tex4ht.env. I updated all occurrences of

c:\tex4ht\texmf and c:/tex4ht/texmf

to the actual TEXMF path on my system, so that all the paths resolve.

Update: Note that java doesn't like space characters in file paths, so you'll need to use those old-style 8.3 filenames if a directory name contains spaces. For the purpose of oolatex, search for the <ooxtpipes> section and edit the java calls accordingly:

.4oo move %%0.4oo %%0.tmp
.4oo java -classpath  c:/Progra~1/MiKTeX~1/tex4ht/bin/tex4ht.jar xtpipes -i c:\Progra~1\MiKTeX~1\tex4ht\xtpipes\ -o %%0.4oo %%0.tmp
.4om move %%1.4om %%1.tmp
.4om java -classpath  c:/Progra~1/MiKTeX~1/tex4ht/bin/tex4ht.jar xtpipes -i c:\Progra~1\MiKTeX~1\tex4ht\xtpipes\ -o %%1.4om %%1.tmp
  • Thx for that suggestion, I changed those path and got a Java exception, the log of that is now pasted into the original question. Aug 17, 2010 at 13:05
  • @Wojtek, I think java has a problem with the space characters in your TEXMF path. I've updated my answer to indicate the use of 8.3 style file/path names in such cases.
    – imnothere
    Aug 17, 2010 at 14:53
  • I took the paths into "" and change move to copy and it solved the problem... dont know why by with move it failed to produce do 4oo and 4om files... Aug 17, 2010 at 16:46
  • So you're able to get a .odt now? Funny about the move and copy, but whatever that works! :)
    – imnothere
    Aug 18, 2010 at 1:26
  • Yes, now I can produce .odt :) Aug 18, 2010 at 6:36

I have the same problem. For documents that aren't too complex, I often render the LaTeX as a PDF, and then use one of the PDF-to-Word coverters to make a Word document. For many jobs that works quite well, although if you have mathematical formulas, tables, or other complicated formatting, you will probably need to do some editing of the target document.

  • But those OCR based converters often result in serious mistakes in your document. Thats why I want to have tex4ht operational :) However I'll probably have to convice my University to buy me GrindEQ (grindeq.com) software... Aug 16, 2010 at 14:35

mk4ht oolatex foo.tex can be problematic. An alternative, make4ht -f odt test.tex, may resolve a number of issues, including those associated with xtpipes.


(The reputation system prevents me from commenting so an answer is the best I can do, sorry.)

With such a small amount of text, a manual conversion (copying and pasting the text, possibly removing extraneous newlines) is probably the fastest way to go.

  • Th., such a small amount of text is only for testing purposes I did it in order to avoid additional problems. I need this to work in order to allow cooperation on larger scientific documents, which I can convert to HTML and open in word/writer, however I want them directly conveted to OO in order to make the process as easy as possible. Aug 16, 2010 at 11:33
  • Ah, okay. In that case, manual conversion might not be so great.
    – TH.
    Aug 17, 2010 at 7:45
  • Now I'm a bit closer to the goal but receive a Java error while converting... but hope to cope with that soon, when you know what the error is its easyier to solve the problem ;) Aug 17, 2010 at 13:20

I have never before used tex4ht, however, what I have done in the past is use latex2html and then import the .html into OpenOffice/Word. The only problem with this approach is that large equations will be rendered as images (and will therefore not be editable).

  • u can do the same with tex4ht, producing HTML work perfectly ok for me there, but I'm a stubborn person and want the conversion to OpenOffice to work ;) Aug 16, 2010 at 17:43

You must log in to answer this question.

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