5

I have defined my own chapter heading with modified font size and spacing above and below.

\documentclass[final]{book}
\usepackage{titlesec}
\titleformat{\chapter}[hang]{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{0pt}{\LARGE}
\titlespacing*{\chapter}{0pt}{30pt}{20pt}
\def \mychapter#1{\chapter*{#1}}
\begin{document}
\mychapter{Some Very Long Chapter Heading That Will Span Across Two Or More Lines}
\end{document}

Now I am trying to decrease line spacing (baselineskip) for this chapter heading. So I thought setspace package and setstretch command will do the trick.

\documentclass[final]{book}
\usepackage{setspace}
\usepackage{titlesec}
\titleformat{\chapter}[hang]{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{0pt}{\LARGE}
\titlespacing*{\chapter}{0pt}{30pt}{20pt}
\def \mychapter#1{\chapter*{\setstretch{0.1}#1}}
\begin{document}
\mychapter{Some Very Long Chapter Heading That Will Span Across Two Or More Lines}
\end{document}

Unfortunately, \setstretch{0.1} seems to have no effect on line spacing. When used on its own, without titlesec package and its commands

\documentclass[final]{book}
\usepackage{setspace}
\def \mychapter#1{\chapter*{\setstretch{0.1}\LARGE#1}}
\begin{document}
\mychapter{Some Very Long Chapter Heading That Will Span Across Two Or More Lines}
\end{document}

it works as expected, but there seems to be some package conflict between titlesec and setspace.

How can I keep my titlesec definition of this chapter heading, but at the same time change (decrease/inrease) its line spacing?

1
  • \titleformat{\chapter}[hang]{\normalfont\huge\bfseries\setstretch{0.1}}{\chaptertitlename\ \thechapter}{0pt}{\LARGE} Dec 2, 2014 at 14:54

1 Answer 1

4

Give the specification in the first mandatory argument (as a personal note, I consider the spacing of your definition a little bit awkward):

\documentclass[final]{book}
\usepackage{setspace}
\usepackage{titlesec}
\titleformat{\chapter}[hang]  
  {\normalfont\huge\bfseries\setstretch{0.1}}
  {\chaptertitlename\ \thechapter}{0pt}{\LARGE}
\titlespacing*{\chapter}{0pt}{30pt}{20pt}

\begin{document}
\chapter{Some Very Long Chapter Heading That Will Span Across Two Or More Lines}
\end{document}

enter image description here

Since, according to comments, no numbering will be used, the following definition would seem the proper way to go (no need for an additional command); I also incorporated barbara beeton's suggestion about suppressing hypheneation in the titles:

\documentclass[final]{book}
\usepackage{setspace}
\usepackage{titlesec}
\titleformat{\chapter}[hang]  
  {\normalfont\filright\bfseries\setstretch{0.1}}
  {}{0pt}{\LARGE}
\titlespacing*{\chapter}{0pt}{30pt}{20pt}

\begin{document}
\chapter{Some Very Long Chapter Heading That Will Span Across Two Or More Lines}
\end{document}

enter image description here

7
  • I know this spacing is awful. 1) I always use starred version of chapter, so I never have auto-generated number, 2) I used such small spacing just to make sure I see an effect when it finally works. I just wanted to see change, getting to right value was left for later.
    – Rafal
    Dec 2, 2014 at 15:51
  • oh, please suppress automatic hyphenation (and discourage line breaks at existing hyphens unless really necessary). you've already got semi-ragged right (spaces in second line are wider than those in the last line); "full" ragged would look nicer. Dec 2, 2014 at 16:28
  • @barbarabeeton I knew you were going to suggest this :) I've incorporated your suggestion (and some other improvements) to my updated answer. Dec 2, 2014 at 17:18
  • @Rafal Since you're always going to suppress the string "Chapter #" from titles, then a different modification of your definition might be better, so you don't have to use a user defined command. Please see my updated answer. Dec 2, 2014 at 17:19
  • This is simply awful; no document should have something so horrible!
    – egreg
    Dec 2, 2014 at 17:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .