I am using the following code to create overlays with beamer

    visible on/.style={alt={#1{}{invisible}}},
    alt/.code args={<#1>#2#3}{%
      \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path

It works great except when one needs to use opacity in the path that is to be overlayed i.e.

\scoped[visible on=<2->]{\filldraw[shade, opacity=.5, color=red] (0,1) rectangle (0,0);}

does not work because of the opacity argument in the path itself. So this rectangle is always seen in all the overlays.

Anyway of a workaround?


  • Why you cannot use \onslide with \transfade transitions between overlays? – vi pa Jun 25 at 10:29
  • never used \transfade, I know \onslide does not work by itself. Can you give an example please – Jean Eid Jul 3 at 14:00

This is a MWE with \transfade and \onslide. This work only in fullscreen mode.

\filldraw[shade, opacity=.5, color=red] (1,1) rectangle (0,0);

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.