Tikz 叠加与 Beamer 布局

Tikz 叠加与 Beamer 布局

我想用我所有的幻灯片制作一份讲义,但有些幻灯片包含 tikz 图,其中节点和边的颜色会发生变化。

我有点困惑如何处理框架的每个实例最终在 PDF 中得到一个真正的页面。所以我不想讲义改变这里的事情,因为我需要所有的幻灯片。

以下是一个例子:

\begin{frame}{Eksempel DFS}
\begin{tikzpicture}[
    node distance=1.45cm, thick,
    main node/.style={circle, draw, font=\sffamily\bfseries}
]
    \node[main node] (1) [onslide=<1->{fill=black!30!red}]                   {1};
    \node[main node] (2) [right of =1,onslide=<3->{fill=black!30!red}] {2};
    \node[main node] (3) [right of =2,onslide=<4->{fill=black!30!red}] {3};
    \node[main node] (4) [right of =3,onslide=<7->{fill=black!30!red}] {4};
    \node[main node] (5) [right of =4,onslide=<9->{fill=black!30!red}] {5};
    \node[main node] (6) [below of =1,onslide=<11->{fill=black!30!red}] {6};
    \node[main node] (7) [right of =6,onslide=<12->{fill=black!30!red}] {7};
    \node[main node] (8) [right of =7,onslide=<5->{fill=black!30!red}] {8};
    \node[main node] (9) [right of =8,onslide=<6->{fill=black!30!red}] {9};
    \node[main node] (0) [right of =9,onslide=<8->{fill=black!30!red}] {0};

    \path (1) edge[onslide=<2->{propertiesBlue},onslide=<3->{propertiesRed}] (2)
        (1) edge[onslide=<2-11>{propertiesBlue}] (6)
        (1) edge[onslide=<2-11>{propertiesBlue},onslide=<12->{propertiesRed}] (7)
        (2) edge[onslide=<3-3>{propertiesBlue},onslide=<4->{propertiesRed}] (3)
        (2) edge[onslide=<3-9>{propertiesBlue}] (8)
        (3) edge[onslide=<4-5>{propertiesBlue},onslide=<5->{propertiesRed}] (8)
        (3) edge[onslide=<4-5>{propertiesBlue},onslide=<6->{propertiesRed}] (9)
        (4) edge[onslide=<6-6>{propertiesBlue},onslide=<7->{propertiesRed}] (9)
        (9) edge[onslide=<6-7>{propertiesBlue},onslide=<8->{propertiesRed}] (0)
        (0) edge[,onslide=<8-8>{propertiesBlue},onslide=<9->{propertiesRed}] (5)
        (2) edge[onslide=<3-10>{propertiesBlue},onslide=<11->{propertiesRed}] (6);
\end{tikzpicture}
\medskip

\only<1>{
    Stack: 
}
\only<2>{
    Stack: 7 6 2
}
\only<3>{
    Stack: 7 6 \cancel{2} 6 8 3
}
\only<4>{
    Stack: 7 6 \cancel{2} 6 8 \cancel{3} 9 8
}
\only<5>{
    Stack: 7 6 \cancel{2} 6 8 \cancel{3} 9 \cancel{8}
}
\only<6>{
    Stack: 7 6 \cancel{2} 6 8 \cancel{3} \cancel{9} \cancel{8} 0 4
}
\only<7>{
    Stack: 7 6 \cancel{2} 6 8 \cancel{3} \cancel{9} \cancel{8} 0 \cancel{4}
}
\only<8>{
    Stack: 7 6 \cancel{2} 6 8 \cancel{3} \cancel{9} \cancel{8} \cancel{0} \cancel{4} 5
}
\only<9>{
    Stack: 7 6 \cancel{2} 6 8 \cancel{3} \cancel{9} \cancel{8} \cancel{0} \cancel{4} \cancel{5}
}
\only<10>{
    Stack: 7 6 \cancel{2} 6 \cancel{8} \cancel{3} \cancel{9} \cancel{8} \cancel{0} \cancel{4} \cancel{5}
}
\only<11>{
    Stack: 7 6 \cancel{2} \cancel{6} \cancel{8} \cancel{3} \cancel{9} \cancel{8} \cancel{0} \cancel{4} \cancel{5}
}
\only<12>{
    Stack: \cancel{7} \cancel{6} \cancel{2} \cancel{6} \cancel{8} \cancel{3} \cancel{9} \cancel{8} \cancel{0} \cancel{4} \cancel{5}
}
\end{frame}

是否有一个好的方法可以使讲义例外?

答案1

尝试|handout:<overlay>为所有覆盖添加。例如,onslide=<3->变为onslide=<3-|handout:3->

参考:https://tex.stackexchange.com/a/214022/133968

相关内容