6

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.

lockstep
  • 250,273
Foo Bar
  • 13,247

2 Answers2

9

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

Gonzalo Medina
  • 505,128
2

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:


enter image description here


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:


enter image description here


enter image description here


  • 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 04 '14 at 00:50
  • Okay, I just updated my answer! This should be enough to get started ;-) – poltexious Apr 04 '14 at 01:27
  • Is there any way to exclude unnumbered chapters or some croncrete chapters from the part TOC, such as glossary or references from the whole document? – Agente 156 Jul 01 '23 at 11:15