我试图让我的 LaTeX 文档仅在方程式后缩进。其他情况(包括段落块的任何行)均不缩进。
这是一个包含多行的段落块,我不想缩进任何行。
方程 1
仅公式后的第一行需要缩进。如果此块有多行,则第一行后无需缩进。
感谢您的帮助!
編輯:
抱歉,我是这个网站的新手。这是我创建的示例。希望我清楚地解决了我的问题。如有不便,敬请谅解。
\documentclass[12pt]{article}
\setlength\parskip{12pt}
\begin{document}
I need help on this problem: indentation only after equation. For example, this is a paragraph not directly following an equation. Then it has no indentation to any of its lines.
\begin{equation}
a = b+c
\end{equation}
This sentence directly follows an equation. Indentation is needed for the first line, only.
\begin{equation}
a = b*c
\end{equation}
This sentence starts a new paragraph, though directly follow an equation but no indentation for first line. Thanks.
Then I start a new paragraph. This paragraph, again, doesn't directly follow an equation. No indentation need.
I read an answer talking about blank line after equation. I understand this case. If I suppress a blank line after equation, it could give me indentation after equation. But it also gives me indentation of first line of every paragraph, which is not I wish to do.
I have a silly solution that just add indent command to every sentence I want it indented. My question is could I have a worldwide solution? Thanks very much.
\end{document}
答案1
这是一个非常奇怪的要求。但为什么不呢?您已设置\parskip
为 12pt,因此段落可以通过这个水平空间看到。您可以将以下三行添加到您的序言中:
\parindent=0pt
\everydisplay={\aftergroup\specindent}
\def\specindent{\global\hangindent=2em \global\hangafter=-1 \global\prevgraf=0 }