TransWikia.com

usepackage{caption} with beamer gives Missing number treated as zero

TeX - LaTeX Asked on December 1, 2021

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.5textwidth}
        begin{figure}
            includegraphics[width=.9linewidth]{example-image-duck}
            caption{Duckfootnote[frame]{Duck Duck}}
        end{figure}
    end{column}
    begin{column}{0.5textwidth}
        begin{figure}
            includegraphics[width=.9linewidth]{example-image-duck}
            caption{Duckfootnote[frame]{Duck Duck}}
        end{figure}
    end{column}
end{columns}
end{frame}

end{document}

One Answer

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

end{document}

enter image description here

Answered by muzimuzhi Z on December 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP