I'm now trying to format the TOC for my thesis. The package tocloft looks
promising, but when all three of "tocloft", "koma-script article" and
"fancy headers" are defined, I get
"\|@chapter undefined"
error.
I tried to replace "fancy headers" with the command "\deftripstyle",
documented in the komascript documentation, but also then I get the same
error.
\usepackage{scrpage}
\deftripstyle{default}[0pt][0pt]{}{}{\pagemark}{}{}{}
Here is my full preamble:
------------
% Redefine section styles with \sectionfont etc...
\usepackage{sectsty}
\usepackage{scrpage}
\deftripstyle{default}[0pt][0pt]{}{}{\pagemark}{}{}{}
% Define page number at the page corner
%\fancyhf{}
%\fancyhead[R]{ \thepage }
%\fancypagestyle{plain}{
%\fancyhf{}
%\fancyhead[R]{ \thepage }
%}
% Remove line below top header
%\renewcommand{\headrulewidth}{0pt}
% Add dots in after sections in TOC
\renewcommand*\l@section[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 1.0em \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\
\leaders\hbox{$\m@th
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
mu$}\hfil\nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi}
\usepackage{tocloft}
% \setlength{\cftbeforetoctitleskip}{10cm}
% Use "Figure x. " instead of "Figure x: "
\usepackage{caption2}
\renewcommand{\captionlabeldelim}{.}
% Allow using \doublespace and \singlespace
\usepackage{setspace}
% Set toplevel section style
\renewcommand\section{
\ifx \aftercontents \undefined%
{ }
\else
\pagebreak
\fi
\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\centering\large\bfseries\uppercase}%
}
% Set subsections headers style
\subsectionfont{\normalfont \centering \normalsize \bfseries }
\subsubsectionfont{\normalfont \normalsize \bfseries }
\newif \ifpdf
\ifx \pdfoutput \undefined
\pdffalse
\else
\pdftrue
\fi
% Insert PDF information and hyperlinks
\ifpdf
\pdfinfo { /Author (Tuukka Toivonen)
/Title (xxx)
/Subject (Diploma Thesis)
/Keywords (xxx)
}
\usepackage[pdftex]{hyperref}
\else
% \usepackage[ps2pdf]{hyperref}
\fi