Add the mathring accent

This commit is contained in:
gloamxun committed 2026-10-20 13:32:05 +08:00
1 parent f18fc5187f
commit 0d3067a86d
2 files changed
+25

No files matched your search

+23
View File
@@ -768,6 +768,16 @@ fn parse_atom(chars: &[char], index: usize) -> (MathAtom, usize) {
after,
)
}
"mathring" => {
let (base, after) = parse_atom(chars, next);
(
MathAtom::Accent {
accent: '\u{030A}',
base: Box::new(base),
},
after,
)
}
"widecheck" => {
let (base, after) = parse_atom(chars, next);
(
@@ -1058,6 +1068,19 @@ mod tests {
assert!(tall.width > plain.width);
}
#[test]
fn mathring_uses_the_ring_accent() {
let MathAtom::Row(atoms) = parse_math(r"\mathring{x}") else {
panic!("expected row")
};
assert!(matches!(
&atoms[0],
MathAtom::Accent {
accent: '\u{030A}',
..
}
));
}
#[test]
fn substack_stacks_multiple_rows() {
let font = Cmr10Metrics::default();
+2
View File
@@ -235,3 +235,5 @@ for a later overlaid slash.
v1 remains the production renderer; the route-D core is additive and tested independently.
`\substack{a\\b}` parses each row and stacks them as `MathAtom::StackLines`.
`\mathring{x}` is the U+030A ring accent.