ich habe für mein Dokument mehrere Anhänge und möchte diese gerne im PDF-Inhaltsverzeichnis als Sections der "Chapter"-Überschrift Anhang zusammengefasst haben.
Für das Inhaltsverzeichnis soll es zwei Varianten geben:
- Die Anhänge tauchen in einem seperaten Anhangsverzeichnis als Chapters auf
- Die Anhänge tauchen wie gewohnt im Inhaltsverzeichnis aber als Sections unter "Anhang" auf.
Momentan habe ich folgenden Code, welcher mir die Verzeichnisse wie unter 1. gewünscht aufteilt, allerdings habe ich sie im Inhaltsverzeichnis des PDF immernoch zusammengefasst. Weiß jemand Rat, wie man rein das PDF-Inhaltsverzeichnis beeinflussen kann?
\documentclass[ a4paper, oneside, 12pt, listof=totoc, appendixprefix, ]{scrreprt} \usepackage{hyperref} % % Inhaltsverzeichnis und Anhangsverzeichnis trennen % und Seitenumbrüche im Inhaltsverzeichnis nicht zwischen sections mit \maintocnewpage % \newcommand*{\makenewpageinmaintoc}{\newpage}%Seitenumbruch im Inhaltsverzeichnis \newcommand*{\makenewpageinappendixtoc}{} %erst mal keinen Seitenumbruch \makeatletter% --> De-TeX-FAQ \newcommand*{\maintoc}{% Hauptinhaltsverzeichnis \begingroup \@fileswfalse% kein neues Verzeichnis öffnen \renewcommand*{\appendixattoc}{% Trennanweisung im Inhaltsverzeichnis \value{tocdepth}=-10000 % lokal tocdepth auf sehr kleinen Wert setzen }% \tableofcontents% Verzeichnis ausgeben \endgroup } \newcommand*{\appendixtoc}{% Anhangsinhaltsverzeichnis \begingroup \edef\@alltocdepth{\the\value{tocdepth}}% tocdepth merken \setcounter{tocdepth}{-10000}% Keine Verzeichniseinträge \renewcommand*{\contentsname}{% Verzeichnisname ändern Verzeichnis der Anh\"ange}% \renewcommand*{\appendixattoc}{% Trennanweisung im Inhaltsverzeichnis \setcounter{tocdepth}{\@alltocdepth}% tocdepth wiederherstellen }% \renewcommand*{\makenewpageinmaintoc}{}%keine neue Seite \renewcommand*{\makenewpageinappendixtoc}{\newpage}%Einschalten des Seitenumbruchs \tableofcontents% Verzeichnis ausgeben \setcounter{tocdepth}{\@alltocdepth}% tocdepth wiederherstellen \endgroup } \newcommand*{\appendixattoc}{}% Trennanweisung im Inhaltsverzeichnis \g@addto@macro\appendix{% \appendix erweitern \if@openright\cleardoublepage\else\clearpage\fi% Neue Seite \addcontentsline{toc}{chapter}{\appendixname}% Eintrag ins Hauptverzeichnis \addtocontents{toc}{\protect\appendixattoc}% Trennanweisung in die toc-Datei } \makeatother \begin{document} %\tableofcontents \maintoc \chapter{Kapitel 1} \chapter{Kapitel 2} \chapter{Kapitel 3} \chapter{Kapitel 4} \listoffigures \appendixtoc \appendix \chapter{Anhang 1} \chapter{Anhang 2} \chapter{Anhang 3} \chapter{Anhang 4} \end{document}
\documentclass[ a4paper, oneside, 12pt, listof=totoc, appendixprefix ]{scrreprt} \usepackage{hyperref} %------------------Anfang Nummerierung Anhang----------------- \renewcommand\appendix{\par \setcounter{section}{0}% \setcounter{subsection}{0}% \setcounter{figure}{0}% \renewcommand\thesection{\Alph{section}}% \renewcommand\thefigure{\Alph{section}.\arabic{figure}}} %------------------Ende Nummerierung Anhang----------------- \begin{document} \tableofcontents \chapter{Kapitel 1} \chapter{Kapitel 2} \chapter{Kapitel 3} \chapter{Kapitel 4} \listoffigures \appendix \section{Anhang 1} \section{Anhang 2} \section{Anhang 3} \section{Anhang 4} \end{document}
Viele Grüße & besten Dank!
Christian