texlive[73126] Master/texmf-dist: anima (14dec24)

commits+karl at tug.org commits+karl at tug.org
Sat Dec 14 22:19:41 CET 2024


Revision: 73126
          https://tug.org/svn/texlive?view=revision&revision=73126
Author:   karl
Date:     2024-12-14 22:19:40 +0100 (Sat, 14 Dec 2024)
Log Message:
-----------
anima (14dec24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/anima/anima-doc.pdf
    trunk/Master/texmf-dist/doc/latex/anima/exemplo.tex
    trunk/Master/texmf-dist/source/latex/anima/anima.dtx
    trunk/Master/texmf-dist/tex/latex/anima/anima.cls

Modified: trunk/Master/texmf-dist/doc/latex/anima/anima-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/anima/exemplo.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/anima/exemplo.tex	2024-12-14 21:19:30 UTC (rev 73125)
+++ trunk/Master/texmf-dist/doc/latex/anima/exemplo.tex	2024-12-14 21:19:40 UTC (rev 73126)
@@ -1,6 +1,10 @@
 
 \documentclass{anima}
 
+\animaStyle{anima}
+\animaColor{graytext}
+\animaTheme{plane}
+
 \begin{document}
 
 \animaFrameTitle
@@ -8,7 +12,7 @@
 {Adriano G. Santana}
 {Toledo-PR}{\today}
 
-\begin{frame}[24]
+\begin{frame}[3]
 \animaExemplo
 \end{frame}
 
@@ -52,7 +56,7 @@
 \end{exampleblock}
 \end{frame}
 
-\begin{frame}[12]
+\begin{frame}[3]
 
 \begin{block}[(-5.1,4.4)]{A CLOCK}[2.8cm]
 \end{block}
@@ -70,12 +74,12 @@
 \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{%
-1 \textbackslash documentclass\{frame\}\\
+\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\{anima\}[10]\\
+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\}\\
@@ -104,10 +108,10 @@
 
 2 \qquad\textbackslash begin\{document\}\\
 3 \qquad\textbackslash def\textbackslash angulo\{90- 360*{\color{animaColor2}\textbackslash um}\}\\
-4 \qquad \textbackslash begin\{anima\}{\color{animaColor1}[10]}\\
+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\{anima\}\\
+7 \qquad \textbackslash end\{frame\}\\
 8 \textbackslash end\{documento\}}
 \end{exampleblock}
 \end{frame}

Modified: trunk/Master/texmf-dist/source/latex/anima/anima.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/anima/anima.dtx	2024-12-14 21:19:30 UTC (rev 73125)
+++ trunk/Master/texmf-dist/source/latex/anima/anima.dtx	2024-12-14 21:19:40 UTC (rev 73126)
@@ -126,10 +126,11 @@
 
 % Although the functionality of this class can be compared to the transition effects of the |beamer| class, it is not a dependency of the |anima| class. However, the class makes extensive use of the image creation language provided by the |tikz| package. Lastly, it is worth noting a comparison between this class and the |animate| package. The |animate| package can create embedded animations within the document, while the |anima| class produces an animation where each frame corresponds to a page of the document. This distinction highlights the different design goals of the |anima| class.
 % \end{abstract}
-% \section{Dependências}
+% \changes{v1.1.0}{2024-12-14}{Correções de textos da lingua inglesa}
+% \section{Requirements}
 % This class depends on the |standalone| class and the |tikz| and |pgf| packages, as well as the other classes and packages on which these are dependent.
 %
-% \section{Funcionamento}
+% \section{How It Works}
 % Like the |beamer| class, the |anima| class uses the |frame| environment to create slide presentations. The main difference is that this class focuses on using the |tikz| package to create a sequence of frames with images that form an animation as the slides transition sequentially.
 %
 % Each slide in the presentation is a frame with dimensions of 16 cm in width and 9 cm in height (i.e., in a 16:9 aspect ratio), which are commands within the |tikzpicture| environment. A standard document using the |anima| class follows this structure:
@@ -193,7 +194,7 @@
 % \tikz[scale=.3]{\fill[opacity=.75] (0,0) circle (1);}, 
 % \tikz[scale=.3]{\fill[opacity=.5] (0,0) circle (1);}, 
 % \tikz[scale=.3]{\fill[opacity=.25] (0,0) circle (1);}, 
-% \tikz[scale=.3]{\fill[opacity=0] (0,0) circle (1);}. Já o código
+% \tikz[scale=.3]{\fill[opacity=0] (0,0) circle (1);}. Already the code
 % \begin{quote}
 % 	\cs{begin}|{scope}[rotate around y={\um}]|\\
 %	\hspace*{24pt} \cs{draw}|[-latex,red] (0,0) -- (1,0);|\\
@@ -225,9 +226,9 @@
 %
 % In summary, it is easy to see the many animation possibilities that can be created with |tikz| using the commands |\um| and |\zero| in the |anima| class. At the end of this documentation, an implementation of a model with some other possibilities is presented.
 %
-% \section{Principais Comandos}
+% \section{Main Commands}
 %
-% \DescribeMacro{\uns\marg{a}\marg{b}\marg{c}}In addition to the commands |\um| and |\zero| presented earlier, there are several other commands implemented by the class to facilitate animation creation. One such command is |\uns|\marg{a}\marg{b}\marg{c}. This command is a function that divides the interval $[0,1]$ into three parts proportional to the ratio |a:b:c| and performs the animation in the intermediate part. The behavior of this command can be represented by its graph.
+% \DescribeMacro{\uns\meta{*}\oarg{r}\oarg{s}\marg{a}\marg{b}\marg{c}} \hspace*{2cm}In addition to the commands |\um| and |\zero| presented earlier, there are several other commands implemented by the class to facilitate animation creation. One such command is |\uns|\marg{a}\marg{b}\marg{c}. This command is a function that divides the interval $[0,1]$ into three parts proportional to the ratio |a:b:c| and performs the animation in the intermediate part. The behavior of this command can be represented by its graph.
 %\begin{center}
 %\begin{tikzpicture}[scale=2]
 %	\foreach \i in {-.4,0,...,2.4}
@@ -247,6 +248,8 @@
 %	\cs{fill}|[-latex,blue] ({\uns011},{\uns110}) circle (1);|\\
 % \end{quote}
 %
+% If the option \meta{*} is passed to the \cs{uns} command, the animation will have a variable speed, starting at zero velocity with positive acceleration, reversing the acceleration midway through the animation, and bringing the velocity back to zero at the end. This option gives the animations a more natural appearance.
+%
 % \DescribeMacro{\zeros\marg{a}\marg{b}\marg{c}} The command |\zeros| is defined as |1-\uns|. By substituting one command for the other, using the same parameters, we will always obtain the inverse animation.
 %
 % \DescribeMacro{block} Just like in the |beamer| class, in the |anima| class we have the |block| environment implemented to insert information such as text into the slide presentation. To use the |block| environment, we write the following code:
@@ -270,12 +273,19 @@
 % \DescribeMacro{\animaFormatTitle\marg{conf}} The command |\animaFormatTitle|\marg{conf} is used to modify the formatting of the block content texts.
 %
 %
-% \DescribeMacro{\animaFrameTitle\marg{t}\marg{n}\marg{c}\marg{y}} The command |\animaFrameTitle|\marg{t}\marg{n}\marg{c}\marg{y} can be used to create a title slide for the presentation. In comparison with |beamer|, it is similar to the command |\makeframetitle|. The mandatory parameters \marg{t}, \marg{n}, \marg{c}, and \marg{y} are texts representing the "Title" of the presentation, the "Name" of the author, the "City" or location, and the "Year" or date.
+% \DescribeMacro{\animaFrameTitle\marg{t}\marg{n}\marg{c}\marg{y}} \hspace*{2cm}The command |\animaFrameTitle|\marg{t}\marg{n}\marg{c}\marg{y} can be used to create a title slide for the presentation. In comparison with |beamer|, it is similar to the command |\makeframetitle|. The mandatory parameters \marg{t}, \marg{n}, \marg{c}, and \marg{y} are texts representing the "Title" of the presentation, the "Name" of the author, the "City" or location, and the "Year" or date.
 %
 %
 % \DescribeMacro{\animaBoardDimension\marg{w}\marg{h}} With the command |\animaBoardDimension|\marg{w}\marg{h}, it is possible to modify the dimensions of the presentation. The parameters \marg{w} and \marg{h} represent the width and height of the presentation, respectively. 
 %
-% \DescribeMacro{\nFrame} The command \cs{nFrame} is the counter that indicates which frame of the animation is currently being displayed. The internal counter of the class is \cs{anima at FrameCount}.
+% \DescribeMacro{\nFrame} The command \cs{nFrame} is the counter that indicates which frame of the animation is currently being displayed. The internal counter of the class is \cs{anima at FrameCount}. 
+%
+% \DescribeMacro{\animaStyle\marg{style}} This command provides style options for slide presentations using the |anima| class. In version v1.1, the available styles are |anima| and |default|. Any option not listed in the code for the argument *style* will default to the |default| option.
+%
+% \DescribeMacro{\animaColor\marg{palette}} This command internally uses the \cs{animaColorTheme} command to provide color palette options for slide presentations using the |anima| class. In version v1.1, the available color palettes are |browntext|, |greenboard|, |blackboard|, |graytext|, |nf|, and |default|. Any option not listed in the code for the *pallet* argument will default to the |default| option.
+%
+% \DescribeMacro{\animaTheme\marg{theme}} This command provides theme options for slide presentations using the |anima| class. In version v1.1, the available themes are |plane| and |default|. The |plane| theme removes the grid from the background of the slides. Any option not listed in the code for the *theme* argument will default to the |default| option.
+%
 % \section{Implementation}
 %    \begin{macrocode}
 %<*class>
@@ -291,10 +301,11 @@
 \newcommand{\animaFrameTitle}[4]{
 	\begin{anima}
 		\node (centro) at (0,0) {};
-		\begin{block}{\huge #1}
+		\begin{block}{\huge\vphantom{Íq} #1}
 			[(\anima at BoardWidth-.15)*1cm]
-			[above = of centro,anima at TextColor,align = center]
-			[node distance = 0.5cm, below = of a]
+			[above = of centro,
+			align = center]
+			[node distance = 0.5cm, below = of animaPosBlock]
 			\\\Large #2
 		\end{block}
 		\node[
@@ -349,7 +360,7 @@
 
 \animaColorThemeI
 
-\newcommand\grade{
+\newcommand\animaBackgroud{
 	\draw[dotted, opacity=.2,line width = .3pt] %
 	({-\anima at BoardWidth},{-\anima at BoardHeight}) grid %
 	({\anima at BoardWidth},{\anima at BoardHeight});
@@ -364,17 +375,71 @@
 %	\frac{a+b+c}{b}x-\frac{a}{b} &\mbox{ nos demais casos}
 %\end{cases}$$
 %\end{macro}
+%\changes{v1.1.0}{2024-12-14}{Modificação do comando |uns| acrescentando mais opções e corrigindo bugs de possíveis divisões por zero.}
 %    \begin{macrocode}
-\newcommand{\uns}[3]{
-	((#1+#2+#3)<=0?1:(
-		(\um<(#1/(#1+#2+#3))?0:
-			(\um>((#1+#2)/(#1+#2+#3))?1:
-				(((#1+#2+#3)/#2)*\um-#1/#2)
-	)))
+\NewExpandableDocumentCommand
+{\uns}{s o o m m m}{
+    %\IfNoValueTF{#2}{
+    % Não há #2 nem #3   
+        \ifnum#5=0
+            (\um*(#4+#6)>=#4?1:0)
+        \else
+           \IfBooleanTF{#1}{
+               (\um*(#4+#5+#6)<#4?0:
+                (\um*(#4+#5+#6)>=#4+#5?1:
+                (
+                    -((2*(#6+#5+#4)^3)/#5^3)*(\um)^3+
+                    ((3*(#5+2*#4)*(#6+#5+#4)^2)/#5^3)*(\um)^2+
+                    -((6*#4*(#5+#4)*(#6+#5+#4))/#5^3)*\um+
+                    ((#4^2*(3*#5+2*#4))/#5^3)
+                )
+                )) 
+            }{
+               (\um*(#4+#5+#6)<#4?0:
+                (\um*(#4+#5+#6)>=#4+#5?1:
+                (((#4+#5+#6)/#5)*\um-#4/#5)
+                )) 
+            }
+        \fi        
+    %}{
+    %    \IfNoValueTF{#3}{
+    %        % Há #2, mas não há #3
+    %        \ifnum#4=0
+    %            \ifnum#5=0
+    %                1
+    %            \else
+    %                1
+    %            \fi
+    %        \else
+    %            \ifnum#5=0
+    %                1
+    %            \else
+    %                1
+    %            \fi
+    %        \fi
+    %    }{
+    %        \ifnum#4=0
+    %            \ifnum#5=0
+    %                1
+    %            \else
+    %                1
+    %            \fi
+    %        \else
+    %            \ifnum#5=0
+    %                1
+    %            \else
+    %                1
+    %            \fi
+    %        \fi
+    %    }
+    %}
 }
 \newcommand{\zeros}[3]{(1-\uns{#1}{#2}{#3})}
 
 % Ambiente anima
+%    \end{macrocode}
+%\changes{v1.1.0}{2024-12-14}{Mudança no ponto de Referência dos Blocks}
+%    \begin{macrocode}
 \newcount\anima at FrameCount
 \newcount\nFrame
 \NewDocumentEnvironment{anima}{+O{1} +b}{
@@ -388,9 +453,9 @@
 		\fill[color=anima at BoardColor]
 			({-\anima at BoardWidth},{-\anima at BoardHeight}) 
 			rectangle ({\anima at BoardWidth},{\anima at BoardHeight});
-		\grade
-		\node (a) at \anima at PositionBlock{};
-		#2
+		\animaBackgroud
+		\node (animaPosBlock) at \anima at PositionBlock{};
+			#2
 		\end{tikzpicture}%
 	\end{page}
 	\else
@@ -407,9 +472,9 @@
 		\fill[color=anima at BoardColor] 	
 		({-\anima at BoardWidth},{-\anima at BoardHeight}) rectangle 
 		({\anima at BoardWidth},{\anima at BoardHeight});
-		\grade
-		\node (a) at \anima at PositionBlock {};
-		#2
+		\animaBackgroud
+		\node (animaPosBlock) at \anima at PositionBlock {};
+			#2
 		\end{tikzpicture}%
 	\end{page}
 	\advance \anima at FrameCount +1
@@ -423,80 +488,182 @@
 \def\anima at PositionBlock{(0,{\anima at BoardHeight})}
 \def\anima at WhidthBlock{\anima at BoardWidth*0.9875 cm}
 
+%\changes{v1.1.0}{2024-12-14}{Criação de Temas}
+\tikzstyle{anima at themeBlock}=[
+		draw,
+		bottom color = BlockColor,
+		top color    = BlockColor!50!anima at BoardColor
+]
+
+\newcommand{\animaStyle}[1]{
+	\def\anima at NameStyle{#1}
+	\def\anima at animaStyle{anima}
+	\def\anima at defaultStyle{default}
+	\ifx\anima at NameStyle\anima at animaStyle
+		\tikzstyle{anima at themeBlock}=[
+			draw = BlockColor,
+			bottom color = BlockColor,
+			top color    = BlockColor!50!anima at BoardColor,
+			rounded corners=1.4pt
+		]
+	\else
+		\tikzstyle{anima at themeBlock}=[
+			draw,
+			bottom color = BlockColor,
+			top color    = BlockColor!50!anima at BoardColor
+		]
+	\fi
+}
+\newcommand{\animaColor}[1]{
+	\def\anima at NameColor{#1}
+	\def\anima at browntextColor{browntext}
+	\def\anima at greenboardColor{greenboard}
+	\def\anima at blackboardColor{blackboard}
+	\def\anima at graytextColor{graytext}
+	\def\anima at nfColor{nf}
+	\def\anima at defaultColor{default}
+	\ifx\anima at NameColor\anima at browntextColor
+		\animaColorTheme
+			{FFFFFF}{660907}{016BBF}
+			{FF0000}{00FFFF}{FFD16A}
+	\else\ifx\anima at NameColor\anima at greenboardColor
+		\animaColorTheme
+			{00542C}{FFFFFF}{2222FF}
+			{FF3333}{00FF00}{FFFF00}
+	\else\ifx\anima at NameColor\anima at blackboardColor
+		\animaColorTheme
+			{252B26}{FFFFFF}{2BA8D9}
+			{F23030}{2EA662}{F28322}
+	\else\ifx\anima at NameColor\anima at graytextColor
+		\animaColorTheme
+			{FFFFFF}{252B26}{2BA8D9}
+			{F23030}{2EA662}{F28322}
+	\else\ifx\anima at NameColor\anima at nfColor
+		\animaColorTheme
+			{252B26}{FFFFFF}{2BA8D9}
+			{F23030}{2EA662}{EEEE44}%{F28322}
+	\else
+		\animaColorTheme%
+			{FFFFFF}{000000}{0000FF}%
+			{FF0000}{00FF00}{FFFF00}
+	\fi\fi\fi\fi
+
+}
+
+\newcommand{\animaTheme}[1]{
+	\def\anima at NameTheme{#1}
+	\def\anima at defaultTheme{default}
+	\def\anima at LTbarTheme{LTbar}
+	\def\anima at planeTheme{plane}
+	\ifx\anima at NameTheme\anima at LTbarTheme
+		\renewcommand\animaBackgroud{
+			\draw[dotted, opacity=.2,line width = .3pt] %
+				({-\anima at BoardWidth},{-\anima at BoardHeight}) grid %
+				({\anima at BoardWidth},{\anima at BoardHeight});
+			\fill[
+				anima at Color3,
+				draw=anima at Color3!50!anima at BoardColor,
+				opacity=.7]
+				({-\anima at BoardWidth},{-\anima at BoardHeight}) rectangle 
+				({-0.7*\anima at BoardWidth},{\anima at BoardHeight});
+			\fill[
+				anima at Color3,
+				draw=anima at Color3!50!anima at BoardColor,
+				opacity=.5]
+				({-\anima at BoardWidth+2.4},{\anima at BoardHeight}) rectangle 
+				({\anima at BoardWidth},{0.7*\anima at BoardHeight});
+			\node at (-5,4.5) [anchor=north west]{\begin{minipage}{14cm}\color{anima at TextColor} \small
+					\textbf{\@title}\vspace{-5pt}
+					
+					\@author
+				\end{minipage}};
+		}
+	\else\ifx\anima at NameTheme\anima at planeTheme
+		\renewcommand\animaBackgroud{}
+	\else
+		\renewcommand\animaBackgroud{
+			\draw[dotted, opacity=.2,line width = .3pt] %
+			({-\anima at BoardWidth},{-\anima at BoardHeight}) grid %
+			({\anima at BoardWidth},{\anima at BoardHeight});
+		}
+	\fi\fi
+}
+
 \NewDocumentEnvironment{block}
-{+O{a} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
+{+O{animaPosBlock} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
 {
-	\node[	draw,
-	bottom color = anima at Color1,
-	top color    = anima at Color1!50!anima at BoardColor,
-	text width = {2*#3-0.25cm},
-	node distance = 0.0cm,
-	below = of {#1}, #4]
-	(a) {\animaFormatTitle\vphantom{bq} #2};
-	\node[	text width = {2*#3-0.25cm},
-	node distance = 0.0cm,
-	below = of a,#5]
-	(a) {\animaFormatText #6};
+	\colorlet{BlockColor}{anima at Color1}
+	\node[
+		anima at themeBlock,
+		text width = {2*#3-0.25cm},
+		node distance = 0.0cm,
+		below = of {#1}, #4]
+		(animaPosBlock) {\animaFormatTitle\vphantom{Íq} #2};
+		\node[	text width = {2*#3-0.25cm},
+		node distance = 0.0cm,
+		below = of animaPosBlock,#5]
+	(animaPosBlock) {\animaFormatText #6};
 }{}
 
 \NewDocumentEnvironment{alertblock}
-{+O{a} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
+{+O{animaPosBlock} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
 {
-	\node[	draw,
-	bottom color = anima at Color2,
-	top color    = anima at Color2!50!anima at BoardColor,
-	text width = {2*#3-0.25cm},
-	node distance = 0.0cm,
-	below = of {#1}, #4]
-	(a) {\animaFormatTitle\vphantom{bq} #2};
+	\colorlet{BlockColor}{anima at Color2}
+	\node[
+		anima at themeBlock,
+		text width = {2*#3-0.25cm},
+		node distance = 0.0cm,
+		below = of {#1}, #4]
+		(animaPosBlock) {\animaFormatTitle\vphantom{Íq} #2};
 	\node[	text width = {2*#3-0.25cm},
-	node distance = 0.0cm,
-	below= of a,#5]
-	(a) {\animaFormatText #6};
+		node distance = 0.0cm,
+		below= of animaPosBlock,#5]
+		(animaPosBlock) {\animaFormatText #6};
 }{}
 
 \NewDocumentEnvironment{exampleblock}
-{+O{a} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
+{+O{animaPosBlock} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
 {
-	\node[	draw,
-	bottom color = anima at Color3,
-	top color    = anima at Color3!50!anima at BoardColor,
-	text width = {2*#3-0.25cm},
-	node distance = 0.0cm,
-	below = of {#1}, #4]
-	(a) {\animaFormatTitle\vphantom{bq} #2};
+	\colorlet{BlockColor}{anima at Color3}
+	\node[
+		anima at themeBlock,
+		text width = {2*#3-0.25cm},
+		node distance = 0.0cm,
+		below = of {#1}, #4]
+		(animaPosBlock) {\animaFormatTitle\vphantom{Íq} #2};
 	\node[	text width = {2*#3-0.25cm},
-	node distance = 0.0cm,
-	below= of a,
-	#5]
-	(a) {\animaFormatText #6};
+		node distance = 0.0cm,
+		below= of animaPosBlock,
+		#5]
+		(animaPosBlock) {\animaFormatText #6};
 }{}
 
 \NewDocumentEnvironment{anotherblock}
-{+O{a} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
+{+O{animaPosBlock} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
 {
-	\node[draw,
-	bottom color = anima at Color4,
-	top color    = anima at Color4!50!anima at BoardColor,
-	text width = {2*#3-0.25cm},
-	node distance = 0.0cm,
-	below = of {#1}, #4]
-	(a) {\animaFormatTitle\vphantom{bq} #2};
+	\colorlet{BlockColor}{anima at Color4}
+	\node[
+		anima at themeBlock,
+		text width = {2*#3-0.25cm},
+		node distance = 0.0cm,
+		below = of {#1}, #4]
+		(animaPosBlock) {\animaFormatTitle\vphantom{Íq} #2};
 	\node[	text width = {2*#3-0.25cm},
-	node distance = 0.0cm,
-	below= of a,
-	#5]
-	(a) {\animaFormatText #6};
+		node distance = 0.0cm,
+		below= of animaPosBlock,
+		#5]
+		(animaPosBlock) {\animaFormatText #6};
 }{}
 
 \NewDocumentEnvironment{notitleblock}
-	{+O{a} +O{\anima at WhidthBlock} +O{} +b}
+	{+O{animaPosBlock} +O{\anima at WhidthBlock} +O{} +b}
 {
-	\node[	text width = {2*#2-0.25cm},
-	node distance = 0.0cm,
-	below= of a,
-	#3]
-	(a) {\animaFormatText #4};
+	\node[
+		text width = {2*#2-0.25cm},
+		node distance = 0.0cm,
+		below= of animaPosBlock,
+		#3]
+		(animaPosBlock) {\animaFormatText #4};
 }{}
 
 \newcommand{\animaExemplo}{\large
@@ -566,11 +733,15 @@
 %</class>
 %    \end{macrocode}
 %
-%\section{Exemplo}
+%\section{Example}
 %    \begin{macrocode}
 %<*example>
 \documentclass{anima}
 
+\animaStyle{anima}
+\animaColor{graytext}
+\animaTheme{plane}
+
 \begin{document}
 
 \animaFrameTitle
@@ -578,7 +749,7 @@
 	{Adriano G. Santana}
 	{Toledo-PR}{\today}
 
-\begin{frame}[24]
+\begin{frame}[3]
 	\animaExemplo
 \end{frame}
 
@@ -622,7 +793,7 @@
 	\end{exampleblock}
 \end{frame}
 
-\begin{frame}[12]
+\begin{frame}[3]
 	
 	\begin{block}[(-5.1,4.4)]{A CLOCK}[2.8cm]
 	\end{block}
@@ -640,12 +811,12 @@
 	\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{%
-			1 \textbackslash documentclass\{frame\}\\
+		\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\{anima\}[10]\\
+			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\}\\
@@ -674,10 +845,10 @@
 			
 			2 \qquad\textbackslash begin\{document\}\\
 			3 \qquad\textbackslash def\textbackslash angulo\{90- 360*{\color{animaColor2}\textbackslash um}\}\\
-			4 \qquad	\textbackslash begin\{anima\}{\color{animaColor1}[10]}\\
+			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\{anima\}\\
+			7 \qquad	\textbackslash end\{frame\}\\
 			8 \textbackslash end\{documento\}}
 	\end{exampleblock}
 \end{frame}

Modified: trunk/Master/texmf-dist/tex/latex/anima/anima.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/anima/anima.cls	2024-12-14 21:19:30 UTC (rev 73125)
+++ trunk/Master/texmf-dist/tex/latex/anima/anima.cls	2024-12-14 21:19:40 UTC (rev 73126)
@@ -26,10 +26,11 @@
 \newcommand{\animaFrameTitle}[4]{
 \begin{anima}
 \node (centro) at (0,0) {};
-\begin{block}{\huge #1}
+\begin{block}{\huge\vphantom{Íq} #1}
 [(\anima at BoardWidth-.15)*1cm]
-[above = of centro,anima at TextColor,align = center]
-[node distance = 0.5cm, below = of a]
+[above = of centro,
+align = center]
+[node distance = 0.5cm, below = of animaPosBlock]
 \\\Large #2
 \end{block}
 \node[
@@ -81,18 +82,68 @@
 
 \animaColorThemeI
 
-\newcommand\grade{
+\newcommand\animaBackgroud{
 \draw[dotted, opacity=.2,line width = .3pt] %
 ({-\anima at BoardWidth},{-\anima at BoardHeight}) grid %
 ({\anima at BoardWidth},{\anima at BoardHeight});
 }
 
-\newcommand{\uns}[3]{
-((#1+#2+#3)<=0?1:(
-(\um<(#1/(#1+#2+#3))?0:
-(\um>((#1+#2)/(#1+#2+#3))?1:
-(((#1+#2+#3)/#2)*\um-#1/#2)
-)))
+\NewExpandableDocumentCommand
+{\uns}{s o o m m m}{
+    %\IfNoValueTF{#2}{
+    % Não há #2 nem #3
+        \ifnum#5=0
+            (\um*(#4+#6)>=#4?1:0)
+        \else
+           \IfBooleanTF{#1}{
+               (\um*(#4+#5+#6)<#4?0:
+                (\um*(#4+#5+#6)>=#4+#5?1:
+                (
+                    -((2*(#6+#5+#4)^3)/#5^3)*(\um)^3+
+                    ((3*(#5+2*#4)*(#6+#5+#4)^2)/#5^3)*(\um)^2+
+                    -((6*#4*(#5+#4)*(#6+#5+#4))/#5^3)*\um+
+                    ((#4^2*(3*#5+2*#4))/#5^3)
+                )
+                ))
+            }{
+               (\um*(#4+#5+#6)<#4?0:
+                (\um*(#4+#5+#6)>=#4+#5?1:
+                (((#4+#5+#6)/#5)*\um-#4/#5)
+                ))
+            }
+        \fi
+    %}{
+    %    \IfNoValueTF{#3}{
+    %        % Há #2, mas não há #3
+    %        \ifnum#4=0
+    %            \ifnum#5=0
+    %                1
+    %            \else
+    %                1
+    %            \fi
+    %        \else
+    %            \ifnum#5=0
+    %                1
+    %            \else
+    %                1
+    %            \fi
+    %        \fi
+    %    }{
+    %        \ifnum#4=0
+    %            \ifnum#5=0
+    %                1
+    %            \else
+    %                1
+    %            \fi
+    %        \else
+    %            \ifnum#5=0
+    %                1
+    %            \else
+    %                1
+    %            \fi
+    %        \fi
+    %    }
+    %}
 }
 \newcommand{\zeros}[3]{(1-\uns{#1}{#2}{#3})}
 
@@ -109,8 +160,8 @@
 \fill[color=anima at BoardColor]
 ({-\anima at BoardWidth},{-\anima at BoardHeight})
 rectangle ({\anima at BoardWidth},{\anima at BoardHeight});
-\grade
-\node (a) at \anima at PositionBlock{};
+\animaBackgroud
+\node (animaPosBlock) at \anima at PositionBlock{};
 #2
 \end{tikzpicture}%
 \end{page}
@@ -128,8 +179,8 @@
 \fill[color=anima at BoardColor]  
 ({-\anima at BoardWidth},{-\anima at BoardHeight}) rectangle
 ({\anima at BoardWidth},{\anima at BoardHeight});
-\grade
-\node (a) at \anima at PositionBlock {};
+\animaBackgroud
+\node (animaPosBlock) at \anima at PositionBlock {};
 #2
 \end{tikzpicture}%
 \end{page}
@@ -143,80 +194,181 @@
 \def\anima at PositionBlock{(0,{\anima at BoardHeight})}
 \def\anima at WhidthBlock{\anima at BoardWidth*0.9875 cm}
 
+\tikzstyle{anima at themeBlock}=[
+draw,
+bottom color = BlockColor,
+top color    = BlockColor!50!anima at BoardColor
+]
+
+\newcommand{\animaStyle}[1]{
+\def\anima at NameStyle{#1}
+\def\anima at animaStyle{anima}
+\def\anima at defaultStyle{default}
+\ifx\anima at NameStyle\anima at animaStyle
+\tikzstyle{anima at themeBlock}=[
+draw = BlockColor,
+bottom color = BlockColor,
+top color    = BlockColor!50!anima at BoardColor,
+rounded corners=1.4pt
+]
+\else
+\tikzstyle{anima at themeBlock}=[
+draw,
+bottom color = BlockColor,
+top color    = BlockColor!50!anima at BoardColor
+]
+\fi
+}
+\newcommand{\animaColor}[1]{
+\def\anima at NameColor{#1}
+\def\anima at browntextColor{browntext}
+\def\anima at greenboardColor{greenboard}
+\def\anima at blackboardColor{blackboard}
+\def\anima at graytextColor{graytext}
+\def\anima at nfColor{nf}
+\def\anima at defaultColor{default}
+\ifx\anima at NameColor\anima at browntextColor
+\animaColorTheme
+{FFFFFF}{660907}{016BBF}
+{FF0000}{00FFFF}{FFD16A}
+\else\ifx\anima at NameColor\anima at greenboardColor
+\animaColorTheme
+{00542C}{FFFFFF}{2222FF}
+{FF3333}{00FF00}{FFFF00}
+\else\ifx\anima at NameColor\anima at blackboardColor
+\animaColorTheme
+{252B26}{FFFFFF}{2BA8D9}
+{F23030}{2EA662}{F28322}
+\else\ifx\anima at NameColor\anima at graytextColor
+\animaColorTheme
+{FFFFFF}{252B26}{2BA8D9}
+{F23030}{2EA662}{F28322}
+\else\ifx\anima at NameColor\anima at nfColor
+\animaColorTheme
+{252B26}{FFFFFF}{2BA8D9}
+{F23030}{2EA662}{EEEE44}%{F28322}
+\else
+\animaColorTheme%
+{FFFFFF}{000000}{0000FF}%
+{FF0000}{00FF00}{FFFF00}
+\fi\fi\fi\fi
+
+}
+
+\newcommand{\animaTheme}[1]{
+\def\anima at NameTheme{#1}
+\def\anima at defaultTheme{default}
+\def\anima at LTbarTheme{LTbar}
+\def\anima at planeTheme{plane}
+\ifx\anima at NameTheme\anima at LTbarTheme
+\renewcommand\animaBackgroud{
+\draw[dotted, opacity=.2,line width = .3pt] %
+({-\anima at BoardWidth},{-\anima at BoardHeight}) grid %
+({\anima at BoardWidth},{\anima at BoardHeight});
+\fill[
+anima at Color3,
+draw=anima at Color3!50!anima at BoardColor,
+opacity=.7]
+({-\anima at BoardWidth},{-\anima at BoardHeight}) rectangle
+({-0.7*\anima at BoardWidth},{\anima at BoardHeight});
+\fill[
+anima at Color3,
+draw=anima at Color3!50!anima at BoardColor,
+opacity=.5]
+({-\anima at BoardWidth+2.4},{\anima at BoardHeight}) rectangle
+({\anima at BoardWidth},{0.7*\anima at BoardHeight});
+\node at (-5,4.5) [anchor=north west]{\begin{minipage}{14cm}\color{anima at TextColor} \small
+\textbf{\@title}\vspace{-5pt}
+
+\@author
+\end{minipage}};
+}
+\else\ifx\anima at NameTheme\anima at planeTheme
+\renewcommand\animaBackgroud{}
+\else
+\renewcommand\animaBackgroud{
+\draw[dotted, opacity=.2,line width = .3pt] %
+({-\anima at BoardWidth},{-\anima at BoardHeight}) grid %
+({\anima at BoardWidth},{\anima at BoardHeight});
+}
+\fi\fi
+}
+
 \NewDocumentEnvironment{block}
-{+O{a} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
+{+O{animaPosBlock} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
 {
-\node[ draw,
-bottom color = anima at Color1,
-top color    = anima at Color1!50!anima at BoardColor,
+\colorlet{BlockColor}{anima at Color1}
+\node[
+anima at themeBlock,
 text width = {2*#3-0.25cm},
 node distance = 0.0cm,
 below = of {#1}, #4]
-(a) {\animaFormatTitle\vphantom{bq} #2};
+(animaPosBlock) {\animaFormatTitle\vphantom{Íq} #2};
 \node[ text width = {2*#3-0.25cm},
 node distance = 0.0cm,
-below = of a,#5]
-(a) {\animaFormatText #6};
+below = of animaPosBlock,#5]
+(animaPosBlock) {\animaFormatText #6};
 }{}
 
 \NewDocumentEnvironment{alertblock}
-{+O{a} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
+{+O{animaPosBlock} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
 {
-\node[ draw,
-bottom color = anima at Color2,
-top color    = anima at Color2!50!anima at BoardColor,
+\colorlet{BlockColor}{anima at Color2}
+\node[
+anima at themeBlock,
 text width = {2*#3-0.25cm},
 node distance = 0.0cm,
 below = of {#1}, #4]
-(a) {\animaFormatTitle\vphantom{bq} #2};
+(animaPosBlock) {\animaFormatTitle\vphantom{Íq} #2};
 \node[ text width = {2*#3-0.25cm},
 node distance = 0.0cm,
-below= of a,#5]
-(a) {\animaFormatText #6};
+below= of animaPosBlock,#5]
+(animaPosBlock) {\animaFormatText #6};
 }{}
 
 \NewDocumentEnvironment{exampleblock}
-{+O{a} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
+{+O{animaPosBlock} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
 {
-\node[ draw,
-bottom color = anima at Color3,
-top color    = anima at Color3!50!anima at BoardColor,
+\colorlet{BlockColor}{anima at Color3}
+\node[
+anima at themeBlock,
 text width = {2*#3-0.25cm},
 node distance = 0.0cm,
 below = of {#1}, #4]
-(a) {\animaFormatTitle\vphantom{bq} #2};
+(animaPosBlock) {\animaFormatTitle\vphantom{Íq} #2};
 \node[ text width = {2*#3-0.25cm},
 node distance = 0.0cm,
-below= of a,
+below= of animaPosBlock,
 #5]
-(a) {\animaFormatText #6};
+(animaPosBlock) {\animaFormatText #6};
 }{}
 
 \NewDocumentEnvironment{anotherblock}
-{+O{a} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
+{+O{animaPosBlock} +m +O{\anima at WhidthBlock} +O{} +O{} +b}
 {
-\node[draw,
-bottom color = anima at Color4,
-top color    = anima at Color4!50!anima at BoardColor,
+\colorlet{BlockColor}{anima at Color4}
+\node[
+anima at themeBlock,
 text width = {2*#3-0.25cm},
 node distance = 0.0cm,
 below = of {#1}, #4]
-(a) {\animaFormatTitle\vphantom{bq} #2};
+(animaPosBlock) {\animaFormatTitle\vphantom{Íq} #2};
 \node[ text width = {2*#3-0.25cm},
 node distance = 0.0cm,
-below= of a,
+below= of animaPosBlock,
 #5]
-(a) {\animaFormatText #6};
+(animaPosBlock) {\animaFormatText #6};
 }{}
 
 \NewDocumentEnvironment{notitleblock}
-{+O{a} +O{\anima at WhidthBlock} +O{} +b}
+{+O{animaPosBlock} +O{\anima at WhidthBlock} +O{} +b}
 {
-\node[ text width = {2*#2-0.25cm},
+\node[
+text width = {2*#2-0.25cm},
 node distance = 0.0cm,
-below= of a,
+below= of animaPosBlock,
 #3]
-(a) {\animaFormatText #4};
+(animaPosBlock) {\animaFormatText #4};
 }{}
 
 \newcommand{\animaExemplo}{\large



More information about the tex-live-commits mailing list.