3

An mdframe blocks global counting. How can I resolve this?

enter image description here

\documentclass{article}

\usepackage{enumitem,mdframed}

\begin{document}

\begin{enumerate}
\item This should have a numeral of one.
\end{enumerate}

\begin{mdframed}

\begin{enumerate}[resume]
\item This should have a numeral of two.
\end{enumerate}

\end{mdframed}

\begin{enumerate}[resume]
\item This should have a numeral of three.
\end{enumerate}

\end{document}
1
  • 2
    see the documentation. Below resume it says "This is done locally. If you want global resuming, see next section on series." Apr 19, 2023 at 17:38

1 Answer 1

5

For this kind of global resume, it's best to use the series key for the list and then use resume=... to resume it:

\documentclass{article}

\usepackage{enumitem,mdframed}

\begin{document}

\begin{enumerate}[series=mylist]
\item This should have a numeral of one.
\end{enumerate}

\begin{mdframed}

\begin{enumerate}[resume=mylist]
\item This should have a numeral of two.
\end{enumerate}

\end{mdframed}

\begin{enumerate}[resume=mylist]
\item This should have a numeral of three.
\end{enumerate}

\end{document}

output of code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .