fix(typeset): a term a file adds to a sum keeps its definition line when the expressions are inlined - #766
Merged
Conversation
…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
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.
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, astypeset.mdsays.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)onmainprinted no Definitions section at all, while the legend row said "an expression this file addsdemand_injectionto". Found while reviewing #763, which restates the docs claim that the term prints under Definitions.The fix.
defined()keeps a name that somegiven: expressions:entry names as its term, beside acasesblock and a reported entry.docs/reference/typeset.mdlists the term among what keeps its definition line.Guard.
test_inlining_keeps_the_definition_of_a_termintests/test_terms.pyfails onmainwithassert '#### Definitions' in inlined, and passes with the fix.Gates. No
pixiin this container; the equivalent commands ran in auvvenv with the pinned tool versions:pytest -q -n 4: 2515 passed, 47 skippedruff check,ruff format --check: cleanpyrefly check: 0 errorsprettier --checkon the changed markdown: cleanNot 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()foradds_to:, so whichever merges second takes a conflict inwalk.py,tests/test_terms.py,typeset.mdandCHANGELOG.md. The resolution on #763's side isor entry.adds_to is not Nonein the standing list, the test kept with #763's fixtures, and both changelog lines.🤖 Generated with Claude Code
https://claude.ai/code/session_01FhcGptSPeUeVFHwf7Nbpjc