I'm learning the basics of the animate package. In a simple image I want to insert a counter that represents the time. Here there is the code I've used.
\documentclass[12pt]{article}
\usepackage[italian]{babel}
\usepackage{tikz}
\usepackage[controls]{animate}
%=====================
\begin{document}
%=====================
\begin{figure}
\begin{animateinline}
[
loop,
controls,
begin={
\begin{tikzpicture}
\useasboundingbox (-3,-3) rectangle (10, 5);
},
end={\end{tikzpicture}}
]{10}
\multiframe {40}{n=0+0.05} % andata
{
\draw[very thick](-2,0) -- (-1,0); %linee
\draw[very thick](-2,2) -- (-1,2);
%
\draw[->,very thick](0,0) -- (9,0); %assi
\draw[->,very thick](0,-2) -- (0,4);
\filldraw [red] (-1.5,0+\n) circle (1pt) ; %fotone
\draw[dashed,red] (-1.5,0+\n)--(0+\n,0+\n); %proiezione
\draw [thick,red] (0,0)--(0+\n,0+\n); %grafico
%%counter
\node [thick, black] at (1,-1){$t=$};
\node [thick, black] at (2,-1){$\n$};
}
%
\multiframe {40}{n=0+0.05} %ritorno
{
\draw[very thick](-2,0) -- (-1,0); %linee
\draw[very thick](-2,2) -- (-1,2);
%
\draw[->,very thick](0,0) -- (9,0); %assi
\draw[->,very thick](0,-2) -- (0,4);
\draw [red] (0,0)--(2,2);
\filldraw [blue] (-1.5,2-\n) circle (1pt) ; %fotone
\draw[dashed,blue] (-1.5,2-\n)--(2+\n,2-\n); %proiezione
\draw [thick,blue] (2,2)--(2+\n,2-\n); % grafico
}
\end{animateinline}
%
\end{figure}
%======================
\end{document}
%======================
With this solution the digits of the number that represents the time change all at any frame, giving a fastidious effect of blink that it is also difficult to read. So my question is: there is some way to have a counter that change only the changing digit, as in a digital timer?