# Removing page numbers from appendices

I am trying to remove all page numbers from my Appendices section. The following fix was suggested: create an 'interlude environment' that suppresses page numbers for its contents. (source: Intervening pages that do not add to page-count?)

This works on the majority of the pages in the appendix section, however, on all pages that contain a Appendix heading, Chapter heading or Bibliography heading the numbers are still present. Presumably this is built into the commands in order to ensure they are include in the TOC, but this is not something I mind about.

\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}

\usepackage[
backend=biber,
style=numeric,
sortlocale=de_DE,
natbib=true,
url=false,
doi=true,
eprint=false
]{biblatex}
\bibliography{references}
\usepackage[toc,page]{appendix}

%create interlude environment:
\newcounter{mypagecount}% create a new counter
\setcounter{mypagecount}{0}% set it to something just in case
\newenvironment{interlude}{% create a new environment for the unnumbered section(s)
\clearpage
\setcounter{mypagecount}{\value{page}}% use the new counter we created to hold the page count at the start of the unnumbered section
\pagestyle{empty}% use the same style for subsequent pages in the unnumbered section
}{%
\clearpage
\setcounter{page}{\value{mypagecount}}% restore the incremented value to the official tally of pages so the page numbering continues correctly
}

\begin{document}
body of document

\begin{interlude}

\begin{appendices}
\chapter{Code Name}
\label{codename}
code

\chapter{Name of more code}
more code

\end{appendices}

\pagebreak
\printbibliography
\end{interlude}
\end{document}


A fix is suggested here by Charles Stewart for removing numbers from 'divider pages' (he edits the appendix.sty source) - indeed, using this unnumbers the appendix divider page, but I do not know how to modify this for chapter heading pages too. https://stackoverflow.com/questions/2631973/no-page-number-for-divider-pages-in-latex

• Welcome to TeX.SX! Your example does not compile. Please fix the multiple errors – user31729 Mar 25 '16 at 16:04
• Apologies! Fixed now. – user101550 Mar 25 '16 at 16:13

A suggestion, to use \thepage being emptied and a proper page style. I addition, I suspended the page counter, but this not really necessary, in my point of view.

\documentclass[11pt]{report}
\usepackage{appendix}
\usepackage[
backend=biber,
style=numeric,
sortlocale=de_DE,
natbib=true,
url=false,
doi=true,
eprint=false
]{biblatex}

\usepackage{xassoccnt}

\usepackage{fancyhdr}

\bibliography{references}

\usepackage{blindtext}
\pagestyle{fancy}%
\begin{document}

\tableofcontents

\chapter{Regular chapter}
\blindtext[20]

\nocite{*}
\SuspendCounters{page}
\renewcommand{\thepage}{}

\begin{appendices}
\chapter{Code Name}
\label{codename}
\blindtext[5]

\chapter{Name of more code}
\blindtext[10]

\end{appendices}

\pagebreak
\printbibliography

\end{document}


I used this small references.bib

@book{knuth1986texbook,
keywords = {book},
title={The texbook},
author={Knuth, D.E. and Bibby, D.},
volume={1993},
year={1986},
}
@article{knuth1977fast,
keywords = {article},
title={Fast pattern matching in strings},
author={Knuth, D.E. and Morris Jr, J.H. and Pratt, V.R.},
journal={SIAM journal on computing},
volume={6},
number={2},
pages={323--350},
year={1977},
publisher={SIAM}
}

• Brilliant, thank-you! Took a little bit of playing as the {xassoccnt} package clashed with {mathtools}, but all fine once I identified which package was causing the problem. – user101550 Mar 25 '16 at 16:47
• @user101550: You don't need xassoccnt actually. But thanks, I know now that mathtools loads calc :-( – user31729 Mar 25 '16 at 17:53

I think you don't need the appendix package, nor a interlude environment: if you suppress page numbering at some point (the start of appendices), you can't resume it later on.

\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}

\usepackage[
backend=biber,
style=numeric,
sortlocale=de_DE,
natbib=true,
url=false,
doi=true,
eprint=false
]{biblatex}

% no need to load etoolbox
\makeatletter
\preto{\appendix}{%
\cleardoublepage
\pagestyle{empty}%
\let\ps@plain\ps@empty
\let\thepage\@empty
\part*{Appendices}%
}
\makeatother

\begin{document}

\tableofcontents

\chapter{Main}
body of document

\cite{weinberg}
\cite{yoon}

\appendix

\chapter{Code Name}
\label{codename}
code
\clearpage
code

\chapter{Name of more code}
more code
\clearpage
more code

\printbibliography

\end{document}


The trick is to make the plain page style, used at chapter starting pages, the same as empty.

As an aside, note that \addbibresource is to be preferred over \bibliography, when biblatex is used.