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 the appendix package with the \appendixpage command to insert a "Appendices" title page. However, I was wondering how I could avoid that there is a pagenumber on this inserted page.

MWE:

\documentclass{book}
\usepackage[titletoc]{appendix}
\begin{document}

\tableofcontents

\appendix \appendixpage \noappendicestocpagenum \addappheadtotoc

\chapter{Some title} Some text

\end{document}

Mind that the \noappendicestocpagenum is about a page number in the ToC, not in the text, so this is unrelated to my question.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

The page style of that appendix page is plain. You could temporarily redefine it to be empty:

\appendix
\begingroup
\makeatletter
\let\ps@plain\ps@empty
\appendixpage
\makeatother
\endgroup
\noappendicestocpagenum
\addappheadtotoc

The important line is just

\let\ps@plain\ps@empty

\makeatletter and \makeatletter have been used to be able to work with @ in macro names, \begingroup and \endgroup limit the scope of this redefinition. So afterwards, plain is normal plain again.

Referring to lockstep's comment, you can do this in the preamble instead. Define

\makeatletter
\newcommand*{\myappendixpage}{%
  \begingroup
  \let\ps@plain\ps@empty
  \appendixpage
  \endgroup}
\makeatother

and later in the document just use it:

\appendix
\myappendixpage
\noappendicestocpagenum
\addappheadtotoc

Or redefine \appendixpage in the preamble:

\let\plainappendixpage\appendixpage
\makeatletter
\renewcommand{\appendixpage}{%
  \begingroup
  \let\ps@plain\ps@empty
  \plainappendixpage
  \endgroup}
\makeatother

Note, if you use \let in situations with a macro with optional argument or one made by \DeclareRobustCommand, use \LetLtxMacro of the letltxmacro package instead. Here, \let is sufficient.

share|improve this answer
1  
I prefer "preamble-only" solutions. ;-) –  lockstep Dec 6 '11 at 22:07
1  
Like often, it's directly demonstrated in the body. Of course it can go to the preamble, for example just define \myappendixpage with this code in the preamble and use that instead. –  Stefan Kottwitz Dec 6 '11 at 22:10
    
@Lockstep: I agree. But on the other hand, Stefan's solution is less dependent on the internals of the appendix package, right? –  Matthias Dec 6 '11 at 22:16
    
@Stefan: I was about to ask that. Would it also be possible to redefine \appendixpage? –  Matthias Dec 6 '11 at 22:17
1  
@Matthias Yes, I added a version. –  Stefan Kottwitz Dec 6 '11 at 22:26

Use the etoolbox package to patch the \@chap@pppage macro.

\documentclass{book}

\usepackage[titletoc]{appendix}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\@chap@pppage}{\thispagestyle{plain}}{\thispagestyle{empty}}{}{}
\makeatother

\begin{document}

\tableofcontents

\appendix
\appendixpage
\noappendicestocpagenum
\addappheadtotoc

\chapter{Some title}

Some text.

\end{document}
share|improve this answer
1  
This time you beat me by 40 seconds! –  Werner Dec 6 '11 at 22:02

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.