Add common fence delimiter symbols
This commit is contained in:
1 parent
df511602cf
commit
dc8282f707
1 file changed
+18
@@ -581,6 +581,16 @@ fn parse_atom(chars: &[char], index: usize) -> (MathAtom, usize) {
|
|||||||
return match command.as_str() {
|
return match command.as_str() {
|
||||||
"quad" => (MathAtom::Space(655_360), next),
|
"quad" => (MathAtom::Space(655_360), next),
|
||||||
"qquad" => (MathAtom::Space(1_310_720), next),
|
"qquad" => (MathAtom::Space(1_310_720), next),
|
||||||
|
"lvert" | "rvert" | "vert" => (MathAtom::Symbol('|'), next),
|
||||||
|
"lVert" | "rVert" | "Vert" => (MathAtom::Symbol('\u{2016}'), next),
|
||||||
|
"lbrace" => (MathAtom::Symbol('{'), next),
|
||||||
|
"rbrace" => (MathAtom::Symbol('}'), next),
|
||||||
|
"langle" => (MathAtom::Symbol('\u{27E8}'), next),
|
||||||
|
"rangle" => (MathAtom::Symbol('\u{27E9}'), next),
|
||||||
|
"lfloor" => (MathAtom::Symbol('\u{230A}'), next),
|
||||||
|
"rfloor" => (MathAtom::Symbol('\u{230B}'), next),
|
||||||
|
"lceil" => (MathAtom::Symbol('\u{2308}'), next),
|
||||||
|
"rceil" => (MathAtom::Symbol('\u{2309}'), next),
|
||||||
"displaystyle" | "textstyle" | "scriptstyle" | "scriptscriptstyle" | "nonumber"
|
"displaystyle" | "textstyle" | "scriptstyle" | "scriptscriptstyle" | "nonumber"
|
||||||
| "notag" | "limits" | "nolimits" | "displaylimits" => {
|
| "notag" | "limits" | "nolimits" | "displaylimits" => {
|
||||||
let mut after = next;
|
let mut after = next;
|
||||||
@@ -1278,6 +1288,14 @@ mod tests {
|
|||||||
assert_eq!(plain.height, numbered.height);
|
assert_eq!(plain.height, numbered.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fence_delimiters_have_widths() {
|
||||||
|
let font = Cmr10Metrics::default();
|
||||||
|
for source in [r"\lvert x \rvert", r"\lfloor x \rfloor", r"\lceil x \rceil"] {
|
||||||
|
let boxed = layout_math(&parse_math(source), &font);
|
||||||
|
assert!(boxed.width > layout_math(&parse_math(r"x"), &font).width);
|
||||||
|
}
|
||||||
|
}
|
||||||
#[test]
|
#[test]
|
||||||
fn pmod_wraps_the_argument_and_bmod_stays_inline() {
|
fn pmod_wraps_the_argument_and_bmod_stays_inline() {
|
||||||
let font = Cmr10Metrics::default();
|
let font = Cmr10Metrics::default();
|
||||||
|
|||||||
Reference in new issue
Block a user