Skip to content

Getting enumi counter outside of enumerate #56

@lennartack

Description

@lennartack

It usually works to get the number of the last item using \theenumi. But it fails in the following example:

\documentclass{article}

\usepackage{enumitem}

\begin{document}

\begin{enumerate}
  \item One
  \item Two
\end{enumerate}

\begin{enumerate}[resume*]
  \item[(2')] Another Two
\end{enumerate}

\theenumi

\begin{enumerate}[resume*]
  \item Three
\end{enumerate}

\end{document}

Where \theenumi outputs 0, even though the next enumerate resumes at 3.

Relatedly, it would be nice if enumi could support incrementing the counter outside of enumerate environments. For example:

\documentclass{article}

\usepackage{enumitem}

\begin{document}

\begin{enumerate}
  \item One
\end{enumerate}

\stepcounter{enumi}

\begin{enumerate}[resume*]
  \item Three
\end{enumerate}
\end{document}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions