Page LayoutCustomizing table of contents

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
craig
Posts: 3
Joined: Fri Oct 02, 2009 3:06 pm

Customizing table of contents

Post by craig »

I have encountered a problem when trying to customize my table of contents.

I am using my own adaption of the package 'fncychap' and I am happy with the layout of most of the document. However I would like to adjust the (vertical) position where the first line of the table of contents is set.

I tried:

Code: Select all

\usepackage{tocloft}
\renewcommand{\cftaftertoctitle}{\vskip-1.5cm}
which seemed to work well. Except it removed my customized title and replaced it with its own. I had a look through the documentation and discovered that:

Code: Select all

\usepackage[titles]{tocloft}
\renewcommand{\cftaftertoctitle}{\vskip-1.5cm}
should do the trick. This has allowed me to use my customized title however it has also added the space I was trying to remove back in.

Any suggestions would be appreciated!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Customizing table of contents

Post by Stefan Kottwitz »

Hi Craig,

welcome to the board!
It would be easier for forum users to examine your problem if you would provide a compilable minimal working example.

Stefan
LaTeX.org admin
craig
Posts: 3
Joined: Fri Oct 02, 2009 3:06 pm

Customizing table of contents

Post by craig »

I think this contains the points which are causing the problem but I should point out that I am using other packages as well (graphicx, setspace, fancyhdr, mathptmx, color, fontenc, geometry and hyperref). I should also point out that the chapter titles I am using have been customized but are based on that shown below.

I am trying to get a similar seperation between the chapter title and the first line of text in the table of contents as can be seen in the 'Acknowledgements' chapter.

Code: Select all

\documentclass[a4paper,12pt,oneside]{book}

\usepackage[titles]{tocloft}
\usepackage[Bjornstrup]{fncychap}

\renewcommand{\cftaftertoctitle}{\vskip-1.5cm}

\begin{document}
\frontmatter

\chapter{Acknowledgements}\markright{Acknowledgements}

\markright{Table of Contents}\tableofcontents

\end{document}
Thanks
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Customizing table of contents

Post by Stefan Kottwitz »

Hi Craig,

this workaround using \addtocontents could do it, right after \begin{document}:

Code: Select all

\addtocontents{toc}{\protect\vspace{-1.5cm}}
Stefan
LaTeX.org admin
craig
Posts: 3
Joined: Fri Oct 02, 2009 3:06 pm

Re: Customizing table of contents

Post by craig »

That's done the trick!

Thanks!
Post Reply