forked from typst-community/glossarium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.typ
60 lines (49 loc) · 1.54 KB
/
main.typ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#import "../../glossarium.typ": make-glossary, register-glossary, print-glossary, gls, glspl
// Replace the local import with a import to the preview namespace.
// If you don't know what that mean, please go read typst documentation on how to import packages at https://typst.app/docs/packages/.
#show: make-glossary
#let entry-list = (
(
key: "potato",
short: "potato",
// "plural" will be used when "short" should be pluralized
plural: "potatoes",
description: [#lorem(10)],
),
(
key: "dm",
short: "DM",
long: "diagonal matrix",
// "longplural" will be used when "long" should be pluralized
longplural: "diagonal matrices",
description: "Probably some math stuff idk",
),
(
key: "cpu",
short: "CPU",
long: "Central Processing Unit",
description: [#lorem(10)],
),
(
key: "buffer",
short: "buffer",
description: "A place to store stuff",
),
)
#register-glossary(entry-list)
#set page(paper: "a5")
#show link: set text(fill: blue.darken(60%))
I like to eat #glspl("potato"). Yes I still like to eat #glspl("potato").
But I don't like to eat #glspl("dm").
...
I thought about it and now I like to eat #glspl("dm").
I love #glspl("cpu"). I ate a #gls("cpu") once.
Would you eat a #gls("buffer") ? I heard #glspl("buffer") are tasty.
= Glossary
#print-glossary(
entry-list,
// show all term even if they are not referenced, default to false
show-all: true,
// disable the back ref at the end of the descriptions
disable-back-references: true,
)