# What exactly does \pagenumbering do?

I am trying to squelch the page numbers using the code from here. This works fine, if one uses ordinary page numbers. If the page numbers are modified with the pagenumbering command, it doesn't work anymore.

Here is the MWE:

\documentclass{scrbook}
\usepackage{accsupp}
% Defining the squelch command
\DeclareRobustCommand\squelch[1]{%
\BeginAccSupp{method=plain,ActualText={}}#1\EndAccSupp{}}
% Trying to squelch the page numbers
\let\oldthepage\thepage
\def\thepage{\squelch{\oldthepage}}

\begin{document}
\pagenumbering{roman}
\chapter{First Chapter}
\newpage
\pagenumbering{arabic}
\chapter{Next Chapter}
\end{document}

-
\pagenumbering redefines \thepage. –  egreg Mar 31 '12 at 17:58
okay, so implementing \let\oldthepage\thepage \def\thepage{\squelch{\oldthepage}} after each pagenumbering command seems to do the job. –  maetra Mar 31 '12 at 18:02
I've updated my original answer to work with \pagenumbering. –  rdhs Mar 31 '12 at 18:04

The cleanest solution is to load scrpage2:

\documentclass{scrbook}
\usepackage{accsupp}

\usepackage{scrpage2}
\pagestyle{scrplain}

% Defining the squelch command
\DeclareRobustCommand\squelch[1]{%
\BeginAccSupp{method=plain,ActualText={}}#1\EndAccSupp{}}

% Trying to squelch the page numbers
\ofoot[\normalfont\squelch{\thepage}]{\normalfont\squelch{\thepage}}

\begin{document}
\pagenumbering{roman}

\chapter{First Chapter}
\newpage
\pagenumbering{arabic}

\chapter{Next Chapter}
\end{document}

-