TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

\newcommand{\NoIndCmd}[1]{#1 \par\@afterindentfalse\@afterheading}    

Now compare the following two:

   Text ...

Some text ...


\NoIndCmd{Text ...}

Some text ...

For some reason, the environment definition works only if it is placed after a \section command; i.e.:


   Text ...

Some text ...

Could you please help me figure out what's wrong?

share|improve this question
Simply ending it with \par\noindent doesn't work? – Martin Scharrer Jul 17 '11 at 11:09
@Martin: Peculiarly, it does not work either! – M.S. Dousti Jul 17 '11 at 11:25
up vote 9 down vote accepted

The problem is that \@afterindentfalse\@afterheading are done inside a group, in the environment case. Solution: do them after the group has ended.

share|improve this answer
Thank you both for the question, and the answer: it is very useful and not that easy to find! – Jérémie May 1 '12 at 21:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.