Add the mathring accent
This commit is contained in:
1 parent
f18fc5187f
commit
0d3067a86d
2 files changed
+25
No files matched your search
@@ -768,6 +768,16 @@ fn parse_atom(chars: &[char], index: usize) -> (MathAtom, usize) {
|
|||||||
after,
|
after,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
"mathring" => {
|
||||||
|
let (base, after) = parse_atom(chars, next);
|
||||||
|
(
|
||||||
|
MathAtom::Accent {
|
||||||
|
accent: '\u{030A}',
|
||||||
|
base: Box::new(base),
|
||||||
|
},
|
||||||
|
after,
|
||||||
|
)
|
||||||
|
}
|
||||||
"widecheck" => {
|
"widecheck" => {
|
||||||
let (base, after) = parse_atom(chars, next);
|
let (base, after) = parse_atom(chars, next);
|
||||||
(
|
(
|
||||||
@@ -1058,6 +1068,19 @@ mod tests {
|
|||||||
assert!(tall.width > plain.width);
|
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]
|
#[test]
|
||||||
fn substack_stacks_multiple_rows() {
|
fn substack_stacks_multiple_rows() {
|
||||||
let font = Cmr10Metrics::default();
|
let font = Cmr10Metrics::default();
|
||||||
|
|||||||
@@ -235,3 +235,5 @@ for a later overlaid slash.
|
|||||||
v1 remains the production renderer; the route-D core is additive and tested independently.
|
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`.
|
`\substack{a\\b}` parses each row and stacks them as `MathAtom::StackLines`.
|
||||||
|
|
||||||
|
`\mathring{x}` is the U+030A ring accent.
|
||||||
Reference in new issue
Block a user