5

If all I want to do is to tweak the vertical space before one particular chapter title, can I somehow do it in a quick way without redefining much?

I tried the following and it didn't work:

\documentclass{report}

\begin{document}

\vspace*{-3cm}
\chapter{My chapter}

\end{document}
3

\chapter issues a \clearpage to start on a new page, and the insertion of a \vspace*, while necessary, inserts content that is sufficient for the \clearpage to be realised. We can avoid this by issuing the \clearpage manually and removing this capability from the regular \chapter command temporarily:

enter image description here

\documentclass{report}

\begin{document}

\chapter{First chapter}

\begingroup
\clearpage% Manually insert \clearpage
\let\clearpage\relax% Remove \clearpage functionality
\vspace*{-2cm}% Insert needed vertical retraction
\chapter{Second chapter}% Regular \chapter
\endgroup

\chapter{Third chapter}

\end{document}

The definition of \clearpage is restored after \endgroup as it adheres to the scoping rules of a redefinition within a group.

  • See my comment to Bernard’s example regarding indented first paragraph after the chapter command – Sveinung Nov 26 '16 at 18:10
  • @Sveinung: I can't replicate your concern with my code. – Werner Nov 26 '16 at 18:22
  • Try adding some text between the \endgroup and the next \chapter. – Sveinung Nov 26 '16 at 23:13
  • @Sveinung: I did. – Werner Nov 26 '16 at 23:58
  • Strange, because when I do that, the first paragraph is indented. – Sveinung Nov 27 '16 at 11:29
7

If you want to re-define the whole layout of chapter headings, you can use titlesec and its \titlespacing command. If you just want to change the vertical spacing, it's easy with xpatch:

\documentclass{report}
\usepackage[showframe]{geometry}
\usepackage{xpatch}%

 \begin{document}


{ %   
\makeatletter
\xpatchcmd{\@makechapterhead}{%
\vspace*{50\p@}}{%
\vspace*{50\p@}
\vspace*{-3cm}}
{}{}
\chapter{A higher chapter}
}%
\noindent

\chapter{A lower chapter}

\end{document}

enter image description here

  • I meant I want to do it for one particular chapter, e.g. for "Chapter 3" withouth affecting the rest. – Leo Nov 26 '16 at 13:11
  • Oh! I didn't notice that. With titlesec, it should be possible. – Bernard Nov 26 '16 at 13:14
  • @Leo: The initial code also works. Please see my updated answer. – Bernard Nov 26 '16 at 13:21
  • If you put in text after the patched chapter, you will find that the first paragraph is indented, because you have put the chapter in a group. You therefore have to start add a \nopindent after the patch command, or explicitly reverse the patching – Sveinung Nov 26 '16 at 13:34
  • @Sveinung: I had forgotten to check this. Fixed now. Thanks for pointing it! – Bernard Nov 26 '16 at 13:58

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.