1
\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 file is named pres.bib

I am using the above in Beamer. The citation gives me [?] after multiple runs. Citation in the text works fine. Any ideas why ?

Edit: MWE added.

5
  • Please add a minimal working example (MWE) that illustrates your problem.
    – percusse
    Aug 28, 2012 at 15:53
  • Does \protect needs any package to be included ?
    – shrm
    Aug 28, 2012 at 15:53
  • That's why we need a MWE to understand the context. You can add a dummy bibliography with filecontents package as in this tex.stackexchange.com/questions/68828/referencing-book-ieee/… .
    – percusse
    Aug 28, 2012 at 15:56
  • No, \protect doesn't require any package, and some simple tests I did with your snippet worked as expected, so please add (as requested by percusse) a MWE: Aug 28, 2012 at 16:03
  • That's not a mWe. Try to compile it.
    – percusse
    Aug 28, 2012 at 16:49

1 Answer 1

1

I don't see any problems with the following code. I've removed \protect. MikTeX 2.9 and beamer 3.20A. I've put the command \listfiles in the file so that the version info of the packages printed in the log file.

\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}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .