TeXnik - Tips TeX and LaTeX


Welcome to the TeXnik website (under construction)

Enumerate without Reset
TUG logo

Main page

Index
UK FAQ
Documentation
Software
CTAN
Search CTAN:

Statistics

Google c.t.t.

Google d.c.t.t.

 


 


The counting of an enumerate environment is reset after any other environment. With the following command in LaTeX preamble you get an absolute counting without resetting:
\newcounter{myEnumCounter}
\newcounter{mySaveCounter}
\renewenvironment{enumerate}{%
  \begin{list}{\arabic{myEnumCounter}.}{\usecounter{myEnumCounter}%
  \setcounter{myEnumCounter}{\value{mySaveCounter}}}
  }{%
  \setcounter{mySaveCounter}{\value{myEnumCounter}}\end{list}%
}
\newcommand\myEnumReset{\setcounter{mySaveCounter}{0}}
The old enumerate environment is redefined, so you need no special command to start continuing counting. With the command \myEnumReset you can Reset the couter at any place in the text.

local time: Thu Apr 25 01:41:34 CEST 2024 ; file is: 1762.47599537037 days old
contact webmaster _at_ TeXnik.de