将外部 bibtex 添加到 beamer 演示文稿

将外部 bibtex 添加到 beamer 演示文稿

我想将参考书目与幻灯片分开。但是,目前唯一可行的版本是将引文直接添加到我的主文件中。

这是我的示例代码:

\documentclass{beamer}

\mode<presentation> {


\usetheme{Madrid}

}
\usepackage{natbib}
\usepackage{bibentry}
\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, 


\title[Test]{Test } 

\author{} 
\institute[] 
{

}
\date{\today} 
\begin{document}

\begin{frame}
\titlepage % Print the title page as the first slide
\end{frame}

\begin{frame}
\frametitle{Overview} % Table of contents slide, comment this block out to remove it
\tableofcontents 
\end{frame}

%----------------------------------------------------------------------------------------
%   PRESENTATION SLIDES
%----------------------------------------------------------------------------------------

%------------------------------------------------
\section{First Section} % Sections can be created in order to organize your presentation into discrete blocks, all sections and subsections are automatically printed in the table of contents as an overview of the talk
%------------------------------------------------

\subsection{Subsection Example} % A subsection can be created just before a set of slides with a common theme to further break down your presentation into chunks


\begin{frame}[fragile] % Need to use the fragile option when verbatim is used in the slide
\frametitle{Citation}
An example of the \verb|\cite| command to cite within the presentation:\\~

This statement requires citation \cite{p1}.~\cite{test1}
\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{References}
\footnotesize{
\begin{thebibliography}{99} % Beamer does not support BibTeX so references must be inserted manually as below
\bibitem[Smith, 2012]{p1} John Smith (2012)
\newblock Title of the publication
\newblock \emph{Journal Name} 12(3), 45 -- 678.
\end{thebibliography}
}
\end{frame}

\begin{frame}[t,allowframebreaks]
\frametitle{References}
\bibliography{bibfile.bib}
\end{frame}

\end{document}

我的外部 bibtex 文件被调用bibfile.bib并且位于同一目录中。

@article{test1,
title = {Commercial Banks as Creators of 'Money'},
author = {Tobin, James},
year = {1963},
institution = {Cowles Foundation for Research in Economics, Yale University},
type = {Cowles Foundation Discussion Papers},
number = {159},
url = {http://EconPapers.repec.org/RePEc:cwl:cwldpp:159}
}

然而,最后一张幻灯片上什么也没有显示。

有什么建议我做错了吗?

感谢您的回复!

答案1

以下代码对我有用。我删除了该natbib包,因为它引起了问题。我还提供了一个书目样式。

\documentclass{beamer}

\mode<presentation> {


\usetheme{Madrid}

}
%\usepackage{natbib}
\usepackage{bibentry}
\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, 


\title[Test]{Test } 

\author{} 
\institute[] 
{

}
\date{\today} 
\begin{document}

\begin{frame}
\titlepage % Print the title page as the first slide
\end{frame}

\begin{frame}
\frametitle{Overview} % Table of contents slide, comment this block out to remove it
\tableofcontents 
\end{frame}

%----------------------------------------------------------------------------------------
%   PRESENTATION SLIDES
%----------------------------------------------------------------------------------------

%------------------------------------------------
\section{First Section} % Sections can be created in order to organize your presentation into discrete blocks, all sections and subsections are automatically printed in the table of contents as an overview of the talk
%------------------------------------------------

\subsection{Subsection Example} % A subsection can be created just before a set of slides with a common theme to further break down your presentation into chunks


\begin{frame}[fragile] % Need to use the fragile option when verbatim is used in the slide
\frametitle{Citation}
An example of the \verb|\cite| command to cite within the presentation:\\~

This statement requires citation \cite{p1}.~\cite{test1} 
\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{References}
\footnotesize{
\begin{thebibliography}{99} % Beamer does not support BibTeX so references must be nserted manually as below
\bibitem[Smith, 2012]{p1} John Smith (2012)
\newblock Title of the publication
\newblock \emph{Journal Name} 12(3), 45 -- 678.
\end{thebibliography}
}
\end{frame}

\begin{frame}[t, allowframebreaks]
\frametitle{References}
\bibliographystyle{amsalpha}
\bibliography{bibfile}
\end{frame}

\end{document}

引用正确。 在此处输入图片描述

得到的参考框架如下所示

在此处输入图片描述

相关内容