\documentclass{beamer}
\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{wasysym}
\usetheme{CambridgeUS}
\title{Beamer o Beamer}
\author{mishr}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
%slide 0
\begin{frame}
\frametitle{Introduction}
\begin{itemize}
\item Item A \cite{author1} %This works
\item ItemB
\end{frame}
\begin{frame}
\begin{figure}
\includegraphics[scale=0.4]{fig}
\caption{Some figure\protect \cite{Author}}%This doesn't work.
\end{figure}
\end{frame}
\begin{frame}
\frametitle{Bibliography}
\bibliographystyle{abbrvnat}
\bibliography{pres}
\end{frame}
%bib 文件名为 pres.bib
我在 Beamer 中使用上述方法。多次运行后,引用结果为 [?]。文本中的引用效果很好。有什么想法吗?
编辑:添加了 MWE。
答案1
我发现以下代码没有任何问题。我已删除\protect
.MikTeX 2.9 和beamer
3.20A。我已将命令放入\listfiles
文件中,以便软件包的版本信息打印在日志文件中。
\documentclass{beamer}
\listfiles
\usepackage[latin1]{inputenc}
\usepackage{lmodern} % Irrelevant for the problem but suppresses warnings
\usepackage{mwe} % Adds the dummy image used and loads graphicx
%\usepackage{tikz} % Not needed for the problem
%\usepackage{wasysym} % Same here
\usetheme{CambridgeUS}
\usepackage{filecontents} % For a dummy bibfile creation
\begin{filecontents*}{mybibfile.bib}
@ARTICLE{authora,
author = {A. Aaaaa},
title = {Some article},
journal = {Journal of Dummy Article Names},
year = {2012},
volume = {99},
pages = {1-5}
}
@ARTICLE{authorb,
author = {B. Baaaa},
title = {Another article},
journal = {Journal of Dummy Article Names},
year = {2012},
volume = {99},
pages = {6-10}
}
\end{filecontents*}
\title{Beamer o Beamer}
\author{mishr}
\begin{document}
\begin{frame}
\frametitle{Introduction}
\begin{itemize}
\item Item A \cite{authora} %This works
\item ItemB
\end{itemize}
\end{frame}
\begin{frame}
\begin{figure}
\includegraphics[scale=0.4]{example-image-a}
\caption{Some figure from \cite{authorb}}%This doesn't work.
\end{figure}
\end{frame}
\begin{frame}
\frametitle{Bibliography}
\bibliographystyle{abbrvnat}
\bibliography{mybibfile}
\end{frame}
\end{document}