1

i have some problems with tikz and pause in beamer. The graphic crashes every time after the second frame. I have already tried onslide, pasue and only. Without pause etc. the TikZ picture works...

Can anyone help me here?

best regards Alex

Sorry for the chaotic code

\documentclass[aspectratio=169,xcolor=table]{beamer}
    % Define block styles
\usepackage[ngerman]{babel}
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary{shapes.geometric}% für Ellipse
\usetikzlibrary{calc}
\tikzset{
    pfeil/.style={stealth-},
    beschr/.style={remember picture,overlay,font=\small}}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows} 
\usepackage{tikz}
\usetikzlibrary{snakes}
\begin{document}

\begin{frame} \usetikzlibrary{arrows, arrows.meta, calc, positioning, shapes} \tikzstyle{block} = [rectangle, draw, fill=white!20, text width=3cm, text centered, rounded corners, minimum height=2.1cm]

\tikzstyle{block1} = [rectangle, draw, fill=gray!10, 
text width=3.2cm, text centered, rounded corners, minimum height=2.1cm]
\tikzstyle{block2} = [rectangle, draw, fill=gray!20, 
text width=3.2cm, text centered, rounded corners, minimum height=2.1cm]
    \tikzstyle{block3} = [rectangle, draw, fill=gray!25, 
text width=3.4cm, text centered, rounded corners, minimum height=2.1cm]

\tikzstyle{line} = [draw, -latex'] \centering {\begin{tikzpicture}[node distance = 0.4cm, auto] \footnotesize % Place nodes \only<1>{ \node [block] (Messdaten) {\textbf{Start: ..}}; } \only<1-2>{ \node [block1, right =of Messdaten] (Maxima) {Unterteilung...}; \path [line] (Messdaten.east) -- (Maxima); } \only<1-3>{ \node [block2, right =of Maxima] (SdkF) {Summe der kleinsten Fehlerquadrate....}; \path [line] (Maxima.east) -- (SdkF); } \only<1-4>{
\node [block3, right =of SdkF] (BSpline) {\textit{B-Spline Approximation}}; \path [line] (SdkF.east) -- (BSpline); } \only<1-5>{ \node [block2, below =of Messdaten] (Phasenv) {Elimination}; \path [line] (BSpline.south) -- ++(0,-5.5pt) -| (Phasenv); } \only<1-6>{ \node [block1, right =of Phasenv] (Aufsp) {Unterteilung ..}; \path [line] (Phasenv.east) -- (Aufsp); } \only<1-7>{ \node [block1, right =of Aufsp] (Minima) {Suche ..}; \path [line] (Aufsp.east) -- (Minima); } \only<1-8>{ \node [block, right =of Minima] (Rissschl) {\textbf{Ende..}}; \path [line] (Minima.east) -- (Rissschl); }

\end{tikzpicture} } \end{frame} \end{document}

  • First, you should move all the \usetikzlibrary and \tikzset after usepackage{tikz}. – vi pa Sep 30 '20 at 09:55
  • As @vipa said: \usepackage{tikz} first, then load the libraries. Repeated loading of libraries won't break things but it certainly doesn't help either. \tikzstyle still works, too, but it is deprecated. What's left then is that you're missing the positioning library. – Qrrbrbirlbel Jul 12 '22 at 22:53

1 Answers1

0

You have load the positioning library in order to use the =of syntax

\documentclass[aspectratio=169,xcolor=table]{beamer}
    % Define block styles
\usepackage[ngerman]{babel}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary{shapes.geometric}% für Ellipse
\usetikzlibrary{calc}
\tikzset{
    pfeil/.style={stealth-},
    beschr/.style={remember picture,overlay,font=\small}}
%\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows} 
\usetikzlibrary{positioning}

\usetikzlibrary{snakes} \begin{document}

\begin{frame} \usetikzlibrary{arrows, arrows.meta, calc, positioning, shapes} \tikzset{ block/.style={rectangle, draw, fill=white!20, text width=3cm, text centered, rounded corners, minimum height=2.1cm}, block1/.style={rectangle, draw, fill=gray!10, text width=3.2cm, text centered, rounded corners, minimum height=2.1cm}, block2/.style={rectangle, draw, fill=gray!20, text width=3.2cm, text centered, rounded corners, minimum height=2.1cm}, block3/.style={rectangle, draw, fill=gray!25, text width=3.4cm, text centered, rounded corners, minimum height=2.1cm}, line/.style={draw, -latex'} } \centering {\begin{tikzpicture}[node distance = 0.4cm, auto] \footnotesize % Place nodes \only<1>{ \node [block] (Messdaten) {\textbf{Start: ..}}; } \only<1-2>{ \node [block1, right =of Messdaten] (Maxima) {Unterteilung...}; \path [line] (Messdaten.east) -- (Maxima); } \only<1-3>{ \node [block2, right =of Maxima] (SdkF) {Summe der kleinsten Fehlerquadrate....}; \path [line] (Maxima.east) -- (SdkF); } \only<1-4>{
\node [block3, right =of SdkF] (BSpline) {\textit{B-Spline Approximation}}; \path [line] (SdkF.east) -- (BSpline); } \only<1-5>{ \node [block2, below =of Messdaten] (Phasenv) {Elimination}; \path [line] (BSpline.south) -- ++(0,-5.5pt) -| (Phasenv); } \only<1-6>{ \node [block1, right =of Phasenv] (Aufsp) {Unterteilung ..}; \path [line] (Phasenv.east) -- (Aufsp); } \only<1-7>{ \node [block1, right =of Aufsp] (Minima) {Suche ..}; \path [line] (Aufsp.east) -- (Minima); } \only<1-8>{ \node [block, right =of Minima] (Rissschl) {\textbf{Ende..}}; \path [line] (Minima.east) -- (Rissschl); }

\end{tikzpicture} } \end{frame} \end{document}