BibTeX export: bug with certain page numbers

I've noticed a bug with the way that BibTeX exports page numbers in certain rare cases, i.e. when the page "number" includes one or more capital letters. An example is the following reference:

B. D. Terris and T. Thomson, “Nanofabricated and self-assembled magnetic structures as data storage media,” J. Phys. D: Appl. Phys 38 (2005): R199-R222.

This comes out in BibTeX as the following:

title = {Nanofabricated and self-assembled magnetic structures as data storage media},
volume = {38},
journal = {J. Phys. D: Appl. Phys},
author = {B. D. Terris and T. Thomson},
year = {2005},
keywords = {data storage,have hardcopy,patterned media,review article},
pages = {{R199--R222}}

The problem occurs when BibTeX tries to parse the page number. For some reason, I think the double braces fool it. Here is a sample error output when I try to cite this reference:

Runaway argument?
{{R199} (\bibinfo {year}{2005}). \par \bibitem [{\citenamefont {Kerch\ETC.
! File ended while scanning use of \bibinfo.

l.173 \bibliography{refs}

As long as the inner braces *only* surround the capital letters, BibTeX compiles just fine. Hence, instead of:

pages = {{R199--R222}}
the output should be:

pages = {{R}199--{R}222}
(By the way, for those unfamiliar with LaTeX/BibTeX, the purpose of putting those extra braces around the capital letters is to retain their case. Since this is indeed the desired behaviour, removing the braces is not a good option.)

Just wanted to help make people aware of a relatively obscure, presumably easily fixed bug.

Sign In or Register to comment.