# Appendix in scrreprt - Separate table of appendices but mentioned in original TOC

I tried to find solutions to this particular case, but I wasn't able to. What I want to achieve is to create an appendix in the following class:

\documentclass[a4paper, 12pt, headsepline, smallheadings]{scrreprt}

which is mentioned in the usual TOC only once by the name, that means as 'Appendix'. Moreover, I would like add a separate table of contents as 'List of Appendices' for the subsections of the appendix. This should become the first page of the appendix. The headline should still work as intended, that means show the current appendix/chapter. The names of 'Appendix' and 'List of appendices' should be changable (if possible), because I am not sure yet which names are ideal.

To illustrate this a little better, I want the following entries in the TOC:

TOC

Introduction
Chapter
etc.
List of appendices


And then at some point of the document:

List of appendices

A
B
etc.


Does anyone know how to do it? Thanks for any helps/hints. Regards

Here is a very small MWE:

\documentclass[a4paper, 12pt, headsepline, smallheadings]{scrreprt}
\begin{document}

\listoffigures
\listoftables
\tableofcontents

\chapter{Start}
Start

\appendix
\chapter{AAA}
\chapter{vvv}
\chapter{ccc}

\end{document}

• Without having tested ever: perhaps package etoc? See also KOMA-Script’s tocbasic (described in KOMA-Script documentation) and tocstyle (own description in KOMA-Script directory; produces a warning of being in alpha state, but I’ve never got problems). – Speravir Dec 17 '13 at 2:08
• @Speravir I have looked around, but found nothing which does exactly what I wanted to achieve. – TomM Dec 17 '13 at 13:59

Here is a solution.

With these lines we create a new "List of Appendices" (LoA) that can then be recalled through the command \listofappendices. Note that the names are customizable.

\newcommand\appendicesname{Appendices}
\newcommand\listofloaname{List of \appendicesname}
\newcommand*{\listofappendices}{\listoftoc{loa}}


The following line is to add the LoA to the ToC:

\setuptoc{loa}{totoc}


With the following lines, partially borrowed from this answer of Caramdir, we redefine all sectioning commands so to be added to the LoA instead of to the ToC, when issuing the \appendix command:

\makeatletter
\let\oldpart\part
\renewcommand*\part[1]{%
\oldpart{#1}%
}
\let\oldchapter\chapter
\renewcommand*\chapter[1]{%
\oldchapter{#1}%
}
\let\oldsection\section
\renewcommand*\section[1]{%
\oldsection{#1}%
}
\let\oldsubsection\subsection
\renewcommand*\subsection[1]{%
\oldsubsection{#1}%
}
\let\oldsubsubsection\subsubsection
\renewcommand*\subsubsection[1]{%
\oldsubsubsection{#1}%
}
}
\makeatother


Complete working example (remove listof=totoc from scrreprt's options if you don't want LoT and LoF in the ToC):

\documentclass[a4paper, 12pt, headsepline, smallheadings, listof=totoc]{scrreprt}

\newcommand\appendicesname{Appendices}
\newcommand\listofloaname{List of \appendicesname}
\newcommand*{\listofappendices}{\listoftoc{loa}}
\setuptoc{loa}{totoc}

\makeatletter
\let\oldpart\part
\renewcommand*\part[1]{%
\oldpart{#1}%
}
\let\oldchapter\chapter
\renewcommand*\chapter[1]{%
\oldchapter{#1}%
}
\let\oldsection\section
\renewcommand*\section[1]{%
\oldsection{#1}%
}
\let\oldsubsection\subsection
\renewcommand*\subsection[1]{%
\oldsubsection{#1}%
}
\let\oldsubsubsection\subsubsection
\renewcommand*\subsubsection[1]{%
\oldsubsubsection{#1}%
}
}
\makeatother

\begin{document}

\listoffigures
\listoftables
\tableofcontents

\chapter{1st chapter}
\section{1st section}
\chapter{2nd chapter}
\section{2nd section}

\listofappendices

\appendix

\chapter{1st appendix chapter}
\section{1st appendix section}
\chapter{2nd appendix chapter}
\section{2nd appendix section}

\end{document}


Output (ToC):

Output (LoA):

• Wow that was more complicated than I thought it would be. Thanks A LOT! very useful – TomM Dec 17 '13 at 18:08
• @TomM You're welcome. Thanks for accepting (it took me almost one hour...) – karlkoeller Dec 17 '13 at 18:10
• I have a short follow up question. Assuming I'd like to use only chapters in the appendix, but no sections, is it possible to obtain table numbering according to the chapter? In short: A. 1st appendix chapter, then just Table A.1, Table A.2 etc. Then B. 2nd appendix chapter, Table B.1, Table B.2 etc.? (Also appendix tables are still in the original Table of contents atm. Is this intended? My appendix consists 99% of tables) – TomM Dec 17 '13 at 21:57
• @TomM This is quite a different question. Please ask a new question for this. – karlkoeller Dec 18 '13 at 5:21
• ok done. Here is the thread, for reference: tex.stackexchange.com/questions/150581/… – TomM Dec 18 '13 at 15:48