5

It is pretty weird that once I load the caption package, all table captions start with "Figure", instead of "Table".

For example,

\documentclass[10pt]{beamer} 
\usepackage{caption}
\begin{document}

\begin{frame} 
\begin{table}   
\caption{Add caption}
\begin{tabular}{c}
a \\        
b \\    
\end{tabular} 
\end{table}
\end{frame}

\end{document}

produces enter image description here

Yet, removing the caption package solves the problem.

It seems that the problem exists only for new versions of the caption package. For example, on my office computer, where the caption packages was installed on September 2018, the problem disappear, but on my personal laptop, which generates the problem above, the package was installed a few months ago.

  • 1
    Welcome to TeX.SE! With your MWE I cant reproduce your problem! Caption label is Table (as expected). – Zarko Nov 20 '19 at 16:36
  • I get the problem too. Beamer is dated 10/4/2019 and caption is dated 9/8/2019 (MikTeX). \tablename is still Table. – John Kormylo Nov 20 '19 at 18:44
  • Until they get the bug fixed, use \captionof{table}{...}. – John Kormylo Nov 20 '19 at 18:46
  • \@captype in table is set to figure, but only when using the caption package. – John Kormylo Nov 20 '19 at 18:49
  • hm, I have recent MikTeX installation (hopefully with recent version of caption and beamer). I wonder, why you like to use caption package? beamer offer good own support for managing caption style. – Zarko Nov 20 '19 at 19:26
5

I found the following in caption.sty:

\@ifclassloaded{beamer}{%
  \caption@InfoNoLine{beamer document class}%
  \let\caption@ORI@figure\figure
  \def\figure{\caption@settype{figure}\caption@ORI@figure}
  \let\caption@ORI@table\figure
  \def\table{\caption@settype{table}\caption@ORI@table}
}{}

which sets \@captype to table, then resets it to figure. Anyway, one can avoid the problem using:

\documentclass[10pt]{beamer} 
\let\BeamerFigure=\figure
\let\BeamerTable=\table
\usepackage{caption}
\let\figure=\BeamerFigure
\let\table=\BeamerTable
\begin{document}

\begin{frame} 
\begin{table}
\caption{Add caption}
\begin{tabular}{c}
a \\        
b \\    
\end{tabular} 
\end{table}
\end{frame}

\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.