Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
\usepackage[nouppercase,headsepline,footsepline,automark]{scrpage2}
\clearscrheadfoot
\clearscrheadings
\chead{}
\cfoot{}
\ihead{HeaderLeftText}
\ohead{\parttitle}
\ifoot{\rule{0pt}{\ht\strutbox+\dp\strutbox}\leftmark}
\ofoot{\rule{0pt}{\ht\strutbox+\dp\strutbox}\thepage}
\pagestyle{scrheadings}

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?

share|improve this question
1  
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

2 Answers 2

up vote 2 down vote accepted

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
\pagestyle{scrheadings}
\part{blub}
share|improve this answer

To get rid of the headers/footers in ToC, you can use:

\tableofcontents
\thispagestyle{empty}
share|improve this answer
    
This give the wanted result only if the table of contents has at most 2 pages. –  Ulrike Fischer Jun 6 '11 at 14:20
    
@Ulrike: that's right. –  ℝaphink Jun 6 '11 at 14:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.