From b07607d35e697be3dd5e56945b16afa8103a491e Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 9 Aug 2024 07:41:01 +0000 Subject: Split shorthands into math and markup, add tilde shorthand (#4706) --- tests/ref/math-class-chars.png | Bin 1331 -> 1346 bytes tests/ref/shorthand-minus.png | Bin 0 -> 175 bytes tests/ref/shorthands-math.png | Bin 1832 -> 1921 bytes tests/suite/math/class.typ | 2 +- tests/suite/syntax/shorthand.typ | 7 ++++++- 5 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 tests/ref/shorthand-minus.png (limited to 'tests') diff --git a/tests/ref/math-class-chars.png b/tests/ref/math-class-chars.png index a4f7d29b..6bcaaf40 100644 Binary files a/tests/ref/math-class-chars.png and b/tests/ref/math-class-chars.png differ diff --git a/tests/ref/shorthand-minus.png b/tests/ref/shorthand-minus.png new file mode 100644 index 00000000..e4249865 Binary files /dev/null and b/tests/ref/shorthand-minus.png differ diff --git a/tests/ref/shorthands-math.png b/tests/ref/shorthands-math.png index 0514fa62..ab6b7333 100644 Binary files a/tests/ref/shorthands-math.png and b/tests/ref/shorthands-math.png differ diff --git a/tests/suite/math/class.typ b/tests/suite/math/class.typ index 7aad0446..d25071db 100644 --- a/tests/suite/math/class.typ +++ b/tests/suite/math/class.typ @@ -8,7 +8,7 @@ $ a class("normal", +) b \ { x class("fence", \;) x > 0} \ a class("large", \/) b \ a class("punctuation", :) b \ - a class("relation", ~) b \ + a class("relation", !) b \ a + class("unary", times) b \ class("vary", :) a class("vary", :) b $ diff --git a/tests/suite/syntax/shorthand.typ b/tests/suite/syntax/shorthand.typ index 81aa6b7b..7d1782b9 100644 --- a/tests/suite/syntax/shorthand.typ +++ b/tests/suite/syntax/shorthand.typ @@ -19,12 +19,17 @@ a~b #set text(font: "Roboto") A... vs #"A..." +--- shorthand-minus --- +// Make sure shorthand is applied only before a digit. +-a -1 + --- shorthands-math --- -// Check all math shorthands +// Check all math shorthands. $...$\ $-$\ $'$\ $*$\ +$~$\ $!=$\ $:=$\ $::=$\ -- cgit v1.2.3