Consider the following minimal example:
-----------------
\documentclass[10pt]{article}
\begin{document}
\tableofcontents
\section{A}
\section{B}
\end{document}
-----------------
I want to change the default vertical space between sections in the
TOC, i.e., the vertical space between
1 A
and
2 B
Which command should I use to do trick? Thanks in advance.
--
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.
tocloft or the memoir class
--
/daleif (remove RTFSIGNATURE from email address)
LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html
Hongyi Zhao wrote:
> I want to change the default vertical space between sections
> in the TOC, i.e., the vertical space between
> Which command should I use to do trick? Thanks in advance.
Try `titletoc'. For example:
--8<---------------cut here---------------start------------->8---
\usepackage[dotinlabels]{titletoc}
\titlecontents{section} [7mm]% [left]
{\addvspace{4mm}}% {above}
{\bf\contentslabel{7mm}}% {before with label}
{}% {before without label}
{\bf\titlerule*[2.7mm]{.}\contentspage}% {filler and page}
[\addvspace{0mm}]% [after]
\titlecontents{subsection} [17mm]
{}
{\contentslabel{10mm}}
{}
{\titlerule*[2.7mm]{.}\contentspage}
\titlecontents{subsubsection} [30mm]
{}
{\contentslabel{13mm}}
{}
{\titlerule*[2.7mm]{.}\contentspage}
--8<---------------cut here---------------end--------------->8---
Seb
--
Sébastien Vauban
>Try `titletoc'. For example:
>
>--8<---------------cut here---------------start------------->8---
>\usepackage[dotinlabels]{titletoc}
>
>\titlecontents{section} [7mm]% [left]
> {\addvspace{4mm}}% {above}
> {\bf\contentslabel{7mm}}% {before with label}
> {}% {before without label}
> {\bf\titlerule*[2.7mm]{.}\contentspage}% {filler and page}
> [\addvspace{0mm}]% [after]
>
>\titlecontents{subsection} [17mm]
> {}
> {\contentslabel{10mm}}
> {}
> {\titlerule*[2.7mm]{.}\contentspage}
>
>\titlecontents{subsubsection} [30mm]
> {}
> {\contentslabel{13mm}}
> {}
> {\titlerule*[2.7mm]{.}\contentspage}
>--8<---------------cut here---------------end--------------->8---
When I use it with beamer, I meet the following errors:
! Undefined control sequence.
l.634 \@tempskipa\@pnumwidth
?
Regards,
>tocloft or the memoir class
I want to use it with beamer, any minimal example please?
I'm sorry. My limit is reached...
But I guess that if you provide a minimal, but complete, example
that leads to that error, others could help.
Seb
--
Sébastien Vauban
Of course the packages tocloft and titletoc are useless with beamer,
which uses a completely different approach to the table of contents.
As far as I can see, the entries are automatically spread out to fill
the frame.
Ciao
Enricos
Agreed. Sometimes, I find beamer trying to play the smart kid,
'optimizing' more than the user wants to have optimized...
(More often, the automatisms work just fine, so I'd not complain about
it!)
Generally, entries in list-like structures are spread over the page
(=frame) to achieve an equally spaced slide. In the case of the TOC
this is definitely unwanted, if there are only 2-3 entries. A quick
hack (and nothing to be taken as a sound typographic solution) would
be to keep together the TOC as a single parbox:
\documentclass[10pt]{beamer}
\begin{document}
\frame{\parbox{\textwidth}{\tableofcontents}}
\section{A}
\section{B}
\end{document}
Of course, enclosing the TOC in other environments (which are treated
as unbreakable entities by beamer) would have similar effects.
HTH,
Holger
Hi
I have succesfully implemented this command several times...
\makeatletter
\def\addspacetotoc{\@ifnextchar[%]
\addspacetotocdefine\addspacetotocpreset}
\def\addspacetotocdefine[#1]{\addtocontents{toc}{\vskip #1\p@\protect
\mbox{}\par}}
\def\addspacetotocpreset{\addtocontents{toc}{\vskip 10\p@\protect\mbox
{}\par}}
\makeatother
It's a simple space adder, but you can substitue whatever you want.
Hope it'll be of use!
/Nick