-
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
$page.typ()$
// Modified from <https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/formats/typst/pandoc/quarto/typst-show.typ>
// to add support for:
// - more complex author affiliations TODO
// - short titles TODO
// - font options
#show: doc => ajl-article(
$if(title)$
title: [$title$],
$endif$
$if(subtitle)$
subtitle: [$subtitle$],
$endif$
$if(journal.blinded)$
authors: (( name: [Anonymzied Authors], affiliation: [], email: [], ), ),
$else$
$if(by-author)$
authors: (
$for(by-author)$
$if(it.name.literal)$
(
name: [*$it.name.literal$*$if(it.attributes.corresponding)$#footnote(numbering: "*")[
To whom correspondence should be addressed.
$if(it.email)$Email: #link("mailto:$it.email$".replace("\\", ""), raw("$it.email$".replace("\\", ""))).$endif$
$if(it.url)$Website: #link("$it.url$".replace("\\", ""), raw("$it.url$".replace("\\", ""))).$endif$
$for(it.affiliations/first)$$if(it.address)$Address:
$it.address$, $it.city$, $if(it.region)$$it.region$$else$$it.country$$endif$ $it.postal-code$.
$endif$$endfor$
]$endif$],
affiliation: [
$for(it.affiliations)$$if(it.department)$$it.department$\ $endif$
$if(it.name)$$it.name$$endif$
#v(2pt)$endfor$
],
),
$endif$
$endfor$
),
$endif$
$endif$
$if(thanks)$
thanks: [$thanks$],
$endif$
$if(date)$
date: [$date$],
$endif$
$if(lang)$
lang: "$lang$",
$endif$
$if(region)$
region: "$region$",
$endif$
$if(abstract)$
abstract: [$abstract$],
abstract-title: "$labels.abstract$",
$endif$
$if(keywords)$
keywords: ($for(keywords)$[$keywords$]$sep$, $endfor$),
$endif$
$if(jelcodes)$
jelcodes: ($for(jelcodes)$[jelcodes]$sep$, $endfor$),
$endif$
$if(font-serif-crimson)$
font: ("Cochineal",),
$elseif(mainfont)$
font: ("$mainfont$",),
$else$
font: ("Palatino",),
$endif$
$if(fontsize)$
fontsize: $fontsize$,
$endif$
$if(title)$
$if(font-headings-sans)$
$if(font-sans-biolinum)$
heading-family: ("Linux Biolinum", "Helvetica", "Arial",),
$else$
heading-family: ("Helvetica", "Arial",),
$endif$
$else$
$if(font-serif-crimson)$
heading-family: ("Cochineal",),
$elseif(mainfont)$
heading-family: ("$mainfont$",),
$else$
heading-family: ("Palatino",),
$endif$
$endif$
heading-weight: "bold",
$endif$
$if(section-numbering)$
sectionnumbering: "$section-numbering$",
$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,
)