如何让 \maketitle 后不出现缩进?

如何让 \maketitle 后不出现缩进?

默认情况下,从 开始的段落\maketitle将缩进。但是,我不需要 之后的缩进\maketitle

有人能建议我们如何在模板中控制这一点吗?我已附上屏幕截图供您参考

在此处输入图片描述

\documentclass{article}

\begin{document}

\title{Title page}

\author{Author name}

\maketitle

This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.

This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.

\end{document}

答案1

在您的示例中,以下内容有效。但是,如果您使用 titlepage 选项,它将失败。我也没有对每个类进行测试...

\documentclass{article}

\usepackage{etoolbox}
\makeatletter
\appto\@maketitle{\aftergroup\@afterindentfalse\aftergroup\@afterheading}
\makeatother
\begin{document}

\title{Title page}

\author{Author name}

\maketitle

This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.

This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.

\end{document}

在此处输入图片描述

答案2

您可以\noindent在 之后的第一个段落之前使用\maketitle。此方法不需要额外的包,并且它应该适用于几乎任何文档类,即任何不修改 含义的文档类\noindent

在此处输入图片描述

\documentclass{article}
\begin{document}

\title{Title page}
\author{Author name} 
\maketitle

\noindent  % insert this instruction before the first text paragraph
This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.

This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.
This is a sample text. This is a sample text. This is a sample text. This is a sample text.

\end{document}

答案3

或者你可以插入

\parindent 0 pt 

在你的序言中

相关内容