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: Sat Aug 24 02:00:37 CEST 2019 ; file is: 56.489224537037 days old
contact webmaster _at_ TeXnik.de