使用 Optics Express 模板时出现 BibTeX 错误“文字堆栈为空”和“'128' 是函数文字”

使用 Optics Express 模板时出现 BibTeX 错误“文字堆栈为空”和“'128' 是函数文字”

我在使用Optics Express 模板。我收到错误消息:

--- 执行文件 osajnl.bst 的第 2689 行时,条目 Haug2004 的文字堆栈不为空

“'128' 是函数文字,而不是字符串或缺失字段,对于执行文件 osajnl.bst 的第 2689 行时输入 Miller 而言

我查过 Google/StackExchange这里这里这里这里但这些都不能真正解决我的问题。特别是,最后两个表明 osajnl.bst 文件中存在错误,这对我来说似乎不太可能,因为该模板似乎经过了充分的测试。

一个最小的工作示例如下:

    \documentclass[10pt,letterpaper]{article}
    \usepackage{opex3}
    \usepackage{color}
    \usepackage[colorlinks=true,urlcolor=blue,linkcolor=black,citecolor=black,breaklinks=true,bookmarks=false]{hyperref}
    \begin{document}

    \title{XXX}

    \begin{abstract}
    YYY
    \end{abstract}

    \bibliography{/path/to/file/bibliography.bib}
    \bibliographystyle{osajnl}

    \section{Introduction}
    This is very interesting \cite{Haug2004,Miller}.
    \end{document}

现在,Haug2004 和 Miller 的参考书目条目如下(通过导出我的 Mendeley 库生成)。

    @book{Haug2004,
    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"
    }

    @incollection{Miller,
    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}
    }

然后,使用 TeXworks 将 .tex(第一个代码块)编译为 pdflatex,一切顺利,但是当我执行 BibTeX 时,它会吐出上面的错误消息。另外,如果我查看 osajnl.bst,只有 1354 行,所以我不明白为什么它说第 2689 行有错误。

有人能给出如何解决这个问题的建议吗?谢谢!

答案1

我遇到了同样的问题,并找到了解决方案。当你使用

\bibliography{/path/to/file/bibliography.bib}
\bibliographystyle{osajnl}

创建的文件your_article.bbl包含错误,因为文件中有书籍引用bibliography.bib。我不知道为什么以及如何解决,但这里有一个解决方案:查看your_article.bbl并修复书籍引用。或者, your_article.tex 直接在文件中使用下面的内容

%\bibliographystyle{osajnl}
%\bibliography{references}
\begin{thebibliography}{10}
\newcommand{\enquote}[1]{``#1''}
\bibitem{your_reference}
...
\end{thebibliography}

希望这能有所帮助。至少对我来说是有用的。

答案2

我遇到了和你一模一样的问题。我找到了一种方法,但你可能不喜欢:删除标题条目!我们需要告诉 Optics Express 他们的错误。

相关内容