I created a counter named foo to add up so money which I want to get from my boss. When having an itemize environment the counter is reset accidently. Does anyone know why or how to solve problem (so tell my what I am doing wrong ;-) )? I added comment lines to clear up what I want to do. Everytime I add a value of money, the sum is created.
\documentclass{scrbook}
%\usepackage{eurosym}
%\newcommand{\eu}[1]{\advance\foo by #1 \EUR{#1}}
\begin{document}
Create Counter: \newcount\foo
Give counter: \the\foo
Increase by three: \advance\foo by 3
Give result: \the\foo
\begin{itemize}
\item Increase by seven: \advance\foo by 7
%\item \eu{7}
\item Give result: \the\foo
\end{itemize}
Give result: \the\foo
\end{document}
The PDF looks like:
Create Counter:
Give counter: 0
Increase by three:
Give result: 3
• Increase by seven:
• Give result: 10
Give result: 3
I use texniccenter with Miktex 2.9 on a Win7 64 machine.
\global
. Usingexpl3
gives you some more options.