枚举的特殊格式

枚举的特殊格式

我该如何调整enumerate(或者其他什么?)才能在第一级枚举中实现固定宽度的插入标签。也就是说,我想要

This is some text before the list
\begin{enumerate}
\item This is an item on the first level and has a run-in label
\item This is an item on the first level and has a run-in label
  \begin{enumerate}
  \item This is an item on the second level and looks more familiar
  \item This is an item on the second level and looks more familiar
  \end{enumerate}

生产类似的东西(例如,在欧盟法规中很常见)

This is some text
before the list

(1)   This is an
item on the first
level and has a 
run-in label

(2)   This is an
item on the first
level and has a 
run-in label

a)  This is an item
    on the second 
    level and looks
    more familiar

b)  This is an item
    on the second 
    level and looks
    more familiar

答案1

也许是这样的(为了演示,边缘缩小了):

\documentclass{article}
\usepackage{enumitem}
\textwidth=1.5in
\begin{document}
\noindent This is some text before the list
\begin{enumerate}[itemindent=17pt, leftmargin=0pt, label=(\arabic*)]
\item This is an item on the first level and has a run-in label
\item This is an item on the first level and has a run-in label
  \begin{enumerate}[itemindent=0pt, labelsep=10pt, leftmargin=20pt,label=\alph*)]
  \item This is an item on the second level and looks more familiar
  \item This is an item on the second level and looks more familiar
  \end{enumerate}
\end{enumerate}
\end{document}

在此处输入图片描述

答案2

在此处输入图片描述

\documentclass{article}
\usepackage{enumitem}
\usepackage{showframe} % <---- remove in actual document.


\setlist[enumerate, 1]{label={(\arabic*)}, wide=0pt, widest=99, labelsep=15pt}
\setlist[enumerate, 2]{label={\alph*)}, align=left,labelsep=*}
\begin{document}

This is some text before the list. This is some text before the list. This is some text before the list. This is some text before the list. 
\begin{enumerate}
\item This is an item on the first level and has a run-in label This is an item on the first level and has a run-in label This is an item on the first level and has a run-in label This is an item on the first level and has a run-in label
\item This is an item on the first level and has a run-in label
  \begin{enumerate}
  \item This is an item on the second level and looks more familiar This is an item on the second level and looks more familiar This is an item on the second level and looks more familiar 
  \item This is an item on the second level and looks more familiar
  \end{enumerate}
\end{enumerate}
\end{document}

答案3

您可以通过 enumitem 包提供的许多选项进行这些自定义缩进,这是根据您的问题的 MWE:

% pdflatex

\documentclass{article}
\usepackage{enumitem}

\begin{document}
This is some text before the list
\begin{enumerate}[leftmargin = 0.25\textwidth, rightmargin = 0.25\textwidth]
\item This is an item on the first level and has a run-in label
\item This is an item on the first level and has a run-in label
\begin{enumerate}[ref=\arabic*]
\item This is an item on the second level and looks more familiar
\item This is an item on the second level and looks more familiar
\end{enumerate}
\end{enumerate}
\end{document}

在此处输入图片描述

相关内容