答案1
“外部”问题被设置为\item[]
“内部”列表中的空白。以下使用新定义的question
环境和\subquestion
宏(用于上下文)实现了这一点:
\documentclass{article}
\usepackage{enumitem}
\usepackage{lipsum}
\NewDocumentEnvironment{question}{ +m }{%
\begin{enumerate}[label={\bfseries \arabic*.},ref=\arabic*]
\item
\begin{enumerate}[label={\alph*)},ref=\alph*]
\item[] {\bfseries #1}
}{
\end{enumerate}
\end{enumerate}
}
\NewDocumentCommand{\subquestion}{}{\item}
\begin{document}
\begin{question}
{\lipsum[1][1-3]}% Main question
\subquestion \lipsum[1][4-5]% sub-question
\subquestion \lipsum[1][6-7]% sub-question
\end{question}
\end{document}
答案2
答案3
也许我误解了 OP 的要求,但对我来说,他们似乎想要对内部和外部枚举的文本进行对齐。
\documentclass{article}
\usepackage{lipsum} % only for testing reasons
\usepackage{enumitem}
\newlength\oldlabelsep \setlength\oldlabelsep\labelsep % store old value
\newlength\mylength \setlength\mylength{0.7cm} % choose any length that suits you
\setlist{
itemindent=0cm,
leftmargin=\dimexpr\leftmargin+\mylength\relax,
labelsep=\dimexpr\labelsep+\mylength\relax,
}
\setlist[2]{ % adaptions only for level two
itemindent=\dimexpr\labelwidth\relax,
leftmargin=0cm,
labelsep=\oldlabelsep,
label=\alph*)
}
\def\longtext{This is a very very very very very very very very very long text for testing reasons.} % only for testing reasons
\begin{document}
\lipsum[2]
\begin{enumerate}
\item \longtext
\begin{enumerate}
\item\longtext
\item\longtext
\end{enumerate}
\item \longtext
\end{enumerate}
\lipsum[2]
\end{document}