Debug: add LaTeX numbering check assertions#2811
Merged
rbeezer merged 4 commits intoPreTeXtBook:masterfrom Mar 30, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
Author
Note: if the debug flag is not set, nothing is added to the LaTeX source, no macros, no checks. Code itself looks good. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-x debug.numbering.check yes) that embeds PreTeXt-computed numbers into LaTeX source and compares them against LaTeX's own counter values at compile time\ptxnumbercheckvia\thetcbcounter) and divisions (\ptxdivisionnumbercheckvia\csname the#2\endcsname)Developing the check mechanism revealed a cross-format formatting bug: subnumbered figure-like elements inside sidebyside panels produced
6.1.(a)instead of6.1(a). The period separator is now suppressed for these elements. This fix affects all output formats (LaTeX, HTML, etc.) and is a separate commit from the debug infrastructure.Test results
The 14 article mismatches: 12 from a missing
structure-numbertemplate forfigure/sbsgroup/sidebyside/figure, 1 from openproblem placeholder numbers, 1 from a figure inside decorativeexercises. None are introduced by this branch — they are pre-existing bugs surfaced by the check.Test plan
-x debug.numbering.check yes, confirm warnings match documented mismatches6.1(a)vs6.1.(a))Claude Opus 4.6, acting as a coding assistant for Rob Beezer