I'm having an issue compiling the bibliography for a document using the Optics Express Template. I get error messages which say:

---the literal stack isn't empty for entry Haug2004 while executing---line 2689 of file osajnl.bst


`'128' is a function literal, not a string or missing field, for entry Miller while executing---line 2689 of file osajnl.bst

I've looked on Google/StackExchange here, here, here and here but none of these really solve my problem. Particularly, the last two suggest there is a mistake in the osajnl.bst file, which seems unlikely to me as the template seems to be well tested.

A minimal working example would be as follows:





    This is very interesting \cite{Haug2004,Miller}.

Now, the bibliography entries for Haug2004 and Miller are as follows (which are generated by exporting my Mendeley library.)

    address = {Singapore},
    author = {{Haug, H. and Koch, S.}},
    doi = {10.1142/7184},
    edition = {{4th}},
    isbn = {9812386092},
    publisher = {World Scientific Publishing},
    title = {Quantum theory of the optical and electronic properties of semiconductors},
    url = {http://cds.cern.ch/record/1055549$\backslash$nhttp://www.worldscientific.com/doi/pdf/10.1142/9789814503389{\_}bmatter},
    year = "2004"

    abstract = {In this article, we will introduce quantum wells, and will concentrate on some of the physical effects that are seen in optical experiments. Quantum wells also have many interesting properties for electrical transport, though we will not discuss those here. We will briefly allude to some of the optoelectronic devices, though again we will not treat them in any detail.},
    address = {London},
    author = {Miller, David A B},
    booktitle = {Quantum Dynamics of Simple Systems},
    chapter = {9},
    editor = {Oppo, G.L. and Barnett, S.M. and Riis, E. and Wilkinson, M},
    isbn = {0750304901},
    keywords = {Excitons,Quantum Wells},
    mendeley-tags = {Excitons,Quantum Wells},
    pages = {239--266},
    publisher = {Institute of Physics},
    title = {Optical Physics of Quantum Wells},
    year = {1996}

Then, compiling the .tex (first code block) as pdflatex using TeXworks, it goes fine, but then when I do BibTeX, then it spits out the error messages above. Also, if I look at osajnl.bst, there are only 1354 lines, so I don't see why it's saying there's an error in line 2689.

Does anyone have any suggestions how to overcome this problem? Thank-you!

2 Answers 2


I have encountered the same problem and found a solution. When you use


a file created your_article.bbl that includes error when you have a book reference in the bibliography.bib file. I don't know why and how, but here is a solution: look at your_article.bbl and fix the book references. Or, instead, use below in the your_article.tex file directly


I hope this helps. At least it works for me.


I have got the same problem as you, exactly. I found a way but you may not like it: delete the title entry! We need to tell Optics Express about their bug.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .