答案1
下面是使用 的解决方案tcolorbox
。
我首先创建了一个新列表,其中包含要包含的myenumerate
包,并在每个级别进行编号,枚举标签后面使用白色背景(使用)。enumitem
\Alph
\alph
\roman
\colorbox{white}
tcolorbox
然后它被一个可破坏的通孔包围\tcolorboxenvironment
,其左边界线由钥匙定义borderline west
。
最终结果如下:
以下是完整代码:
\documentclass{article}
\usepackage{blindtext}
\usepackage[many]{tcolorbox}
\usepackage{enumitem}
\newlist{myenumerate}{enumerate}{3}
\setlist[myenumerate,1]{label=\colorbox{white}{\Alph*.}}
\setlist[myenumerate,2]{label=\colorbox{white}{\alph*.}}
\setlist[myenumerate,3]{label=\colorbox{white}{\roman*.}}
\tcolorboxenvironment{myenumerate}{blanker, breakable, before skip=6pt, after skip=6pt, borderline west={.6pt}{12pt}{gray!55}}
\begin{document}
Some text. \blindtext
\begin{myenumerate}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\begin{myenumerate}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\begin{myenumerate}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\end{myenumerate}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\end{myenumerate}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\end{myenumerate}
More text. \blindtext
\end{document}
由于您还提到了项目之间的距离(即拉伸),以下版本可能更适合您:
\newlist{myenumerate}{enumerate}{3}
\setlist[myenumerate,1]{label=\colorbox{white}{\Alph*.}, itemsep=.5\baselineskip}
\setlist[myenumerate,2]{label=\colorbox{white}{\alph*.}, itemsep=0pt}
\setlist[myenumerate,3]{label=\colorbox{white}{\roman*.}, itemsep=0pt}
\tcolorboxenvironment{myenumerate}{blanker, breakable, before skip=\baselineskip, after skip=\baselineskip, borderline west={.4pt}{12pt}{gray!55}}
其结果如下: