# biblatex & TeX4HT: citations in footnotes = missing \begin{document}

the following code, which I'm trying to run through TeX4HT and biber in order to create an .odt file, results in a »missing \begin{document}« error, pointing to the aux file. Something about the citation in the footnote seems to cause trouble. No trouble occurs when

• I'm creating a pdf using ordinary pdflatex or lualatex, or
• [which is the most interesting part] a biblatex style other than ›authoryear‹, like ›numeric‹, or
• I remove the citation from the footnote

Unfortunately, I can't do without any of these three in this case, so I'd appreciate any thoughts on this issue. Thanks a lot! It might have to do with the biblatex adaption of tex4ht, so maybe what'S required here is a manual definition of a missing command, similar to what Ulrike replied to a different but related question.

PS: same problem occurs with \footcite{BoS99}; it also occurs when creating an .html rather than an .odt (option xhlatex).

PPS: I'm using
mk4ht oolatex [filename]
biber [filename]
mk4ht oolatex [filename]

\begin{filecontents}{testbib.bib}
@BOOK{BoS99,
author = {Bowker, Geoffrey and Star, Susan Leigh},
year = {1999},
title = {Sorting Things Out: Classification and its Consequences},
publisher = {MIT Press}
}
\end{filecontents}

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber,style=authoryear]{biblatex}
\bibliography{testbib.bib}
\begin{document}
hat einer und gemacht zu werden%
\footnote{um von Buch wollen \cite{BoS99}}
\end{document}


error message:

! LaTeX Error: Missing \begin{document} in '.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...

l.3 \abx@aux@fnpage{1}{1}


contents of the aux file:

\relax
\abx@aux@fnpage{1}{1}

-
With a (mostly, i think) up to date set of packages, I have no problems with your test file. (But run mk4ht after you have done the normal latex, biber, latex run.) Relevant files: biblatex.sty 2011/11/13 v1.7, biber version: 0.9.9, and the tex4ht release from CTAN. You can use the \listfiles command in your preamble to check which versions you are using. –  jon Jul 10 '12 at 20:13
I keep my TeXLive up-to-date on a weekly basis, and wouldn't even think about posting a question without an additional check for updates :) biblatex.sty 2011/11/13 v1.7| biber version: 0.9.9| tex4ht.sty 2008-10-27-17:23| t4ht.c (2010-12-16-08:47 kpathsea) I tried the workaround you suggested, latex biber latex mk4ht instead of mk4ht biber mk4ht. The problem persists, the only difference is that there's no error message in the first of the three runs invoked by the last mk4ht -- probably because that first run finds a correct aux file produced by the preceding latex run. –  Nils L Jul 11 '12 at 18:37
Well that is strange because I ran your file just fine with the same set of files (although AFAIK I do not have a t4ht.c file on my system..?). Hopefully someone else can replicate and solve your problem. –  jon Jul 12 '12 at 0:49
t4ht.c (2010-12-16-08:47 kpathsea) is simply what shows up when I run tex4ht without any options or wrappers... –  Nils L Jul 12 '12 at 7:59
Hmm, I get tex4ht.c (2009-01-31-07:33 kpathsea), but not t4ht.c. That might be worth investigating further. –  jon Jul 12 '12 at 17:26

Okay, some further research turned up a few interesting things about tex4ht and its relationship with biblatex, plus a provisional fix for my problem. In a nutshell: the author of tex4ht passed away in 2009, and even though Karl Berry et al. took over maintenance, it is not yet fully compatible with the biblatex versions released since then. But they're working on it, and TeXLive 2012 already contains a more up-to-date version of biblatex.4ht (the file that's in charge of the interaction between the two). However, even that version doesn't contain what's necessary for my example to work. I found what I need, though, in an unofficial, anonymous version of biblatex.4ht mentioned here.

So what follows is basically a personal bugfix for my specific problem -- until tex4ht has regained full compatibility with biblatex. I think I should submit the issue to tex4ht's bug database, as it doesn't seem to be in there yet.

\begin{filecontents}{testbib.bib}
@BOOK{BoS99,
author = {Bowker, Geoffrey and Star, Susan Leigh},
year = {1999},
title = {Sorting Things Out: Classification and its Consequences},
publisher = {MIT Press}
}
\end{filecontents}

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber,style=authoryear]{biblatex}
\bibliography{testbib.bib}
\makeatletter                    %[!]
\let\abx@aux@fnpage\@gobbletwo   %[!]
\makeatother                     %[!]
\begin{document}
hat einer und gemacht zu werden%
\footnote{um von Buch wollen \cite{BoS99}}
\end{document}
`
-