-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugSomething isn't workingSomething isn't workingmathRelated to math category, with its syntax, layout, etc.Related to math category, with its syntax, layout, etc.
Description
Description
When laying out numbers in math we currently only apply the ssty feature tag if it is a single number. The relevant code is here:
typst/crates/typst-layout/src/math/text.rs
Lines 68 to 80 in df89a0e
| let is_single = text.chars().count() == 1; | |
| for unstyled_c in text.chars() { | |
| let c = styled_char(styles, unstyled_c, false); | |
| let mut glyph = GlyphFragment::new(ctx, styles, c, span); | |
| if is_single { | |
| // Duplicate what `layout_glyph` does exactly even if it's | |
| // probably incorrect here. | |
| match EquationElem::size_in(styles) { | |
| MathSize::Script => glyph.make_script_size(ctx), | |
| MathSize::ScriptScript => glyph.make_script_script_size(ctx), | |
| _ => {} | |
| } | |
| } |
I think it makes sense to apply to all numbers.
$script(1)$ and $script(11)$ should not produce different results IMO (which is what happens currently).
cc @wrzian
Reproduction URL
No response
Operating system
No response
Typst version
- I am using the latest version of Typst
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingmathRelated to math category, with its syntax, layout, etc.Related to math category, with its syntax, layout, etc.