[Tex/LaTex] “File ended while scanning use of \@firstofone”

errors

After making many changes to a large file, I get errors in the last two lines, which I did not change. The lines are:

\bibliography{../erelsegal-halevi}
\end{document}

And the errors are:

File ended while scanning use of \@firstofone.

\begin{thebibliography} on input line 1 ended by \end{document}. 

There are no other errors. Probably, the errors are caused by some mistake earlier in the document. How can I find it? I can try "binary search": delete parts of the document until the error disappears. Is there a better way?

Best Answer

Based on egreg's comment, instead of doing a binary search on the entire document, I focused on the citations. Finally I narrowed the problem down to a single entry in the bbl file:

\begin{thebibliography}{1}
\providecommand{\natexlab}[1]{#1}
\providecommand{\url}[1]{\texttt{#1}}
\providecommand{\urlprefix}{URL }
\expandafter\ifx\csname urlstyle\endcsname\relax
  \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else
  \providecommand{\doi}[1]{doi:\discretionary{}{}{}\begingroup
  \urlstyle{rm}\url{#1}\endgroup}\fi
\providecommand{\bibinfo}[2]{#2}

\bibitem[{Debreu(1960)}]{Debreu1960Topological}
\bibinfo{author}{G.~Debreu}, \bibinfo{title}{{Topological methods in cardinal
  utility theory}}, chap.~\bibinfo{chapter}{9}, \bibinfo{publisher}{Stanford
  University Press}, \bibinfo{address}{\}, ISBN \bibinfo{isbn}{9781139052092},
  \bibinfo{pages}{16--26}, \doi{\bibinfo{doi}{10.1017/ccol052123736x.010}},
  \urlprefix\url{http://dido.wss.yale.edu/P/cp/p01b/p0156.pdf},
  \bibinfo{year}{1960}.

\end{thebibliography}

The corresponding bibtex entry is:

@inbook{Debreu1960Topological,
    address = {\},
    author = {Debreu, Gerard},
    booktitle = {Mathematical Methods in Social Sciences},
    chapter = {9},
    citeulike-article-id = {13704178},
    citeulike-linkout-0 = {http://dido.wss.yale.edu/P/cp/p01b/p0156.pdf},
    citeulike-linkout-1 = {http://dx.doi.org/10.1017/ccol052123736x.010},
    doi = {10.1017/ccol052123736x.010},
    isbn = {9781139052092},
    keywords = {utility-theory},
    pages = {16--26},
    posted-at = {2015-08-17 07:40:14},
    priority = {2},
    publisher = {Stanford University Press},
    title = {{Topological methods in cardinal utility theory}},
    url = {http://dido.wss.yale.edu/P/cp/p01b/p0156.pdf},
    year = {1960}
}

The problem was solved after deleting the first line "address = {},".

Related Question