Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In my current document, section and subsection have too much bottom and top margin. How can I change that globally to be less? I use the document class as book.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

As you didn't specify how much less, here's a general answer: \usepackage[compact]{titlesec}.

\documentclass{article}

\usepackage[compact]{titlesec}

\begin{document}

\section{First}

\subsection{First-first}

Some text.

\section{Second}

Some text.

\end{document}

enter image description here

EDIT: Here's an example how to change the spacing starting from values corresponding to the book class (see secion 9.2 of the titlesec manual for details):

\documentclass{book}

\usepackage{titlesec}

% Spacing corresponding to `book` class
% \titlespacing*{\section} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
% \titlespacing*{\subsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

% Spacing before/after reduced by 1ex each
\titlespacing*{\section} {0pt}{2.5ex plus 1ex minus .2ex}{1.3ex plus .2ex}
\titlespacing*{\subsection} {0pt}{2.25ex plus 1ex minus .2ex}{0.5ex plus .2ex}

\begin{document}

\chapter{First}

\section{First-first}

\subsection{First-first-first}

Some text.

\section{First-second}

Some text.

\end{document}

enter image description here

share|improve this answer
    
I thought we would be setting those as values but apparently not. Thanks! –  tugberk May 5 '12 at 14:22
1  
@tugberk If you edit your question to include the document class and the top/bottom spacing you strive for, a more specific answer is likely to be provided. –  lockstep May 5 '12 at 14:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.