[Tex/LaTex] tex4ht gives ‘illegal storage address’ error when trying to convert to odt

htlatextex4ht

I am trying to convert a LaTeX document to opendocument with TeX4ht (on Windows/MiKTeX 2.9 32-bit). I am using the following command (as suggested on the TeX4ht website):

D:\latex>htlatex mwe.tex "xhtml,ooffice" "ooffice/! -cmozhtf" "-coo -cvalidate"

My mwe.tex reads:

\documentclass{minimal}
\begin{document}
Hello World
\end{document}

The LaTeX calls of htlatex.bat are running fine, but the tex4ht call is giving an error Illegal storage address:

D:\latex>tex4ht mwe.tex  -i/tex4ht/ht-fonts/"ooffice/! -cmozhtf" -ewin32/tex4ht.env
----------------------------
tex4ht.c (2010-12-16-08:39 Windows MiKTeX)
tex4ht mwe.tex
  -i/tex4ht/ht-fonts/ooffice/!
  -cmozhtf
  -ewin32/tex4ht.env
(C:/Program Files (x86)/MiKTeX 2.9/tex4ht/base/win32/tex4ht.env)
(C:/Program Files (x86)/MiKTeX 2.9/fonts/tfm/public/amsfonts/cmextra/cmbsy5.tfm)

(C:/Program Files (x86)/MiKTeX 2.9/tex4ht/ht-fonts/alias/cm/cmbsy.htf)
Searching `cmsy.htf' for `cmbsy5.htf'
(C:/Program Files (x86)/MiKTeX 2.9/tex4ht/ht-fonts/unicode/cm/cmsy.htf)
--- error --- Illegal storage address    

D:\latex>t4ht mwe.tex "-coo -cvalidate" -ewin32/tex4ht.env
----------------------------
t4ht.c (2010-12-16-08:47 MiKTeX)
t4ht mwe.tex
  -coo
  -cvalidate
  -ewin32/tex4ht.env
(C:/Program Files (x86)/MiKTeX 2.9/tex4ht/base/win32/tex4ht.env)
Entering mwe.lg
Entering mwe.css
Entering mwe.tmp

cmbsy.htf and cmsy.htf are at the designated locations. So what is wrong here?

I have found this workaround by Ulrike Fischer (in German), but my tex4ht.env already contains relative paths (tex4ht.env is dated 12 Jul 2011 and the workaround is from 17 Jun 2011, so I guess that problem is fixed already) and I do not have a oolatex.bat in C:\Program Files (x86)\MiKTeX 2.9\scripts\tex4ht. The htlatex.bat in the scripts folder reads:

latex %5 \makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode %2.a.b.c.\input  %1
latex %5 \makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode %2.a.b.c.\input  %1
latex %5 \makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode %2.a.b.c.\input  %1
tex4ht %1  -i/tex4ht/ht-fonts/%3 -ewin32/tex4ht.env
t4ht %1 %4 -ewin32/tex4ht.env

Best Answer

The first problem here is that the minimal is obviously not supported by tex4ht conversion to odt, there are probably some missing configurations. But minimal doc class isn't recommended for normal usage, so it should be no issue. Just use article document class.

The second problem is with your command line, it is better to use

mk4ht oolatex mwe

instead of your version

Related Question