Bibtex 错误“环境 thebibliography 未定义”

Bibtex 错误“环境 thebibliography 未定义”

我正在尝试使用最简单的代码来尝试 bibtex,但尽管遵循了教程/搜索,我还是搞不懂。我正在使用 texmaker,对此我还很陌生。

我收到以下消息:

! LaTeX Error: Environment thebibliography undefined.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \begin{thebibliography}
! LaTeX Error: \begin{document} ended by \end{thebibliography}.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \end{thebibliography}
Citation `DUMMY:1' on page 1 undefined
There were undefined references.

这是我的文档expose.tex::

\bibliography{lesson7a1} 
\bibliographystyle{alpha}
\documentclass{article}
\usepackage{cite}   
\begin{document}

\section{Text goes here} 

This feature works as I described in \cite{DUMMY:1}

\end{document}

\printbibliography

在同一个文件夹中,我有一个名为的文件lesson7a1.bib,如下所示:

@BOOK{DUMMY:1,
AUTHOR="John Doe",
TITLE="The Book without Title",
PUBLISHER="Dummy Publisher",
YEAR="2100",
}

答案1

@Tom。您需要剪切 bibliography 的内容并将其粘贴到 \end{document} 环境之前。此外,从序言中删除 \printbibliography。这可以按如下方式完成。

\documentclass{article}
\usepackage{cite}   
\begin{document}

\section{Text goes here}. 

This feature works as I described in \cite{DUMMY:1}
\bibliographystyle{alpha}
\bibliography{lesson7a1} 

\end{document}

相关内容