Creating a separate list of appendices with tocloft

I'm very sorry but I have to ask for urgent help as I could not make sense of the individual questions I asked previously.

I'm required a separate list of appendices, i.e. the appendix is not to show up in the TOC except for the item Appendix, which can be manually created with

\addcontentsline{toc}{section}{Appendix}


The appendix itself is supposed to be structured like

Appendix A
A.1 Title
A.2 Title
..

Appendix B
B.1 Title
B.2 Title
..


Tocloft provides a means to manually create a list, this example is taken from the documentation:

\newcommand{\listanswername}{List  of  Answers}



creates the command \listofanswer which items are added to with

\answer{Hard}


This results in

List of Answers
1 Hard ....... pageno


Several problems arise for me:

• Decimal counter instead of alphabetic
• no sub environment for the A.n scheme
• no prefix like "Appendix A.1 Hard .... pageno"

So I need a list such as

List of Appendices

Appendix A    Code listings   ................. 187
Appendix A.1  Stackexchange generator ........  187
Appendix A.2  Stackexchange hack function .... 2179

Appendix B    Misc            ................ 2180
Appendix B.1  Overview Q&A Sites      ........ 2181
Appendix B.2  User psychoanalysis         .... 2378


I assume this may be solved by adding a second command in the manner presented by the tocloft documentation but I'm currently not capable of spending time figuring it out due to my desastrous state of the paper (of course, due tomorrow).

So if someone could provide the sub-command and a way to change enumeration to literals I'd greatly appreciate it. Sorry again, I'm in a state of mind where only a a bullet-proof for-dummies solution will get me somewhere.

This might be too late for the original poster, but here's what I came up with. Largely adapted from lockstep's answer, but matches the Appendix/Subappendix model, and follows the ToC style requested:

\documentclass[toc=flat,numbers=noenddot]{scrartcl}
\usepackage{lipsum}
\usepackage{tocloft}

\newcommand{\listappendixname}{List of Appendices}
\newlistof{appendix}{app}{\listappendixname}
\setcounter{appdepth}{2}
\renewcommand{\theappendix}{\Alph{appendix}}
\renewcommand{\cftappendixpresnum}{Appendix\space}
\setlength{\cftbeforeappendixskip}{\baselineskip}
\setlength{\cftappendixnumwidth}{1in}
\newlistentry[appendix]{subappendix}{app}{1}
\renewcommand{\thesubappendix}{\theappendix.\arabic{subappendix}}
\renewcommand{\cftsubappendixpresnum}{Appendix\space}
\setlength{\cftsubappendixnumwidth}{1in}
\setlength{\cftsubappendixindent}{0em}

\newcommand{\myappendix}[1]{%
\refstepcounter{appendix}%
\section*{\theappendix\space #1}%
\par
}

\newcommand{\subappendix}[1]{%
\refstepcounter{subappendix}%
\subsection*{\thesubappendix\space #1}%
}

\begin{document}
\tableofcontents
\section{Foo} \lipsum[1]
\subsection{Bar} \lipsum[2]

\listofappendix

\myappendix{Baz} \lipsum[5]
\subappendix{Qux} \lipsum[6]
\end{document}


I managed to correct the example from the tocloft documentation.

• Two codelines are actually faulty -- one mandatory argument of \newlistentry is missing, as well as a closing brace in \addcontentsline. I have marked these corrections with "(!)".

• Because you are using a document class without \chapter, some parameters had to be changed.

I have also taken the liberty to make changes in the vertical and horizontal spacing (marked with "Optional").

\documentclass[toc=flat,numbers=noenddot]{scrartcl}

\usepackage{tocloft}

\bigskip% Optional
\par\noindent
\par
}

\smallskip% Opional
\par
}

\begin{document}

\section{foo}

Making a custom list with \texttt{tocloft}.

\subanswer{Reformulate the problem } It assists \dots

\end{document}

• Thanks so much for getting it to work. It's not quite what I need yet but I'll try to figure it out. Will get back to this in <24 hrs. Thanks again. – None Jan 17 '11 at 17:43
• This results in 6.1.j Sublevel . .. . . . . . . . . . 66 6.2 Nexttoplevel . . . . . . . . . 66 6.2.a Nextsublevel . . . . . . . . . xx Could someone please help me out and tell me how to create the list as shown in my question? Sorry about the desparation :-( – None Jan 18 '11 at 8:09

Here's a solution that doesn't involve tocloft. The author is Markus Kohm; I have taken the code from this site, made minor modifications and translated Markus Kohm's comments.

\documentclass[toc=flat,numbers=noenddot]{scrartcl}

\usepackage{blindtext}

\makeatletter
\begingroup
\@fileswfalse% don't open new ToC file
\renewcommand*{\appendixattoc}{% macro for separation of ToC contents
\value{tocdepth}=-10000 % set tocdepth to very small value locally
}%
\tableofcontents% output ToC
\endgroup
}
\begingroup
\edef\@alltocdepth{\the\value{tocdepth}}% save tocdepth
\setcounter{tocdepth}{-10000}% no ToC entries
\renewcommand*{\contentsname}{% change ToC name
List of Appendices}% "List of Appendices" INSTEAD OF "Verzeichnis der Anh\"ange"
\renewcommand*{\appendixattoc}{% macro for separation of ToC contents
\setcounter{tocdepth}{\@alltocdepth}% restore tocdepth
}%
\tableofcontents% output ToC
\setcounter{tocdepth}{\@alltocdepth}% restore tocdepth
\endgroup
}
\newcommand*{\appendixattoc}{% macro for separation of ToC contents
}
%  \if@openright\cleardoublepage\else\clearpage\fi% new page; DELETED
\addtocontents{toc}{\protect\appendixattoc}% macro for separation into ToC file
}
\makeatother

\begin{document}

\maintoc
\blinddocument
% \blinddocument% DELETED

\appendix
\appendixtoc
\blinddocument
% \blinddocument% DELETED

\end{document}

% Note that \maintoc only works if \appendixtoc is also present. Otherwise,
% the ToC will never be updated. If \appendixtoc is removed, one should use

• It seems, that Appendix bookmark doesn't link on the correct page. In my case it is the subsubsection before List of Appendices. Adding \phantomsection after \clearpage% new page; ADDED solved the problem. – CSchulz Aug 5 '11 at 11:45