Files
typst-collection/glossy/tests/refs-in-captions/test.typ
T
swaits a2947f2b7b feat(glossy): Count both mode as first use
A breaking change, by default the `both` mode now counts towards the
first use of a term. This in accordance to the documentation.
(updated in bffe5fdc35fcb67aca188fc0642db5bf23530bcd!)
2025-10-26 16:00:22 -06:00

83 lines
2.3 KiB
Typst

#import "/lib.typ": *
// Our test glossary
#show: init-glossary.with((
ShortInHeader: "short used in header",
ShortInCaption: "short used in caption",
LongInHeader: "long used in header",
LongInCaption: "long used in caption",
BothInHeader: "both used in header",
BothInCaption: "both used in caption",
NormalInHeader: "unmodified use in header",
NormalInCaption: "unmodified use in caption",
))
// Configure styling
#set page(numbering: "1")
#set page(margin: 0.5in)
#set page(height: auto)
#set text(size: 10pt)
// Outlines
#outline(title:"Table of Contents", indent: auto)
#outline(title: "List of Figures", target: figure.where(kind: image))
#block(
height:7em,
glossary(title: "List of Abbreviations", theme: theme-twocol)
)
#line(length: 100%)
// Doc Body
// Use all the terms in headings
#heading(level: 1, outlined: false, [Use terms in HEADERS])
=== `@ShortInHeader:short` = "@ShortInHeader:short"
=== `@LongInHeader:long` = "@LongInHeader:long"
=== `@BothInHeader:both:nouse` = "@BothInHeader:both:nouse"
=== `@NormalInHeader` = "@NormalInHeader"
#line(length: 100%)
// Use all the terms in captions
#heading(level: 1, outlined: false, [Use terms in CAPTIONS])
#figure([], caption: [`@ShortInCaption:short` = "@ShortInCaption:short"])
#figure([], caption: [`@LongInCaption:long` = "@LongInCaption:long"])
#figure([], caption: [`@BothInCaption:both:nospend` = "@BothInCaption:both:nospend"])
#figure([], caption: [`@NormalInCaption` = "@NormalInCaption"])
#line(length: 100%)
// Now use the terms in the body to see if they handle "first use" correctly
#heading(level: 1, outlined: false, [Use terms in BODY])
First `@ShortInHeader` = "@ShortInHeader".
Second `@ShortInHeader` = "@ShortInHeader"
First `@LongInHeader` = "@LongInHeader".
Second `@LongInHeader` = "@LongInHeader".
First `@BothInHeader` = "@BothInHeader".
Second `@BothInHeader` = "@BothInHeader".
First `@NormalInHeader` = "@NormalInHeader".
Second `@NormalInHeader` = "@NormalInHeader".
#v(0.5em)
First `@ShortInCaption` = "@ShortInCaption".
Second `@ShortInCaption` = "@ShortInCaption"
First `@LongInCaption` = "@LongInCaption".
Second `@LongInCaption` = "@LongInCaption".
First `@BothInCaption` = "@BothInCaption".
Second `@BothInCaption` = "@BothInCaption".
First `@NormalInCaption` = "@NormalInCaption".
Second `@NormalInCaption` = "@NormalInCaption".