錯誤:LaTeX 錯誤:出了點問題-可能缺少 \item

錯誤:LaTeX 錯誤:出了點問題-可能缺少 \item

我發現了很多關於同一問題的帖子,但沒有一個能提供幫助。您能幫我找出為什麼會出現此錯誤嗎?我正在使用:IEEEtran.bstIEEEtran.cls.這兩個檔案和主 .tex 檔案都references.bib位於一個資料夾中。當我嘗試編譯腳本時,出現以下錯誤:

test.bbl(24): Error: LaTeX Error: Something's wrong--perhaps a missing \item.

這是test.bbl

% Generated by IEEEtran.bst, version: 1.12 (2007/01/11)
\begin{thebibliography}{}
\providecommand{\url}[1]{#1}
\csname url@samestyle\endcsname
\providecommand{\newblock}{\relax}
\providecommand{\bibinfo}[2]{#2}
\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}
\providecommand{\BIBentryALTinterwordstretchfactor}{4}
\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus
\BIBentryALTinterwordstretchfactor\fontdimen3\font minus
  \fontdimen4\font\relax}
\providecommand{\BIBforeignlanguage}[2]{{%
\expandafter\ifx\csname l@#1\endcsname\relax
\typeout{** WARNING: IEEEtran.bst: No hyphenation pattern has been}%
\typeout{** loaded for the language `#1'. Using the pattern for}%
\typeout{** the default language instead.}%
\else
\language=\csname l@#1\endcsname
\fi
#2}}
\providecommand{\BIBdecl}{\relax}
\BIBdecl

\end{thebibliography}

還有我的 test.tex:

\documentclass[conference]{IEEEtran}
\begin{document}

\section{Test Citation}
\cite{logjam2015}

% ---- Bibliography ----
\bibliographystyle{IEEEtran}
\bibliography{references}

\end{document}

和參考文獻.bib

@inproceedings{logjam2015,
 author               = {Adrian, David and Bhargavan, Karthikeyan and Durumeric, Zakir and Gaudry, Pierrick and Green, Matthew and Halderman, J. Alex and Heninger, Nadia and Springall, Drew and Thom{\'e}, Emmanuel and Valenta, Luke and VanderSloot, Benjamin and Wustrow, Eric and Zanella-B{\'e}guelin, Santiago and Zimmermann, Paul},
 booktitle            = {Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security (CCS '15)},
 pages                = {5-17},
 title                = {{I}mperfect {F}orward {S}ecrecy: {H}ow {D}iffie-{H}ellman {F}ails in {P}ractice},
 url                  = {http://doi.acm.org/10.1145/2810103.2813707},
 year                 = {2015},
 }

答案1

.bbl當您的文件不包含\cite任何命令時,您已產生該文件\nocite。此錯誤源自於巨集IEEEtran.cls的錯誤重新定義\endthebibliography

標準類有類似的東西

\newenvironment{thebibliography}[1]
     {[irrelevant code omitted]}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}

這意味著

\def\endthebibliography{%
  \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
  \endlist
}

IEEEtran.cls

\let\endthebibliography\endlist

這顯然是錯誤的。

如果你修好它

\documentclass[conference]{IEEEtran}

\makeatletter
\def\endthebibliography{%
  \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
  \endlist
}
\makeatother

\begin{document}

\section{Test Citation}
\cite{logjam2015}

% ---- Bibliography ----
\bibliographystyle{IEEEtran}
\bibliography{references}

\end{document}

那麼空.bbl文件(即沒有\bibitem命令)也只會產生警告而不是錯誤。

答案2

如果即使您已經\cite{something}在論文中添加了錯誤,但仍然出現錯誤,則必須清除輔助文件。

詳細來說,刪除所有以以下結尾的文件.log .aux .bbl .blg。然後再次編譯該文檔,瞧。

答案3

我有完全相同的錯誤訊息,但.bbl文件為空。如果你跟我一樣使用 MiKTeX,你可以試著將\bibliographystyle{IEEEtran}with\bibliographystyle{ieeetran}全部改為小寫。然後運行 BibTeX。最後產生運行您習慣的文檔。它解決了我的問題。

我找到了這個解決方案閱讀https://ctan.org/pkg/ieeetran,他們提供了最新版本的 IEEEtran BibTeX 樣式(順便說一句,我不需要下載),並指定它作為 IEEEtran 包含在 TeX Live 中,並且包含在MiKTeX 作為 ieeetran

答案4

就我而言,這是在 BibTex BBL 檔案的上下文中,經檢查該檔案是空的。

顯然,Overleaf 將 .bib 檔案的名稱報告為Mendeley.biband I include \bibliography{Mendeley},但該檔案卻默默地沒有找到。

解決方案:我將 .bib 檔案重命名為全部小寫,並更新了\bibliography條目以匹配,一切都按預期工作。

相關內容