How to change the number of spaces between sections in Latex?

How do I change the distance between the end of a section and the title of the next section in a Latex document?

+4
source share
2 answers

You can customize the style of section titles, including spacing, using the titlesec package. There is a “compact” option for simple space reduction, or you can specify specific values ​​using more complex parameters (see the documentation on the linked page for gory details).

+8
source

An alternative to titlesec is to override the section command, as in the following snippet. Note that beforeskip and afterskip are the variables that interest you. The code itself is just the first few lines. Then a long comment followed to remind me of the definitions when I cut and pasted it all from one document to another. The code, by the way, is more or less from an indispensable book, The LaTeX Companion, Second Edition .

 \makeatletter \renewcommand\section{\@startsection {section}{1}{\ z@ }% {-2.5ex \@plus -1ex \@minus -.2ex}% {1.3ex \@plus.2ex}% {\centering\bfseries}} % \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE} % optional * [ALTHEADING]{HEADING} % Generic command to start a section. % NAME : eg, 'subsection' % LEVEL : a number, denoting depth of section -- eg, chapter=1, % section = 2, etc. A section number will be printed if % and only if LEVEL gt or eq the value of the secnumdepth % counter. % INDENT : Indentation of heading from left margin % BEFORESKIP : Absolute value = skip to leave above the heading. % If negative, then paragraph indent of text following % heading is suppressed. % AFTERSKIP : if positive, then skip to leave below heading, % else - skip to leave to right of run-in heading. % STYLE : commands to set style % If '*' missing, then increments the counter. If it is present, then % there should be no [ALTHEADING] argument. A sectioning command % is normally defined to \@startsection + its first six arguments. \makeatother 
+6
source

All Articles