I'm using beamer package to produce slides. I put many figures on a slide by using the subfigure package. The problem is that for captions, the subfigure are labeled "a", "b".. "m", "n" and so on, for subfigures appearing on different slides. How could I reset the subfigure numbering when passing to a new slide?

  • 3
    Using figure and subfigure in beamer seems like a conflict of interest. Figure is for floating material, which you don't want for beamer. Why not just use the columns environment? Commented Oct 25, 2010 at 13:19
  • I did not know about this environment. Thank you.
    – lmsasu
    Commented Oct 30, 2010 at 9:20
  • I have 4 graphs and I want to put them on one beamer slide with a note at the top of each. How do I do this in beamer?
    – user5242
    Commented May 2, 2011 at 2:50
  • 1
    Adding the reset counter in every frame can be tedious when you have too many and you must add them at different times. The answer that gave Stefan didn't work with me, but I found this solution in another question, so I post it here: what you should add is, instead of figure, framenumber: \makeatletter \@addtoreset{subfigure}{framenumber} \makeatother always in the preamble. I've just tried it and it works. Regards!
    – oxio
    Commented Jan 31, 2013 at 14:46

3 Answers 3


Instead of doing this for every figure, you could define it once in the preamble:


Alternatively, using the chngcntr package:


Though I would expect such a reset per figure as default subfigure behavior, but you did not post your code.

  • I guess this is a conflict between beamer and subfigure; beamer has its own definitions of figure environments (which are non-floating in beamer). Commented Oct 25, 2010 at 14:09
  • 1
    Neither of these solutions works for me under MikTeX 2.9. The first one just doesn't work, and the second one gives me an error to the effect that subfigure is not a counter.
    – SSilk
    Commented Sep 27, 2011 at 2:08
  • @SSilk: perhaps you didn't load the subfigure package.
    – Stefan Kottwitz
    Commented Sep 27, 2011 at 6:49
  • These two don't work for me either. TeX Live 2015
    – Bastian
    Commented Jun 4, 2016 at 14:27
  • never mind, these work, but of course one has to have a caption to get the counter reset which I forgot
    – Bastian
    Commented Jun 4, 2016 at 14:41


Since version 2015/09/17 v3.3-111 of the caption package, beamer and subcaption are again compatible.

You shouldn't be using the obsolete subfigure package in modern LaTeX documents; you could use the subfig package instead (the subcaption package is not compatible with beamer for old versions):

enter image description here

The code:



  \subfloat[First subfigure\label{fig:a}]{\includegraphics[height=2cm,width=3cm]{example-image}}\qquad
  \subfloat[Second subfigure\label{fig:b}]{\includegraphics[height=2cm,width=3cm]{example-image-a}}
\caption{A figure}
  \subfloat[Third subfigure\label{fig:c}]{\includegraphics[height=2cm,width=3cm]{example-image-b}}\qquad    
  \subfloat[Fourth subfigure\label{fig:d}]{\includegraphics[height=2cm,width=3cm]{example-image-c}}
\caption{Another figure}


When I first wrote this answer subcaption and beamer were not explicitly incompatible; since this has changed, now I updated my answer with subfig. Thanks to kww who noticed this in his/her comment.

Things have changed one more time: subcaption and beamer are compatible again.

  • The answer can't be moved to another question. You need to copy it manually and delete this one. Just click on edit and copy&paste the whole text should work including the images. Commented May 2, 2011 at 10:10
  • Note that the @usename notification doesn't work in answers or questions. Commented May 2, 2011 at 10:13
  • @Martin Scharrer: I'll then wait and see if Jim Silverton moves his answer to a new question and then I'll move my answer accordingly. Thank you. Commented May 2, 2011 at 14:14
  • @Gonzalo Medina I receive the "! Package caption Error: The 'subcaption' package does not work correctly" by loading \usepackage{caption} and \usepackage{subcaption}.
    – Ka Wa Yip
    Commented Jul 20, 2015 at 19:21
  • @kww Yes, This was an old answer and 4 years ago there was no incompatibility between (sub)caption and beamer. Since that time, the packages became incompatible with beamer. However, subfig can still be used. Give me some minutes to update the answer. Thanks for pointing me out to this problem. Commented Jul 20, 2015 at 19:38

Solved: added \setcounter{subfigure}{0} before each \begin{figure}.

  • Adding \setcounter{subfigure}{0} before each \begin{figure} worked perfectly for me. It is especially usefull when you want to reset it inside a frame (e.g. when you are making a poster using beamer you only have one frame).
    – user27314
    Commented Mar 13, 2013 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .