Skip to content

Commit

Permalink
Add new command that switches between chapter abbreviation and Appendix,
Browse files Browse the repository at this point in the history
use it in toc

Fixes #305
  • Loading branch information
timvdalen committed Feb 14, 2021
1 parent ff40b34 commit 5528c35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/dndtoc.sty
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
\titlecontents{chapter}
[0pt] % left
{ \addvspace{.1in} \DndFontTocChapter } % above-code
{\tocchapterabbreviationname\ \thecontentslabel :~ } % numbered-entry-format
{ \tocchapapp\ \thecontentslabel :~ } % numbered-entry-format
{} % numberless-entry-format
{\titlerule*{.}\contentspage} % filler-page-format

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

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

0 comments on commit 5528c35

Please sign in to comment.