Hi,

I had this problem:

I'm writing a text with scrbook that includes 2 tables of contents
(tocs), the first one is a short toc (toc depth 0), the second one is a
detailed toc (toc depth 5).
The short toc is generated with package shorttoc. My problem: How can I
get pagebreaks for each toc separately, as the command

\addtocontents{toc}{\protect\newpage}

effects both tocs?

And below comes the solution that Markus Kohm found in a small example.
Thanks to him!

Regards
Detlev


\documentclass[oneside,german]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

\usepackage{shorttoc}%%% For short and long toc

\usepackage{babel}
\makeatother

\begin{document}
\DeclareRobustCommand*{\shortortoc}[2]{#1}%%% New command \shortortoc
\shorttoc{Short TOC}{0} 
\DeclareRobustCommand*{\shortortoc}[2]{#2}
\renewcommand*{\contentsname}{Long TOC} 
\setcounter{tocdepth}{5}
\tableofcontents

\clearpage{}

\part{Introduction}
\part{Mainpart}
\chapter{Chapter 1}
\section{Section 1}
\subsection{Subsection 1}
\subsection{Subsection 2}
\subsection{Subsection 3}
\section{Section 2}
\subsection{Subsection 1}
\subsection{Subsection 2}
\chapter{Chapter 2}
\section{Section 1}
\subsection{Subsection 1}
\subsection{Subsection 2}
\section{Section 2}
\subsection{Subsection 1}
\subsection{Subsection 2}
\subsection{Subsection 3}
\chapter{Chapter 3}
\section{Section 1}
\subsection{Subsection 1}
\subsection{Subsection 2}
\subsection{Subsection 3}
\section{Section 2}
\subsection{Subsection 1}
\subsection{Subsection 2}
\addtocontents{toc}{\shortortoc{}{\protect\newpage}}%%% Pagebreak for long toc 
\chapter{Chapter 4}
\section{Section 1}
\subsection{Subsection 1}
\subsection{Subsection 2}
\subsection{Subsection 3}
\section{Section 2}
\subsection{Subsection 1}
\subsection{Subsection 2}
\chapter{Chapter 5}
\chapter{Chapter 6}
\chapter{Chapter 7}
\chapter{Chapter 8}
\chapter{Chapter 9}
\chapter{Chapter 10}
\chapter{Chapter 11}
\chapter{Chapter 12}
\chapter{Chapter 13}
\chapter{Chapter 14}
\chapter{Chapter 15\_A}
\chapter{Chapter 16\_A}
\addtocontents{toc}{\shortortoc{\protect\newpage}{}}%%% Pagebreak for short toc 
\chapter{Chapter 17\_B}
\chapter{Chapter 18\_B}
\part{Conclusion}
\end{document}


Attachment: Shorttoc_Minimalbeispiel_6.lyx
Description: application/lyx

Reply via email to