Overlay specifications can be added to the TikZ commands.

\node<2> (a) {only visible on slide 2};

Is this also possible for the whole tikzpicture environment?

  \node (a) {only visible on slide 2};
  \node (b) {also only visible on slide 2};

This can be emulated by enclosing the environment in \only<2>{ ... } but this is impossible when the tikzpicture is used in a \newenvironment.


1 Answer 1


As usual, these problems can be easily solved thanks to the style visible on defined by Daniel (see Mindmap tikzpicture in beamer (reveal step by step)).

Moreover, it works without problems with custom environments. Demonstration:


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


\begin{tikzpicture}[visible on=<2->]
  \node at (0,0) (a) {only visible on slide 2};
  \node at (2,2) (b) {also only visible on slide 2};

Some text here:
\item one
\item two

\begin{mytikz}[visible on=<3>]
 \draw[top color=orange,bottom color=magenta!80!purple]
 (0,0) rectangle(2,1);
 \draw[top color=magenta!80!purple,bottom color=green,radius=0.5]
 (4,0.5) circle ;

The result:

enter image description here

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.