我想为红色箭头制作动画,有人能帮我吗?谢谢。
\documentclass{beamer}
\usepackage{graphics}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{lmodern}
\usepackage{pgf}
\usepackage{amsfonts}
\usepackage{eurosym}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{tikz}
\texhash
\usepackage{mathrsfs}
\begin{document}
\begin{tikzpicture}
\node[draw,very thick](1) at (0,0){A};
\node[draw,very thick](2) at (5,2){B};
\node[draw,very thick](3) at (3,-2){C};
\node[draw,very thick](6) at (7,-2){D};
\node[draw,very thick](7) at (10,0){E };
\node[draw,very thick](8) at (0,-4){F};
\node[draw,very thick](9) at (3,-4){G};
\node[draw,very thick](10) at (7,-4){H};
\node[draw,very thick](11) at (10,-4){I};
\draw[->] [>=stealth,red,very thick](1) to (2);
\draw[->] [>=stealth,red,very thick](1) to (3);
\draw[->] [>=stealth,red,very thick](2) to (7);
\draw[->] [>=stealth,very thick](6) to (7);
\draw[->] [>=stealth,very thick](3) to (6);
\draw[->] [>=stealth,very thick](3) to (6);
\draw[->] [>=stealth,very thick](8) to (9);
\draw[->] [>=stealth,very thick](9) to (3);
\draw[->] [>=stealth,very thick](9) to (10);
\draw[->] [>=stealth,very thick](10) to (11);
\draw[->] [>=stealth,very thick](11) to (7);
\draw[->] [>=stealth,red,very thick](2) to (6);
\draw[->] [>=stealth,very thick](10) to (6);
\draw[->] [>=stealth,very thick](3) to (11);
\end{tikzpicture}
\end{frame}
\end{document}
答案1
你可以通过使用以下方法,稍后显示红色路径
\draw<2->[->,red] ... ;
第二次点击时会显示路径。
例子
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\begin{tikzpicture}[>=stealth,very thick,every node/.style={draw}]
\node(1) at (0,0){A};
\node(2) at (5,2){B};
\node(3) at (3,-2){C};
\node(6) at (7,-2){D};
\node(7) at (10,0){E };
\node(8) at (0,-4){F};
\node(9) at (3,-4){G};
\node(10) at (7,-4){H};
\node(11) at (10,-4){I};
\draw<2->[->,red](1) to (2);
\draw<3->[->,red](1) to (3);
\draw<4->[->,red](2) to (7);
\draw[->](6) to (7);
\draw[->](3) to (6);
\draw[->](3) to (6);
\draw[->](8) to (9);
\draw[->](9) to (3);
\draw[->](9) to (10);
\draw[->](10) to (11);
\draw[->](11) to (7);
\draw<5->[->,red](2) to (6);
\draw[->](10) to (6);
\draw[->](3) to (11);
\end{tikzpicture}
\end{frame}
\end{document}