Accept the starred operatorname form
This commit is contained in:
1 parent
f3bbe4098b
commit
c72f612431
1 file changed
+11
@@ -918,6 +918,9 @@ fn parse_atom(chars: &[char], index: usize) -> (MathAtom, usize) {
|
||||
}
|
||||
"operatorname" => {
|
||||
let mut after = next;
|
||||
if chars.get(after) == Some(&'*') {
|
||||
after += 1;
|
||||
}
|
||||
if chars.get(after) == Some(&'{') {
|
||||
after += 1;
|
||||
}
|
||||
@@ -1265,6 +1268,14 @@ mod tests {
|
||||
assert_eq!(under.height, plain.height);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn operatorname_star_does_not_emit_a_symbol() {
|
||||
let font = Cmr10Metrics::default();
|
||||
let plain = layout_math(&parse_math(r"\operatorname{argmax}"), &font);
|
||||
let starred = layout_math(&parse_math(r"\operatorname*{argmax}"), &font);
|
||||
assert_eq!(plain.width, starred.width);
|
||||
assert_eq!(plain.height, starred.height);
|
||||
}
|
||||
#[test]
|
||||
fn operatorname_becomes_upright_text() {
|
||||
let font = Cmr10Metrics::default();
|
||||
|
||||
Reference in new issue
Block a user