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 generating a short table of contents using the shorttoc-package.

\documentclass{scrartcl}
\usepackage[tight]{shorttoc}

\begin{document}

\shorttoc{Shorttoc}{1}
\tableofcontents

\section{Sec1}
\subsection{Subs1}
\section{Sec2}
\subsection{Subs2}
\section{Sec3}
\subsection{Subs3}

\end{document}

The package documentation states, that the option tight should reduce the vertical spacing between the entries in the shorttoc, but in my example it doesn't. I suspect, this is due to this part of shorttoc.sty?

\newif\if@tightshtoc \@tightshtocfalse
\def\shorttableofcontents#1#2{\bgroup\c@tocdepth=#2\@restonecolfalse
  \if@tightshtoc
     \parsep\z@
  \fi

What do I have to do to resize the vertical spacing?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

As \parsep is the vertical space between paragraphs of a list item, I'm at a loss why redefining it should change the spacing between ToC lines. For section entries, the latter is controlled by the \l@section macro (which contains the line \addvspace{1.0em \@plus\p@}), and this macro needs to be redefined. If you want to change the spacing only for the short ToC, the redefinition must be done inside a group. (Note: I'm using the etoolbox package and its \patchcmd macro for convenience.)

\documentclass{scrartcl}

\usepackage{shorttoc}
\usepackage{etoolbox}

\begin{document}

\begingroup
\makeatletter
\patchcmd{\l@section}{%
  \addvspace{1.0em \@plus\p@}% original code line
}{%
  \addvspace{0.3em \@plus 0.3\p@}% substitute code line
}{}{}
\makeatother
\shorttoc{Shorttoc}{1}
\endgroup

\tableofcontents

\section{Sec1}
\subsection{Subs1}
\section{Sec2}
\subsection{Subs2}
\section{Sec3}
\subsection{Subs3}

\end{document}
share|improve this answer
    
works like a charm, thanks :) –  meep.meep Apr 15 '11 at 7:45

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.