[texhax] Peculiar behavior of latex \section

Michael Barr barr at math.mcgill.ca
Tue Jul 15 00:02:14 CEST 2008

The following short file illustrates the behavior:

{\section{Section one}}
First section
\section{Section two}
Second section
\section{Section three}
Third section

When you run it, two things happen.  The "First section" is indented.  I 
understand, more or less, why this happens.  But there is only a small 
space between "First section" and "Section two", which is certainly 
anomalous.  Compare with the space between "Second section" and "Section 
three".  Things are normal if you remove the extra outer braces around 
"\section{Section one}, but the strange thing is that affects the spacing 
above the NEXT \section.  Incidentally the problem also disappears if you 
change the third and fourth lines to:

{\section{Section one}
F}irst section

It seems likely to me that some parameter that has to be reset at the end 
of the sectioning macros is not getting reset properly.  But I don't 
understand the operation of the \@startsection macro well enough to deal 
with this.

Michael Barr

More information about the texhax mailing list