Skip to content

Title every definition and result callout (base for #872 diagram)#875

Merged
d-morrison merged 1 commit into
mainfrom
claude/issue-872-divs
Jun 3, 2026
Merged

Title every definition and result callout (base for #872 diagram)#875
d-morrison merged 1 commit into
mainfrom
claude/issue-872-divs

Conversation

@d-morrison

Copy link
Copy Markdown
Owner

Base PR of a two-PR stack addressing #872.

What this PR does

Adds a concise #### Title to every previously-untitled def/thm/lem/cor/prp callout, so each one:

  • renders as "Definition N (Title)" / "Theorem N (Title)" instead of an anonymous "Definition N", and
  • is easy to refer to by name.

This covers point 3 of #872 ("make sure all definitions and results are in divs, and each div has a concise title"). It titles 89 previously-untitled callouts across 38 files, leaving 0 untitled of the 434 result callouts in the notes. The titles are content-derived noun phrases following the existing house convention (a #### heading as the div's first inner line).

Why split it out

The stacked PR (#873) builds the relationship diagram and descendants table for #872. Those node/table labels come straight from these titles, so getting every result into self-describing div form first keeps that PR focused on the graph code and keeps this large-but-mechanical titling diff reviewable on its own.

Checks

  • quarto render ✅ — all 11 affected parent chapters render clean
    (basic-statistical-methods, probability, algebra, poisson, negbinom, parametric-survival-models, logistic-regression, proportional-hazards-models, intro-to-survival-analysis, intro-MLEs, Linear-models-overview)
  • lintr ✅ — no new findings (7 pre-existing findings remain in R chunks not touched here)
  • spelling::spell_check_package() ✅ — clean

Stacked PR for the diagram + table: to follow, based on this branch.

🤖 Generated with Claude Code

Every definition and result callout (def/thm/lem/cor/prp) now has a
concise `#### Title` as its first inner line, so each renders as
"Definition N (Title)" and is easy to refer to. This titles the 89
previously-untitled callouts across 38 files, leaving 0 untitled of the
434 result callouts in the notes.

This is the base of a two-PR stack for #872: this PR gets every
definition and result into self-describing div form; the stacked PR
builds the relationship diagram and descendants table on top.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
@claude

claude Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 5m 13s —— View job


Code Review — PR #875

  • Gather context and understand PR scope
  • Review git diff for title correctness and convention compliance
  • Spot-check a sample of changed files for content accuracy
  • Check for any formatting or structural issues
  • Post review findings

Summary

This is a well-executed mechanical PR. All 89 new titles are accurate noun-phrase descriptions of their callouts' mathematical content, and an automated search confirms the PR's claim: 0 untitled def/thm/lem/cor callouts remain across chapters/ and _subfiles/. The changes are mostly additive (135 insertions, 4 deletions), and the deletions are minor whitespace fixes.

Below are a few issues worth addressing before merging, ordered by severity.


Issues

1. Inline LaTeX in titles will break diagram node labels (PR #873) — medium priority

Two titles contain inline LaTeX:

  • chapters/basic-statistical-methods.qmd, #def-r-squared: "Coefficient of determination ($R^2$)"
  • chapters/algebra.qmd:64, #thm-negative-one: "Negation is multiplication by $-1$"

Since PR #873 derives node and table labels directly from these #### headings, the raw LaTeX strings $R^2$ and $-1$ will appear literally in graph source (e.g., DOT/Mermaid) unless the diagram code explicitly strips or renders math. Consider using plain-text equivalents: "Coefficient of determination (R²)" and "Negation is multiplication by negative one" (or keep $R^2$ and handle it in the diagram code, but the safer choice is plain text here). Fix this →

2. #thm-mult-ineq theorem body has a logical error (pre-existing, now visible via title) — low priority

chapters/algebra.qmd:55–59:

:::{#thm-mult-ineq}
#### Multiplying both sides of an inequality by a nonnegative number
If $a < b$ and $c \geq 0$, then $ca < cb$.

When c = 0, ca = 0 = cb, so the strict inequality ca < cb fails. The condition should be c > 0 (positive, not nonnegative). This bug is pre-existing; the new title faithfully mirrors the stated condition. But now that the theorem is named, the inconsistency (≥ 0 in the body, "nonnegative" in the title) is more visible — worth fixing the theorem body to say c > 0 and updating the title to "…by a positive number." Fix this →

3. One title describes the proof method, not the mathematical result — low priority

_subfiles/logistic-regression/_sec_logistic_score_fn.qmd:27, #lem-logistic-score-comp:

"Chain rule applied to the score component"

All other new titles describe the mathematical relationship (e.g., "Derivative of log-odds with respect to coefficients", "Score function decomposes over observations"). This one names the proof technique. A result-oriented title like "Score component as a chain rule expansion" or "Chain-rule expansion of the score component" would be more consistent. Fix this →


Minor observations (no action needed)

  • Blank line after title is inconsistent: Several new #### lines are immediately followed by content with no blank line (e.g., _sec_expit.qmd #thm-expit-prob-logodds, chapters/probability.qmd #thm-prob-subset). This doesn't affect rendering, but differs from callouts where a blank line already existed. Not worth fixing separately.

  • Incidental trailing whitespace removal: Three diffs (_thm-d_pi_d_beta.qmd, _sec-understand-coxph.qmd, chapters/poisson.qmd) also strip trailing spaces from adjacent lines. Harmless, slightly beyond scope.

  • Pre-existing ID/title mismatch: #lem-deriv-invodds has an ID suggesting "inverse-odds" but both the content and the new title ("Derivative of odds w.r.t. log-odds") describe the derivative of odds. Pre-existing and not introduced by this PR.


Overall this is clean and mergeable once the LaTeX-in-title issue is resolved (item 1), since that's the only change that could cause a concrete downstream problem in PR #873.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.

2026-06-03 18:21 UTC

d-morrison added a commit that referenced this pull request Jun 3, 2026
New appendix `chapters/concept-map.qmd` visualizes how every definition
and result in the notes depends on the others:

- a color-by-type dependency diagram, with node size proportional to the
  number of descendants so the most foundational results stand out, and
- a table listing each result's direct and indirect descendants (live
  `@ref` cross-reference links), sorted by number of direct descendants.

The graph is built by `data-raw/callout-graph.R`, which scans the `.qmd`
sources and saves the result to `inst/extdata/callout-graph.rds`. The
appendix reads that saved artifact, so the scan does not re-run on every
render — re-run the script when divs are added, removed, or re-titled.

References are attributed to the enclosing callout, or to the callout an
immediately-following proof/solution div belongs to; references that
aren't inside a result (plain prose) don't create edges.

Stacked on the title-audit PR (#875), which gives every node a concise
label. Registered as the final appendix in the book and website configs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
@d-morrison d-morrison merged commit d3c1c0a into main Jun 3, 2026
3 of 5 checks passed
@d-morrison d-morrison deleted the claude/issue-872-divs branch June 3, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant