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.

To reduce space between the table of contents heading and the first entry in the table of contents the following solution is used:

\addtocontents{toc}{\vskip-40pt The heading to display}

However, this produces the undesired effect that in the table of contents the words "The heading to display" is shifted to the right by 11 characters which is the size of the text "\vskip-40pt". How can this text be vertically left aligned with the other headings?

\documentclass[a4paper,12pt,twoside]{book}
\usepackage[Bjornstrup]{fncychap}

\begin{document}    
        \addcontentsline{toc}{section}{\vskip-60pt The heading to display} 
        \tableofcontents                
    \addcontentsline{toc}{section}{Abstract}        % Add another entry to the contents page    

    \chapter{Test chapter}
    Here is some text in the chapter.
    \section{A section}
    text in a section.    
\end{document}

This post follows the suggested solution in: fncychap package - vertical gap/space between text and heading too large - how to reduce?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

If you see my answer in the question you linked, I used \addtocontents and not \addcontentsline to reduce the space between the title and the first entry; simply replace \addcontentsline{toc}{section}{\vskip-60pt The heading to display} with \addtocontents{toc}{\vskip-60pt} to get the desired result.

The \addtocontents command is mainly intended to enter formatting information not directly related to any contents line; it can be used, for example, to add (or subtract) additional white space in some places.

The \addcontentsline command, on the other hand, is intended to enter specific information (a new entry including some text, the page number of the current page, etc.) in the ToC.

share|improve this answer
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.