Change the default math class of U+22A5 ⊥ UP TACK to Normal#5714
Change the default math class of U+22A5 ⊥ UP TACK to Normal#5714laurmaedje merged 5 commits intotypst:mainfrom
Conversation
|
I will mark this PR as a draft until we decide if we want to override the class of other characters. This can be discussed in the comment thread following #4985 (comment), or on Discord in the Symbols Forge. |
|
@MDLC01 I'd be okay with changing UP TACK for Typst 0.13 and leaving the rest for later. |
| ':' => Some(MathClass::Relation), | ||
| '.' | '/' | '⋯' | '⋱' | '⋰' | '⋮' => Some(MathClass::Normal), | ||
| _ => unicode_math_class::class(c), | ||
| _ => default_math_class(c), |
There was a problem hiding this comment.
shouldn't we move the math class overrides above this line into typst-utils too? ideally, with short comments or links on why we did override them (I think you already dug up most of it?).
There was a problem hiding this comment.
To be honest, I'm not sure what the implications of the overrides being only here are. I will take a look at that this week-end.
There was a problem hiding this comment.
It's not an issue for this character (and all the others that are overrided in fragment.rs), but will be for delimiters like U+27C5 ⟅ in #4985 (comment), I believe.
unicode_math_class::class also appears in the parser and the matrix code in typst-library:
typst/crates/typst-syntax/src/parser.rs
Line 471 in cd04482
typst/crates/typst-library/src/math/matrix.rs
Line 295 in cd04482
typst/crates/typst-library/src/math/matrix.rs
Line 314 in cd04482
There was a problem hiding this comment.
Looking at when default_math_class is called (i.e., all places where unicode_math_class::class was previously called), it looks like moving the above overrides to default_math_class would make those overrides also affect:
- default
Limits; - whether a given character can be used as a delimiter for matrices (would affect ⟅ and ⟆ if we changed them to opening and closing brackets as noted by @mkorje above, but does not affect any current override);
- the math class, as detected by the parser, when the characters are used as is (which I think only has an effect for opening and closing delimiters, to match them).
In conclusion, moving the current overrides from GlyphFragment::with_id to typst_utils::default_math_class would not break anything, and have little effect (AFAIK, only the default Limits).
|
Thank you! |
git download method fixed warinings documentation cli updater adaptation and clippy fixes enhanced documentation add git downloader default impl migrating from git2 to gitoxide crate for git downloads Add support for `c2sc` OpenType feature in `smallcaps` (typst#5655) Just add MathText SyntaxKind Basic SymbolElem addition Use SymbolElem in more places and add `char` cast for content Add SymbolElem to realization Update math TextElem layout to separate out SymbolElem Handle boxes and blocks a bit better in HTML export (typst#5744) Co-authored-by: Martin Haug <3874949+reknih@users.noreply.github.com> Tweak HTML pretty printing (typst#5745) Semantic paragraphs (typst#5746) Fix space collapsing for explicit paragraphs (typst#5749) Support first-line-indent for every paragraph (typst#5768) Fixed typo in the new outline docs (typst#5772) Resolve bound name of bare import statically (typst#5773) Fix typo in scripting.md (typst#5783) Modular, multi-threaded, transitioning plugins (typst#5779) Include images from raw pixmaps and more (typst#5632) Co-authored-by: PgBiel <9021226+PgBiel@users.noreply.github.com> Co-authored-by: Laurenz <laurmaedje@gmail.com> Change type repr to short name (typst#5788) Disable cjk_latin_spacing in raw by default (typst#5753) Change the default math class of U+22A5 ⊥ UP TACK to Normal (typst#5714) Revert adding `flatten-text` to `image` (typst#5789) Refactor `Scope` (typst#5797) Enable HTML feature in docs generator (typst#5800) Scope deprecations (typst#5798) Fix typo in page documentation (typst#5804) Bump openssl from 0.10.66 to 0.10.70 (typst#5802) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump codex to 0.1.0 (typst#5805) Bump dependencies (typst#5808) Fix small copy-paste oversight (typst#5811) Bump more dependencies (typst#5813) Export target docs (typst#5812) Co-authored-by: Martin Haug <3874949+reknih@users.noreply.github.com> 0.13 changelog (typst#5801) Release Candidate 1 Autocomplete content methods (typst#5822) Documentation fixes and improvements (typst#5816) Fix docs outline for nested definitions (typst#5823) Document removals in changelog (typst#5827) Fix unnecessary import rename warning (typst#5828) Don't crash on image with zero DPI (typst#5835) Add warning for `pdf.embed` elem used with HTML (typst#5829) Add smart quotes for Bulgarian (typst#5807) Respect `par` constructor arguments (typst#5842) Bump `typst-assets` Fix autocomplete and jumps in math (typst#5849) Update documentation for `float.{to-bits, from-bits}` (typst#5836) `Gradient::repeat`: Fix floating-point error in stop calculation (typst#5837) Lazy parsing of the package index (typst#5851) Remove Linux Libertine warning (typst#5876) Bring back type/str compatibility for 0.13, with warnings and hints (typst#5877) More robust SVG auto-detection (typst#5878) HTML export: Use `<code>` for inline `RawElem` (typst#5884) --make-deps fixes (typst#5873) Update changelog (typst#5894) Version bump Fix HTML export of table with gutter (typst#5920) Fix comparison of `Func` and `NativeFuncData` (typst#5943) HTML export: fix elem counting on classify_output (typst#5910) Co-authored-by: Laurenz <laurmaedje@gmail.com> Fix introspection of HTML root sibling metadata (typst#5953) Fix high CPU usage due to inotify watch triggering itself (typst#5905) Co-authored-by: Laurenz <laurmaedje@gmail.com> Fix false positive for type/str comparison warning (typst#5957) Fix paper name in page setup guide (typst#5956) Fix curve with multiple non-closed components. (typst#5963) Fix docs example with type/string comparison (typst#5987) Correct typo (typst#5971) Make `array.chunks` example more readable (typst#5975) Hotfix for labels on symbols (typst#6015) Replace `par` function call in tutorial (typst#6023) Mention that `sym.ohm` was removed in the 0.13.0 changelog (typst#6017) Co-authored-by: Laurenz <laurmaedje@gmail.com> Mark breaking symbol changes as breaking in 0.13.0 changelog (typst#6024) 0.13.1 changelog (typst#6025) Version bump dep min 1.81 use 1.81 in ci
git download method fixed warinings documentation cli updater adaptation and clippy fixes enhanced documentation add git downloader default impl migrating from git2 to gitoxide crate for git downloads Add support for `c2sc` OpenType feature in `smallcaps` (typst#5655) Just add MathText SyntaxKind Basic SymbolElem addition Use SymbolElem in more places and add `char` cast for content Add SymbolElem to realization Update math TextElem layout to separate out SymbolElem Handle boxes and blocks a bit better in HTML export (typst#5744) Co-authored-by: Martin Haug <3874949+reknih@users.noreply.github.com> Tweak HTML pretty printing (typst#5745) Semantic paragraphs (typst#5746) Fix space collapsing for explicit paragraphs (typst#5749) Support first-line-indent for every paragraph (typst#5768) Fixed typo in the new outline docs (typst#5772) Resolve bound name of bare import statically (typst#5773) Fix typo in scripting.md (typst#5783) Modular, multi-threaded, transitioning plugins (typst#5779) Include images from raw pixmaps and more (typst#5632) Co-authored-by: PgBiel <9021226+PgBiel@users.noreply.github.com> Co-authored-by: Laurenz <laurmaedje@gmail.com> Change type repr to short name (typst#5788) Disable cjk_latin_spacing in raw by default (typst#5753) Change the default math class of U+22A5 ⊥ UP TACK to Normal (typst#5714) Revert adding `flatten-text` to `image` (typst#5789) Refactor `Scope` (typst#5797) Enable HTML feature in docs generator (typst#5800) Scope deprecations (typst#5798) Fix typo in page documentation (typst#5804) Bump openssl from 0.10.66 to 0.10.70 (typst#5802) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump codex to 0.1.0 (typst#5805) Bump dependencies (typst#5808) Fix small copy-paste oversight (typst#5811) Bump more dependencies (typst#5813) Export target docs (typst#5812) Co-authored-by: Martin Haug <3874949+reknih@users.noreply.github.com> 0.13 changelog (typst#5801) Release Candidate 1 Autocomplete content methods (typst#5822) Documentation fixes and improvements (typst#5816) Fix docs outline for nested definitions (typst#5823) Document removals in changelog (typst#5827) Fix unnecessary import rename warning (typst#5828) Don't crash on image with zero DPI (typst#5835) Add warning for `pdf.embed` elem used with HTML (typst#5829) Add smart quotes for Bulgarian (typst#5807) Respect `par` constructor arguments (typst#5842) Bump `typst-assets` Fix autocomplete and jumps in math (typst#5849) Update documentation for `float.{to-bits, from-bits}` (typst#5836) `Gradient::repeat`: Fix floating-point error in stop calculation (typst#5837) Lazy parsing of the package index (typst#5851) Remove Linux Libertine warning (typst#5876) Bring back type/str compatibility for 0.13, with warnings and hints (typst#5877) More robust SVG auto-detection (typst#5878) HTML export: Use `<code>` for inline `RawElem` (typst#5884) --make-deps fixes (typst#5873) Update changelog (typst#5894) Version bump Fix HTML export of table with gutter (typst#5920) Fix comparison of `Func` and `NativeFuncData` (typst#5943) HTML export: fix elem counting on classify_output (typst#5910) Co-authored-by: Laurenz <laurmaedje@gmail.com> Fix introspection of HTML root sibling metadata (typst#5953) Fix high CPU usage due to inotify watch triggering itself (typst#5905) Co-authored-by: Laurenz <laurmaedje@gmail.com> Fix false positive for type/str comparison warning (typst#5957) Fix paper name in page setup guide (typst#5956) Fix curve with multiple non-closed components. (typst#5963) Fix docs example with type/string comparison (typst#5987) Correct typo (typst#5971) Make `array.chunks` example more readable (typst#5975) Hotfix for labels on symbols (typst#6015) Replace `par` function call in tutorial (typst#6023) Mention that `sym.ohm` was removed in the 0.13.0 changelog (typst#6017) Co-authored-by: Laurenz <laurmaedje@gmail.com> Mark breaking symbol changes as breaking in 0.13.0 changelog (typst#6024) 0.13.1 changelog (typst#6025) Version bump dep min 1.81 use 1.81 in ci
Closes #4985.
See #4985 (comment) for rationale.