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

Unnumbered chapters appear twice in TOC #7

Open
turtlegraphics opened this issue Jan 9, 2021 · 0 comments
Open

Unnumbered chapters appear twice in TOC #7

turtlegraphics opened this issue Jan 9, 2021 · 0 comments

Comments

@turtlegraphics
Copy link

This is an issue with the krantz.cls file, but since this repo is the best source for making a CRC krantz.cls book, I thought I should raise it here.

Unlike a latex book, krantz.cls by default includes unnumbered chapters in the TOC. As far as I can tell, this is unaffected by being part of \frontmatter or \mainmatter.

The problem does not appear in this demonstration book because the _output.yml file has the code toc_unnumbered: false to suppress the duplicate headings. You'll notice that in this demo book, the Preface does appear in the TOC.
However, there are other reasons one might want toc_unnumbered: true (say, for unnumbered sections to appear).

My suggested solution is to comment out, or remove, line 717 of krantz.cls which has
\addcontentsline{toc}{fm}{#1} in the definition of \@schapter. That will make krantz.cls behave more like the normal latex book class and requires unnumbered chapters to be explicitly included in the TOC. Since bookdown handles the TOC for unnumbered chapters and sections, this makes krantz.cls behave better with bookdown.

If there's a better approach I'd love to hear it, or if this seems like the right fix then it would be helpful to change it in this repo.

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

No branches or pull requests

1 participant