如何删除枚举环境中非项目文本的缩进?

如何删除枚举环境中非项目文本的缩进?

我正在使用enumerate环境制作一个编号列表。我想写一段作为下一项的信息。我想删除这段文字的缩进,这样它的缩进量就和列表中的数字一样多。我该怎么做?

这基本上就是我所做的。我尝试过\noindent,但没有成功。

\documentclass{book}

\begin{document}
\section*{Exercises}

Here are some exercises.

\begin{enumerate}
    \item This is the first exercise.
    \item This is the second exercise.

    Here is some information to answer the questions below. This paragraph
    should be indented just as much as the numbers in the list are.

    \item This is the third exercise.
    \item This is the fourth exercise.
\end{enumerate}
\end{document}

输出为:

在此处输入图片描述

答案1

以下是使用该包的解决方案enumitem:它具有resume可选参数和series枚举环境的概念。因此,我定义了一个quest系列和一个inform系列,它们的格式使得通知系列左边缘恰好是任务系列标签的开始位置。

这些信息可以由几个段落组成。我不知道您是否希望第一个段落之后的段落缩进。在我的代码中,它们是缩进的;如果您不想要这种缩进,只需删除listparindent=\parindent

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{enumitem}

\begin{document}
\section*{Exercises}

Here are some exercises. Here are some exercises. Here are some exercises. Here are some exercises. Here are some exercises.

\begin{enumerate}[labelindent =\parindent, align = left, labelwidth =1em, leftmargin =! , labelsep =0.2 em, series = quest]
    \item This is the first exercise. Quite a very very long exercise, with many questions and many more subquestions.
    \item This is the second exercise.
\end{enumerate}

\begin{enumerate}[series = inform, leftmargin =\parindent, labelwidth =0pt, listparindent = \parindent]
\item[] Here is some information to answer the questions below. This paragraph
    is indented just as much as the numbers in the list are.

    Here is another information to answer the questions below. This paragraph is indented just as much as the numbers in the list are.
\end{enumerate}

\begin{enumerate}[resume* = quest]%
    \item This is the third exercise.
    \item This is the fourth exercise.
\end{enumerate}

\begin{enumerate}[resume*= inform]
\item[] Here is some more information to answer further questions below. This paragraph
    is indented just as much as the numbers in the list are.
\end{enumerate}

\end{document} 

在此处输入图片描述

相关内容