-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.typ
89 lines (81 loc) · 2.79 KB
/
template.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
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
#import "@preview/cuti:0.2.1": show-cn-fakebold, show-fakebold
#let custom-numbering(base: 1, depth: 5, first-level: auto, second-level: auto, third-level: auto, format, ..args) = {
if (args.pos().len() > depth) {
return
}
if (first-level != auto and args.pos().len() == 1) {
if (first-level != "") {
numbering(first-level, ..args)
}
return
}
if (second-level != auto and args.pos().len() == 2) {
if (second-level != "") {
numbering(second-level, args.pos().at(1))
}
return
}
if (third-level != auto and args.pos().len() == 3) {
if (third-level != "") {
numbering(third-level, ..args)
}
return
}
// default
if (args.pos().len() >= base) {
numbering(format, ..(args.pos().slice(base - 1)))
return
}
}
// This function gets your whole document as its `body` and formats
// it as a simple fiction book.
#let proposal(
body,
) = {
show: show-cn-fakebold
let title = [报告正文]
let headsize = 14pt
let headfont = "KaiTi"
let headcolor = rgb("#0070c0")
set document(title: title)
set text(12pt, font: ("Times New Roman", "SongTi"), lang: "zh", region: "cn")
set page(
paper: "a4",
margin: (bottom: 2.5cm, top: 2.78cm, left: 3cm, right: 3cm),
)
set par(leading: 1em, first-line-indent: 2em, justify: true)
show par: set block(spacing: 1.2em)
// Configure chapter headings.
set heading(numbering: custom-numbering.with(base: 2, first-level: "(一)", second-level: "1. ", depth: 5, "1.1"))
show heading.where(level: 1): it => {
show: show-fakebold
set text(headsize, font: headfont, weight: "bold", fill: headcolor)
set par(first-line-indent: 21pt, justify: true)
show par: set block(above: 18.2pt, below: 18.4pt)
[#counter(heading).display()#it.body]
}
show heading.where(level: 2): it => {
set text(headsize, font: headfont, weight: "medium", fill: headcolor)
set par(leading: 12.4pt, first-line-indent: 27.5pt, justify: true)
show par: set block(above: 12.6pt, below: 0.2pt)
[#counter(heading).display()#it.body]
}
{
set text(headsize, font: headfont)
{
set text(15.5pt, font: headfont, weight: "bold")
set align(center)
// show par: set block(above: 8pt)
v(-1pt)
[*#title*]
}
set par(leading: 13pt, first-line-indent: 28pt, justify: true)
show par: set block(above: 16.5pt)
[参照以下提纲撰写,要求内容翔实、清晰,层次分明,标题突出。]
text(weight: "bold", fill: headcolor, [请勿删除或改动下述提纲标题及括号中的文字。])
}
set text(11.8pt, font: ("Times New Roman", "SongTi"), lang: "zh", region: "cn")
set par(leading: 14.5pt, first-line-indent: 24pt, justify: true)
show par: set block(spacing: 1em, above: 14.2pt)
body
}