LaTeX forum ⇒ Theses, Books, Title pagesHow can you remove whitespace between header and toc?

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

How can you remove whitespace between header and toc?

Postby templateuser » Mon Mar 30, 2015 12:58 pm

I am using the following packages to set up my chapter headings but there is still a major space below the chapter heading the the content in the table of contents.
Any way of removing it.

  1. \usepackage[Sonny]{fncychap}
  2. \usepackage{etoolbox}
  3. \makeatletter
  4. \patchcmd{\@makechapterhead}{\vspace*{50\p@}}{}{}{}% Removes space above \chapter head
  5. \patchcmd{\@makeschapterhead}{\vspace*{50\p@}}{}{}{}% Removes space above \chapter* head
  6. \makeatother

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3551
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Aug 21, 2015 1:39 pm

Package fncychap redefines the appearance of chapter titles by redefining the internals, so much more stuff has to be dealt with when changing the appearance.

  1. \documentclass{report}
  2. \usepackage[Sonny]{fncychap}
  3. \usepackage{blindtext}
  4. \usepackage{showframe}
  5. \usepackage{etoolbox}
  6. \makeatletter
  7. \patchcmd{\@makechapterhead}{\vspace*{50\p@}}{}{}{}% Removes space above \chapter head
  8. \patchcmd{\@makeschapterhead}{\vspace*{50\p@}}{}{}{}% Removes space above \chapter* head
  9. \renewcommand{\DOCH}{%
  10. \raggedleft
  11. \CNV\FmN{\@chapapp}\space \CNoV\thechapter
  12. \par\nobreak
  13. \vskip 10\p@}
  14. \renewcommand{\DOTI}[1]{%
  15. \CTV\raggedleft\mghrulefill{\RW}\par\nobreak
  16. \vskip 5\p@
  17. \CTV\FmTi{#1}\par\nobreak
  18. \mghrulefill{\RW}\par\nobreak
  19. \vskip 10\p@}
  20. \renewcommand{\DOTIS}[1]{%
  21. \CTV\raggedleft\mghrulefill{\RW}\par\nobreak
  22. \vskip 5\p@
  23. \CTV\FmTi{#1}\par\nobreak
  24. \mghrulefill{\RW}\par\nobreak
  25. \vskip 10\p@}
  26. \makeatother
  27. \begin{document}
  28. \chapter{Wallaby}
  29. \blindtext
  30. \chapter*{Wombat}
  31. \blindtext
  32. \end{document}


Changing this low level code should be done by experienced users only.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 2 guests