Skip to content

fix(typeset): a term a file adds to a sum keeps its definition line when the expressions are inlined - #766

Merged
FBumann merged 2 commits into
mainfrom
claude/review-pr-763-lshilb
Sep 28, 2026
Merged

FBumann merged 2 commits into
mainfrom
claude/review-pr-763-lshilb

Conversation

@FBumann

@FBumann FBumann commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Prompt: Then fix 2 on a or from main directly and rebase 763 onto it

Note

The following content was generated by AI.

With inline_expressions=True, the term a file adds to a sum vanished from the page: defined() dropped it as read by the math, but nothing substitutes it. The term now keeps its definition line, as typeset.md says.

Method, gate output, alternatives

What was wrong. A term is read only through the sum it adds to, and that reads as the sum's symbol, so substitution never reaches the term's body. typeset(DEMAND, 'markdown', inline_expressions=True) on main printed no Definitions section at all, while the legend row said "an expression this file adds demand_injection to". Found while reviewing #763, which restates the docs claim that the term prints under Definitions.

The fix. defined() keeps a name that some given: expressions: entry names as its term, beside a cases block and a reported entry. docs/reference/typeset.md lists the term among what keeps its definition line.

Guard. test_inlining_keeps_the_definition_of_a_term in tests/test_terms.py fails on main with assert '#### Definitions' in inlined, and passes with the fix.

Gates. No pixi in this container; the equivalent commands ran in a uv venv with the pinned tool versions:

  • pytest -q -n 4: 2515 passed, 47 skipped
  • ruff check, ruff format --check: clean
  • pyrefly check: 0 errors
  • prettier --check on the changed markdown: clean

Not run: docs-build, compile-tex, the golden regeneration (no golden model declares a term).

Relation to #763. Not stacked: #763 was not rebased, since that needs a force-push. #763 rewrites defined() for adds_to:, so whichever merges second takes a conflict in walk.py, tests/test_terms.py, typeset.md and CHANGELOG.md. The resolution on #763's side is or entry.adds_to is not None in the standing list, the test kept with #763's fixtures, and both changelog lines.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FhcGptSPeUeVFHwf7Nbpjc

…hen the expressions are inlined

A term is read only through the sum it adds to, which prints as a symbol, so
substitution never reaches its body. `defined()` dropped it as read by the
math, and the page named a term it never defined.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FhcGptSPeUeVFHwf7Nbpjc
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FhcGptSPeUeVFHwf7Nbpjc
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 mathspec | 🛠️ Build #34813671 | 📁 Comparing cc0f32a against latest (e7af8f8)

  🔍 Preview build  

2 files changed
± changelog/index.html
± reference/typeset/index.html

@FBumann
FBumann merged commit 2288421 into main Sep 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants