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.

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.

share|improve this question
add comment

2 Answers

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.

share|improve this answer
    
Could you please also provide an example with titlesec? :-) –  Hugo S Ferreira Aug 14 '11 at 0:32
add comment

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.

share|improve this answer
    
+1 to the \titleformat requirement for Chapters! –  Hugo S Ferreira Aug 14 '11 at 22:20
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.