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.

I have grouped sections nicely below of chapters in ToC, so that there is no space between chapter and following sections, but there is some space between last section and following chapter. All this is done using memoir:

\setlength{\cftbeforesectionskip}{4pt}
\setlength{\cftbeforechapterskip}{16pt}

The problem is that chapter-like entries in the frontmatter (e.g. Foreword, Abstract) will have relatively large vertical space in between. What I would like to have is `grouped´ frontmatter chapter-like entries with 4pt vertical space, and 16pt space between last entry of the group (say, ToC or LoF) and the first chapter. Something like this:

Foreword
Abstract
List of Figures

Chapter 1 Introduction
  1.1 Section title
  1.2 Section title

Chapter 2 Theory
  2.1 Section title
  2.2 Section title

Bibliography
share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

Here's one possible solution using the etoolbox package to patch the \chapter command to add some spacing to the ToC; the change is at the point the spacing is required:

\documentclass{memoir}
\usepackage{etoolbox}

\setlength{\cftbeforesectionskip}{4pt}

\begin{document}

\tableofcontents

\chapter*{Foreword}
\addcontentsline{toc}{chapter}{Foreword}
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}

\pretocmd{\chapter}{\addtocontents{toc}{\addvspace{16pt}}}{}{}

\chapter{Chapter One}
\section{Section One One}
\section{Section One Two}
\section{Section One Three}
\section{Section One Four}

\chapter{Chapter Two}
\section{Section Two One}
\section{Section Two Two}
\section{Section Two Three}

\chapter{Chapter Three}
\section{Section Three One}
\section{Section Three Two}
\section{Section Three Three}
\section{Section Three Four}
\section{Section Three Five}

\end{document}

The resulting ToC:

enter image description here

share|improve this answer
    
Thank you for the quick answer, it worked perfectly! Maybe this needs new Question, but: I use small caps for the chapter entries, and the grouped entries look `ugly´. Is there a way to change them to non-small-caps? –  TKO Nov 19 '12 at 15:34
    
@TKO as you said, this deserves a new question; please include in your new question a complete sample document (as the one in my answer) showing the relevant settings and illustrating the problem mentioned. –  Gonzalo Medina Nov 19 '12 at 15:42
    
Done! Entry is in tex.stackexchange.com/questions/83377/… Thanks again! –  TKO Nov 19 '12 at 17:27
add comment

Gonzalo Medina answer is very good for automated behaviour. If you need only to act once or twice for specific cases, you should add manually the space. This is to be used with care, since the general equilibrium of the toc can be altered dramatically.

This is done with

\addtocontents{toc}{\vspace{xpt}}

with x being a positive or negative value, written just before your chapter, section, part etc. entry in the text.

You can also use the \addvspace command, but only for positive values.

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.