# Single-space chapter titles with double-spaced document

I am typesetting a thesis using the book class and need the chapter titles to be single-spaced while the main text must be double-spaced.

Inserting \singlespacing before the text in the definition of the chapter creates ! Missing control sequence inserted. <inserted text> \inaccessible errors on compiling, and also inserts a spurious newline between the chapter numbers and names in the table of contents.

Here is a minimum working example:

\documentclass[12pt,oneside]{book}
\usepackage{lipsum} % included only to generate example text
\usepackage{setspace} % set double vs single spacing
\begin{document}
\clearpage
\doublespacing
\chapter{I need singlespace titles, doublespace text.}
\section{Section headers should also be single-spaced, but I could adjust titles to fit on one line}
\lipsum[4] % generate some filler text
\end{document}


This is not a duplicate of this question, as the answers to that question involve either specific hacks to the \section commands, or the titlesec package which gives the error ! Package titlesec Error: Not allowed in 'easy' settings. when I attempt to use it with the book class.

Edit: it turns out that sectsty is unsuitable for my needs as it disrupts formatting elsewhere and interacts with doublespacing differently than using the titlesec solution. For example,

\documentclass[12pt,oneside]{book}
\usepackage{lipsum}
\setcounter{secnumdepth}{3}
\usepackage{sectsty}
\usepackage{setspace} % set double vs single spacing
\allsectionsfont{\singlespacing}
\begin{document}
\doublespacing
\chapter{Singlespace titles, doublespace text.}
\section{Section headers should \\also be single-spaced}
\subsubsection{The \texttt{sectsty} package interacts with \texttt{doublespacing}, adds too much space below this header}
\paragraph{The \texttt{sectsty} package causes this paragraph to be indented}
\lipsum[4]
\end{document}

• Notice that in my answer sectsty is loaded after setspace; this is not the case in your updated example. – Mico Feb 6 '16 at 22:55

You could add the following instructions to the document's preamble (after loading the setspace package):

\usepackage{sectsty}
\allsectionsfont{\singlespacing}


A full MWE (minimum working example):

\documentclass[12pt,oneside]{book}
\usepackage{lipsum}   % for filler text
\usepackage{setspace}
\doublespacing

\usepackage{sectsty}
\allsectionsfont{\singlespacing}

\begin{document}

\chapter{I need singlespace titles, doublespace text.}

\section{Section headers should also be single-spaced, but I could adjust titles to fit on one line}

\lipsum[4] % filler text
\end{document}

• This sectsty package is very handy and I think should be added as an answer to these two questions 1 2 – MRule Feb 5 '16 at 19:35
• @MRule - Thanks for this suggestion; I've provided an answer that mentions the sectsty package in the first of the two posting's you've provided links to. The second is about issues with the titlesec package, and sectsty doesn't directly address these issues. – Mico Feb 5 '16 at 19:53
• Apologies, it turns out the sectsty package interacts poorly with some of my other formatting needs. I've updated the question to reflect this. – MRule Feb 6 '16 at 19:56
• @MRule - Please provide specifics about the "poor interactions". – Mico Feb 6 '16 at 22:56

A related question has a solution for section headings using the titlesec package. However, if this answer is copied and naïvely modified for chapter headings, it will result in a ! Package titlesec Error: Not allowed in 'easy' settings error. The error arises because the titlesec package works a little differently with chapters than it does sections. An incantation to single-space chapters and section headers using the titlesec package is as follows:

\usepackage{titlesec}
\titleformat{\chapter}[display]{\normalfont\huge\bfseries\singlespacing}{\chaptertitlename\ \thechapter}{40pt}{\huge}
\titleformat{\section}{\singlespacing\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\singlespacing\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\singlespacing\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}