The current problem with your setup is the redefinition of \@chapter
inside the book.cls
class. Typically \@chapter
is defined to take two arguments - the first being optional and the second mandatory (taken from book.cls
):
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
Your class has been modified to make \@chapter
take three arguments:
\def\@chapter[#1]#2#3{\ifnum \c@secnumdepth >\m@ne %%%Changed by Rajarshi
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#2}%
\else
\addcontentsline{toc}{chapter}{#2}%
\fi
\else
\addcontentsline{toc}{chapter}{#2}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#1}]%
\else
\@makechapterhead{#3}%
\@afterheading
\fi}
Rajarshi must have had something in mind here... :)
algorithm2e
taps into \@chapter
to insert content into the List of Algorithms (LoA), but it doesn't keep the three-argument definition of \@chapter
. Here's the definition inside algorithm2e.sty
:
\def\@chapter[#1]#2{\algocf@original@chapter[#1]{#2}\addtocontents{loa}{\protect\addvspace{10\p@}}}%
This has to change to
\def\@chapter[#1]#2#3{\algocf@original@chapter[#1]{#2}{#3}\addtocontents{loa}{\protect\addvspace{10\p@}}}%
so that the third argument is captured properly.
There are more problems, but this at least solves the issue with \chapter
s.
book.cls
. It's been modified and doesn't work properly when generating\chapter
s.book.cls
. Are you saying you don't have that as part of your version? It's difficult to help you without seeing exactly what you're seeing.