# How to convert to odt using xparse and mk4ht oolatex

Both tex4ht and htlatex compile documents with package xparse.

But mk4ht oolatex doesn't. Running it on a document as simple as:

\documentclass{article}
\usepackage{xparse}
\begin{document}
a
\end{document}


raises these errors:

! Missing number, treated as zero.
^
l.30 \catcode\^^
A=\catcode\%


and

! Missing number, treated as zero.
^
l.479 \Gin@codes


How can I fix that?

-

The problem is an assumption in the LaTeX core graphics package. Early on, it includes the lines

\edef\Gin@codes{%
\catcode\noexpand\^^A\the\catcode\^^A\relax
\catcode\noexpand\"\the\catcode\"\relax
\catcode\noexpand\*\the\catcode\*\relax
\catcode\noexpand\!\the\catcode\!\relax
\catcode\noexpand\:\the\catcode\:\relax}
\catcode\^^A=\catcode\%


which are intended to save category codes of various items, then alter the catcode of ^^A (which is then used to set up some debug code). The problem is that the ^^A input syntax only works if ^ is a math superscript character (catcode 7). That's almost always the case, but running mk4ht oolatex sets the category code of ^ to 12 ('other').

(You see the issue with xparse as it loads expl3, and that in turn loads graphics. However, you can see the issue just loading graphics alone, so this is not an xparse issue per se.)

Some information on how tex4ht handles super- and subscripts can be found in trouble shooting section on tex4ht site. For suppression of subscripts redefinitions, you can use no^ command line option. So for your file, this should compile without errors:

mk4ht oolatex filename "xhtml, no^"


I cannot test it now, but there is command line option no^ for tex4ht which suppresses making ^ active. but I don't know if oolatex supports this option –  michal.h21 Jan 23 '13 at 19:44
Running mk4ht oolatex filename "xhtml, no^", sample file compiles without errors. –  michal.h21 Jan 23 '13 at 19:53