For the main toc
Please read carefully again the linked answer and the KOMA-Script documentation1): By default in scrbook
(and scrreprt
) the toc is set in onecolumn modus. Only, when you want to have it in two columns, you need \unsettoc{toc}{onecolumn}
. So, leaving it out is the solution here …
For the minitoc
Use \setchapterpreamble
2). Note, you must set it before the chapter, where it belongs to. With two optional arguments you can influence position and width.
Also take notice, that I had to deactivate the rules before and after with \mtcsetrules{minitoc}{off}
. As workaround I added two times \hrulefill
(the first must be in \smash
and then a make box [it would have worked without, but then a more difficult vertical space determining], the second would also work without, but I just copied it) and some vertical spaces. I guess, the \vspace
must be individually adjusted to one’s font and font size.
Since you very probably will have more than one chapter, I defined two new commands, see below code for remarks. Because these have \setchapterpreamble
inside (or are intended to use them inside), these must be set before each chapter.
\documentclass[twocolumn]{scrbook}
\usepackage[nohints]{minitoc}
\mtcsetrules{minitoc}{off}
\usepackage{lipsum}
\newcommand{\dochaptertoc}{%
\vspace{1.85\baselineskip} % workaround for removed rule
\smash{\makebox[\linewidth]{\hrulefill}} % workaround for removed rule
\vspace{-1.85\baselineskip} % workaround for removed rule
\minitoc
\vspace{-1.15\baselineskip} % workaround for removed rule
\smash{\makebox[\linewidth]{\hrulefill}} % workaround for removed rule
\vspace{1.15\baselineskip} % workaround for removed rule
}
\newcommand{\setchaptertoc}{%
\setchapterpreamble{% KOMA-Script command
\dochaptertoc%
}}
\begin{document}
\dominitoc
\tableofcontents
\setchaptertoc
\chapter{One}
\lipsum[1]
\section{One, one}
\lipsum[2]
\subsection{One, one, one}
\lipsum[3]
\section{One, two}
\lipsum[4]
\setchapterpreamble{
\dictum{Time for a bon-mot.}% KOMA-Script command
\dochaptertoc
}
\chapter{Two}
\lipsum[5]
\section{Two, one}
\lipsum[6]
\section{Two, two}
\subsection{two, two, one}
\lipsum[7]
\end{document}
In most cases it will be enough to put \setchaptertoc
in front of a chapter. But for cases, when you want to add more than the minitoc, I defined \dochaptertoc
with the workarounds for removed rules intended for use in \setchapterpreamble
, cf. chapter 2 in the example.
1) Read online on Texdoc.net: “\setuptoc” & “\unsettoc” (PDF)
2) Read online on Texdoc.net, as well: “\setpartpreamble” & “\setchapterpreamble” (PDF again)