enumitem 计数器范围问题

enumitem 计数器范围问题

mdframe 阻止全局计数。我该如何解决这个问题?

在此处输入图片描述

\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

对于这种全局恢复,最好使用series列表的键,然后使用resume=...来恢复它:

\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}

代码输出

相关内容