Vertical spacing between sections
The solution depends on the document class. Usually \section
is defined \@startsection
that is defined in the LaTeX kernel. The article
class defines \section
the following way:
\newcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries}}
source2e
documents the options for the 4th and 5th argument of \@startsection
that controls the spaces before and after the section title:
\@startsection{⟨name⟩}{⟨level⟩}{⟨indent⟩}{⟨beforeskip⟩}{⟨afterskip⟩}{⟨style⟩}*[⟨altheading⟩]{⟨heading⟩}
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 negative of skip to leave to right of run-in heading.
Example that redefines \section
with doubled spaces:
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\section{Section A}
\lipsum[2]
\section{Section B}
\lipsum[2]
\makeatletter
\renewcommand*{\section}{%
\@startsection {section}{1}{\z@}%
{-7ex \@plus -3ex \@minus -.4ex}%
{4.6ex \@plus.4ex}%
{\normalfont\Large\bfseries}%
}
\makeatother
\section{New Section C}
\lipsum[2]
\section{New Section D}
\lipsum[2]
\end{document}
Related videos on Youtube
user47812
Updated on March 19, 2020Comments
-
user47812 over 3 years
I would like to know how I can define the vertical space between:
- a previous section and the new section title;
- the new section title and the following text.
Now it looks like both space measure the same.
-
Henri Menke over 9 yearsWelcome to TeX.SX! You don't have to sign with your name since it automatically appears in the lower right corner of your post. Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with
\documentclass{...}
and ending with\end{document}
.
-
Yigit Alparslan almost 3 yearsHow do you make the section header single-spaced if it spans multiple lines?
-
Heiko Oberdiek almost 3 years@YigitAlparslan This is a different topic for a new question (with example, since the answer will probably depend on the class).