# [texhax] biblatex and tex4ht

Thu Aug 20 13:12:03 CEST 2009

On 20-Aug-09, at 6:21 AM, Christoph Haug wrote:

> 2009/8/17 Radhakrishnan CV <cvr at river-valley.org>:

[...]

>> take a look
>> at:
>>
>>  http://tug.org/~cvr/christoph.zip
>>
>> which has test.tex, test.html and test.odt. Seems like oolatex
>> behaves as
>> expected.
>
> thanks for testing this. so here is what I get when using your
> test.tex together with the mybib.bib:
>
> 1. trying to run latex on it gives me an error on \ConfigureEnv
> (undefined control sequence)

Sorry, that was my mistake, please forget it.

> 2. oolatex accepts the command but it only renders the citations in
> the first section, not the one in the subsection.

Wors fine here. Please take a look at the contents of the archive at:

http://tug.org/~cvr/test.zip

> 3. I have no Idea where the second and third reference in your
> odt-file are from. I don't have these.

Just copied the first item twice in mybib.bib and slightly changed the
keys. That was to test footnote numbering.

> 4. on the "positive" side, you are right that the stub-environment is
> rendered properly. I have no idea, how it can be working for me on one
> document but not in the other (I doublechecked!). Maybe something else
> in the preamble of my other document? If you want, I can send it to
> you.

OK, please do off the list.

> 5. also your starred subsection works. the problem is that I was
> referring to a starred sub*sub*section, so if you substitute
> \subesection* with \subsubsection* you should get the error, At least
> I am still getting it.

That is true. Eitan provided 'ooffice' option as a proof of concept
that even word processor formats can be generated from TeX sources
with the help of TeX4ht. It is not perfect, though. If you want to
make high fidelity output, you need to extend ooffice.4ht which is the
package loaded in the background when you call 'oolatex'. You need to
add extra hooks in a private configuration, which is the recommended
way to do, where you can define new environments or modify existing
ones to suit your requirements. I have done an example for you to fix
the problem of \subsubsection* in a file namely, chris.cfg which is
also included in the test.zip and listed below:

------------ begin private configuration ------------
\Preamble{ooffice}

\begin{document}
\catcode:=11
\catcode@=11

\Configure{likesubsubsection}
{\IgnorePar\EndP \HCode{<!--start of subsubsection-->}}
{\IgnorePar\EndP \HCode{<!--end of subsubsection-->}}
{\HCode{<text:h
\text:outlinelevel="4"   ><text:span
text:style-name="subsubsection"  >}%
\HCode{</text:span>}\IgnoreIndent}
{\HCode{</text:h>\Hnewline}\par\ShowPar}
\catcode:=12
\catcode@=12

\EndPreamble
--------------- end private configuration ------------

You might invoke oolatex in the following fashion:

oolatex test "chris"

and see the output. It should be OK.

> What next?
>
> BTW, I took a chance today in using oolatex on my thesis, which is
> quie a bit more complicated than the other documents. The result was
> sobering. I gut so many errors (mainly "undefined control sequence"

This is quite imaginable. You have to create a custom package
configuring all the environments, commands which were disliked by
TeX4ht.

> that I couldn't even count them. It ended where I had included a
> pdf-graphic, which of course doesn't work with latex and hence with
> oolatex. I haven't retried it without that figure, but if you are
> you at least a selection. But I suppose, you can take any bigger book
> project and oolatex will not work...

Those problems can be fixed without much difficulties. However,
pressures at work don't allow me to spend more time on your project.
Someone with more deeper knowledge of Open Office XML format will be
the best candidate to perfect ooffice.4ht.

Best regards
--