forked from Shuenhoy/modern-zju-thesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbib-provider.typ
36 lines (33 loc) · 938 Bytes
/
bib-provider.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
#let bib-provider(bibsource, mode: "") = {
let typstbib = bibliography(bytes(bibsource), style: "gb-7714-2015-numeric", title: none)
let hiddenbib = [
#show bibliography: none // to provide hint in the editor
#typstbib
]
if mode == "bilingual" {
import "./bilingual-bibliography.typ": show-bilingual-bibliography
(
bibcontent: typstbib,
bibshow: show-bilingual-bibliography,
hiddenbib: none,
new-bib: () => (),
)
} else if (mode == "citext") {
import "./citext/lib.typ": *
let bib = init-citation(bibsource)
(
bibcontent: extbib(bib),
bibshow: show-extcite.with(bib: bib, gen-id: true),
hiddenbib: hiddenbib,
new-bib: new-citext-session,
)
} else if (mode == "partbib") {
import "./part.typ": *
(
bibcontent: part-bib,
bibshow: x => x,
hiddenbib: hiddenbib,
new-bib: () => part-refs.update(()),
)
}
}