Removing footer on last pages of a chapter

Using scrpage2 with scrbook, how can I make it so that there is no footer on the last pages of a chapter (so that the white is not interrupted)?

-
With "last pages", do you mean blank even pages before new chapter-starting odd pages? – lockstep Jun 11 '11 at 20:41
@lockstep: the guidelines for French typography specify that page numbers in footer have to be removed at the end of partial pages finishing chapters. – ℝaphink Jun 11 '11 at 20:51

I would suggest

 \usepackage{etoolbox}
\preto\chapter{\thispagestyle{endchapterstyle}}


where endchapterstyle is a page style defined as the normal one, but with empty footer.

The command \chapter has the responsibility to clear the page. But a direct command \thispagestyle{endchapterstyle} might be preferable. Or

\newcommand{\closechapter}{\thispagestyle{endchapterstyle}}


so that you can change your mind later and leave in place \closechapter after having redefined it.

-
 Right. I'm actually using an \input for each chapter, so I could probably call \thispagestyle{endchapterstyle} after each call to \input. That said, I've already defined scrplain and scrheadings. How can I add more styles? – ℝaphink Jun 11 '11 at 20:52 @Raphink: from page 141 in the KoMaScript manual. – egreg Jun 11 '11 at 21:02 thanks, I hadn't read far enough... – ℝaphink Jun 11 '11 at 21:15 @Raphink: the \\ is ignored as the footer is typeset in horizontal mode; use \parbox[t]{6mm}{\hrule\vspace{2pt}\centering\pagemark} – egreg Jun 11 '11 at 21:45 thanks. As you can see, I actually decided to go with \defstyle instead, and it works really well :-) – ℝaphink Jun 11 '11 at 21:47
show 1 more comment

For the record, here is my implementation of @egreg's answer:

\cfoot[\rule{6mm}{0.8pt}\\\pagemark]{\rule{6mm}{0.8pt}\\\pagemark}
\ofoot[]{}

\defpagestyle{chapterend}%
{%