我正在用 latex 写一篇多选题文本,但在识别方面遇到了一些问题。我成功地使用以下方法缩进了所有文本:
\begin{enumerate}
{\setlength\itemindent{15pt}\item[1)] Select one of the following:}
\vspace{0.2cm}
{\setlength\itemindent{32pt}\item[a)] This is the answer a), which
is not true unless you know it is.}
\itemsep0em
{\setlength\itemindent{32pt}\item[b)] This is the answer b), which
is not true unless you know it is.}
\itemsep0em
{\setlength\itemindent{32pt}\item[c)] This is the answer c), which
is not true unless you know it is.}
\itemsep0em
{\setlength\itemindent{32pt}\item[d)] This is the answer d), which
is not true unless you know it is.}
\itemsep0em
{\setlength\itemindent{32pt}\item[e)] This is the answer e), which
is not true unless you know it is.}
\end{enumerate}
最大的问题是,在标识字母之后,多项选择的每个可能答案的文本没有相对于字母缩进。换句话说,我得到:
a) This is the answer a), which
is not true unless you know it is.
而我真正想要的是:
a) This is the answer a), which
is not true unless you know it is.
有人知道怎么做吗?我搜索过以前的答案,但没有一个直接涉及枚举环境。
提前致谢!
答案1
你可能想看看enumitem
的文档。这将减少列表格式化的大量重复代码:
\documentclass{article}
\usepackage{enumitem}
\usepackage{lipsum}
\begin{document}
\setlist[enumerate]{noitemsep}
% uncomment the line below to align first-level enumerated lists along the
% left margin
% \setlist[enumerate,1]{leftmargin=*}
\setlist[enumerate,2]{label={\alph*}),leftmargin=0em}
% aligns second-level enumerated lists with the first-level enumerated lists
\lipsum[1]
\begin{enumerate}
\item Select one of the following:
\begin{enumerate}
\item This is the answer a), which is not true unless you know it is. This is
the answer a), which is not true unless you know it is.
\item This is the answer b), which is not true unless you know it is. This is
the answer b), which is not true unless you know it is.
\end{enumerate}
\end{enumerate}
\end{document}
答案2
为什么不像这样简单地嵌套枚举?
\documentclass{article}
\usepackage{enumitem} %% for fancy stuff like itemsep..
\begin{document}
\begin{enumerate}
\item{ Select one of the following:}
\begin{enumerate}[itemsep=0pt]
\item{This is the answer a), which is not true unless you know it is.}
\item{This is the answer b), which is not true unless you know it is is not true unless you know it is.}
\item{This is the answer c), which is not true unless you know it is.}
\item{This is the answer d), which is not true unless you know it is.}
\item{This is the answer e), which is not true unless you know it is.}
\end{enumerate}
\end{enumerate}
\end{document}