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.

The below example shows the table large gap between the top of the table of contents its section heading.
How can this gap be reduced?

\documentclass{book}

\usepackage[Bjornstrup]{fncychap}

\begin{document}
\tableofcontents 
\chapter{This is an unnecessary huge gap!!?}
Here is some text in the section.
\end{document}
share|improve this question
1  
Welcome to tex.sx! It's better to format the whole example (including the preamble) as a code sample -- I did this for you. I also removed the {parskip} tag which is about the package of the same name. –  lockstep Mar 13 '11 at 15:57
add comment

2 Answers

up vote 4 down vote accepted

If the change in vertical spacing should affect only the title "Contents" and the first entry in the Table of Contents, an \addtocontents command should be enough:

\documentclass{book}
\usepackage[Bjornstrup]{fncychap}

\begin{document}

\tableofcontents
\addtocontents{toc}{\vskip-40pt}
\chapter{Test chapter}
Here is some text in the section.

\end{document}
share|improve this answer
    
@Gonzalo and \addtocontents{toc}{\vskip-120pt}. This worked very well and as expected. –  Ian Gregory Mar 14 '11 at 0:39
    
@Gonzalo, if using the hyperref package (\usepackage(hyperref}) in the preamble, "\vskip-60ptTable of Contents" is inserted into the link and not simply "Table of Contents". Any idea how to fix? –  Ian Gregory Mar 14 '11 at 1:48
    
@Gonzalo, further to this. The word "Table of Contents" in the table of contents is shifted to the right an extra 11 characters due to size of the phrase "\vskip-60pt". How can the text be shifted left and hence left aligned? –  Ian Gregory Mar 14 '11 at 2:05
    
@Ian: I don't see any of those undesired effects after adding \usepackage{hyperref} right before \begin{document} in my example code. If you are experiencing some undesired behaviour, it would be appropriate to open a new question exposing your problem in detail (and including a MWE). –  Gonzalo Medina Mar 14 '11 at 2:18
1  
@Ian: I already provided an answer to the new question. –  Gonzalo Medina Mar 14 '11 at 4:25
show 1 more comment

Add the following immediately before \begin{document} (halves vertical space):

\usepackage{etoolbox}
\makeatletter
\patchcmd{\DOTI}{\vskip 40\p@}{\vskip 20\p@}{}{}
\patchcmd{\DOTIS}{\vskip 40\p@}{\vskip 20\p@}{}{}% for unnumbered chapters
\makeatother
share|improve this answer
    
This looks somewhat like the way to do it according to the fncychap package manual. However, I could not get your code to work as there is no change to any spacing. –  Ian Gregory Mar 14 '11 at 0:46
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.