-
Notifications
You must be signed in to change notification settings - Fork 312
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
Appendices in the table of contents #305
Comments
Please post a Minimum Working Example to generate the |
Of course, apologies: \documentclass[letterpaper,twocolumn,openany,nodeprecatedcode]{dndbook}
\usepackage[english]{babel}
\usepackage{hyperref}
\begin{document}
\frontmatter%
\tableofcontents
\mainmatter%
\chapter{Test}
\appendix
\chapter{Test}
\end{document} Edit: Cut down the MWE a little further |
Placing this as a note to myself (and others) on a direction to fix this. https://tex.stackexchange.com/questions/57642/checking-if-is-appendix-or-chapter I would like something that does not dig into internal book variables if possible. The problem is that our abbreviation in the chapter heading of the toc styling does not handle appendices. Ideally we typeset the chapter abbreviation if we are in mainmatter, appendix abbreviation if we are in the appendices, and nothing otherwise. |
Thanks for the direction, I will see if I can hack something together for my document and report back if it might be useful generally. Unrelated, but your proposed approach would solve another problem I have with the layout in the original issue. \chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction} because I don't want it to appear as |
More notes:
|
Okay, so I remembered at least one way to handle this in a (mostly) elegant manner. \setcounter{secnumdepth}{-1}
\chapter{Introduction}
\setcounter{secnumdepth}{0} In effect we tell LaTeX to only number Parts (-1). This means that "Chapter X" is not displayed on Introduction and the chapter counter is suspended. When the section numbering depth is restored to Chapter (0), the chapter number will start at 1 (or the next unused number). |
Having spent some time looking into this, I believe I have a fix for at least the footer problem. Testing for I will hold off on creating a PR until I can find a fix for the TOC problem as well, but maybe my results so far are helpful to someone else. |
Just tested this against the latest |
Hi. Back on the appendix topic, the proposed solution did not work for me, so I edited it a bit. First of all, I define a new command in
Then, in
In my early tests it seems to work. A working commit can be found in my fork. |
Due to the current setup of
dndtoc.sty
, the following TOC contents:which renders as follows in
book
:renders as follows in
dndbook
:Renewing
\tocchapterabbreviationname
allows renamingCh.
to something likeChapter
, but is there a way to differentiate between normal chapters and appendix chapters?The
titletoc
documentation (https://mirror.lyrahosting.com/CTAN/macros/latex/contrib/titlesec/titlesec.pdf) seems to suggest so at the bottom of page 4 ("It defaults to \chaptername except in appendices where it is \appendixname. Use it insteadof \chaptername when defining a chapter.").
The text was updated successfully, but these errors were encountered: