With a KOMA-Script class you can use the automatically loaded package tocbasic
to define an additional ToC.
\documentclass[12pt,twoside,ngerman]{scrartcl}
\usepackage{babel}
%%% see: https://komascript.de/comment/5578#comment-5578 (Markus Kohm)
\DeclareNewTOC[%
owner=\jobname,
listname={Inhalt des Anhangs},% Titel des Verzeichnisses
]{atoc}% Dateierweiterung (a=appendix, toc=table of contents)
\makeatletter
\newcommand*{\useappendixtoc}{%
\renewcommand*{\ext@toc}{atoc}%
\scr@ifundefinedorrelax{hypersetup}{}{% damit es auch ohne hyperref funktioniert
\hypersetup{bookmarkstype=atoc}%
}%
}
\ifundefinedorrelax{ext@toc}{%
\newcommand*{\ext@toc}{toc}
\renewcommand{\addtocentrydefault}[3]{%
\expandafter\tocbasic@addxcontentsline\expandafter{\ext@toc}{#1}{#2}{#3}%
}
}{}
\makeatother
%%%
\usepackage{xpatch}
\xapptocmd\appendix{%
\cleardoublepage
\vspace*{\fill}
\addpart{\appendixname}
\thispagestyle{empty}
\vfill\vfill
\clearpage
\useappendixtoc
\listofatocs
}{}{\PatchFailed}
\renewcommand\raggedpart{\centering}
\setkomafont{partentry}{\usekomafont{sectionentry}}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\Blinddocument
\Blinddocument
\appendix
\blinddocument
\blinddocument
\end{document}
If you switch to scrreprt
you can use:
\documentclass[12pt,twoside,ngerman]{scrreprt}
\usepackage{babel}
%%% see: https://komascript.de/comment/5578#comment-5578 (Markus Kohm)
\DeclareNewTOC[%
owner=\jobname,
listname={Inhalt des Anhangs},% Titel des Verzeichnisses
]{atoc}% Dateierweiterung (a=appendix, toc=table of contents)
\makeatletter
\newcommand*{\useappendixtoc}{%
\renewcommand*{\ext@toc}{atoc}%
\scr@ifundefinedorrelax{hypersetup}{}{% damit es auch ohne hyperref funktioniert
\hypersetup{bookmarkstype=atoc}%
}%
}
\ifundefinedorrelax{ext@toc}{%
\newcommand*{\ext@toc}{toc}
\renewcommand{\addtocentrydefault}[3]{%
\expandafter\tocbasic@addxcontentsline\expandafter{\ext@toc}{#1}{#2}{#3}%
}
}{}
\makeatother
%%%
\usepackage{xpatch}
\xapptocmd\appendix{
\cleardoublepage
\addpart{\appendixname}
\useappendixtoc
\listofatocs
}{}{\PatchFailed}
\renewcommand\partpagestyle{empty}
\setkomafont{partentry}{\usekomafont{chapterentry}}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\Blinddocument
\Blinddocument
\appendix
\blinddocument
\blinddocument
\end{document}
Dots between all TOC entries and their page numbers:
If you want to add dots between the chapter entries and their page numbers in all TOCs insert the following line in your preambel:
\RedeclareSectionCommands[toclinefill=\TOCLineLeaderFill]{chapter,part}
If you want to add these dots only in the appendix TOC use either
\xapptocmd\appendix{
\cleardoublepage
\addpart{\appendixname}
\RedeclareSectionCommand[toclinefill=\TOCLineLeaderFill]{chapter}% <- added
\useappendixtoc
\listofatocs
}{}{\PatchFailed}
or
\xapptocmd\appendix{
\cleardoublepage
\addpart{\appendixname}
\KOMAoptions{toc=chapterentrywithdots}% <- added
\useappendixtoc
\listofatocs
}{}{\PatchFailed}
ngerman
option ofbabel
.