1

In a beamer presentation, I would like to state a theorem in such a way that the citation appears next to the 'Theorem'. It should look something like

Theorem [AB, Theorem 1]

This is a theorem.

Instead, I only manage to produce either:

Theorem ([AB])

This is a theorem.

using

\begin{theorem}[\cite{voidref}]
   This is a theorem.
\end{theorem}

But whenever I try to include the precise numbering of the theorem using

\begin{theorem}[\cite[Theorem~1]{voidref}]
   This is a theorem.
\end{theorem}

I get an error. The only thing I managed to do so far is something like

Theorem

[AB, Theorem 1]This is a theorem.

using the following.

\begin{theorem}\cite[Theorem~1]{voidref}
   This is a theorem.
\end{theorem}

A sample code is written below.

\documentclass{beamer}
\usepackage{graphicx} % Required for inserting images

\title{This is a test}

\begin{document}

\begin{frame}{Introduction}

    This is a frame. It contains a theorem.

    \begin{theorem}[\cite{voidref}]
        This is a theorem.
    \end{theorem}
    
\end{frame}

\begin{frame}
    \frametitle{References}

    \bibliographystyle{alpha}
    \bibliography{refs}

\end{frame}

\end{document}

where the refs.bib file contains the single entry

@article {voidref,
    AUTHOR = {Alpha Beta},
     TITLE = {An unknown reference},
   JOURNAL = {An unknown journal},
}

1 Answer 1

0
  • to use \cite[...]{...} inside of an optional argument, wrap it in {...} to hide the square bracket from the optional argument

  • to remove the (...) around the theorem addition, redefine the theorem begin template

  • you don't need graphicx, beamer loads it automatically


\documentclass{beamer}
%\usepackage{graphicx} % Required for inserting images

\title{This is a test}

\begin{filecontents*}[overwrite]{\jobname.bib}
@article {voidref,
    AUTHOR = {Alpha Beta},
     TITLE = {An unknown reference},
   JOURNAL = {An unknown journal},
}
\end{filecontents*}

\makeatletter
\setbeamertemplate{theorem begin}{
  \normalfont
  \begin{\inserttheoremblockenv}
  {%
    \inserttheoremname
    \ifx\inserttheoremaddition\@empty\else\ \inserttheoremaddition\fi%
  }%
}
\makeatother

\begin{document}

\begin{frame}{Introduction}

    This is a frame. It contains a theorem.

    \begin{theorem}[{\cite[Theorem~1]{voidref}}]
        This is a theorem.
    \end{theorem}
    
\end{frame}

\begin{frame}
    \frametitle{References}

    \bibliographystyle{alpha}
    \bibliography{\jobname}

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