[texhax] LaTeX bibliography woes.

Evgenie Medvedev medvedev at project7.ru
Mon Jul 9 07:35:19 CEST 2007

I'm typesetting an old thesis of mine in LaTeX, partly to ensure I
finally have a good looking pdf to show off (the old one was done in
Word) and partly to build a workflow I could later hand over to my
less-savvy brother who has to submit a work with very similar
requirements soon in a related field. And I keep stumbling into more and
more problems.

According to local thesis-writing tradition and rules:

1) The citations have to be formatted in a very particular BibTeX style.
(Someone else wrote that one already, thankfully.)
2) All citations must both be present completely as footnotes and in the
list at the end.
3) The list at the end must be subdivided into sections by type of
source cited, where 'type' does not mean BibTeX record type.

I'm also working under these constraints:

* Everything has to be in utf-8. Single-byte encodings are taboo for
multiple good reasons, we can't go back and in fact haven't been back
for years.
* I have to use XeLaTeX, for the extra fonts.

First I've had the problem of BibTeX chewing up utf-8 when attempting to
abbreviate names. I've solved this by preventing it from abbreviating
names and making sure all names in the .bib file are already abbreviated
-- though I'm looking into Pybtex, which claims to be capable of working
with utf-8 and processing original BibTeX style files.

The problem of putting the references into footnotes was solved with the
bibentry package, which is part of natbib. It didn't play nice with
hyperref, and more importantly, it didn't play nice with the particular
style I have to use, since it defines new commands at the start of the
.bbl, which bibentry bypassed somehow. I've solved this by encapsulating
them all into a package which juggles them into correct order.

But this is nowhere near the end, since I now have to subdivide the
list, and none of the packages which purport to do that can work
together with bibentry -- as far as I can make out from LaTeX code,
which I don't claim to understand, it depends on the existence of a
single \thebibliography environment which it somehow lifts the full
citation text out of. It didn't play nicely with any of them.

I've tried biblatex, which says it was meant to do all of that together
and more, but it seems to reliably choke on all the utf-8 symbols I need
to localize it for Russian, and it chokes on \CYR<whatever> commands
declared by babel too. The error message about an unexpected paragraph
break leaves me with no clue. I can't go that way unless someone
explains me what could be wrong.

I've considered writing a script to process the .bbl file after it has
been generated to split it into sections and sort it properly -- if that
even works with bibentry. Experiments in manually altering the .bbl seem
to suggest it might, but I'm not sure how to do it in such a way as to
prevent it from starting every \thebibliography section from a new page
with the big "Literature" heading, and I don't think subsections are
possible within itemized environments.

What do I do?

P.S. In case it matters, I'm running TexLive 2007 on Linux with extra
packages pulled off CTAN.

Evgenie Medvedev

More information about the texhax mailing list