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.

Ingrid
  • 149

2 Answers2

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.

Thruston
  • 42,268
  • 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 Apr 29 '16 at 15:18
  • @ingrid - perhaps you should email them with the suggestion... – Thruston Apr 29 '16 at 15:28
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