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 do not appear in TOC (regression) #1707

Closed
jslabovitz opened this issue Feb 3, 2023 · 4 comments · Fixed by #1751
Closed

Unnumbered chapters do not appear in TOC (regression) #1707

jslabovitz opened this issue Feb 3, 2023 · 4 comments · Fixed by #1751
Assignees
Labels
bug Software bug issue
Milestone

Comments

@jslabovitz
Copy link
Contributor

I'm at a loss to explain exactly why, but chapters marked with numbering=false do not appear in the table of contents. (Sections and subsections appear as expected.) This seems to have something to do with the book:chapter:post hook inserting \par. I found that if I redefined that command to do nothing, the unnumbered chapter did appear in the TOC. Mystifying!

I also found that the ...:post hooks for sections and subsections inserts a space, which I think shouldn't happen if the headers are unnumbered as well. Similarly, redefining the hooks to null commands seems to fix the problem.

\begin[class=book,papersize="a5"]{document}

% uncommenting the following makes the chapter appear in the TOC, and also avoids extra spaces in sections/subsections
% \define[command="book:chapter:post"]{}
% \define[command="book:section:post"]{}
% \define[command="book:subsection:post"]{}

\ftl{tableofcontents-title=Contents}
\tableofcontents

\chapter[numbering=false]{A chapter}

foo bar zot

\section[numbering=false]{A section}

foo bar zot

\section[numbering=false]{A subsection}

foo bar zot

\end{document}
@Omikhleia
Copy link
Member

FWIW, this is a regression, it worked with SILE 0.12:

alias SILE12='docker run -it --volume "$(pwd):/data" --user "$(id -u):$(id -g)" siletypesetter/sile:v0.12.5'
SILE12 toc.sil

... has the unnumbered chapter in the TOC.

Where toc.sil is the same as your file, with only the \ftl{tableofcontents-title=Contents} commented out. (The fluent support was not there yet)

(FWIW again, the resilient.book does have it too with SILE 0.14, yay... though it doesn't use the fluent thing either... yet?)

@Omikhleia
Copy link
Member

The regression occurred between 0.13.3 (TOC correct) and 0.14.0 (TOC showing this issue)

@Omikhleia Omikhleia added the bug Software bug issue label Mar 25, 2023
@Omikhleia Omikhleia changed the title Unnumbered chapters do not appear in TOC Unnumbered chapters do not appear in TOC (regression) Mar 26, 2023
@Omikhleia Omikhleia added this to the v0.14.9 milestone Mar 27, 2023
@alerque
Copy link
Member

alerque commented Mar 28, 2023

First of all (while I look into the real issue here) the \ftl thing is a red herring, but possible worth a separate issue. We might want to do something else. The problem is that your document doesn't declare any language at all. Instead of supplying a string for the "undefined" language like you are doing the correct fix would be to set a language with \language[main=en].

@alerque alerque self-assigned this Mar 28, 2023
@alerque
Copy link
Member

alerque commented Mar 28, 2023

This has something to do with the default \book:chapter:post having \par in it. Drop that and it the info node ends up in the TOC file, with it it does not. This makes no sense to me since \book:sectioning where the info node is written happens independently of that function, but empirical tests suggest I'm missing something.

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

Successfully merging a pull request may close this issue.

3 participants