TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Some styles work correctly for Lyx's BibTeX Generated Bibliography, others give errors. For example, if I set the style to IEEEtran, then all is well. However, if I set it to apsrev, I get output like:

Runaway argument?
{{72} (\bibinfo {year}{{2012}}), ISSN \bibinfo {issn}{{0002-9505}}. \par \ETC.
! File ended while scanning use of \@firstofone.
<inserted text> 
l.397 ...Interference-Diffraction_Project_AJP_bib}

I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

Class revtex4 Warning: Endnote numbers changed: rerun LaTeX.

! LaTeX Error: \begin{thebibliography} on input line 1 ended by \end{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.

l.399 \end{document}

Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.

Any thoughts on what I should do?



Here's a minimal lyx file with the problems. Plain works but the one it's set as doesn't. I'm using the latest version of MacTex; I downloaded it yesterday.

bib file lyx file

share|improve this question
Hi Inmaurer, please always post your LyX version number and what OS you are using (and the OS version). It is often useful (it is in this case) to post a Minimum Working Example. Make a document that generates your error with as little other information as possible in it. And of course don't put personal information in it. And then post that. – scottkosty Jul 29 '12 at 23:12
Alrighty, I've linked to one. – lnmaurer Jul 30 '12 at 4:30
up vote 2 down vote accepted

Your bib.bib file is a mess. It's not your fault -- you were given those bib entries from websites (e.g. JSTOR). However, you should clean them up. Otherwise certain bibliography styles will have trouble with them. Different bibliography styles react differently because they use different fields and they use those fields in different ways. I tested your .lyx file with a .bib file that only contained a cleaned up version of your first entry:

  title = {An Account of Some Cases of the Production of Colours, not Hitherto Described},
  author = {Young, Thomas},
  journal = {Philosophical Transactions of the Royal Society of London},
  volume = {92},
  number = {},
  pages = {pp. 387-397},
  language = {English},
  year = {1802},
  publisher = {The Royal Society}

And it worked fine. So clean up your .bib and add in the new entries one by one to make sure you can figure out which entry is the one that is causing problems.

Also note in the following that the ampersands should probably be escaped (put a backslash before them):

publisher = {Taylor & Francis, Ltd.},
copyright = {Copyright © 2005 Taylor & Francis, Ltd.}
share|improve this answer
Thanks, that did it. I wish things like the url field wouldn't trip it up. – lnmaurer Aug 2 '12 at 3:04
@Inmaurer yeah I agree that it can be very sensitive. And the errors are sometimes cryptic. – scottkosty Aug 2 '12 at 3:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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