1

I have found some links on here (for example No page number on \appendixpage) that explain how to remove the pagenumber from the divider appendix page, but how can I use this when using the appendices environment? Than the proposed solutions are no longer working and I would really like to use the environment since I would like to have 'Appendix' added in the toc as well.

So I would like to get the same behavior as in the other question (no page number on divider appendices page) but then inside the appendices environment.

MWE:

 \documentclass{report}
 \usepackage[titletoc,toc,page]{appendix}
 \usepackage[titles]{tocloft}

 \begin{document}
 \tableofcontents

 \chapter{First chapter}
 \chapter{Second chapter}

 \begin{appendices}
 \chapter{First appendix chapter name}
 \chapter{Second appendix chapter name}
 \end{appendices}

 \end{document}

So in this MWE I would like to not show the number 4 on the Appendices divider page. The toc is ok as it is.

4

2 Answers 2

1
 \documentclass{report}
 \usepackage[titletoc,toc,page]{appendix}
 \usepackage[titles]{tocloft}

 \makeatletter
\renewcommand{\@chap@pppage}{%
    \clear@ppage
    \thispagestyle{empty}%%%% This line was "plain" in the original definition
    \if@twocolumn\onecolumn\@tempswatrue\else\@tempswafalse\fi
    \null\vfil
    \markboth{}{}%
    {\centering
        \interlinepenalty \@M
        \normalfont
        \Huge \bfseries \appendixpagename\par}%
    \if@dotoc@pp
    \addappheadtotoc
    \fi
    \vfil\newpage
    \if@twoside
    \if@openright
    \null
    \thispagestyle{empty}%
    \newpage
    \fi
    \fi
    \if@tempswa
    \twocolumn
    \fi
}
 \makeatother

 \begin{document}
    \tableofcontents

    \chapter{First chapter}
    \chapter{Second chapter}

    \begin{appendices}
        \chapter{First appendix chapter name}
        \chapter{Second appendix chapter name}
    \end{appendices}

 \end{document}

enter image description here

4
  • thanks works like a charm! I wish I was able to actually work with this kind of stuff but right now I'm just a novice able to apply pre-defined package behavior, not enough when you are a perfectionist
    – Ingrid
    Commented Apr 29, 2016 at 14:44
  • You could use xpatch to change the page style instead of redefining the whole command. Can I edit an xpatch version into your answer?
    – Thruston
    Commented Apr 29, 2016 at 14:49
  • @Thruston Interessting idea, maybe post it as an additional answer? Commented Apr 29, 2016 at 14:50
  • @Ingrid Glad I could help you! Commented Apr 29, 2016 at 14:51
2

A shorter way of patching the command without using renewcommand. You can learn more about patching from the answer to this question.

\documentclass{report}
\usepackage[titletoc,toc,page]{appendix}
\usepackage[titles]{tocloft}
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\@chap@pppage}{\thispagestyle{plain}}{\thispagestyle{empty}}{}{}
\makeatother
\begin{document}
\tableofcontents

\chapter{First chapter}
\chapter{Second chapter}

\begin{appendices}
\chapter{First appendix chapter name}
\chapter{Second appendix chapter name}
\end{appendices}

\end{document}

A better long term solution would be for the authors of appendix to provide an option to switch on and off this behaviour.

2
  • indeed a much shorter solution and works as expected as well I could not agree with you more that it should be an option that can be switched on/off and as for I am concerned the standard should be switched off, it just looks strange to have a page number there but I guess that is just a personal opinion
    – Ingrid
    Commented Apr 29, 2016 at 15:18
  • @ingrid - perhaps you should email them with the suggestion...
    – Thruston
    Commented Apr 29, 2016 at 15:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .