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 bold = EquationElem::bold_in(styles);
|
||||||
let default_style = EquationElem::default_style_in(styles);
|
let default_style = EquationElem::default_style_in(styles);
|
||||||
let default_italic = match c {
|
let default_italic = match c {
|
||||||
'a'..='z' | 'ħ' | 'ı' | 'ȷ' |
|
'a'..='z' | 'ħ' | 'ı' | 'ȷ' | 'α'..='ω' | 'ϵ' | 'ϑ' | 'ϰ' | 'ϕ' | 'ϱ' | 'ϖ' => {
|
||||||
'α'..='ω' | 'ϵ' | 'ϑ' | 'ϰ' | 'ϕ' | 'ϱ' | 'ϖ' =>
|
matches!(default_style, MathStyle::Iso | MathStyle::Tex | MathStyle::French)
|
||||||
matches!(default_style, MathStyle::Iso | MathStyle::Tex | MathStyle::French),
|
}
|
||||||
'A'..='Z' =>
|
'A'..='Z' => matches!(default_style, MathStyle::Iso | MathStyle::Tex),
|
||||||
matches!(default_style, MathStyle::Iso | MathStyle::Tex),
|
'Α'..='Ω' => matches!(default_style, MathStyle::Iso),
|
||||||
'Α'..='Ω' =>
|
'∂' => matches!(default_style, MathStyle::Tex | MathStyle::French),
|
||||||
matches!(default_style, MathStyle::Iso),
|
|
||||||
'∂' =>
|
|
||||||
matches!(default_style, MathStyle::Tex | MathStyle::French),
|
|
||||||
_ => false
|
_ => false
|
||||||
};
|
};
|
||||||
let italic = EquationElem::italic_in(styles).unwrap_or(
|
let italic = EquationElem::italic_in(styles)
|
||||||
auto_italic && default_italic && matches!(variant, Sans | Serif),
|
.unwrap_or(auto_italic && default_italic && matches!(variant, Sans | Serif));
|
||||||
);
|
|
||||||
|
|
||||||
if let Some(c) = basic_exception(c) {
|
if let Some(c) = basic_exception(c) {
|
||||||
return c;
|
return c;
|
||||||
|
@ -253,7 +253,6 @@ pub enum MathVariant {
|
|||||||
Bb,
|
Bb,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// A rule describing which letters and symbols are italic by default.
|
/// A rule describing which letters and symbols are italic by default.
|
||||||
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Cast, Hash)]
|
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Cast, Hash)]
|
||||||
// #[derive(Serialize, Deserialize, Cast)]
|
// #[derive(Serialize, Deserialize, Cast)]
|
||||||
@ -266,5 +265,5 @@ pub enum MathStyle {
|
|||||||
// Lowercase letters and [partial] italic.
|
// Lowercase letters and [partial] italic.
|
||||||
French,
|
French,
|
||||||
// Everything upright.
|
// Everything upright.
|
||||||
Upright
|
Upright,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user