[英]Latex: Multiple Table of Contents
我在尋找的是以下目錄結構:
目錄
1個艾蒿
2哈羅
3月
包含這些章節的文檔,但在每章的開頭均包含其特定的目錄:
1個艾蒿
-----這里子目錄-----
1.1主題
1.2測試
----這里是部分測試的開始----
1.2測試
但是問題是,在這些不同的章節中,所有子主題都被組合了,例如在我的示例中:
\documentclass{scrbook}
\usepackage[latin1]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{blindtext}% generiert Beispieltext
\usepackage{tocstyle}[2008/10/20]% experimentelles KOMA-Script-Paket
\usetocstyle{standard}
\newcounter{normaltocdepth}
\newcommand*{\startstory}[1]{%
\newpage\chapter{#1}\addtocontents{toc}{\protect\startstory}%
}
\newcommand*{\afterstory}{%
\addtocontents{toc}{\protect\afterstory}
}
\newcommand*{\maintoc}{%
\begingroup
\setcounter{normaltocdepth}{\value{tocdepth}}%
\renewcommand*{\startstory}{%
\setcounter{tocdepth}{1}%
}%
\renewcommand*{\afterstory}{%
\setcounter{tocdepth}{\value{normaltocdepth}}%
}%
\tableofcontents
\endgroup
}
\newcommand*{\storytoc}{%
\begingroup
\setcounter{normaltocdepth}{\value{tocdepth}}%
\setcounter{tocdepth}{-2}%
\renewcommand*{\startstory}{%
\setcounter{tocdepth}{\value{normaltocdepth}}%
}%
\renewcommand*{\afterstory}{%
\setcounter{tocdepth}{-2}%
}%
\showtoc{toc}
\setcounter{tocdepth}{\value{normaltocdepth}}% Hinzugefügt!
\endgroup
}
\newcommand{\neuestory}[3]{
\startstory{#3}
\vspace{10mm}
\section*{Abstract}
\small
\noindent #1
\section*{Personen}
\noindent #2
\normalsize
\vspace{10mm}
\section*{Inhalt}
\storytoc
%\cleardoublepage
}
\begin{document}
\maintoc
\newpage
\chapter{Vorwort}
blabla
\neuestory{ABC}{eine Frau}{Hallo}
\section{Test}
abc
\afterstory
\neuestory{DEF}{eine Mann}{Und so weiter}
\section{weiterheiter}
def
\afterstory
\end{document}
答案是minitoc軟件包。
工作正常!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.