I need to change the way the command \section
enumerates the sections: I'd like my second section to be section number 4. (I don't want any section number 2 or three in my article).
Is this possible?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityShort answer
Put \setcounter{section}{3}
just before the second \section
.
Long answer
The numbering of sectioning commands is governed by counters that have the same name as the command, e.g. for the \section
command we have the counter section
, for the \subsection
command we have the counter subsection
, and so on.
Each time a sectioning command is issued, the corresponding counter is incremented by one.
If you want to change this behavior manually, you have a few possibilities:
\setcounter{counter}{value}
Issuing this command you can set the value of counter
to the specified value
, e.g. \setcounter{section}{3}
assigns the value 3 to the counter section
.
\addtocounter{counter}{value}
Issuing this command you can increment the value of counter
by the specified value
, e.g. \addtocounter{section}{2}
increments the counter section
by a value of 2.
\stepcounter{counter}
The same as above but the increment is fixed at 1.
\refstepcounter{counter}
The same as above but useful when you're using a label/ref system for the counter.
\setcounter{section}{3}
just before the second\section
. And Welcome to TeX.SX!