# Question on spacing in the book document class

I have 2 questions regrading the spacing is concerned.

### 1. How to reduce the space between the heading of the paragraph in the paragraph command and the content?

Usually, the space provided is far sufficient. But rather sometimes, the space is too much and changes the meaning of the content. So are there low-level TeX commands to reduce this space.

The MWE:

\documentclass[12pt]{book}
\usepackage{kantlipsum}
\begin{document}
\chapter{Sample}
\section{Demo}
\paragraph{Demo}\kant[1]
\end{document}


### 2. How to enable \doublespacing only to the content of the document and not to chapter, section or other headings.

When I include \doublespacing immediately after the \begin{document}, the whole document is double spaced but I want only the content. How do I do that?

The MWE:

\documentclass[12pt]{book}
\usepackage{kantlipsum}
\usepackage{setspace}
\begin{document}
\doublespacing
\chapter{Sample}
\section{Demo}
\paragraph{Demo}\kant[1]
\end{document}


• What does "only the content" mean? Everything but the \chapter? – Werner May 18 '14 at 5:44
• The \chapter,\section and the other headings @Werner – subham soni May 18 '14 at 5:56
• It is an error really to use sectioning commands out of sequence, the order is \chapter, \section, \subsection, \subsubsection, \paragraph so you have jumped three levels, this error is masked but if the document class is changed to one that sets secnumdepth to a higher value it will become very apparent with numbering such as 1.1.0.0.1 – David Carlisle May 18 '14 at 10:14

For first, you can use titlesec and put

\titlespacing*{\paragraph} {0pt}{3.25ex  plus 1ex minus .2ex}{0.5em}  %% change the 0.5em as you wish, default is 1em


0.5em is the length you have to adjust.

For second, You can put \doublespacing at appropriate place. However, I feel that the spacing in titles should vary according the baseline skip of the contents.

\documentclass[12pt]{book}
\usepackage{kantlipsum}
\usepackage{setspace}
\usepackage{titlesec}
\titlespacing*{\paragraph} {0pt}{3.25ex  plus 1ex minus .2ex}{0.5em}  %% change the 0.5em as you wish, default is 1em

\begin{document}
\singlespacing
\chapter{Sample}
\section{Demo}
\doublespacing
\paragraph{Demo}
\kant[1-5]
\singlespacing
\section{Demo}
\doublespacing
\paragraph{Demo}
\kant[6-10]
\end{document}


For the second question, you can play with the \baselineskip length and the \baselinestretch factor:

\documentclass[12pt]{book}
\usepackage{kantlipsum}
\begin{document}
\setlength{\baselineskip}{2.5em}
\renewcommand\baselinestretch{0}
\chapter{Sample}
\section{Demo}
\paragraph{Demo}\kant[1]
\end{document}


For the first, without additional packages you can redefine \paragraph in the preamble:

\makeatletter
\renewcommand{\paragraph}{%
\@startsection{paragraph}{4}%
{\z@}{0ex \@plus 0ex \@minus 0ex}{-0.5em}%
{\normalfont\normalsize\bfseries}%
}
\makeatother


Change as you wish the -0.5em (note the negative symbol) to control the space between "Demo and "As" and the 0ex values to control the vertical space (plus minus adjustements) with the previous paragraph (note: not the space between the \section{} and \paragraph{}).

Example with and -0.5em and 1em, repectively:

Example with -2em and 0.5em: