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

Multi-level counter pitfalls (counters package) #1536

Closed
Omikhleia opened this issue Aug 22, 2022 · 0 comments · Fixed by #1541
Closed

Multi-level counter pitfalls (counters package) #1536

Omikhleia opened this issue Aug 22, 2022 · 0 comments · Fixed by #1541
Labels
bug Software bug issue enhancement Software improvement or feature request modules:packages Issue relates to core or 3rd party packages
Milestone

Comments

@Omikhleia
Copy link
Member

Omikhleia commented Aug 22, 2022

(For the record, sharpening counters was evoked in #455)

When working on my book class (and a pending article class to go with it), I quickly hacked the multilevel counters. Since I am refactoring it for 0.14, it's perhaps time for me to report my findings / issues. (I can make a PR with my changes so far, just mentioning the main points below, some could be questionable.)

  • formatMultilevelCounter() issues

    • It behaves quite badly if the (optional) level parameter is greater than the current level (robustness)
    • An option for skipping leading zeroes would really be handy for classes that would accept, e.g. unnumbered chapters to have sections naturally starting at 1, not 0.1 (and so on).
    • BTW, I would question the "minlevel" option, what's the use case for it? Having a counter "1.2.3.4", is one really expecting a use case for formatting, say, "2.3"? For the sake of simplicity over over-design, I'd suggest removing it. Bah, could be kept anyway. Just weird maybe.
  • \set-multilevel-counter missing

    • For single-counters, we have \set-counter, so it sounds logical having it here too.
    • The class may need to reset sectioning counters to some level (e.g. entering an appendix, resetting chapter level to 1, with alpha display, etc.)
  • \show-multilevel-counter

    • It claims "optionally displaying it with the <display> format", but this is really confusing as:
      • These are multilevel counters where all levels may have different display format
      • The option currently acts on the current level, without regards for the requested level.
      • The option (as for the \show-counter too) does not only use that display for showing, it also alters it (so this is still changed afterwards).
@alerque alerque added this to the v0.14.4 milestone Sep 8, 2022
@alerque alerque added bug Software bug issue enhancement Software improvement or feature request modules:packages Issue relates to core or 3rd party packages labels Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Software bug issue enhancement Software improvement or feature request modules:packages Issue relates to core or 3rd party packages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants