[texhax] Reference counter turns out to be too big by 1.
Herbert Voss
Herbert.Voss at FU-Berlin.DE
Thu Aug 31 08:54:18 CEST 2017
Am 31.08.2017 um 07:10 schrieb Rolf Turner:
>
> I have defined a new numbered environment and counter by which to number
> instances of that environment. When I label such instances and refer to
> the labels, I get values of the counter that are too big by 1.
>
> I have attached a reproducible example. I get Zorch II, Zorch III and
> Zorch IV where I should get Zorch I, Zorch II and Zorch III.
>
> I'm sure that there's a simple explanation and fix, but I can't see what
> these might be.
\newcounter{Zorch}
\setcounter{Zorch}{0}
\renewcommand{\theZorch}{\Roman{Zorch}}
\newenvironment{Zorch}{%
\refstepcounter{Zorch}%
\section*{Zorch \theZorch}%
}{}
Herbert
More information about the texhax
mailing list