使用 enumitem 和 enumerate 对自定义标签进行自动编号和留空

使用 enumitem 和 enumerate 对自定义标签进行自动编号和留空

如果可能的话,我想让自动编号在自定义标签后继续?我试过了setcounter{enumi},但我不知道如何获取最后一个自动编号,然后在其上加一。

如果可能的话,我还希望单个自定义标签与所有其他标签对齐。

\documentclass[oneside,12pt]{scrartcl}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage{refcount}
\usepackage{enumitem}

\begin{document}

\lipsum[66]

\begin{enumerate}[label=\textbf{Step \arabic*}:]
\addtolength{\itemindent}{1.65cm}

\item I like a clean look so I aligned Step 1 with the text.  This is what I want with all my steps.

\item [\textbf{Step 2 a)}:] I can manually put in Step 2 a): but how do I get it to align with Step 1 and the other steps?

%\setcounter{enumi}{2} Not sure how to set this dynamically

\item I really want this to be Step 3 without having to hardcode in Step 3 because I have a bunch more steps that I just want to be auto numbered.

\item \lipsum[66] % Should be step 4

\end{enumerate}

\end{document}

自定义标签的对齐

答案1

\documentclass[oneside,12pt]{scrartcl}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage{refcount}
\usepackage{enumitem}
\SetLabelAlign{step}{\bfseries Step #1:\hfil}
\begin{document}

\lipsum[66]

\begin{enumerate}[label=\arabic*,align=step,itemindent=\leftmargini]

\item I like a clean look so I aligned Step 1 with the text.  This is what I want with all my steps.

\stepcounter{enumi}
\item [\theenumi{} a)] I can manually put in Step 2 a): but how do I get it to align with Step 1 and the other steps?

 Not sure how to set this dynamically

\item I really want this to be Step 3 without having to hardcode in Step 3 because I have a bunch more steps that I just want to be auto numbered.

\item \lipsum[66] % Should be step 4

\end{enumerate}

\end{document}

在此处输入图片描述

相关内容