Continuous list enumeration throughout the document with LaTeX
Karolina asked me today to create a macro for having a continuous list enumeration throughout the whole document, i.e.
This is the first list:
- Item;
- Another item;
And here goes the second list:
- Third item;
- And yet another item.
You can obtain an effect like that by using LaTeX counters and a custom definition of your own enumerate environment. First, we need to \usepackage{enumerate}
, and then define the following counter and an environment in the preamble:
\newcounter{enumi_saved}
\newenvironment{myenumerate} {
\begin{enumerate}\setcounter{enumi}{\value{enumi_saved}}}
{\setcounter{enumi_saved}{\value{enumi}}\end{enumerate}}
After that, you can use myenumerate
and you’ll have a continuous enumeration in the whole document.
Oh and some credits: I wouldn’t come up with a solution if I haven’t read this post, and this website. Huge thanks to the authors for their tips!