6.8.1 \@startsection arguments

Here are the arguments to \@startsection:

name

Name of the counter used to number the sectioning header. This counter must be defined separately. Most commonly this is either section, subsection, or paragraph, which are predefined by LaTeX. Although in those cases the counter name is the same as the sectioning command itself, you don’t have to use the same name.

Then \thename displays the title number, \lname is for the table of contents, and \namemark is for the page headers. See the third example below.

level

An integer giving the depth of the sectioning command. See Sectioning, for the list of standard level numbers.

If level is less than or equal to the value of the counter secnumdepth then titles for this sectioning command will be numbered (see Sectioning/secnumdepth). For instance, if secnumdepth is 1 in an article then the command \section{Introduction} will produce output like “1 Introduction” while \subsection{Discussion} will produce output like “Discussion”, without the number prefix.

If level is less than or equal to the value of the counter tocdepth then the table of contents will have an entry for this sectioning unit (see Sectioning/tocdepth). For instance, in an article, if tocdepth is 1 then the table of contents will list sections but not subsections.

indent

A rubber length giving the indentation of all of the title lines relative to the left margin. To have the title flush with the margin use 0pt. A negative indentation such as -\parindent will move the title into the left margin.

beforeskip

The absolute value of this rubber length is the amount of vertical space that is inserted before this sectioning unit’s title. If this number is negative or zero then the first paragraph following the header is not indented; if it is positive then the first paragraph is indented. (Example: the negative of 1pt plus 2pt minus 3pt is -1pt plus -2pt minus -3pt.)

For example, if beforeskip is -3.5ex plus -1ex minus -0.2ex then to start the new sectioning unit, LaTeX will add about 3.5 times the height of a letter x in vertical space and the first paragraph in the section will not be indented.

Using a rubber length, with plus and minus, is common practice here since it gives LaTeX more flexibility in making up the page (see Lengths).

This space will be discarded if the sectioning unit happens to start at the beginning of a page, and the baseline of the heading will be at the normal position of the baseline of the first line on the page.

The full accounting of the vertical space between the baseline of the line prior to this sectioning unit’s header and the baseline of the header is that it is the sum of the \parskip of the text font, the \baselineskip of the title font, and the absolute value of beforeskip.

afterskip

This is a rubber length. If afterskip is non-negative then this is the vertical space inserted after the sectioning unit’s title header. If it is negative or zero then the title header becomes a run-in header, so that it becomes part of the next paragraph. In this case the absolute value of the length gives the horizontal space between the end of the title and the beginning of the following paragraph. (Example: the negative of 1pt plus 2pt minus 3pt is -1pt plus -2pt minus -3pt.)

As with beforeskip, using a rubber length, with plus and minus components, is common practice here since it gives LaTeX more flexibility in putting together the page.

If afterskip is non-negative then the full accounting of the vertical space between the baseline of the sectioning unit’s header and the baseline of the first line of the following paragraph is that it is the sum of the \parskip of the title font, the \baselineskip of the text font, and the value of afterskip.

Because the sign of afterskip changes the sectioning unit header formatting from standalone to run-in, you cannot use a negative afterskip to cancel part of the \parskip + \baselineskip space.

If both beforeskip and afterskip are negative or zero, the negative beforeskip has no effect: the header will be a run-in.

style

Controls the styling of the title. See the examples below. Typical commands to use here include \centering, \raggedright, \frenchspacing, \normalfont, \hrule, \newpage. The last command in style may be one that takes one argument, such as \MakeUppercase or \fbox that takes one argument. The section title will be supplied as the argument to this command. For instance, setting style to \bfseries\MakeUppercase would produce titles that are bold and uppercase.


Unofficial LaTeX2e reference manual