-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypst-show.typ
More file actions
107 lines (106 loc) · 2.54 KB
/
typst-show.typ
File metadata and controls
107 lines (106 loc) · 2.54 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Typst custom formats typically consist of a 'typst-template.typ' (which is
// the source code for a typst template) and a 'typst-show.typ' which calls the
// template's function (forwarding Pandoc metadata values as required)
#show: doc => clean(
$if(title)$
title: [$title$],
$endif$
$if(subtitle)$
subtitle: [$subtitle$],
$endif$
$if(by-author)$
authors: (
$for(by-author)$
$if(it.name.literal)$
(
name: [$it.name.literal$],
last: [$it.name.family$],
$if(it.affiliations/first)$
$for(it.affiliations/first)$
department: $if(it.department)$[$it.department$]$else$none$endif$,
university: $if(it.name)$[$it.name$]$else$none$endif$,
location: [$if(it.city)$$it.city$$if(it.country)$, $endif$$endif$$if(it.country)$$it.country$$endif$],
$endfor$
$endif$
$if(it.email)$
email: [$it.email$],
$endif$
$if(it.orcid)$
orcid: "$it.orcid$"
$endif$
),
$endif$
$endfor$
),
$endif$
title-only: $title-only$,
$if(date)$
date: [$date$],
date-in-header: $date-in-header$,
$endif$
$if(lang)$
lang: "$lang$",
$endif$
$if(region)$
region: "$region$",
$endif$
$if(abstract)$
abstract: [$abstract$],
abstract-title: "$labels.abstract$",
$endif$
$if(margin)$
margin: ($for(margin/pairs)$$margin.key$: $margin.value$,$endfor$),
$endif$
$if(papersize)$
paper: "$papersize$",
$endif$
$if(mainfont)$
font: ("$mainfont$",),
$elseif(brand.typography.base.family)$
font: $brand.typography.base.family$,
$endif$
$if(monofont)$
monofont: ("$monofont$",),
$endif$
$if(fontsize)$
fontsize: $fontsize$,
$elseif(brand.typography.base.size)$
fontsize: $brand.typography.base.size$,
$endif$
$if(lineheight)$
lineheight: $lineheight$,
$endif$
$if(title)$
$if(brand.typography.headings.family)$
heading-family: $brand.typography.headings.family$,
$endif$
$if(brand.typography.headings.weight)$
heading-weight: $brand.typography.headings.weight$,
$endif$
$if(brand.typography.headings.style)$
heading-style: "$brand.typography.headings.style$",
$endif$
$if(brand.typography.headings.color)$
heading-color: $brand.typography.headings.color$,
$endif$
$if(brand.typography.headings.line-height)$
heading-line-height: $brand.typography.headings.line-height$,
$endif$
$endif$
$if(section-numbering)$
sectionnumbering: "$section-numbering$",
$endif$
pagenumbering: $if(page-numbering)$"$page-numbering$"$else$none$endif$,
$if(toc)$
toc: $toc$,
$endif$
$if(toc-title)$
toc_title: [$toc-title$],
$endif$
$if(toc-indent)$
toc_indent: $toc-indent$,
$endif$
toc_depth: $toc-depth$,
cols: $if(columns)$$columns$$else$1$endif$,
doc,
)