3

If I use the caption package with beamer frames, I get a 'missing number treated as zero'.

The following compiles with texlive, but if I uncomment the \usepackage{caption} line, I get the error.

\documentclass[10pt]{beamer}

\usetheme{metropolis}
\usepackage{appendixnumberbeamer}

% \usepackage{caption}

\title{Error}
\author{Author}
\institute{Stack Overflow}

\begin{document}

\maketitle

\begin{frame} \frametitle{Introduction}
\begin{columns}
    \begin{column}{0.5\textwidth}
        \begin{figure}
            \includegraphics[width=.9\linewidth]{example-image-duck}
            \caption{Duck\footnote[frame]{Duck Duck}}
        \end{figure}
    \end{column}
    \begin{column}{0.5\textwidth}
        \begin{figure}
            \includegraphics[width=.9\linewidth]{example-image-duck}
            \caption{Duck\footnote[frame]{Duck Duck}}
        \end{figure}
    \end{column}
\end{columns}
\end{frame}

\end{document}
8
  • 1
    Hello and welcome. The error is from the [frame] option added to the macro \footnote[frame]{}. Removing this option will make it work : \caption{Duck\footnote{Duck Duck}}. Where did you get this [frame] option?
    – AndréC
    Commented Jul 19, 2020 at 5:52
  • I think in general beamer is incompatible with caption. beamer already provides caption-related templates to control style of \caption, see beamer manual, sec. 12.6. Hence you can avoid loading caption by make use of those beamer caption templates. Commented Jul 19, 2020 at 5:55
  • 2
    @AndréC \footnote[frame] is supported by beamer to indicate "this footnote should be typeset at the bottom of the frame", see beamer manual, sec. 12.12. Furthermore, although no errors, using \caption{Duck \footnote{Duck Duck}} produces wrong output, in which the width of column is wider than expected. From beamer issue #268, Incompatibility of beamer with caption package, it seems the compatibility issue is never solved. Commented Jul 19, 2020 at 6:00
  • 1
    On the caption side, it do fixed compatibility reported issues with beamer, see here. So if one can reduce the problem to be caption-related, an issue to gitlab.com/axelsommerfeldt/caption/-/issues is welcome. @AndréC I checked again, the too-wide column issue is reproducible even without caption. Sorry for my mis-judgement. Commented Jul 19, 2020 at 6:17
  • 1
    This is an compatibility issue, and I've reported to caption. See gitlab.com/axelsommerfeldt/caption/-/issues/84. Commented Jul 19, 2020 at 7:09

1 Answer 1

1

Some updates:

Thanks to Axel Sommerfeldt, the author of caption, this compatibility issue has been fixed in caption 2020-07-20, and the update is already installable in TeX Live. MiKTeX users might need to wait.

This update even allows the direct use of \footnote in multi-line \caption, which will produces two copies of footnote text at the bottom of frame in plain beamer.

\documentclass[10pt]{beamer}

\usetheme{metropolis}
\usepackage{appendixnumberbeamer}

\usepackage{caption}

\begin{document}

\begin{frame} \frametitle{Introduction}
\begin{columns}[t]
    \begin{column}{0.5\textwidth}
        \begin{figure}
            \includegraphics[width=.9\linewidth]{example-image}
            \caption{Duck\footnote[frame]{Duck Duck}}
        \end{figure}
    \end{column}
    \begin{column}{0.5\textwidth}
        \begin{figure}
            \includegraphics[width=.9\linewidth]{example-image}
            \caption{Duck Duck Duck Duck Duck Duck\footnote[frame]{Duck Duck}}
        \end{figure}
    \end{column}
\end{columns}
\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 .