\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{pgf,tikz}
\usepackage{tikz}
\begin{document}
\frame{
\usetikzlibrary{decorations.pathmorphing}
\tikzstyle{kringel}=[decoration={random steps}]
\begin{tikzpicture}
\draw[black] (3,2.5) decorate [kringel] {-- (2,5)};
\end{tikzpicture}
%\uncover<2->{test}
}
\end{document}
Compiles without any problems. If I replace
%\uncover<2->{test}
with
\uncover<2->{test}
then it does not compile and gives the following error:
./test.tex:18: Package tikz Error: You need to load a decoration library.
If I move the two lines
\usetikzlibrary{decorations.pathmorphing}
\tikzstyle{kringel}=[decoration={random steps}]
into the document header, i.e., before
\begin{document}
then it compiles and works. Can someone explain to me what is happening here?
\usetikzlibrary
in your preamble.usetikzlibrary
out and place before\begin{document}