如何禁用LaTeX中特定部分的缩进?

时间:2010-11-01 22:38:00

标签: latex indentation

我只需要在我的文档的一个部分中禁用缩进(子部分,具体而言)。我怎么能这样做?

默认缩进由indentfirst包提供。

3 个答案:

答案 0 :(得分:21)

这取决于你想要根除缩进的普遍程度。但我要尝试的第一件事就是将\parindent设置为0pt

Some text with normal indentation...

{\parindent0pt % disables indentation for all the text between { and }

Text with no indentation.

Still no indentation.

}% restore indentation

Indented again.

答案 1 :(得分:6)

设置缩进的环境可能是一种可能的解决方案吗?您可以在序言中定义它:

\newlength\mystoreparindent
\newenvironment{myparindent}[1]{%
\setlength{\mystoreparindent}{\the\parindent}
\setlength{\parindent}{#1}
}{%
\setlength{\parindent}{\mystoreparindent}
}

在您的文档中,您将编写如下内容:

\begin{myparindent}{0pt}
This paragraph is not indented, ehm well, actually it is indented by 0pt
which is the same as not indented.

And this paragraph neither\ldots
\end{myparindent}

或者如果你想要一个大段缩进

\begin{myparindent}{5cm}
The first line of this paragraph is indented by 5 cm.

And so is the first line of the next paragraph.
\end{myparindent}

答案 2 :(得分:3)

\ noindent我认为是你想要的。