# What is the logic behind \@afterindentfalse when \@tempskipa <\z@?

I am just looking to confirm what I suspect. Was this programmed to make any negative :

• have no vertical effect because nobody in their right mind would want overlapping text?
• Therefore disable indent in inline headings?

If there is more to add, please do! If I am wrong, please tell the real story behind this.

In the source2e document, the \@startsection has this code to deal with indentation on the line directly following a heading.

\@tempskipa #4\relax
\@afterindenttrue
\ifdim \@tempskipa <\z@
\@tempskipa -\@tempskipa \@afterindentfalse
\fi

• The fourth argument to \@startsection is overloaded: a negative value means “no indentation in the paragraph following the title”, but the space is the absolute value. – egreg Mar 2 '17 at 7:19
• You can also have a look at ltsect.dtx, which might---or might not---be helpful. – Johannes_B Mar 2 '17 at 7:25

In source2e (or its component ltsect.dtx) you find this documented as

 \begin{macro}{\@startsection}

The |\@startsection{|\meta{name}|}{|\meta{level}|}{|%
\meta{indent}|}{|\meta{beforeskip}|}|\\
command is the mother of all the user level sectioning commands.
The part after the |*|, including the |*| is optional.

\begin{description}
\item[name:] e.g., 'subsection'
\item[level:] a number, denoting depth of section -- e.g.,
chapter = 0, section = 1, etc.
\item[indent:] Indentation of heading from left margin
If negative, then paragraph indent of text following
\item[style:] Commands to set style. Since June 1996 release the
\emph{last} command in this argument may be a command
such as |\MakeUppercase| or |\fbox| that takes an
argument. The section heading will be supplied as the
argument to this command. So setting |#6| to, say,
|\bfseries\MakeUppercase| would produce bold,

So the code that you show negates \@tempskipa if it is negative so it ends up being the absolute value of the value specified in \@startsection, while at the same time setting the \if@afterindent flag to false to suppress paragraph indentation in the first paragraph after the heading.
• I finally understand it. I know why I did not understand it the first time. TeX register variables can be set implicitly (the operator = is optional)-which makes it difficult for humans to read! The document could do a better job at explaining this. For example: \@tempskipa_OPERAND =_OPERATOR_IMPLICIT -\@tempskipa_OPERAND is the absolute value of #4, because this only occurs when #4 is negative (\ifdim \@tempskipa <\z@). The operator is left out to save on token munching. – Jonathan Komar Mar 2 '17 at 9:38
• @macmadness86 in the latex kernel we omit every token that was omittable = spaces, optional {} around arguments that are a single token. Doing so saved several hundred bytes which made the difference between latex2e being able to load into emtex and not fitting:-) – David Carlisle Mar 2 '17 at 10:33
• I understand. I made that last comment for posterity. Btw, I think the implicit aspects (utilized for sparing bytes) of the LaTeX kernel is the primary reason why the backend is hard for newcomers to grasp. I find that I had to learn how TeX processes everything before I could get something out of source2e. Still, TeX has come a long way since 1978! – Jonathan Komar Mar 2 '17 at 12:56