# KOMA Script exclude header-footer in contents

I am using these settings:

\documentclass[12pt,a4paper,english,openany,oneside]{scrbook}
\usepackage{etoolbox}
\usepackage{calc}
\makeatletter
\pretocmd{\@part}{\gdef\parttitle{#1}}{}{}
\pretocmd{\@spart}{\gdef\parttitle{#1}}{}{}
\makeatother
\cfoot{}
\ifoot{\rule{0pt}{\ht\strutbox+\dp\strutbox}\leftmark}
\ofoot{\rule{0pt}{\ht\strutbox+\dp\strutbox}\thepage}


and

\begin{document}
% title stuff here
\thispagestyle{empty}
\newpage
\tableofcontents
\part{PartText}


The problem is that since the settings above are defined before \begin{document}, the rendering of table of contents causes error that undefined control sequence in \parttitle and \part, because the headers and footers also appear on the contents page (which I dont want). I think the error is due to the fact that no \part is defined before the TOC and hence there is no text to put in partitle, i.e. the right header.

So, how could I get rid of the header-footer in TOC, or what's another solution?

-
I am not sure about your intent with the headers/footers. Remove \pagestyle{scrheadings} from the preamble and place it right after the firs \part command. This will prevent the error; I'm not sure however, if this is what you expect. –  Gonzalo Medina Jun 6 '11 at 14:12

To get rid of the error initialize your command (that's a good idea anyway) in the preamble: \newcommand\parttitle{}

To get another pagestyle (e.g. empty) in the toc do

\newpage
\pagestyle{empty}
\tableofcontents
\clearpage
\part{blub}

-
\tableofcontents