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.

  • Can you please give us a MWE? – user36296 Apr 29 '16 at 13:41
  • What's wrong with e.g. tex.stackexchange.com/a/37360/36296, it also adds "Appendix" to the ToC? – user36296 Apr 29 '16 at 13:44
  • @samcarter when I apply that answer it does not add 'Appendix' to each chapter title in the toc as is done in the MWE I have added – Ingrid Apr 29 '16 at 13:55
  • Sorry, I misunderstood the ToC entry. I thought it should just be an entry in front of the appendices. – user36296 Apr 29 '16 at 14:33
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

  • 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 Apr 29 '16 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 Apr 29 '16 at 14:49
  • @Thruston Interessting idea, maybe post it as an additional answer? – user36296 Apr 29 '16 at 14:50
  • @Ingrid Glad I could help you! – user36296 Apr 29 '16 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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.