\documentclass{anima} \animaStyle{anima} \animaColor{graytext} \animaTheme{plane} \begin{document} \animaFrameTitle {PRESENTATIONS WITH ANIMATIONS IN \LaTeX} {Adriano G. Santana} {Toledo-PR}{\today} \begin{frame}[3] \animaExemplo \end{frame} \begin{frame}[3] \begin{block}[(-5.1,4.4)]{A CLOCK}[2.8cm] \end{block} \draw[-latex] (-5,1.8)--++({90-360*\um}:1.4); \draw[-latex] (-5,1.8) circle (1.4); \begin{alertblock}[(-5.1,0)]{DESCRIPTION}[2.8cm] 4 - defines the counter;\\ 5 - initializes it to zero;\\ 7 - start of the loop;\\ 10 - drawing the pointer;\\ 14 - counter + 1;\\ 15 - stop condition \end{alertblock} \begin{exampleblock}[(2.9,4.4)]{CODE}[5cm] \normalsize\tt{% 1 \textbackslash documentclass[multi=page]\{standalone\}\\ 2 \textbackslash usepakage\{pgf,tikz\} 3 \qquad\textbackslash begin\{document\} 4 \qquad\textbackslash newcount\textbackslash nFrame\\ 5 \qquad\textbackslash nFrame = 0\\ 6 \qquad\textbackslash def\textbackslash angulo\{90- 36*\textbackslash the\textbackslash nfram\}\\ 7 \qquad\textbackslash loop\\ 8 \qquad\qquad \textbackslash begin\{page\}\%\\ 9 \qquad\qquad \textbackslash begin\{tikzpicture\}\\ 10\qquad\qquad\qquad\textbackslash draw [->] (0,0)--(\{\textbackslash angulo\}:1);\\ 11\qquad\qquad\qquad\textbackslash draw (0,0) circle (1);\\ 12\qquad\qquad \textbackslash end\{tikzpicture\}\%\\ 13\qquad\qquad \textbackslash end\{page\}\\ 14\qquad\textbackslash advance \textbackslash nFrame +1\\ 15\qquad\textbackslash ifnum \textbackslash nFrame < 11 \textbackslash repeat\\ 16\textbackslash end\{documento\}} \end{exampleblock} \end{frame} \begin{frame}[3] \begin{block}[(-5.1,4.4)]{A CLOCK}[2.8cm] \end{block} \draw[-latex] (-5,1.8)--++({90-360*\um}:1.4); \draw[-latex] (-5,1.8) circle (1.4); \begin{alertblock}[(-5.1,0)]{DESCRIPTION}[2.8cm] 1 - anima class;\\ 3 - \textbackslash um default counter\\ 4 - [10] defines the number of repetitions\\ 5 and 6 - same command as before \end{alertblock} \begin{exampleblock}[(2.9,4.4)]{CODE WITH ANIMA CLASS}[5cm] Of course, the same result can be achieved by creating a command with \textbf{\textbackslash newcommand} or \textbf{\textbackslash NewDocumentEnvironment}. This is exactly what the \textbf{anima} class does. With this class, the same result can be obtained with the following code. \\\vspace{.5cm} \tt{% \normalsize 1 \textbackslash documentclass\{anima\}\\ 2 \qquad\textbackslash begin\{document\}\\ 3 \qquad\textbackslash def\textbackslash angulo\{90- 360*\textbackslash um\}\\ 4 \qquad\qquad \textbackslash begin\{frame\}[10]\\ 5 \qquad\qquad\qquad\textbackslash draw [->] (0,0)--(\{\textbackslash angulo\}:1);\\ 6 \qquad\qquad\qquad\textbackslash draw (0,0) circle (1);\\ 7 \qquad\qquad \textbackslash end\{frame\}\\ 8 \textbackslash end\{documento\}} \end{exampleblock} \end{frame} \begin{frame}[3] \begin{block}{HOW WORKING} The environment named {\tt frame} produces a screen with a 16:9 aspect ratio, similar to modern computer, smartphone, and other device screens, with the point (0,0) at the center. \end{block} \draw[latex-latex] ({-8*\um},-3.5)--node[above]{16cm}({8*\um},-3.5); \draw[latex-latex] (-7,{-4.5*\um})--node[right]{9cm} (-7,{4.5*\um}); \end{frame} \begin{frame} \begin{block}{HOW WORKING} The optional parameter {\tt{\color{animaColor1}[10]}} defines the number of frames in the animation. The command {\tt\textbackslash nFrame} is the counter responsible for the loop within the environment, ranging from 0 to the total number of frames minus 1. The command {\tt{\color{animaColor2}\textbackslash um}} spans the interval from 0 to 1, dividing it into {\tt \textbackslash nFrame} segments. We can insert any code within the \textbf{anima} environment that would typically be used in the \textbf{tikzpicture} environment of TikZ. Additional definitions can be included using the \textbf{scope} environment from TikZ itself. \end{block} \begin{exampleblock}{NEW EXAMPLE} \tt{% 1 \textbackslash documentclass\{anima\}\\ 2 \qquad\textbackslash begin\{document\}\\ 3 \qquad\textbackslash def\textbackslash angulo\{90- 360*{\color{animaColor2}\textbackslash um}\}\\ 4 \qquad \textbackslash begin\{frame\}{\color{animaColor1}[10]}\\ 5 \qquad\qquad\textbackslash draw [->] (0,0)--(\{\textbackslash angulo\}:1);\\ 6 \qquad\qquad\textbackslash draw (0,0) circle (1);\\ 7 \qquad \textbackslash end\{frame\}\\ 8 \textbackslash end\{documento\}} \end{exampleblock} \end{frame} \begin{frame} \begin{block}{BLOCK, EXAMPLEBLOCK, ALERTBLOCK} To simplify the creation of slide presentations, the \textbf{block}, \textbf{alertblock}, and \textbf{exampleblock} environments from the \textbf{beamer} class have been recreated.\vspace{.5cm} {\tt% 1- \textbackslash begin\{block\}\{Title\}\\ 2-\qquad Body text\\ 3- \textbackslash begin\{block\}\\ } \end{block} \begin{alertblock}{Alignment} The first block starts at the top of the page, and subsequent blocks are aligned directly below it. \end{alertblock} \begin{exampleblock}{} A title is mandatory, even if left empty. \end{exampleblock} \end{frame} \begin{frame} \begin{block}[(-2,3)]{Basic Block Options}[5.5cm] {\tt% 1- \textbackslash begin\{block\}{\color{animaColor2}[(-2,3)]}\{Title\}{\color{animaColor1}[5.5cm]}\\ 2-\qquad Body text\\ 3- \textbackslash begin\{block\} }\\ If repositioning or resizing a block is necessary, there are two optional parameters to achieve this: {\tt\color{animaColor1}[(-2,3)]} - defines the position of the top center of the block;\\ {\tt\color{animaColor2}[5.5cm]} - defines half the width of the block. \end{block} \draw[-latex,animaColor2] (-2,3.5)--node[above,animaColor2]{5.5cm}++(5.5,0); \draw[-latex,animaColor2] (-2,3.5)--node[above,animaColor2]{5.5cm}++(-5.5,0); \draw[animaColor2] (-2,3.3)--(-2,3.7);~ \fill[animaColor1] (-2,3) circle (.2) node[above]{center block}; \begin{exampleblock}{NEW BLOCK}[4cm] The next block is always vertically aligned with the previous one. Here, we only need to define its width to ensure it doesn't exceed the screen. \end{exampleblock} \end{frame} \end{document}