Created
June 3, 2020 06:48
Example of use of TikZ beamer styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{beamer} | |
\usepackage[utf8]{inputenc} | |
\usepackage{tikz} | |
\usetikzlibrary{arrows,overlay-beamer-styles} | |
\begin{document} | |
% mode 1 (but you need to add an "use as bounding box" | |
% somewhere to avoid jumping because adding things changes | |
% the size of the picture | |
\begin{frame} | |
\begin{center} | |
\begin{tikzpicture}[>=stealth',thick] | |
\node at (0,0) (1) {$1$}; | |
\node at (2,0) (2) {$2$}; | |
\draw<2-> (1) edge[bend left,->] (2); | |
\draw<3-> (2) edge[bend left,->] (1); | |
\end{tikzpicture} | |
\end{center} | |
\end{frame} | |
% mode 2, better, now the arrows are drawn always but they are | |
% invisible on some frames | |
\begin{frame} | |
\begin{center} | |
\begin{tikzpicture}[>=stealth',thick] | |
\node at (0,0) (1) {$1$}; | |
\node at (2,0) (2) {$2$}; | |
\begin{scope}[visible on=<2->] | |
\draw (1) edge[bend left,->] (2); | |
\end{scope} | |
\begin{scope}[visible on=<3->] | |
% change color on <4> | |
\draw[alt=<4->{red}{}] (2) edge[bend left,->] (1); | |
\end{scope} | |
% you can use only too: | |
\only<4->{ | |
\draw [red, ultra thick, red, ->] (2) -- (1); | |
} | |
\end{tikzpicture} | |
\end{center} | |
\end{frame} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment