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'm using the simple ordinary \tableofcontents command to produce a table of contents, and I find that the resulting spacing between the section number and the section title is too small:

enter image description here

Can someone tell me how to fix this, please. My documentclass is memoir, if that matters.

share|improve this question

2 Answers 2

up vote 9 down vote accepted

The width for the section numbers in the ToC is defined by the length called \cftKnumwidth, where K should be replaced by the sectioning level, i.e. chapter, section, etc. You can change it with \setlength, e.g.

\setlength\cftsectionnumwidth{4em}

See section 9.2.2 Typesetting the entries of the memoir manual for more on this.

A complete example:

\documentclass{memoir}
% \setlength\cftsectionnumwidth{4em} % uncomment to see difference
\begin{document}
\tableofcontents
\chapter{A chapter}
\setcounter{section}{999} % just for this example
\section{A section}
\end{document}
share|improve this answer
    
Thanks very much. I got the result I wanted after a lot of iterative fiddling with the length parameter. This is one of those occasions where a visual interface would have been very useful. Or, maybe Latex could be smarter about this: the minimum space would be a much easier parameter to work with, rather than thr indent distance. But, anyway, it works, after some fiddling. Thanks again. –  bubba Jul 14 '13 at 13:21

If you have huge numbers in the ToC, you can use the \cftsetindents command (texdoc memoir, page 153) in the preamble, to control the space before and after the numbers, with this syntax:

\cftsetindents{kind}{indent}{numwidth}

Where kind in the sectioning level (e.g., subsection) indent is the length of the indent (space before the numbers) and numwidth is the space for the numbers and the separation of section titles.

For example:

\cftsetindents{section}{1em}{3em}

MWE

share|improve this answer
    
Thanks for your answer. If I had huge numbers in my toc, will the previous answer (using \cftKnumwidth) not work? What are the pros and cons of the two solutions? –  bubba Jul 14 '13 at 10:25
    
@bubba. Torbjørn T. answer works. I made this answer in parallel and I hesitated to left because this, but I left anyway because for huge numbers and long titles could be interesting a higher numwith but also a lower indent value (even 0em) and I think that this solution is more flexible but not less "user friendly". –  Fran Jul 14 '13 at 10:48

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.