I create a presentation with pdfLaTeX and the beamer document class. In the presentation graphics are shown step by step. The graphic for each step replaces the graphic from the preceding step. To this end, I use beamer's overprint environment.

\usepackage{mwe} % provides example-image-*


This works well. I get the following four slides:

good result

However, as soon as I add the package graphbox the example above stops working, that is, the generated PDF is not what I want. There is an additional slide and all but the last slide contain no graphic:

bad result

I really would like to use graphbox because of its easy vertical alignment (\includegraphics[align=c]). Is there a way to make graphbox work with overprint?

1 Answer 1


The graphbox package redefines \includegraphics such that the included picture always occupies space (even if not visible). This changes the behavior of beamer overlays (see Sections 1.3 and 2.2 of the package manual) and causes your problem. Add the option nobeamer to the graphbox package to disable this behavior.

  • Thank you, worked like a charm. With graphbox' default behavior it might even be possible to cope without overprint using \only instead of \onslide.
    – Socowi
    Nov 10, 2019 at 22:25

You must log in to answer this question.

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