// Test labels. --- label-show-where-selector --- // Test labelled headings. #show heading: set text(10pt) #show heading.where(label: ): underline = Introduction The beginning. = Conclusion The end. --- label-after-expression --- // Test label after expression. #show strong.where(label: ): set text(red) #let a = [*A*] #let b = [*B*] #a #b --- label-on-text --- // Test labelled text. #show "t": it => { set text(blue) if it.has("label") and it.label == it } This is a thing #[that ] happened. --- label-dynamic-show-set --- // Test abusing dynamic labels for styling. #show : set text(red) #show : set text(blue) *A* *B* *C* #label("bl" + "ue") *D* --- label-after-parbreak --- // Test that label ignores parbreak. #show : none _Hidden_ _Hidden_ _Visible_ --- label-in-block --- // Test that label only works within one content block. #show : strike *This is* #[] *protected.* *This is not.* --- label-unclosed-is-text --- // Test that incomplete label is text. 1 < 2 is #if 1 < 2 [not] a label. --- label-text-styled-and-sequence --- // Test label on text, styled, and sequence. #test([Hello].label, ) #test([#[A *B* C]].label, ) #test([#text(red)[Hello]].label, ) --- label-string-conversion --- // Test getting the name of a label. #test(str(), "hey") #test(str(label("hey")), "hey") #test(str([Hmm].label), "hey") --- label-in-code-mode-hint --- // Error: 7-7 expected semicolon or line break // Hint: 7-7 labels can only be applied in markup mode // Hint: 7-7 try wrapping your code in a markup block (`[ ]`) #{ [A] }