Issue #270 open

# Problems with \pause inside tikzpicture

ignasi
created an issue

As is described in Tabular inside tcolorbox breaks beamer \pause?, \pause in tikzpicture breaks footline or Missing footer on first Beamer slide of TikZ example a \pause command inside a tikzpicture breaks some frames.

#!latex

\documentclass{beamer}
\usepackage{tikz}

\begin{document}
\begin{frame}
\frametitle{test}
\begin{tikzpicture}
\node at (0, 1) {Hello};
\pause
\node at (0, 0) {World};
%      \onslide<1->
\end{tikzpicture}
\end{frame}
\end{document}


In TeX.SX is suggested to use \onslide<1-> as last line in tikzpicture to solve the problem.

If it's not possible to correct this behaviour, may be a comment about it into the manual would help.

1. Close \pause inside TikZ pictures (fixes #270)

The way \pause is set up means that it has to be cleanly closed at the end of a picture, so add the appropriate code to the end command.

→ <<cset 39bc573c5bfc>>

This bug should be reopened, since the fix has been reversed later.

In fact this bug is about overlay commands inside pgfpicture environments. A minimal example showing this bug is as follows:

\documentclass{beamer}
\setbeamertemplate{footline}{footline}
\begin{document}
\makeatletter
\begin{frame}
\begin{pgfpicture}
\pgftext{one}
\pgfsys@begininvisible
\pgftext{two}
\end{pgfpicture}
\pgfsys@endinvisible
\end{frame}
\end{document}


Note that by the default setting \setbeamercovered{invisible}, both \onslide (also \pause) and \onslide+ without optional arguments are implemented by \pgfsys@begininvisible and \pgfsys@endinvisible commands.

Inside pgfsys.code.tex I find the following definitions:

\def\pgfsys@begininvisible{\pgfsys@transformcm{1}{0}{0}{1}{2000bp}{2000bp}
\def\pgfsys@endinvisible{\pgfsys@transformcm{1}{0}{0}{1}{-2000bp}{-2000bp}


It means that \pgfsys@begininvisible and \pgfsys@endinvisible are just two pdf shifting transforms in opposite directions.

When a pgfpicture environment ends, all pdf transforms inside it will be discarded. Therefore after it we have only an unmatch \pgfsys@endinvisible in effect, causing the missing footline.