I have created a counter to count enclosures:
\newcounter{enclosure}{0}
At the bottom of each enclosure I put:
\addtocounter{enclosure}{1}\vfill\hfill\Enclosure \arabic{enclosure}\clearpage
And that works perfectly.
However, at the page before the enclosures I need to put this at the bottom (if there are three enclosures):
ENCLOSURES (3)
I would like to make the value in the parenthesis reflect the last value of the enclosure
counter. I've tried \ref
and \label
but that grabs the section counter, not these counters.
Here is a complete example:
\documentclass[10pt]{article}
\begin{document}
\newcounter{enclosure}
\noindent
Total Enclosures: \\
\stepcounter{enclosure} Enclosure \arabic{enclosure}\\
\stepcounter{enclosure} Enclosure \arabic{enclosure}\\
\stepcounter{enclosure} Enclosure \arabic{enclosure}\\
\stepcounter{enclosure} Enclosure \arabic{enclosure}\\
Total Enclosures: \arabic{enclosure}
\end{document}
I want the Total Enclosures to be the same at the top as the bottom.
Thanks.
.aux
file, and then read it. Once implemented, it'll need two runs to get it right. You can see examples of this in a few different packages, for example thelastpage
package\ref
and\label
...