# use Minitoc with KOMA-Script (scrbook)

I'm using the KOMAscript scrbook class together with the minitoc package. When I compile, I get the message

Usage of package minitoc together (scrbook) with a KOMA-Script class is not recommended.

Is there a replacement to minitoc? Or does it simply mean I must rather stick with the book class? Can I get the same appearance using another KOMA friendly package?

Seems easier than I thought:

\documentclass{scrbook}

\usepackage{etoc, blindtext}
\newcommand{\chaptertoc}[1][Chaptertoc]{%
\localtableofcontents%
}

\begin{document}
\chapter{First Chapter}
\label{CLA:first-chapter}

\chaptertoc{}
\bigskip{}
\blindtext

\section{First section in first chapter}
\label{CLA:first-section-first}
\blindtext

\section{Second section in first chapter}
\label{CLA:second-section-first}
And this section even has subsections:
\blindtext{}

\subsection{First subsec in second sec of first chapter}
\label{CLA:first-subsec-second}
\blindtext{}

\subsection{You know how to proceed}
\label{CLA:you-know-how}
\blindtext{}

\end{document}


First I tried to find out how to do that without the etoc package, because the tocbasic package, which is part of the KOMAscript bundle, surely provides the machinery. However, with etoc it seems fairly easy.

• merci, the only thing missing now is the rule (see my posting). – aerioeus May 8 '18 at 13:35
• @aerioeus Change \addsec... to \addsec*{#1\\\rule{\textwidth}{0.4pt}}}{}% – Keks Dose May 8 '18 at 14:14
• What if I want bold for section lines (number on the left, title, page) like with the default minitoc settings? – Archange Mar 15 '19 at 1:07
• @Archange Sorry, I don't understand your very short description. May I recommend to ask your own question including a description what you want and a minimal working example? Feel free to take the code posted here! – Keks Dose Mar 15 '19 at 13:42

@aerious using the code provided by @keks-dose, the only change you have to make is adding the commands in the fourth line.

Like this,

\documentclass{scrbook}

\usepackage{etoc, blindtext}
\newcommand{\chaptertoc}[1][Chaptertoc]{%
\etocsettocstyle{\addsec*{#1\\\rule{\textwidth}{0.4pt}}}{}%}{}%<---- NOTE HERE THE CHANGE,
%%%%TO ADD THE RULE.
\localtableofcontents%
}

\begin{document}
\chapter{First Chapter}
\label{CLA:first-chapter}

\chaptertoc{}
\bigskip{}
\blindtext

\section{First section in first chapter}
\label{CLA:first-section-first}
\blindtext

\section{Second section in first chapter}
\label{CLA:second-section-first}
And this section even has subsections:
\blindtext{}

\subsection{First subsec in second sec of first chapter}
\label{CLA:first-subsec-second}
\blindtext{}

\subsection{You know how to proceed}
\label{CLA:you-know-how}
\blindtext{}

\end{document}


This change result in the desired element

• If you are going to use \bigskip and rule in the end , better to fix it to: \usepackage{etoc, blindtext} \newcommand{\chaptertoc}[1][Conteúdo]{% \etocsettocstyle{\addsec*{#1\\\rule{\textwidth}{0.4pt}} }{ \rule{\textwidth}{0.4pt} \bigskip}%}{} \localtableofcontents } – Xexeo Feb 17 at 5:14