3

Does anyone know how to change the distance between a chapter title (or table of contents title, or...) and the top of the page, when using the book document class? I'm satisfied with the rest of the typesetting, so I want to do this with minimal intervention.

6

The titlesec package provides

\titlespacing[*]{<command>}{<left>}{<before-sep>}{<after-sep>}[<right-sep>]

where (according to the package documentation) provides horizontal (via <left> and <right-sep>) and vertical (via <before-sep> and <after-sep>) spacing around the sectional command <command>. The starred version * kills the indentation of the paragraph following the title. So, for example,

\usepackage{titlesec}% http://ctan.org/pkg/titlesec
...
\titleformat{\chapter}{\Huge\bfseries}{\chaptername\ \thechapter}{0pt}{\vskip 20pt\raggedright}%
\titlespacing{\chapter}{0pt}{50pt}{<after-sep>}%

provides a 50pt space before and a <after-sep>=40pt|50pt space after the chapter title. The parameters were chosen similar to Stefan's answer. Here's a graphic displaying the difference - 40pt on the left and 100pt on the right:

Different titlespacing

As per the package documentation, \part and \chapter spacing can only be specified in conjunction with the \titleformat command.

5

Since minimal intervention means not changing the class and not adding a package such as titlesec, you could adjust the original definition slightly. Insert in your document preamble the original definitions of book.cls:

\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \huge\bfseries \@chapapp\space \thechapter
        \par\nobreak
        \vskip 20\p@
      \fi
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@
  }}
\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
    \Huge \bfseries  #1\par\nobreak
    \vskip 40\p@
  }}
\makeatother

Now, look at the two lines with

\vspace*{50\p@}%

these are responsible for the space between the chapter head and the top margin. Just change the value of the argument as you like. This looks like many lines of code, however the change is minimal.

  • Could you please also provide an example with titlesec? :-) – Hugo Sereno Ferreira Aug 14 '11 at 0:32
  • None of these make any difference for me. – Ivan Perez Sep 16 '18 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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