Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 

and

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?

Edit:

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
  -cooxtpipes
  -coo
  -ec:\tex4ht\texmf\tex4ht\base\win32\tex4ht.env
  -cvalidate
(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
ngs.xml
        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...

share|improve this question
    
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 '10 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). –  Wojtek Kurek Aug 15 '10 at 20:40
add comment

4 Answers

up vote 5 down vote accepted

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:

<ooxtpipes>
.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
</ooxtpipes>
share|improve this answer
    
Thx for that suggestion, I changed those path and got a Java exception, the log of that is now pasted into the original question. –  Wojtek Kurek Aug 17 '10 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. –  LianTze Lim Aug 17 '10 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... –  Wojtek Kurek Aug 17 '10 at 16:46
    
So you're able to get a .odt now? Funny about the move and copy, but whatever that works! :) –  LianTze Lim Aug 18 '10 at 1:26
    
Yes, now I can produce .odt :) –  Wojtek Kurek Aug 18 '10 at 6:36
show 1 more comment

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.

share|improve this answer
    
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... –  Wojtek Kurek Aug 16 '10 at 14:35
add comment

(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.

share|improve this answer
    
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. –  Wojtek Kurek Aug 16 '10 at 11:33
    
Ah, okay. In that case, manual conversion might not be so great. –  TH. Aug 17 '10 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 ;) –  Wojtek Kurek Aug 17 '10 at 13:20
add comment

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).

share|improve this answer
    
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 ;) –  Wojtek Kurek Aug 16 '10 at 17:43
add comment

Your Answer

 
discard

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.