# White box behind page numbers in beamer

I lost the codes for a beamer that I previously prepared. Now I am creating a new presentation with exactly the same style, and I am using the pdfpages package the include some pages of the pdf. However, the page numbers overlap with the previous one.

I would like to cover the page numbers of the included pdf so that the page numbers of the new presentation is clearly visible. A white box behind page numbers and above the included pdf would work really well.

Here is a sample code:

\documentclass{beamer}
\setbeamertemplate{footline}[page number]{}
\usepackage{pdfpages}

\begin{document}

{
\setbeamercolor{background canvas}{bg=}
%old pdf have different page numbers so I want to hide them
\includepdf[pages={-}, pagecommand={}]{old.pdf}
}

\begin{frame}
Some new stuff.
\end{frame}

\end{document}

• Try with pagecommand={\thispagestyle{empty}}.
– Werner
May 7 '20 at 2:05
• @Werner thanks for the quick response. However, I would like to show the pdf numbers of the new pdf, not the old one (and they are totally different). This is why I want a white box above the bottom right corner of the old pdf. May 7 '20 at 2:11

Based on this answer here is how you can hack the framenumber.

\documentclass{beamer}
\setbeamertemplate{footline}[page number]{}
\setbeamertemplate{footline}{%
\hfill%
\kern1em\vskip2pt%
}
\usepackage{pdfpages}

\begin{document}

{
\setbeamercolor{background canvas}{bg=}
%old pdf have different page numbers so I want to hide them
%\includepdf[pages={-}, pagecommand={}]{example-image-duck.pdf}
}

\begin{frame}
Some new stuff.
\end{frame}

\end{document}


You will need something like

 \fcolorbox{white}{white}{...


instead, i.e. white color instead of red, and you may need make the box a bit wider depending on the number of digits in the page numbers of the original slides, e.g.

  \fcolorbox{white}{white}{\phantom{1}\insertframenumber%

For the future, I'd kindly like to ask you to include files like old.pdf that others do not have. If the file is essential, explain how you generate it, if not, replace it by some generic file.