I am using a piece of code (\tikzset) which people have repeatedly been posting in various questions, e.g. Mindmap tikzpicture in beamer (reveal step by step) and highlight a node in tikz.
But now, I want to specify a piece of animation that highlights in step 1 and 3, separately (alt=<1,3>). However, this code gives pgf error. How should this problem be resolved?
\documentclass{beamer}
\usepackage{tikz}
\tikzset{
invisible/.style={opacity=0,text opacity=0},
visible on/.style={alt=#1{}{invisible}},
alt/.code args={<#1>#2#3}{%
\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}
},
}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\node[circle, draw, alt=<1,3>{red}{black}]{};
\end{tikzpicture}
\end{frame}
\end{document}
alt=<1,3>. https://tex.stackexchange.com/questions/84513/highlighting-in-beamer-using-tikz-nodes – PatrickT Oct 01 '21 at 06:42alt. in my example, I directly usealt=which is not quite the same as that answer which usesBeamerAlert– Jason Hu Oct 01 '21 at 14:01