From 7af46fc025ee08eb78ae7f6898300083c886bf6f Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 26 Nov 2022 13:39:18 +0100 Subject: Dynamic labels --- tests/ref/style/label.png | Bin 18402 -> 20873 bytes tests/typ/style/label.typ | 22 +++++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/ref/style/label.png b/tests/ref/style/label.png index 836899e1..ffad978c 100644 Binary files a/tests/ref/style/label.png and b/tests/ref/style/label.png differ diff --git a/tests/typ/style/label.typ b/tests/typ/style/label.typ index 3ce0c02c..795c0435 100644 --- a/tests/typ/style/label.typ +++ b/tests/typ/style/label.typ @@ -3,7 +3,7 @@ --- // Test labelled headings. #show heading: set text(10pt) -#show heading.where(label: "intro"): underline +#show heading.where(label: ): underline = Introduction The beginning. @@ -13,7 +13,7 @@ The end. --- // Test label after expression. -#show strong.where(label: "v"): set text(red) +#show strong.where(label: ): set text(red) #let a = [*A*] #let b = [*B*] @@ -22,22 +22,22 @@ The end. --- // Test labelled text. #show "t": it => { - set text(blue) if it.label == "last" + set text(blue) if it.label == it } This is a thing [that ] happened. --- -// Test abusing labels for styling. -#show strong.where(label: "red"): set text(red) -#show strong.where(label: "blue"): set text(blue) +// Test abusing dynamic labels for styling. +#show : set text(red) +#show : set text(blue) -*A* *B* *C* *D* +*A* *B* *C* #label("bl" + "ue") *D* --- // Test that label ignores parbreak. -#show emph.where(label: "hide"): none +#show : none _Hidden_ @@ -49,6 +49,10 @@ _Visible_ --- // Test that label only works within one content block. -#show strong.where(label: "strike"): strike +#show : strike *This is* [] *protected.* *This is not.* + +--- +// Test that incomplete label is text. +1 < 2 is #if 1 < 2 [not] a label. -- cgit v1.2.3