我正在使用IEEE Conference
模板撰写论文,在将BibTeX
文件添加到 LaTeX 文件中时,一次又一次出现错误。错误如下:
bare_conf.tex 544 LaTeX 错误:出现问题——可能缺少 \item。
请参阅 LaTeX 手册或 LaTeX Companion 了解解释。输入 H 可立即获得帮助。...
l.544 \end{参考书目}
此外,我还没有引用参考书目中的任何论文。(只是在这里添加了参考书目文件)。这里是:
\begin{thebibliography}{}
\bibliography{library}
\bibliographystyle{ieeetr}
\end{thebibliography}
答案1
您没有给我们一个最小的工作示例,因此让我们尝试以下示例:
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Goossens,
author = {Goossens, Michel and Mittelbach, Frank and
Samarin, Alexander},
title = {The LaTeX Companion},
edition = {1},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
@Book{adams,
title = {The Restaurant at the End of the Universe},
author = {Douglas Adams},
series = {The Hitchhiker's Guide to the Galaxy},
publisher = {Pan Macmillan},
year = {1980},
}
@article{einstein,
author = {Albert Einstein},
title = {{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]},
journal = {Annalen der Physik},
volume = {322},
number = {10},
pages = {891--921},
year = {1905},
DOI = {http://dx.doi.org/10.1002/andp.19053221004},
}
\end{filecontents*}
\documentclass[conference]{IEEEtran}
\usepackage[hyphens]{url} % <=================== better urls in document
\usepackage{lipsum}
\title{This document}
\author{This author}
\begin{document}
\maketitle
\begin{abstract}
\lipsum[1]
\end{abstract}
\lipsum[2-6]
I have cited this document \cite{einstein} % <==========================
\nocite{*} % <============== to add not cited entrys to the bibliography
\bibliographystyle{ieeetran}
\bibliography{\jobname} % to use the bib file created with filecontents
\end{document}
包裹filecontents
用于将 bib 文件和 tex 代码合并到一个可编译mwe。你的工作不需要它。
以下部分创建参考书目:
I have cited this document \cite{einstein} % <==========================
\nocite{*} % <============== to add not cited entrys to the bibliography
\bibliographystyle{ieeetran}
\bibliography{\jobname} % to use the bib file created with filecontents
正如您所看到的,您必须引用一个或多个 bibentrys ( \cite{einstein}
) 或者您也可以使用\nocite{*}
将所有未引用的 bib 条目添加到参考书目中。
ieeetran
命名用于布局参考书目的样式。
请将我的 MWE 复制到您的计算机,例如mwe.tex
,使用链进行编译
pdflatex mwe.tex
bibtex mwe
pdflatex mwe.tex
pdflatex mwe.tex
然后你会得到以下结果: