![使用 enumitem 和 enumerate 对自定义标签进行自动编号和留空](https://linux22.com/image/377633/%E4%BD%BF%E7%94%A8%20enumitem%20%E5%92%8C%20enumerate%20%E5%AF%B9%E8%87%AA%E5%AE%9A%E4%B9%89%E6%A0%87%E7%AD%BE%E8%BF%9B%E8%A1%8C%E8%87%AA%E5%8A%A8%E7%BC%96%E5%8F%B7%E5%92%8C%E7%95%99%E7%A9%BA.png)
如果可能的话,我想让自动编号在自定义标签后继续?我试过了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}