From 851b154a6cb1d558b0091f1a63baa4d3414a7356 Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Thu, 20 Apr 2023 10:48:11 -0700 Subject: Convert math alignment to single-pass algorithm (#891) --- tests/ref/math/alignment.png | Bin 0 -> 9752 bytes tests/typ/math/alignment.typ | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/ref/math/alignment.png create mode 100644 tests/typ/math/alignment.typ (limited to 'tests') diff --git a/tests/ref/math/alignment.png b/tests/ref/math/alignment.png new file mode 100644 index 00000000..45b0cd86 Binary files /dev/null and b/tests/ref/math/alignment.png differ diff --git a/tests/typ/math/alignment.typ b/tests/typ/math/alignment.typ new file mode 100644 index 00000000..8482d89e --- /dev/null +++ b/tests/typ/math/alignment.typ @@ -0,0 +1,28 @@ +// Test implicit alignment math. + +--- +// Test alignment step functions. +#set page(width: 300pt) +$ +"abc" &= c \ +&= c + 1 & "By definition" \ +&= d + 100 + 1000 \ +&= x && "Even longer" \ +$ + +--- +// Test post-fix alignment. +#set page(width: 300pt) +$ +& "right" \ +"a very long line" \ +$ + +--- +// Test alternating alignment. +#set page(width: 300pt) +$ +"abc" & "abc abc abc" & "abc abc" \ +"abc abc" & "abc abc" & "abc" \ +"abc abc abc" & "abc" & "abc abc abc" \ +$ -- cgit v1.2.3