Controles alineados y los controles no funcionan en tikz

Controles alineados y los controles no funcionan en tikz

Estoy intentando usar controlsalignedy mostrar solo los play,stop,stepbotones en los controladores. Aquí está el código que estoy usando.

 \documentclass[12pt]{article}
    \usepackage{tikz}
    \usepackage[utf8]{inputenc}
    \usepackage{xcolor}
    \definecolor{lava}{rgb}{0.81, 0.06, 0.13}
    \definecolor{myblue}{rgb}{0.0, 0.30, 0.60}
    \usepackage{gensymb}
    \usetikzlibrary{shapes}
    \usepgflibrary{shapes.symbols}
    \usetikzlibrary{mindmap,trees,arrows,shapes.symbols,shapes.misc}
    \usepackage[ampersand]{easylist}
    \usepackage{lmodern}  
    \pagestyle{empty}
    \usetikzlibrary{decorations.markings}
    \usepackage{ifthen}
\usepackage{animate}  
   \newcounter{angle}
\setcounter{angle}{0}
\begin{document}
\begin{center}
  \begin{animateinline}[loop, poster = first,controls={[play,stop,speed]},controlsaligned=right+-4em]
\whiledo{\theangle<359}{
\vspace{-1em}
    \begin{tikzpicture}[scale=0.9]    
    % Axis
    \draw[thick,->,black] (-3,0)--(3,0) node[below] {$\Re$}; % x axis
    \draw[thick,->,black] (0,-3)--(0,3) node[left] {$\Im$}; % y axis
    \draw[black,thick] (0,0) circle (2.5cm);
    \node[black,below] at (2.6,0) {$V_m$};
    \node[black,above] at (0.1,-2.5) {$V_m$};
    %
    \draw[ultra thick,lava] (0,0) -- (0,0 |- \theangle:2.5cm); % UpOn x axis
    \draw[ultra thick,myblue] (0,0) -- (\theangle:2.5cm |- 0,0); % UpOn y axis
    %
    \draw[densely dotted,lava] (\theangle:2.5cm) -- (\theangle:2.5cm |- 0,0); % vertical line
    \draw[densely dotted,myblue] (\theangle:2.5cm) -- (0,0 |- \theangle:2.5cm); % horizontal line
    \draw[ultra thick,black,->,rotate=\theangle] (0,0) -- (2.5,0); 
    \node[red,myblue,right] at (0,-3.1) 
            {\footnotesize$\cos(\theangle^{\degree}) = \pgfmathcos{\theangle}\pgfmathresult$};
    \node[lava,lava,right] at (0,-3.5) 
            {\footnotesize$\sin(\theangle^{\degree}) = \pgfmathsin{\theangle}\pgfmathresult$};
    \end{tikzpicture}
    %
    \stepcounter{angle}
    \ifthenelse{\theangle<359}{
            \newframe
    }{
    
            \end{animateinline}
    }
}
\end{center}
\end{document}

El error es

​! Número faltante, tratado como cero.

Respuesta1

Hay algunos errores sintácticos en el código: [y ]alrededor play,stop,speedson incorrectos y falta el argumento de velocidad de fotogramas en el animateinlineentorno.

Además, el código utiliza un \whiledobucle alrededor de marcos parametrizados, lo cual es una práctica obsoleta. Úselo \multiframeen su lugar.

Para evitar que la animación en ejecución se mueva, se coloca un nodo invisible tikzpicturepara empujar un poco el borde derecho del cuadro delimitador. Esto asegura que todos los marcos tengan el mismo tamaño.

Tenga en cuenta que las dimensiones negativas utilizadas controlsalignedhacen que los controles sobresalgan fuera del widget de animación. No estoy seguro si esta es tu intención. (Lo eliminé en el código siguiente).

\documentclass[12pt]{article}

\usepackage{tikz}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}  
\usepackage{lmodern}  
\definecolor{lava}{rgb}{0.81, 0.06, 0.13}
\definecolor{myblue}{rgb}{0.0, 0.30, 0.60}
\usepackage{gensymb}
\pagestyle{empty}
\usepackage{animate}   
    
\begin{document}
\begin{center}
\begin{animateinline}[loop, poster = first,controls={play,stop,speed},controlsaligned=right]{30}
  \multiframe{360}{iAngle=0+1}{
    \begin{tikzpicture}[scale=0.9]
    \node at (3.9,0) {}; % push right bounding box border somewhat 
    % Axis
    \draw[thick,->] (-3,0) -- (3,0) node[right] {$\Re$}; % x axis
    \draw[thick,->] (0,-3)--(0,3) node[left] {$\Im$}; % y axis
    \draw[black,thick] (0,0) circle (2.5cm);
    \node[black,below] at (2.6,0) {$V_m$};
    \node[black,above] at (0.1,-2.5) {$V_m$};
    %
    \draw[ultra thick,lava] (0,0) -- (0,0 |- \iAngle:2.5cm); % UpOn x axis
    \draw[ultra thick,myblue] (0,0) -- (\iAngle:2.5cm |- 0,0); % UpOn y axis
    %
    \draw[densely dotted,lava] (\iAngle:2.5cm) -- (\iAngle:2.5cm |- 0,0); % vertical line
    \draw[densely dotted,myblue] (\iAngle:2.5cm) -- (0,0 |- \iAngle:2.5cm); % horizontal line
    \draw[ultra thick,black,->,rotate=\iAngle] (0,0) -- (2.5,0);
    \node[red,myblue,right] at (0,-3.1)
            {\footnotesize$\cos(\iAngle^{\degree}) = \pgfmathcos{\iAngle}\pgfmathresult$};
    \node[lava,lava,right] at (0,-3.5)
            {\footnotesize$\sin(\iAngle^{\degree}) = \pgfmathsin{\iAngle}\pgfmathresult$};
    \end{tikzpicture}
  }
\end{animateinline}
\end{center}
\end{document}

información relacionada