[Tex/LaTex] How to turn off table and figure captions

captions

I am using my figures and tables both in report documents, where I want them to have caption text, an in presentations made with Beamer, where I want them to not have a caption text. I am using the Caption package (2011/08/11) both for my report and presentations.

Is there a simple way to turn off the caption text when I use the figures and tables in my presentations?

Best Answer

Since you're using the caption package already you can use its possibilites to define own caption formats to define one that outputs nothing by saying

\DeclareCaptionFormat{empty}{}

You can now use this format by setting it with \captionsetup:

\captionsetup{format=empty}

A complete example:

\documentclass{beamer}
\usepackage{caption}
\DeclareCaptionFormat{empty}{}
\captionsetup{format=empty}
\begin{document} 

\begin{frame}
\begin{figure}
 some figure
 \caption{some caption}
\end{figure}
\end{frame}

\end{document}

As noted by Axel Sommerfeldt in the comments it is probably a good idea also to set the skip above and below the caption to zero. Otherwise you might wonder where the vertical space below the figure comes from... For this just extend the caption setup:

\captionsetup{format=empty,aboveskip=0pt,belowskip=0pt}
Related Question