[Tex/LaTex] Caption package not working with beamer

beamercaptionsfontsize

I am using beamer to make a presentation. But the default caption font size seems big to me. So I tried to make the font size smaller using caption package. I tried this:

\usepackage[center,scriptsize]{caption}

Also:

\usepackage{caption}
\captionsetup[figure]{font={footnotesize},labelfont={footnotesize}}

But they don't seem to make the caption font size smaller. Where am I going wrong?

My preamble is:

\documentclass{beamer}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{lmodern}% http://ctan.org/pkg/lm
\graphicspath{{images/}}
\usetheme{default}

And my caption code is:

\begin{figure}[h]
  \centering
  \includegraphics[scale=0.8]{axb-grid}
  \caption{$A \times B$ grid}
  \label{fig:axbgrid}
\end{figure}

Best Answer

You don't need the caption package for this.

Simply issue the command

\setbeamerfont{caption}{size=\footnotesize}

MWE

\PassOptionsToPackage{demo}{graphicx} % remove in your document
\documentclass{beamer}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{lmodern}% http://ctan.org/pkg/lm
\graphicspath{{images/}}
\usetheme{default}

\setbeamerfont{caption}{size=\footnotesize}

\begin{document}
\begin{frame}
\begin{figure}[h]
  \centering
  \includegraphics[scale=0.8]{axb-grid}
  \caption{$A \times B$ grid}
  \label{fig:axbgrid}
\end{figure}
\end{frame}
\end{document} 

Output:

enter image description here


EDIT

While with old versions of beamer, caption commands used to work, it seems that now the caption package is not able to recognize beamer anymore.

In fact, loading caption with beamer you get the following warning:

Package caption Warning: \caption will not be redefined since it's already

(caption) redefined by a document class or package which is

(caption) unknown to the caption package.

See the caption package documentation for explanation.

If you want caption and its \captionsetup to work with beamer, you have to load caption with the option compatibility=false:

\usepackage[compatibility=false]{caption}

but, as the documentation warns:

But please note that using this option is neither recommended nor supported since unwanted side-effects or even errors could occur afterwards.

Related Question