mirror of
https://github.com/typst/typst
synced 2025-08-20 01:48:34 +08:00
Fix formatting
This commit is contained in:
parent
1df33f72b4
commit
bb8b7a66ba
@ -189,20 +189,16 @@ fn styled_char(styles: StyleChain, c: char, auto_italic: bool) -> char {
|
||||
let bold = EquationElem::bold_in(styles);
|
||||
let default_style = EquationElem::default_style_in(styles);
|
||||
let default_italic = match c {
|
||||
'a'..='z' | 'ħ' | 'ı' | 'ȷ' |
|
||||
'α'..='ω' | 'ϵ' | 'ϑ' | 'ϰ' | 'ϕ' | 'ϱ' | 'ϖ' =>
|
||||
matches!(default_style, MathStyle::Iso | MathStyle::Tex | MathStyle::French),
|
||||
'A'..='Z' =>
|
||||
matches!(default_style, MathStyle::Iso | MathStyle::Tex),
|
||||
'Α'..='Ω' =>
|
||||
matches!(default_style, MathStyle::Iso),
|
||||
'∂' =>
|
||||
matches!(default_style, MathStyle::Tex | MathStyle::French),
|
||||
'a'..='z' | 'ħ' | 'ı' | 'ȷ' | 'α'..='ω' | 'ϵ' | 'ϑ' | 'ϰ' | 'ϕ' | 'ϱ' | 'ϖ' => {
|
||||
matches!(default_style, MathStyle::Iso | MathStyle::Tex | MathStyle::French)
|
||||
}
|
||||
'A'..='Z' => matches!(default_style, MathStyle::Iso | MathStyle::Tex),
|
||||
'Α'..='Ω' => matches!(default_style, MathStyle::Iso),
|
||||
'∂' => matches!(default_style, MathStyle::Tex | MathStyle::French),
|
||||
_ => false
|
||||
};
|
||||
let italic = EquationElem::italic_in(styles).unwrap_or(
|
||||
auto_italic && default_italic && matches!(variant, Sans | Serif),
|
||||
);
|
||||
let italic = EquationElem::italic_in(styles)
|
||||
.unwrap_or(auto_italic && default_italic && matches!(variant, Sans | Serif));
|
||||
|
||||
if let Some(c) = basic_exception(c) {
|
||||
return c;
|
||||
|
@ -253,7 +253,6 @@ pub enum MathVariant {
|
||||
Bb,
|
||||
}
|
||||
|
||||
|
||||
/// A rule describing which letters and symbols are italic by default.
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Cast, Hash)]
|
||||
// #[derive(Serialize, Deserialize, Cast)]
|
||||
@ -266,5 +265,5 @@ pub enum MathStyle {
|
||||
// Lowercase letters and [partial] italic.
|
||||
French,
|
||||
// Everything upright.
|
||||
Upright
|
||||
Upright,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user