Can anybody explain to me what this


code does in the following definition:

\renewcommand\section{\@startsection {section}{1}{\z@}%
                   {-2.5ex \@plus -1ex \@minus -.2ex}%
                   {1.3ex \@plus.2ex}%

In particular, what does @ do, and why aren't \@minus and \@plus evaluated immediately but, on the contrary, given both?


1 Answer 1


Yes, it's weird. \section in the regular use-case can have any of the following 3 input styles:

\section[<ToC title>]{<title>}

However, it's not clear how any of these relate to its definition (in article.cls):

\renewcommand\section{\@startsection {section}{1}{\z@}%
                   {-2.5ex \@plus -1ex \@minus -.2ex}%
                   {1.3ex \@plus.2ex}%

That's because \section uses \@startsection that actually defines a large number of spacing and formatting parameters. In fact, \@startsection itself is just an intermediary macro that grabs only 6 arguments (from latex.ltx)

  \if@noskipsec \leavevmode \fi
  \@tempskipa #4\relax
  \ifdim \@tempskipa <\z@
    \@tempskipa -\@tempskipa \@afterindentfalse

before handing it over to \@ssect or \@dblarg, depending on whether you used \section or \section*. That's why it's odd - \section is defined to not take any arguments, yet we can supply it with arguments; that's because the arguments are taken and processed by secondary macros contained within \section and deeper.

For more detail about what each argument in \@startsection does, see Where can I find help files or documentation for commands like \@startsection for LaTeX?.

Specifically, the spacing arguments passed to \@startsection contain glue-like lengths which, in general, have the following format

<lengthA> <plus> <lengthB> <minus> <lengthC>

Since the LaTeX kernel defines \@plus/\@minus to be plus/minus, users often mix these as needed. In short the format suggests that the resulting length could be anything between

<lengthA> + <lengthB>

(at maximum) and

<lengthA> - <lengthC>

(at minimum). Specific to the 4th argument of \@startsection, the (vertical) beforeskip for a \section could be as small as 2.3ex (2.5ex - .2ex) or as large as 3.5ex (2.5ex + 1ex)*. Similarly, the afterskip ranges between 1.3ex and 1.5ex (1.3ex + .2ex). The actual value used depends on the other contents used to fill the page (since this glue/stretch is vertical).

* Note that \@startsection's 4th argument sign (positive or negative) is removed from the length calculation and actually denotes the use/suppression of paragraph indentation following a \section. See Where can I find help files or documentation for commands like \@startsection for LaTeX? for details.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .