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

Get un-numbered chapters back in the ToC #1751

Merged
merged 2 commits into from
Mar 29, 2023

Conversation

alerque
Copy link
Member

@alerque alerque commented Mar 28, 2023

Fixes #1707

@alerque
Copy link
Member Author

alerque commented Mar 28, 2023

@Omikhleia This works but I have no idea why.

The same applies to sections too: if the hook functions don't output some sort of node the caller functions don't end up writing an info node.

@alerque alerque added this to the v0.14.9 milestone Mar 28, 2023
@alerque alerque added the bug Software bug issue label Mar 28, 2023
@Omikhleia
Copy link
Member

Omikhleia commented Mar 29, 2023

@Omikhleia This works but I have no idea why.

The same applies to sections too: if the hook functions don't output some sort of node the caller functions don't end up writing an info node.

The reason why some "special" boxes (such as the info node) disappear when immediately followed by a line break seems very similar to #1495 - There's something dubious at play...

But in this very case, why are the pre/post hooks called when the header is unnumbered? (E.g. in a chapter, I was assuming the \par was here so that the numbering would be a different line that the title, but why would be still do it if the chapter is unnumbered?)

@alerque alerque marked this pull request as ready for review March 29, 2023 18:27
@alerque
Copy link
Member Author

alerque commented Mar 29, 2023

But in this very case, why are the pre/post hooks called when the header is unnumbered?

Because disabling numbering has to do with counters and the hook has to do with page layout. It's quite likely that people have already worked around the spacing they want to use for numbered vs. unnumbered chapters and there isn't a good reason to fix the logic yet.

A good reason is coming up when we add \volume, \part, etc. in (or can be extracted from) #597.

@Omikhleia
Copy link
Member

Omikhleia commented Mar 29, 2023

A good reason is coming up when we add \volume, \part, etc. in (or can be extracted from) #597.

Well, honestly, I can't really judge here. After all, I took quite different directions very soon in my resilient.book (and for more than 1 year now, I have working parts, captioned environments, custom ToC, etc. all with customization and styling possible nearly everywhere at several levels -- and I hope to soon focus appendices and indexes, having no idea what "volumes" are, heh) -- So the directions might take the standard default book class (and, IMHO, really, its all too complex hooks) are a bit beyond my reach.

It's just bad to have regressions, so these need at least to be fixed...
But beyond that point, I can't really comment on how it should evolve 🐱 Very honestly again, beyond using it for mere tests and helping here and there if need be, I'm obviously not really wanting to involve too much time into the default book class. As it stands (with its "hard-coded" noindents, for instance), it's not even usable for French. So... I'm afraid I'll just pass here.

@alerque
Copy link
Member Author

alerque commented Mar 29, 2023

I agree the book class is terrible. I've been using cabook that has all this stuff overhauled for years and years now.

This PR is to fix the regression, not fix the book class. I want to see that happen to so new users have a better starting point, but that will be a breaking release.

@alerque alerque merged commit 843aee0 into sile-typesetter:master Mar 29, 2023
@alerque alerque deleted the unnumbered-toc branch March 29, 2023 21:44
@Omikhleia
Copy link
Member

I've been using cabook that has all this stuff overhauled for years and years now.

So we are both using our own book class for real projects :) It tells something. At some point, we may need to re-assess what the default book class in SILE ought to be, but that might be premature for now.

@Omikhleia
Copy link
Member

Aside note: If I had to use LaTeX nowadays for a novel, I wouldn't even consider using its default book class. There are several better alternatives, such as koma. So people might find interesting to start with the default book class (as long as it remains simple enough to be instructive), but then turn to better alternatives too (whether resilient, cabook... or their own take at it, when they feel ready).

@alerque
Copy link
Member Author

alerque commented Mar 29, 2023

That's a good point, the default book class doesn't have to be the most tricked out one. I was (and still am!) a koma user, but it's probably just as well that isn't the LaTeX default.

On the other hand the default class should be cover all the basics well, be robust, look pretty good, and get ease people into customization. I don't think it does any of those really.

Omikhleia added a commit to Omikhleia/resilient-types that referenced this pull request Apr 8, 2023
Omikhleia added a commit to Omikhleia/resilient-types that referenced this pull request Apr 8, 2023
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 this pull request may close these issues.

Unnumbered chapters do not appear in TOC (regression)
2 participants