Take the 2-minute tour ×

I'm using beamer for creating presentations. Inside a TikZ node I'd like to make a part of the content appears afterwards. I'm using the \visible command for doing so (I don't want the content to move when the hidden part is made visible).

Here's a small example:


  \visible<+->{You know\dots}
    \node{I'm \visible<+->{very} happy. };

The compilation fails on a classic TikZ error Giving up on this path. Did you forget a semicolon?. However if I replace \visible by \only or \alt the output is produced flawlessly. But that's not what I want :)

There's a possible workaround which consists in defining a new visible command, based on \alt:


But \phantom may have some undesirable side effects (with line breaks for example).

Do you have any better solution? Thanks!

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

The problem arises due to the grapping of arguments of the node together with the \visible command.

In beamer a good advice is to

  1. Try and insert another group
  2. Try with the fragile option for the frame
  3. Combine 1. and 2.

You simply need to add another group inside.

\node {{ I'm \visible<+->{very} happy. }};
% or
\node {\bgroup \dots \egroup};

This will correctly produce your decired result.

share|improve this answer
Thanks, option 1 works, but not in every case. In TikZ if you add another group in a node, you can't add new lines anymore : \node[align=center]{{a\\b}}; doesn't compile. Should I ask another question on that issue? –  kelux Jul 20 '12 at 19:47
@kelux, then just do: \node[align=center] {I'm {\visible<+->{very}}\\happy.};. Just don't have \visible spanning two lines. –  zeroth Jul 22 '12 at 15:31
add comment

Your Answer


