I'm looking for something to resolve the problem that has been metioned at How do I get \chaptername to appear in the table of contents? and Table of Contents with “Chapter” and per-chapter “Appendix” threads.
Those is exactly what I'm looking for. But I've got error when as soon as using
\usepackage{tocloft}
And here is the error messenge:
! LaTeX Error: Command \c@lofdepth already defined. Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help.
l.597 \newcounter{lofdepth} \setcounter{lofdepth}{1}
Please tell me what is that error! And how to fix?
My .cls file contain:
\renewcommand\tableofcontents{
\btypeout{Contents}
\addtotoc{Contents}
\begin{spacing}{1}{
\setlength{\parskip}{1pt}
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\contentsname
\@mkboth{
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
\@starttoc{toc}
\if@restonecol\twocolumn\fi
\cleardoublepage
}\end{spacing}
}
And because there is error occured when I've tried using the tocloft package. So I have used the following code block:
\makeatletter
\let\@@l@chapter\l@chapter
\def\l@chapter#1{\@@l@chapter{\chaptername\ #1}}
\makeatother
But the result is not as well as my wish. It's look like this:
Chapter List of tables
.....
Chapter List of figures
Chapter 1 Introduction
The chapter 1 contents table.
....
Chapter A Examples
But what I wanna is something like this:
List of tables
List of figuresChapter 1 Introduction
...
Chapter 2 And so on...
Appendix A
Anyone can give me some suggestion? Thanks avandce!