Skip to content

Commit aacf136

Browse files
committed
feat: add page header and update footer font
1 parent 3660e86 commit aacf136

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
- [x] 图片
3838
- [ ] 表格
3939
- [ ] 页面脚注(开发人员说后续会加上的 [#222](https://github.com/typst/typst/discussions/222)
40-
- [ ] 页码字体改为小五号 Times New Man
40+
- [x] 页码字体改为小五号 Times New Man
4141
- [x] 数学公式
4242
- [ ] 参考文献
4343

@@ -49,4 +49,5 @@
4949

5050
- [x] 默认第一段的段首无法自动空两格,必须要自己额外给第一段添加
5151
- [x] 章节无法自动换页,需要手动输入 `#pagebreak()`
52-
- [ ] 多行公式时,公式标号没有垂直居中
52+
- [ ] 多行公式时,公式标号没有垂直居中
53+
- [ ] 目录中的页码不是小五号 Times New Man

template.typ

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 三号 16pt,小三号 15pt,四号 14pt,小四号 12pt,五号 10.5pt
1+
// 三号 16pt,小三号 15pt,四号 14pt,小四号 12pt,五号 10.5pt,小五号 9pt
22

33
#let FONTSET = (
44
Hei: "Noto Sans CJK SC",
@@ -92,7 +92,6 @@
9292
depth: 3,
9393
)
9494
]
95-
pagebreak()
9695

9796
// =========== Configure headings ===========
9897
let chineseNumMap(num) = {
@@ -133,9 +132,29 @@
133132
text(font: FONTSET.at("English"), super(it))
134133
}
135134

136-
// =========== Contents ===========
137-
set page(numbering: "1")
135+
// =========== Page header and footer ===========
136+
set page(
137+
header: [
138+
#align(center)[
139+
#pad(bottom: -4pt)[
140+
#pad(bottom: -8pt,
141+
text(font: FONTSET.at("Song"), size: 9pt, "北京邮电大学本科毕业设计(论文)")
142+
)
143+
#line(length: 100%, stroke: 0.5pt)
144+
]
145+
]
146+
],
147+
footer: [
148+
#align(center)[
149+
#text(font: FONTSET.at("English"), size: 9pt)[
150+
#counter(page).display()
151+
]
152+
]
153+
]
154+
)
138155
counter(page).update(1)
156+
157+
// =========== Contents ===========
139158
body
140159

141160
// =========== Bibliography ===========

0 commit comments

Comments
 (0)