Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new command that switches between chapter abbreviation and Appendix, use it in toc #316

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

timvdalen
Copy link

As discussed in #305, this PR fixes the problem where Appendices show up as normal chapters in the table of contents.

It does this by renewing commands in the toc context when appendices start.
To stay compatible with the current abbreviation, I have added a new command, instead of just using \chaptertitlename\ (as we now do in the footer).

@@ -28,4 +28,10 @@
{\thecontentslabel :~ } % numbered-entry-format
{} % numberless-entry-format
{\titlerule*{.}\contentspage} % filler-page-format

\newcommand\tocchapapp{\tocchapterabbreviationname}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously, feel free to give this another name.


\newcommand\tocchapapp{\tocchapterabbreviationname}
\g@addto@macro\appendix{%
\addtocontents{toc}{\protect\renewcommand{\protect\@chapapp}{\appendixname}}%
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is not strictly necessary, but it allows people to use \@chapapp and \chaptertitlename in their TOC, should they ever whish to do so.

The behaviour without this line is that \@chapapp is always Chapter in that context, which tripped me up at first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant