Seite 1 von 1
Inhaltsverzeichnisse an mehreren Stellen
Verfasst: Fr 25. Jun 2010, 15:57
von fmichel
Hallo Forum,
wie kann ich in einem Dokument mehrere Inhaltsverzeichnisse erzeugen.
Ich teile das Script in mehrere Kapitel auf und möchte auf der zweiten Seite z.B das Inhaltsverzeichnis der Kapitel 1-3 anzeigen. Auf Seite 154(fiktiv) begint Kapitel 4 und geht bis Kapitel 8 .Seite 365. Wie kann ich mir das Inhaltsverzeichnis der kapitel 4-8 auf Seite 154 anzeigen lassen??
Paket: minitoc
Verfasst: Fr 25. Jun 2010, 18:48
von AufdieSchnelle
Dazu eignet sich das Paket "minitoc".
Verfasst: Fr 25. Jun 2010, 20:37
von KOMA
\documentclass{scrbook}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\usepackage{tocstyle}
\usetocstyle{KOMAlike}
\newcounter{tocpart}
\newcommand*{\tocpartoff}{2}% Ab Inhaltsverzeichnisteil 2 abschalten
\newcommand*{\tocparton}{\maxdimen}% bis in alle Ewigkeit
\newcommand*{\tocwithout}[2]{%
\setcounter{tocpart}{0}%
\renewcommand*{\tocpartoff}{#1}%
\renewcommand*{\tocparton}{#2}%
\showtoc{toc}
}
\AtBeginDocument{\xdef\defaulttocdepth{\the\value{tocdepth}}}
\newcommand*{\marknexttocpart}[1][\defaulttocdepth]{%
\addtocontents{toc}{\nexttocpart{#1}}%
}
\DeclareRobustCommand*{\nexttocpart}[1]{%
\stepcounter{tocpart}%
\typeout{Wir sind bei Inhaltsverzeichnisteil \thetocpart.}%
\ifnum \value{tocpart}=\tocpartoff
\typeout{Hier schalten wir ab.}%
\setcounter{tocdepth}{-\maxdimen}%
\else\ifnum \value{tocpart}=\tocparton
\ifx\storedtocdepth\empty\else
\typeout{Hier schalten wir wieder ein.}%
\setcounter{tocdepth}{#1}%
\let\storedtocdepth\empty
\fi
\fi\fi
}
\begin{document}
\tableofcontents
\marknexttocpart
\blinddocument
\blinddocument
\blinddocument
\blinddocument
\marknexttocpart
\chapter*{Inhaltsverzeichnis 2}
\tocwithout{1}{2}% bei Inhaltsverzeichnis Teil 1 abschalten, bei 2 einschalten
\blinddocument
\blinddocument
\blinddocument
\blinddocument
\end{document}