I try to put a colored bar on the bottom of each frame of a Beamer document the lenght of which increases during the presentation. I wrote the following code:
\setbeamertemplate{footline}{%
\leavevmode%
\hbox{%
\begin{tikzpicture}
\draw[-, ultra thick, yellow!50!green] (0,0) -- (\paperwidth*\value{framenumber}/\total,0) ;
\end{tikzpicture}
}
}
and its works well, but the \total
command is the total number of frames which I previousely manually defined (I need it because I want the bar to reach the right side of the screen at the last frame). If I can get the current frame number with \value{framenumber}
, I do not find an equivalent command to get the value of the total frame number. I would like to know if there exists a solution (I think it is possible since \inserttotalframenumber
can print it, but I do not know how it really works to calculate it since it does not seem to be related to some counter "totalframenumber
"...).
.aux
is used for this.\immediate\write\@auxout{\string\@writefile{nav}% {\noexpand\headcommand{\noexpand\gdef\noexpand\inserttotalframenumber{\the\c@framenumber}}}}
so\inserttotalframenumber
just is\the\c@framenumber
i.e. the value of the counterframenumber
at the end of the previous compilation (or1
by default).\inserttotalframenumber
normally works fine. Can you show a Mwe in which you face a problem?\value{\inserttotalframenumber}
" or "\arabic{\inserttotalframenumber}
" but it seems that I was so convinced that\inserttotalframenumber
would not work alone at a number value that I had not even tried it... It is done now, and it perfectly works.