From f81a8d00e3c26e5080f3f32ce775c9f7f04db53c Mon Sep 17 00:00:00 2001 From: LU Jialin Date: Sun, 22 Oct 2023 20:07:30 +0800 Subject: Refactor `cancel`, now able to take absolute angle or functions (#2466) --- tests/ref/math/cancel.png | Bin 24765 -> 24825 bytes tests/ref/math/spacing.png | Bin 21090 -> 20645 bytes tests/typ/math/cancel.typ | 14 +++++++++----- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/ref/math/cancel.png b/tests/ref/math/cancel.png index 146bb855..b39d8d2d 100644 Binary files a/tests/ref/math/cancel.png and b/tests/ref/math/cancel.png differ diff --git a/tests/ref/math/spacing.png b/tests/ref/math/spacing.png index c9522b36..20faf665 100644 Binary files a/tests/ref/math/spacing.png and b/tests/ref/math/spacing.png differ diff --git a/tests/typ/math/cancel.typ b/tests/typ/math/cancel.typ index 315cc7d4..ac715154 100644 --- a/tests/typ/math/cancel.typ +++ b/tests/typ/math/cancel.typ @@ -25,10 +25,14 @@ $ a + cancel(b + c + d, cross: #true) + e $ --- // Resized and styled #set page(width: 200pt, height: auto) -$a + cancel(x, length: #200%) - cancel(x, length: #50%, stroke: #{red + 1.1pt})$ -$ b + cancel(x, length: #150%) - cancel(a + b + c, length: #50%, stroke: #{blue + 1.2pt}) $ +$a + cancel(x, length: #200%) - cancel(x, length: #50%, stroke: #(red + 1.1pt))$ +$ b + cancel(x, length: #150%) - cancel(a + b + c, length: #50%, stroke: #(blue + 1.2pt)) $ --- -// Rotated -$x + cancel(y, rotation: #90deg) - cancel(z, rotation: #135deg)$ -$ e + cancel((j + e)/(f + e)) - cancel((j + e)/(f + e), rotation: #30deg) $ +// Specifying cancel line angle with an absolute angle +$cancel(x, angle: #0deg) + cancel(x, angle: #45deg) + cancel(x, angle: #90deg) + cancel(x, angle: #135deg)$ + +--- +// Specifying cancel line angle with a function +$x + cancel(y, angle: #{angle => angle + 90deg}) - cancel(z, angle: #(angle => angle + 135deg))$ +$ e + cancel((j + e)/(f + e)) - cancel((j + e)/(f + e), angle: #(angle => angle + 30deg)) $ -- cgit v1.2.3