Repository navigation
Conversation
Problem: a label or note containing "≤" or "≥" comes out of
make(type="typst") as "$$≤$$" instead of "$≤$": two empty equations
around a text-mode symbol.
Cause: _output_typst applies _translate_symbols to the finished table
twice. The typst forms of ≤ and ≥ ("$≤$", "$≥$") contain the symbol
itself, so the second pass wraps them again; the other symbols map to
strings without the original character and were unaffected.
Fix: drop the duplicated call.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
What problem do you want to solve?
Observed:
[x $$≤$$ 5]andp $$≥$$ 0.1. Expected:$≤$and$≥$, which is the Typst form insymbols.SYMBOLS._output_typstcalls_translate_symbols(..., "typst")on the finished table twice, one call straight after the other. The Typst forms of≤and≥contain the symbol itself, so the second pass wraps them again. The document still compiles:$$is an empty equation, so the result is two empty equations around a text-mode≤, not a math-mode symbol. The other symbols (R²,×, Greek letters,±,°) map to strings without the original character, so the second pass leaves them alone.Fix
Remove the duplicated call.
Tests
test_typst_translates_each_symbol_onceis parametrized over every key inSYMBOLSand checks that the row label renders as exactlySYMBOLS[s]["typst"]. 2 of the 9 cases (≤,≥) fail on main, and all 9 pass with the fix. The test checks the generated source rather than compiling it, because both the buggy and the fixed output compile. Full suite: 507 passed, and all 135 snapshots are unchanged. pre-commit andtyare clean.🤖 Generated with Claude Code