[Tex/LaTex] minitoc: parttoc on the same page as the part title

minitocpage-breakingpartstable of contents

Easy example:

\documentclass{scrreprt}

\usepackage{minitoc}

\begin{document}

\doparttoc[n]
\noptcrule
\tableofcontents

\part{foo}
\parttoc

\chapter{bar1}
\chapter{bar2}
\chapter{bar3}
\chapter{bar4}

\end{document}

This creates a nice document, but the toc for the part is on a new page, but it would fit perfectly on the same pag as the part title. Is there a way to have the parttoc on the same page as the part title? So that it behaves like minitoc for chapters.

Best Answer

You can redefine \partheadendvskip to suppress the default \vfil\newpage; you might also want to redefine \partheadstartvskip to move up vertically the part heading. Finally you need to redefine \beforeparttoc:

\documentclass{scrreprt}

\usepackage{minitoc}

\renewcommand*{\partheadstartvskip}{%
  \null\vskip20pt
}
\renewcommand*{\partheadendvskip}{%
  \vskip2pt
}

\renewcommand\beforeparttoc{}

\begin{document}

\doparttoc[n]
\noptcrule
\tableofcontents

\part{foo}
\parttoc


\chapter{bar1}
\chapter{bar2}
\chapter{bar3}
\chapter{bar4}

\end{document}

enter image description here