I'm trying to define an environment/command, with the following property: The immediate paragraph after the environment must not be indented. The following shows my attempt at defining such environment/command:
\makeatletter
\newenvironment{NoIndEnv}{}{\par\@afterindentfalse\@afterheading}
\newcommand{\NoIndCmd}[1]{#1 \par\@afterindentfalse\@afterheading}
\makeatother
Now compare the following two:
\begin{NoIndEnv}
Text ...
\end{NoIndEnv}
Some text ...
and
\NoIndCmd{Text ...}
Some text ...
For some reason, the environment definition works only if it is placed after a \section
command; i.e.:
\section{}
\begin{NoIndEnv}
Text ...
\end{NoIndEnv}
Some text ...
Could you please help me figure out what's wrong?
\par\noindent
doesn't work?\par\noindent
can only work if there's no empty line (that means\par
) afterward.