2

I need to get a separate List of Appendices in a new page, but I get an error

Undefined control sequence

My code is

\documentclass[12pt,a4paper,oneside]{report}
\usepackage[titletoc]{appendix}
\usepackage{tocloft}
\begin{document}

\addcontentsline{toc}{chapter}{TABLE OF CONTENTS}
\tableofcontents
\newpage

\listofappendices

\newpage

\chapter{a1}
aaaaaaaaaaaaaaaaaa
\chapter{b1}
bbbbbbbbbbbbbbbbbbbb

\addcontentsline{toc}{chapter}{APPENDICES}
\begin{appendices}
\chapter{MY}
ccccccccccccccccccccccccccc
\chapter{DFG}
dddddddddddddddd
\end{appendices}

\end{document}
egreg
  • 1,121,712
Emalka
  • 1,651
  • 3
  • 22
  • 23
  • Could you please see this: http://tex.stackexchange.com/questions/9138/creating-a-separate-list-of-appendices-with-tocloft – kan May 12 '13 at 07:08
  • It's not worked.My document class is report and i need to add appendix to table of contents as well as separate list.Can u please check my code and give me a simple solution for this matter..thank u – Emalka May 12 '13 at 07:41
  • There is no \listofappendices. Do you need the package tocloft? – Marco Daniel May 12 '13 at 09:22

1 Answers1

2

There is no environment appendices. There is a command appendix which introduce the appendix.

To get a list of appendix you need a new auxiliary file. In the example below the new auxiliary file gets the extension toa (t able o f a ppendix). In the next step you must declare that all entries of the appendix are written to the new file. Therefor I am using the package xpatch:

\listfiles
\documentclass[12pt,a4paper,oneside]{report}
\usepackage[titletoc]{appendix}
\usepackage{tocloft}
\usepackage{xpatch}
\makeatletter
\newcommand\listofappendixname{Table of \appendixname}

\newcommand\listofappendices{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listofappendixname
        \@mkboth{%
           \MakeUppercase\listofappendixname}{\MakeUppercase\listofappendixname}}%
    \@starttoc{toa}%
    \if@restonecol\twocolumn\fi
    }
\g@addto@macro\appendix{%
  \addcontentsline{toc}{chapter}{\appendixname}%
  \xpatchcmd{\@part}{\addcontentsline{toc}}{\addcontentsline{toa}}{}{}%
  \xpatchcmd{\@part}{\addcontentsline{toc}}{\addcontentsline{toa}}{}{}%
  \xpatchcmd{\@chapter}{\addcontentsline{toc}}{\addcontentsline{toa}}{}{}%
  \xpatchcmd{\@chapter}{\addcontentsline{toc}}{\addcontentsline{toa}}{}{}%
  \xpatchcmd{\@sect}{\addcontentsline{toc}}{\addcontentsline{toa}}{}{}%
  \xpatchcmd{\@sect}{\addcontentsline{toc}}{\addcontentsline{toa}}{}{}%
}
\makeatother
\begin{document}


\tableofcontents


\listofappendices

\newpage

\chapter{a1}
aaaaaaaaaaaaaaaaaa
\chapter{b1}
bbbbbbbbbbbbbbbbbbbb


\appendix

\chapter{MY}
ccccccccccccccccccccccccccc
\chapter{DFG}
dddddddddddddddd


\end{document}
egreg
  • 1,121,712
Marco Daniel
  • 95,681