2

I just spent a while identifying that this one reference in my bib file was preventing compilation after running bib mwe. I get the error: ! Extra }, or forgotten $.. I found that it would compile when I changed the style to certain ones but not ieee nor phys. The problem is the greek character \lambda in the title. How can I get this citation to work with these biblatex styles?

\begin{filecontents}{\jobname.bib}
@article{qiu_saltdependent_2011,
  title = {Salt-Dependent DNA-DNA Spacings in Intact Bacteriophage $\ensuremath{\lambda}$ Reflect Relative Importance of DNA Self-Repulsion and Bending Energies}, % ieee does not like math mode commands
  % title = {Salt-Dependent DNA DNA Spacings in Intact Bacteriophage lambda Reflect Relative Importance of DNA Self Repulsion and Bending Energies}, % runs fine
  author = {Qiu, Xiangyun and Rau, Donald C. and Parsegian, V. Adrian and Fang, Li Tai and Knobler, Charles M. and Gelbart, William M.},
  journal = {Phys. Rev. Lett.},
  volume = {106},
  issue = {2},
  pages = {028102},
  numpages = {4},
  year = {2011},
  month = {Jan},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevLett.106.028102},
  url = {http://link.aps.org/doi/10.1103/PhysRevLett.106.028102}
}
\end{filecontents}

\documentclass{article}

\usepackage[
%  style=phys,       % ! Extra }, or forgotten $.
  style=ieee,       % ! Extra }, or forgotten $.
%  style=chem-acs,   % this one works
%  style=science,    % this one works
%  style=nejm,       % this one works
%  style=nature,     % this one works
%  style=chem-rsc,   % this one works
%  style=chem-angew, % this one works
  backend=biber
]{biblatex}

\addbibresource{\jobname.bib}

\begin{document}

test text here \cite{qiu_saltdependent_2011}.

\printbibliography

\end{document}

I compile this using the commands:

rm *.blg *.bib *.bbl *.aux -f && pdflatex mwe.tex && biber mwe && pdflatex mwe.tex 
1
  • Below @egreg points out that the default behavior of [Zotero],(zotero.org) or possibly the BetterBibTex plugin, to use ` $\ensuremath{\lambda}$` is what leads to the problem. In Zotero, I had to change this part of the title to <pre>{$\lambda$}</pre> for the offending reference, to get it to export and then compile properly. I believe it is a Zotero problem because I went to the webpage for the citation and used the import button in my browser and it loaded in the title with $\ensuremath{\lambda}$. Oct 6, 2015 at 0:27

1 Answer 1

6

I get no error if I use {$\lambda$}; I checked with both style=phys and style=ieee.

\begin{filecontents}{\jobname.bib}
@article{qiu_saltdependent_2011,
  title = {Salt-Dependent {DNA-DNA} Spacings in Intact Bacteriophage {$\lambda$} Reflect
           Relative Importance of {DNA} Self-Repulsion and Bending Energies},
  author = {Qiu, Xiangyun and Rau, Donald C. and Parsegian, V. Adrian and Fang,
            Li Tai and Knobler, Charles M. and Gelbart, William M.},
  journal = {Phys. Rev. Lett.},
  volume = {106},
  issue = {2},
  pages = {028102},
  numpages = {4},
  year = {2011},
  month = {Jan},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevLett.106.028102},
  url = {http://link.aps.org/doi/10.1103/PhysRevLett.106.028102}
}
\end{filecontents}

\documentclass{article}

\usepackage[
  style=phys,       % ! Extra }, or forgotten $.
%  style=ieee,       % ! Extra }, or forgotten $.
%  style=chem-acs,   % this one works
%  style=science,    % this one works
%  style=nejm,       % this one works
%  style=nature,     % this one works
%  style=chem-rsc,   % this one works
%  style=chem-angew, % this one works
  backend=biber
]{biblatex}

\addbibresource{\jobname.bib}

\begin{document}

test text here \cite{qiu_saltdependent_2011}.

\printbibliography

\end{document}

Note also the braces around DNA so it is not lowercased.

The first picture is with style=phys, the second one with style=ieee.

Output with style=phys

enter image description here

Output with style=ieee

enter image description here

2
  • Any ideas why the \ensuremath part breaks it? That is throughout the bib file I auto-generate using Zotero using the BetterBibTex addon. (I will have to look into removing that or putting a sed command in my makefile to remove it.) Oct 4, 2015 at 23:49
  • @stvn66 $\ensuremath{\lambda}$ is everything but a sensible thing to do. ;-) The error has something to do with the steps for capitalization/uncapitalization. What's to be preserved in titles without any change should always be braced.
    – egreg
    Oct 5, 2015 at 6:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.