这些角度应该出现在第二张幻灯片上,但是却没有。
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{angles}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\begin{document}
\begin{frame}
\hfill \begin{tikzpicture}
\onslide<+->{
\draw[scale=1.5,rotate=118] (0,0) coordinate (A)
--++(1,0) coordinate (B)
--++(120:2) coordinate (C)
--cycle ;
}
\onslide<+->{%
\begin{pgfonlayer}{background}
\draw pic[%
semithick,
fill=blue!25,
angle radius=.7cm
] {angle=A--C--B} ;
\draw pic[%
semithick,
fill=red!25,
angle radius=.7cm
] {angle=C--B--A} ;
\end{pgfonlayer}
}
\end{tikzpicture}\hfill\strut
\end{frame}
\end{document}
答案1
你也可以 \onslide
使用visible on
https://tex.stackexchange.com/a/55849/36296可通过 方便地获取\usetikzlibrary{overlay-beamer-styles}
。
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{angles}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\usetikzlibrary{overlay-beamer-styles}
\begin{document}
\begin{frame}
\hfill
\begin{tikzpicture}
\draw[scale=1.5,rotate=118] (0,0) coordinate (A)
--++(1,0) coordinate (B)
--++(120:2) coordinate (C)
--cycle ;
\begin{pgfonlayer}{background}
\draw pic[%
semithick,
fill=blue!25,
angle radius=.7cm,
visible on=<+(1)->
] {angle=A--C--B} ;
\draw pic[%
semithick,
fill=red!25,
angle radius=.7cm,
visible on=<+->
] {angle=C--B--A} ;
\end{pgfonlayer}
\end{tikzpicture}\hfill\strut
\end{frame}
\end{document}