如何继续第二级列表

如何继续第二级列表

我被要求编写一个包含列表的文档,并在列表项之间以及列表第二级的列表项之间添加一些标准(或其他)格式的文本。我尝试series在第二级命名,但这没有帮助,因为下面列表的第三部分只会在第一级恢复。请参阅代码中的注释。提供序言是为了方便您。

\documentclass{article}

\usepackage[a4paper, margin=2.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\parindent0pt
\usepackage{lipsum}

\usepackage{enumitem}

\begin{document}

\begin{enumerate}
    \item first
    \begin{enumerate}
        \item first of first
        \item second of first
    \end{enumerate}
\end{enumerate} % all is well

\lipsum[1]

\begin{enumerate}[resume] % this resumes the list on the first level as intended
    \item second
    \begin{enumerate}
        \item first of second
        \item second of second
    \end{enumerate}
\end{enumerate}

\lipsum[42]

\begin{enumerate}[resume] % I'd like the list to resume on the second level
    \item third of second
\end{enumerate}

\end{document}

我到目前为止已经尝试过的(但对我来说不起作用):

\begin{enumerate}[resume]
    \begin{enumerate}[resume]
        \item third of second
    \end{enumerate}
\end{enumerate}

\begin{enumerate}[resume]
    \item second
    \begin{enumerate}[series=mylist]
        \item first of second
        \item second of second
    \end{enumerate}
\end{enumerate}

and then some text to fill the gaps 

\begin{enumerate}[resume=mylist]
    \item third of second
\end{enumerate}

some other screwed up chaotic things ;)

答案1

您需要第一级,至少带有一个空标签:

\documentclass{article}

\usepackage[a4paper, margin=2.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\parindent0pt
\usepackage{lipsum}

\usepackage{enumitem}

\begin{document}

\begin{enumerate}
    \item first
    \begin{enumerate}
        \item first of first
        \item second of first
    \end{enumerate}
\end{enumerate} % all is well

\lipsum[1]

\begin{enumerate}[resume] % this resumes the list on the first level as intended
    \item second \label{enum:second}
    \begin{enumerate}[series=mylist]
        \item first of second 
        \item second of second
    \end{enumerate}
\end{enumerate}

\lipsum[42]

\begin{enumerate} % I'd like the list to resume on the second level
 \item[\ref{enum:second}.\rlap{ (cont.)}]~
    \begin{enumerate}[resume=mylist]
     \item third of second
    \end{enumerate}
\end{enumerate}

some text 
\begin{enumerate} % I'd like the list to resume on the second level
 \item[]
    \begin{enumerate}[resume=mylist]
     \item fourth of second
    \end{enumerate}
\end{enumerate}


\end{document}

在此处输入图片描述

相关内容