Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
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? –  Matthew Leingang Oct 25 '10 at 13:19
I did not know about this environment. Thank you. –  lmsasu Oct 30 '10 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 May 2 '11 at 2:50
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 Jan 31 '13 at 14:46

3 Answers 3

up vote 8 down vote accepted

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.

share|improve this answer
I guess this is a conflict between beamer and subfigure; beamer has its own definitions of figure environments (which are non-floating in beamer). –  Jukka Suomela Oct 25 '10 at 14:09
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 Sep 27 '11 at 2:08
@SSilk: perhaps you didn't load the subfigure package. –  Stefan Kottwitz Sep 27 '11 at 6:49


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.

share|improve this answer
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. –  Martin Scharrer May 2 '11 at 10:10
Note that the @usename notification doesn't work in answers or questions. –  Martin Scharrer May 2 '11 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. –  Gonzalo Medina May 2 '11 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}. –  kww Jul 20 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. –  Gonzalo Medina Jul 20 at 19:38

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

share|improve this answer
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 Mar 13 '13 at 14:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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