答案1
如果我理解正确的话,你想要:
- 让你的枚举从 0 开始,而不是从 1 开始;
- 枚举的标签(至少两个级别)以括号结尾;
- 有嵌套的数字
我提供了下面的代码,这里有些注释:
- 使用包
enumitem
自定义列表 - 该
setlist
指令允许第一层从 0 开始 - renewcommand 应用括号和“嵌套编号”。
以下是具体内容:
\documentclass{article}
\usepackage[utf8]{inputenc}
%enumitem will manage the enumerations
\usepackage{enumitem}
% tells that the enumeration of level 1 (outermost) should start at 0
\setlist[enumerate,1]{start=0}
% sets the label for the second level of the enumeration to its counter value
\renewcommand{\labelenumii}{\theenumii}
% set the value of the second level counter representation as
% 1st level counter followed by "."
% followed by the arabic number of the 2nd level,
% followed by ")" e.g. 2.1)
\renewcommand{\theenumii}{\theenumi.\arabic{enumii})}
% sets the label for the first level of the enumeration to its value followed by ")"
\renewcommand{\labelenumi}{\theenumi)}
\begin{document}
\begin{enumerate}
\item Use SatNav
\item Select new destination
\begin{enumerate}
\item Chose Postcode
\item Chose City
\item chose Previous Destination
\end{enumerate}
\item Chose Mode
\end{enumerate}
\end{document}
答案2
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[start=0]
\item Use SatNav
\item Select new destination
\begin{enumerate}[label*=\arabic*.]
\item Chose Postcode
\item Chose City
\item chose Previous Destination
\end{enumerate}
\item Chose Mode
\end{enumerate}
\end{document}
如果您要使用具有合法样式的大量嵌套列表,请在序言中写入类似以下内容:
\newlist{legal}{enumerate}{5}
\setlist[legal]{label*=\arabic*.}
然后您可以使用不带可选参数的环境legal
(即\begin{legal} \item text ... \end{legal}
)。