diff --git a/crates/texrra-tex-core/src/math.rs b/crates/texrra-tex-core/src/math.rs index 6bb6bf6..171df34 100755 --- a/crates/texrra-tex-core/src/math.rs +++ b/crates/texrra-tex-core/src/math.rs @@ -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(); diff --git a/docs/TEX_CORE.md b/docs/TEX_CORE.md index a160808..b9d442c 100755 --- a/docs/TEX_CORE.md +++ b/docs/TEX_CORE.md @@ -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.