Support filtering by math class in symbol search#8653
Open
MDLC01 wants to merge 3 commits into
Open
Support filtering by math class in symbol search#8653MDLC01 wants to merge 3 commits into
MDLC01 wants to merge 3 commits into
Conversation
Collaborator
Author
|
This is now ready for review but not ready to be merged as is as explained above. |
MDLC01
marked this pull request as ready for review
July 22, 2026 09:38
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.
Closes #8265.
This implements support for filtering symbols by math class in symbol search by adding
class:<class>as a search term, where<class>is case-insensitive and can be:none, matching symbols without a math class;X, or the full name, likeSpecial), matching symbols with this math class.2Alternatively, one can filter out symbols by adding a minus sign before the filter (e.g.,
-class:nonedisplays all symbols that do have a math class). Note that this operates on the default math class assigned to each symbol by Typst. Notably, Typst does not fully follow UTR #25 as it overrides the default math class for some symbols.3This is currently a draft because I am unsure whether this is the right way to expose this feature. This also needs to be documented, which is done is perhaps the most ugly way right now. Any input is welcome!
Also, I implemented this in a way that makes it easy to define further filters in the future.
The first commit is a somewhat-related minor fix. Since Codex doesn't assign names to Glyph_Part symbols, and likely never will, the bug is unlikely to ever surface anyway.
Footnotes
https://www.unicode.org/reports/tr25/ ↩
The underscore can be replaced with a hyphen in
Glyph_Part, matching the convention used by Typst. ↩https://github.com/typst/typst/blob/ed1973b0aec242a41cd3331b266ca13fb887fd59/crates/typst-utils/src/lib.rs#L385 ↩