bibliography@authorIndex

LaTeX and all its little helpers are your friends … most of the time. However, every once in a while they decide to do some nasty stuff and annoy you.

The Quest for the Lost @

Imagine you’re preparing a citation in BibTeX where the author is an institution called author = {iSleep@Work} (@s seem to be very trendy in names nowadays). Using natbib and the *.bib-file in your document, you run latex/bibtex and everything works.

Later you decide to include an index of authors in your appendix, add all the code to your document (\usepackage{makeidx}\citeindextrue\makeindex in the preamble and \printindex in the appendix), but suddenly latex yells that there’s something wrong …
Looking at the document, you will see that all citations in the body are correct and also the references-section has not changed. The problem lies in the author index section, where the entry for your citation now reads Work – something happened to the iSleep@.

BibTeX vs. MakeIndex

Contrary to BibTeX, MakeIndex uses the @ internally. An index reference called sortByThis@displayThis will only read ‘displayThis’, but will be sorted by sortByThis – so we see that the @ and everything before is skipped. That’s what happened to the iSleep@! The MakeIndex manual suggests that the @ will be displayed if we insert a double quote before it, yet this also shows up in all the BibTeX entries, so it’s not an option.

How to fix it …

The solution is embarrassingly simple: just replace the @ (at least in your author tags that will be used by makeindex) with \char"0040{} in your *.bib-file and everything should work (the example above now is author = {iSleep\char"0040{}Work}).
Explanation: we can avoid the @ sign by inserting it as a unicode character by number, so makeindex does not interpret it as the `sorting’ command and prints the field properly.

Tags: , ,

Friday, June 4th, 2010 LaTeX

Leave a Reply

Warning: Undefined variable $user_ID in /home/.sites/135/site907/web/sub_blog/wp-content/themes/decoder/comments.php on line 72

*