minitoc: parttoc on the same page as the part title

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.

-

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}

\null\vskip20pt
}
\vskip2pt
}

\renewcommand\beforeparttoc{}

\begin{document}

\doparttoc[n]
\noptcrule
\tableofcontents

\part{foo}
\parttoc

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

\end{document}


-
Thanks, works perfectly. :) –  Foo Bar Sep 28 '12 at 17:51

Here follows a minimal working example:

\documentclass[a4paper,11pt,twoside,openright]{memoir}

\setlrmargins{*}{*}{1}
\setulmargins{*}{*}{1}
\checkandfixthelayout[nearest]

\usepackage{color}
\usepackage{xcolor}

\usepackage{titletoc}

\settocdepth{subsection}
\setsecnumdepth{subsection}

\makeatletter
\def\@endpart{
%
\vfil
\textcolor{red}{\hrule height 1.5 pt}
\setcounter{tocdepth}{0}

\startcontents[parts]
\printcontents[parts]{}{0}{}

\textcolor{red}{\hrule height 1.5 pt}
\par\bigskip
\vfil\newpage
\if@twoside
\if@openright
\null
\thispagestyle{empty}%
\newpage
\fi
\fi
\if@tempswa
\twocolumn
\fi}
\makeatother

\begin{document}

\part{First Part}

\chapter{First Chapter}
\section{First Section}
\subsection{First Subsection}

\chapter{Second Chapter}
\section{Second Section}
\subsection{Second Subsection}

\chapter{Third Chapter}
\section{Third Section}
\subsection{Third Subsection}

\end{document}


And this is how the first page looks like:

If you are interested in tweaking it a little bit more, check out this post: Pretty List of Figures and List of Tables.

Inspired by the work of Gonzalo Medina, I have managed to do a quite nice Part TOC which you can use. Check out the link and reuse some of the code if you find it useful.

By the way, the choice of the colours were made so that I could easily find the code blocks in the preamble, coding for the different elements in the TOC and Part TOC.

Pictures can be seen below:

-
This is nearly an answer, but you need to include the necessary code; referencing another question and saying that folks need to change some code means that your answer doesn't stand alone... –  cmhughes Apr 4 '14 at 0:50
Okay, I just updated my answer! This should be enough to get started ;-) –  poltexious Apr 4 '14 at 1:27