Yes, something like this. The exact way depends on the requirements, but here's a way for summarizing counters also over several environments.hugovdberg wrote: When defining a new environment you should probably use\addtocounter
and not\setcounter
in case you want to use two lists which total to the same counter.
Code: Select all
\documentclass{article}
\usepackage{totcount}
\newtotcounter{Nature}
\newtotcounter{Other}
\newcommand{\currentcountername}{}
\newenvironment{totenumerate}[2][0]{%
\renewcommand{\currentcountername}{#2}
\setcounter{\currentcountername}{#1}%
\enumerate}{%
\endenumerate%
\addtocounter{\currentcountername}{\value{enumi}}
}
\begin{document}
\noindent The total number will be \total{Nature},
the number together with all others is \total{Other}.
\begin{totenumerate}{Nature}
\item{First item}
\item{Second item}
\item{Third item}
\item{Fourth item}
\end{totenumerate}
More to follow:
\begin{totenumerate}[\value{Nature}]{Other}
\item{First other item}
\item{Second other item}
\end{totenumerate}
\end{document}