[Tex/LaTex] How export LaTeX to OpenDocument format with Biblatex references

biberbiblatextex4ht

I am trying to export a LaTeX document to OpenDocument (.odt) format. This operation is requested by some publishers which do not know how to handle LaTeX files.

I can't find a way of exporting LaTeX documents with Biblatex references in a proper way.

Here is a example. I use TeX4ht to convert .tex files to .odt

\begin{filecontents}{biblio.bib}
@Book{author00:_title,
 author =    {Author},
 title =     {Title},
 publisher =     {Publisher},
 year =      2000}
\end{filecontents}

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=authoryear-comp,hyperref]{biblatex}
\renewcommand*{\newunitpunct}{\addcomma\space}
\bibliography{biblio}
\title{Test}
\author{Title}
\begin{document}

Test\cite{author00:_title}

\printbibliography
\end{document}

TeX4ht command lign to export to .odt is :

mk4ht oolatex test.tex 

This command works but create a OpenDocument file without references. References are replaced by their keys (in our example : author00:_title).

The output of mk4ht oolatex says about biblatex :

No file test.bbl.

LaTeX Warning: Citation 'author00:_title' on page 1 undefined on input line 11.

LaTeX Warning: Empty bibliography on input line 13.

[1] (./test.aux)

LaTeX Warning: There were undefined references.


Package biblatex Warning: Please (re)run Biber on the file:
(biblatex)                test
(biblatex)                and rerun LaTeX afterwards.

 )

So I re-run Biber which found the reference :

biber test
defined(@array) is deprecated at /usr/share/perl5/Log/Log4perl/Config.pm line 864.
        (Maybe you should just omit the defined()?)
INFO - This is Biber 1.7
INFO - Logfile is 'test.blg'
INFO - Reading 'test.bcf'
INFO - Found 1 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'biblio.bib' for section 0
INFO - Decoding LaTeX character macros into UTF-8
INFO - Found BibTeX data source 'biblio.bib'
INFO - Overriding locale 'fr_FR.UTF-8' default tailoring 'variable = shifted' with 'variable = non-ignorable'
INFO - Sorting 'entry' list 'nyt' keys
INFO - Writing 'test.bbl' with encoding 'UTF-8'
INFO - Output to test.bbl

And I re-run TeX4ht (mk4ht oolatex test.tex) which ends unexpectedly :

(/usr/share/texmf/tex/generic/tex4ht/ooffice-mml.4ht)) (./test.aux) (./test.bbl
)
! Undefined control sequence.
\blx@begunit ...penalty \@M \hskip -\blx@unitmark 
                                                  \relax \hskip \blx@unitmar...
l.11 Test\cite{author00:_title}

? 

How can I fix this error and export my biblatex references into odt format?

Best Answer

I found a solution to my problem (which was export to odt with biblatex references) with pandoc :

pandoc test.tex -o output.odt --bibliography /my/bibliography.bib -s

Hope It could help another one.

P-S : Tex4ht was definitively not rendering biblatex for me even after upgrade.