Debian Codegraph @

texmf-dist/doc/latex/anima/exemplo.tex

raw
1
2 \documentclass{anima}
3
4 \animaStyle{anima}
5 \animaColor{graytext}
6 \animaTheme{plane}
7
8 \begin{document}
9
10 \animaFrameTitle
11 {PRESENTATIONS WITH ANIMATIONS IN \LaTeX}
12 {Adriano G. Santana}
13 {Toledo-PR}{\today}
14
15 \begin{frame}[3]
16 \animaExemplo
17 \end{frame}
18
19 \begin{frame}[3]
20
21 \begin{block}[(-5.1,4.4)]{A CLOCK}[2.8cm]
22 \end{block}
23
24 \draw[-latex] (-5,1.8)--++({90-360*\um}:1.4);
25 \draw[-latex] (-5,1.8) circle (1.4);
26
27 \begin{alertblock}[(-5.1,0)]{DESCRIPTION}[2.8cm]
28 4 - defines the counter;\\
29 5 - initializes it to zero;\\
30 7 - start of the loop;\\
31 10 - drawing the pointer;\\
32 14 - counter + 1;\\
33 15 - stop condition
34 \end{alertblock}
35
36 \begin{exampleblock}[(2.9,4.4)]{CODE}[5cm]
37 \normalsize\tt{%
38 1 \textbackslash documentclass[multi=page]\{standalone\}\\
39 2 \textbackslash usepakage\{pgf,tikz\}
40
41 3 \qquad\textbackslash begin\{document\}
42
43 4 \qquad\textbackslash newcount\textbackslash nFrame\\
44 5 \qquad\textbackslash nFrame = 0\\
45 6 \qquad\textbackslash def\textbackslash angulo\{90- 36*\textbackslash the\textbackslash nfram\}\\
46 7 \qquad\textbackslash loop\\
47 8 \qquad\qquad \textbackslash begin\{page\}\%\\
48 9 \qquad\qquad \textbackslash begin\{tikzpicture\}\\
49 10\qquad\qquad\qquad\textbackslash draw [->] (0,0)--(\{\textbackslash angulo\}:1);\\
50 11\qquad\qquad\qquad\textbackslash draw (0,0) circle (1);\\
51 12\qquad\qquad \textbackslash end\{tikzpicture\}\%\\
52 13\qquad\qquad \textbackslash end\{page\}\\
53 14\qquad\textbackslash advance \textbackslash nFrame +1\\
54 15\qquad\textbackslash ifnum \textbackslash nFrame < 11 \textbackslash repeat\\
55 16\textbackslash end\{documento\}}
56 \end{exampleblock}
57 \end{frame}
58
59 \begin{frame}[3]
60
61 \begin{block}[(-5.1,4.4)]{A CLOCK}[2.8cm]
62 \end{block}
63
64 \draw[-latex] (-5,1.8)--++({90-360*\um}:1.4);
65 \draw[-latex] (-5,1.8) circle (1.4);
66
67 \begin{alertblock}[(-5.1,0)]{DESCRIPTION}[2.8cm]
68 1 - anima class;\\
69 3 - \textbackslash um default counter\\
70 4 - [10] defines the number of repetitions\\
71 5 and 6 - same command as before
72 \end{alertblock}
73
74 \begin{exampleblock}[(2.9,4.4)]{CODE WITH ANIMA CLASS}[5cm]
75 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}
76
77 \tt{% \normalsize
78 1 \textbackslash documentclass\{anima\}\\
79
80 2 \qquad\textbackslash begin\{document\}\\
81 3 \qquad\textbackslash def\textbackslash angulo\{90- 360*\textbackslash um\}\\
82 4 \qquad\qquad \textbackslash begin\{frame\}[10]\\
83 5 \qquad\qquad\qquad\textbackslash draw [->] (0,0)--(\{\textbackslash angulo\}:1);\\
84 6 \qquad\qquad\qquad\textbackslash draw (0,0) circle (1);\\
85 7 \qquad\qquad \textbackslash end\{frame\}\\
86 8 \textbackslash end\{documento\}}
87 \end{exampleblock}
88 \end{frame}
89
90 \begin{frame}[3]
91 \begin{block}{HOW WORKING}
92 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.
93 \end{block}
94
95 \draw[latex-latex] ({-8*\um},-3.5)--node[above]{16cm}({8*\um},-3.5);
96 \draw[latex-latex] (-7,{-4.5*\um})--node[right]{9cm} (-7,{4.5*\um});
97 \end{frame}
98
99 \begin{frame}
100 \begin{block}{HOW WORKING}
101 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.
102
103 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.
104 \end{block}
105 \begin{exampleblock}{NEW EXAMPLE}
106 \tt{%
107 1 \textbackslash documentclass\{anima\}\\
108
109 2 \qquad\textbackslash begin\{document\}\\
110 3 \qquad\textbackslash def\textbackslash angulo\{90- 360*{\color{animaColor2}\textbackslash um}\}\\
111 4 \qquad \textbackslash begin\{frame\}{\color{animaColor1}[10]}\\
112 5 \qquad\qquad\textbackslash draw [->] (0,0)--(\{\textbackslash angulo\}:1);\\
113 6 \qquad\qquad\textbackslash draw (0,0) circle (1);\\
114 7 \qquad \textbackslash end\{frame\}\\
115 8 \textbackslash end\{documento\}}
116 \end{exampleblock}
117 \end{frame}
118
119 \begin{frame}
120 \begin{block}{BLOCK, EXAMPLEBLOCK, ALERTBLOCK}
121 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}
122
123 {\tt%
124 1- \textbackslash begin\{block\}\{Title\}\\
125 2-\qquad Body text\\
126 3- \textbackslash begin\{block\}\\
127 }
128 \end{block}
129 \begin{alertblock}{Alignment}
130 The first block starts at the top of the page, and subsequent blocks are aligned directly below it.
131 \end{alertblock}
132 \begin{exampleblock}{}
133 A title is mandatory, even if left empty.
134 \end{exampleblock}
135 \end{frame}
136
137 \begin{frame}
138 \begin{block}[(-2,3)]{Basic Block Options}[5.5cm]
139 {\tt%
140 1- \textbackslash begin\{block\}{\color{animaColor2}[(-2,3)]}\{Title\}{\color{animaColor1}[5.5cm]}\\
141 2-\qquad Body text\\
142 3- \textbackslash begin\{block\}
143 }\\
144
145 If repositioning or resizing a block is necessary, there are two optional parameters to achieve this:
146
147 {\tt\color{animaColor1}[(-2,3)]} - defines the position of the top center of the block;\\
148 {\tt\color{animaColor2}[5.5cm]} - defines half the width of the block.
149 \end{block}
150
151 \draw[-latex,animaColor2] (-2,3.5)--node[above,animaColor2]{5.5cm}++(5.5,0);
152 \draw[-latex,animaColor2] (-2,3.5)--node[above,animaColor2]{5.5cm}++(-5.5,0);
153 \draw[animaColor2] (-2,3.3)--(-2,3.7);~
154 \fill[animaColor1] (-2,3) circle (.2) node[above]{center block};
155
156 \begin{exampleblock}{NEW BLOCK}[4cm]
157 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.
158 \end{exampleblock}
159 \end{frame}
160
161 \end{document}