├── .gitignore ├── LICENSE ├── README.md ├── gb-t-7714-2015-numeric.csl ├── images ├── Apple-Shenzhen.jpg └── bupt.png ├── main.typ ├── reference.bib ├── reference.yml └── template.typ /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.TTF 3 | *.ttf 4 | *.otf 5 | *.exe 6 | *.pdf 7 | .DS_Store 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 QQK 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 北京邮电大学本科学士学位论文模板 2 | 3 | 北邮苦 Word 和 LaTeX 久矣,于是就出现了用 [Typst](https://github.com/typst/typst) 编写的毕业论文模板。 4 | 5 | 欢迎提出任何 Issue 和 PR 帮助完善这个模板。 6 | 7 | ## 在线编辑 8 | 9 | 进入 [Typst 官网](https://typst.app/) ,并将本模板的文件导入进去,但是你还需要导入一些**在线编辑器暂不支持**的字体(比如 `楷体` ),最终你的目录看起来会像是这个样子: 10 | 11 | ``` 12 | - images 13 | - bupt.png 14 | - main.typ 15 | - template.typ 16 | - FZKTK.ttf 17 | ``` 18 | 19 | 然后只要修改 `main.typ` 就可以了。 20 | 21 | ## 本地编译 22 | 23 | 进入 Typst 的 GitHub 仓库,下载 [release](https://github.com/typst/typst/releases) ,解压出 `typst.exe` 放入根目录。 24 | 25 | 更多本地编译的使用信息见 [Typst](https://github.com/typst/typst) 仓库的 README.md 。 26 | 27 | 非常推荐你使用在线编辑来书写 Typst 文档,本模板采用的字体几乎都是官方自带的字体。 28 | 29 | 如果进行本地编译的话,你需要在本仓库的 [release](https://github.com/QQKdeGit/bupt-typst/releases) 中下载所需的字体文件,并执行如下命令: 30 | 31 | ```shell 32 | typst compile --font-path path/to/fonts main.typ 33 | ``` 34 | 35 | ## 已知问题 36 | 37 | - [ ] 段首自动空两格失效,需要手动输入 `#h(2em)` 38 | 39 | ## 注意事项 40 | 41 | 由于 Typst 仍不太完善,如果设置章节自动换页的话,某些地方会出现神奇的空页。 42 | 43 | 因此,我保留了一部分章节的**本味**,所以你需要在章节标题的前一行输入 `#pagebreak()` 手动换页。 44 | 45 | 同时随着 Typst 的不断更新,一些语法会发生改变,有时候我并没有及时跟上它的更新,这有可能会导致 bug 出现。 46 | 47 | ## FAQ 48 | 49 | **为什么模板缺失了封面、诚信声明等其他内容?** 50 | 51 | 所有缺失的内容在 release 中可以找到。考虑到一些格式不太适合和支持 Typst ,我并没有直接在本模板中复刻它。因此本模板负责的内容为论文的正文内容部分,而你需要下载那些缺失内容的文件,编辑 word 文件,导出 pdf ,最后与本模板进行 pdf 拼接(推荐使用 Adobe Acrobat 来完成上述操作)。或许在未来随着 Typst 的逐渐完善,这些缺失内容有机会可以直接在本模板中得到复刻。 52 | 53 | 缺失内容的装订顺序:封面 → 诚信声明,关于论文使用授权的说明(一页) → 任务书 → 成绩评定表 → 论文正文 → 开题报告 → 中期进展情况检查表 → 教师指导毕业设计(论文)记录表 → 提前毕设审批表(如有) → 论文题目变更申请表(如有) → 变更指导教师申请表(如有) 54 | 55 | 其中的论文正文顺序:中文摘要(含关键词) → 外文摘要(含关键词) → 目录 → 正文 → 参考文献 → 致谢 → 附录 → 外文资料 → 外文译文 56 | 57 | **需要注意,此处提供的缺失内容的 word 文件是在北邮官方提供的文件的基础上优化而来(对齐表格,调整内容等),与原版有不同之处。** -------------------------------------------------------------------------------- /gb-t-7714-2015-numeric.csl: -------------------------------------------------------------------------------- 1 | 2 | 436 | -------------------------------------------------------------------------------- /images/Apple-Shenzhen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QQKdeGit/bupt-typst/5f2fb298472ead1f850da000606e63d7698485d1/images/Apple-Shenzhen.jpg -------------------------------------------------------------------------------- /images/bupt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QQKdeGit/bupt-typst/5f2fb298472ead1f850da000606e63d7698485d1/images/bupt.png -------------------------------------------------------------------------------- /main.typ: -------------------------------------------------------------------------------- 1 | #import "template.typ": * 2 | 3 | #show: BUPTBachelorThesis.with( 4 | titleZH: "这是一个本科毕业设计的中文标题", 5 | abstractZH: [ 6 | 中文摘要。 7 | 8 | 那只敏捷的棕毛 fox 跳过那只懒狗,消失得无影无踪。 9 | 10 | 那只敏捷的棕毛狐狸 jumps over 那只懒狗,消失得无影无踪。 11 | 12 | 思源宋体也和它的兄弟字体思源黑体一样针对屏幕显示进行了优化,但前者具有截然不同的风格,适合用于文学性较强的文本或优雅、时尚的标题。它的打印效果也非常优美。 13 | ], 14 | keywordsZH: ("北京邮电大学", "本科生", "毕业设计", "模板", "示例"), 15 | 16 | titleEN: "This is English Title", 17 | abstractEN: [ 18 | English Abstract. 19 | 20 | The quick brown fox jumps over the lazy dog and runs away. The quick brown fox jumps over the lazy dog and runs away. The quick brown fox jumps over the lazy dog and runs away. 21 | ], 22 | keywordsEN: ("BUPT", "undergraduate", "thesis", "template", "example"), 23 | ) 24 | 25 | // 正文 26 | = 基础模块 27 | 28 | 我认为 Typst 介于 LaTeX 和 Markdown 之间。在你开始使用这个模板之前,你可以对 LaTeX 不那么熟悉,但确保你对 Markdown 有一定了解,并且我建议学习一下如何使用 Typst 。 29 | 30 | == 段落示例 31 | 32 | 二级标题和三级标题的段前和段后都增加了 0.5 行间距。如果二级标题和三级标题之间没有内容,两者的间距会直接叠加,而不是像 Word 那样自动设置。 33 | 34 | === 三级标题 35 | 36 | === 另一个三级标题 37 | 38 | 我是标题下的第一个段落。我前面没有缩进。 39 | 40 | 我上面的段落没有 2 个全角空格的缩进,但是我有。我也不知道为什么。 41 | 42 | === 最后一个三级标题 43 | 44 | #h(2em) 45 | 我也是标题下的第一个段落,但是我前面有缩进,因为我的上一行有一个函数。 46 | 47 | == 图示例 48 | 49 | 这是一幅图。 50 | 51 | #Figure( 52 | "images/Apple-Shenzhen.jpg", 53 | [Apple 深圳万象城零售店], 54 | 80% 55 | ) 56 | 57 | == 表格示例 58 | 59 | #Table( 60 | "北京邮电大学历年录取分数线", 61 | (auto, auto, auto, auto, auto), 62 | horizon, 63 | ( 64 | [*年份*], [*录取批次*], [*招生类型*], [*最低分/最低位次*], [*省控线*], 65 | [2018], [本科一批], [普通类], [649/2469], [532], 66 | [2017], [本科一批], [普通类], [635/2548], [537], 67 | [2016], [本科一批], [宏福校区], [621/--], [548], 68 | [2015], [本科一批], [普通类], [646/2499], [548], 69 | [2014], [本科一批], [普通类], [--/--], [548], 70 | ) 71 | ) 72 | 73 | 这是一张表。注意到了吗?这里并没有自动段首空格,因为我们还在上一段里。要想在后面开启新的一段,需要自己手动输入换行符“\\”。后面没有空格的原理是一样的。 74 | 75 | == 公式示例 76 | 77 | 下方是一个简单的求圆的面积的公式: 78 | 79 | $ S = pi r^2 $ 80 | 81 | 语法跟 Markdown 很像,比较容易上手。 82 | 83 | == 引用示例 84 | 85 | 这是一个参考文献 @cn_ref 的引用 @webster_social_media 。 86 | 87 | == 代码示例 88 | 89 | 这是一段用示例代码。 90 | 91 | ```cpp 92 | void setFib(void) 93 | { 94 | fib(1 | 2 | 3 | 5 | 8 | 13 | 21 | 34 | 55 | 89, 10); 95 | } 96 | ``` 97 | 98 | Typst 还支持书写行内的代码,就像 Markdown 一样,比如 `return n * f(n - 1)` 。 99 | 100 | // 附页 101 | #show: Appendix.with( 102 | bibliographyFile: "reference.yml" 103 | ) 104 | 105 | #pagebreak() 106 | #primary_heading([= 致#h(2em)谢]) 107 | 108 | 谢谢你北邮,因为有你,温暖了四季。 109 | 110 | #pagebreak() 111 | #primary_heading([= 附#h(2em)录]) 112 | 113 | #set heading(outlined: false) 114 | 115 | == 附录 1 116 | 117 | 这是一个附录内容,学校规定附录的二级标题得是“附录”二字后接阿拉伯数字。 118 | 119 | 但是 Typst 的中文与英文和数字之间的空格并没有像 LaTeX 那样自动空出,所以就需要自己手打了。 120 | 121 | #set page(footer: none) 122 | 123 | #pagebreak() 124 | #primary_heading([= 外#h(1em)文#h(1em)资#h(1em)料]) 125 | 126 | #pagebreak() 127 | #primary_heading([= 外#h(1em)文#h(1em)译#h(1em)文]) 128 | 129 | -------------------------------------------------------------------------------- /reference.bib: -------------------------------------------------------------------------------- 1 | @ELECTRONIC{webster_social_media, 2 | title = {Social Media}, 3 | organization = {Merriam-Webster}, 4 | year = {2018}, 5 | howpublished = {online}, 6 | refdate = {2018-04-15}, 7 | url = {http://www.merriam-webster.com/dictionary/social media}, 8 | } 9 | 10 | @ELECTRONIC{cn_ref, 11 | title = {中文引用,思源}, 12 | organization = {Merriam-Webster}, 13 | year = {2018}, 14 | howpublished = {online}, 15 | refdate = {2018-04-15}, 16 | url = {http://www.merriam-webster.com/dictionary/social media}, 17 | } 18 | -------------------------------------------------------------------------------- /reference.yml: -------------------------------------------------------------------------------- 1 | webster_social_media: { 2 | type: Book, 3 | title: Harry Potter and the Order of the Phoenix, 4 | author: "Rowling, J. K.", 5 | volume: 5, 6 | page-total: 768, 7 | date: 2003-06-21, 8 | } 9 | 10 | cn_ref: { 11 | type: Web, 12 | title: 中文引用,思源宋体, 13 | serial-number: v2.5, 14 | author: 中文作者, 15 | url: https://source.typekit.com/source-han-serif/cn/, 16 | date: 2024, 17 | } -------------------------------------------------------------------------------- /template.typ: -------------------------------------------------------------------------------- 1 | #let chineseNumMap(num) = { 2 | let chineseNum = ( 3 | "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", 4 | "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", 5 | "二十一", "二十二", "二十三", "二十四", "二十五", "二十六", "二十七", "二十八", "二十九", "三十", 6 | "三十一", "三十二", "三十三", "三十四", "三十五", "三十六", "三十七", "三十八", "三十九", "四十", 7 | ) 8 | chineseNum.at(num - 1) 9 | } 10 | 11 | #let romanNumMap(num) = { 12 | let romanNum = ( 13 | "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", 14 | "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII", "XVIII", "XIX", "XX", 15 | "XXI", "XXII", "XXIII", "XXIV", "XXV", "XXVI", "XXVII", "XXVIII", "XXIX", "XXX", 16 | "XXXI", "XXXII", "XXXIII", "XXXIV", "XXXV", "XXXVI", "XXXVII", "XXXVIII", "XXXIX", "XL", 17 | ) 18 | romanNum.at(num - 1) 19 | } 20 | 21 | #let FONTSIZE = ( 22 | SanHao: 16pt, 23 | XiaoSan: 15pt, 24 | SiHao: 14pt, 25 | XiaoSi: 12pt, 26 | WuHao: 10.5pt, 27 | XiaoWu: 9pt, 28 | ) 29 | 30 | #let FONTSET = ( 31 | Hei: ("Inter", "Noto Sans CJK SC"), 32 | Song: "Noto Serif CJK SC", 33 | Kai: "FZKai-Z03", 34 | English: "STIX Two Text", 35 | ) 36 | 37 | #let tableCounter = counter("Table") 38 | #let figureCounter = counter("Figure") 39 | #let equationCounter = counter("Equation") 40 | 41 | #let BUPTBachelorThesis( 42 | titleZH: "", 43 | abstractZH: "", 44 | keywordsZH: (), 45 | 46 | titleEN: "", 47 | abstractEN: "", 48 | keywordsEN: (), 49 | 50 | body 51 | ) = { 52 | // 页面配置 53 | set page(paper: "a4", margin: 2.5cm) 54 | set text(font: (FONTSET.at("English"), FONTSET.at("Song")), weight: "regular", size: FONTSIZE.XiaoSi) 55 | 56 | // 数学公式 57 | show math.equation: it => if it.block { 58 | locate(loc => { 59 | set par(leading: 1.5em) 60 | let chapterLevel = counter(heading).at(loc).at(0) 61 | 62 | grid( 63 | columns: (100pt, 1fr, 100pt), 64 | [], 65 | align(center, it), 66 | align(horizon + right)[ 67 | #text( 68 | font: (FONTSET.at("English"), FONTSET.at("Song")), 69 | [式(#chapterLevel\-#equationCounter.display())] 70 | ) 71 | ] 72 | ) 73 | 74 | equationCounter.step() 75 | }) 76 | } else { 77 | it 78 | } 79 | 80 | // 代码 81 | show raw.where(block: true): it => { 82 | set block(stroke: 0.5pt, width: 100%, inset: 1em) 83 | it 84 | } 85 | 86 | // 中文摘要 87 | align(center)[ 88 | #set text(font: FONTSET.at("Hei"), weight: "bold") 89 | #text(size: FONTSIZE.SanHao, titleZH) \ \ 90 | #text(size: FONTSIZE.XiaoSan, tracking: 1em, "摘要") \ \ 91 | ] 92 | 93 | set par(first-line-indent: 2em, leading: 1.2em) // 段内行间距为1.2倍 94 | show par: set block(spacing: 1.2em) // 段间距同样为1.2倍 95 | abstractZH 96 | 97 | [\ \ ] 98 | text(font: FONTSET.at("Hei"), weight: "bold", size: FONTSIZE.XiaoSi, h(2em) + "关键词") 99 | text(size: FONTSIZE.XiaoSi, 100 | for value in keywordsZH { 101 | h(1em) + value 102 | } 103 | ) 104 | pagebreak() 105 | 106 | // 英文摘要 107 | align(center)[ 108 | #text(weight: "bold", size: FONTSIZE.SanHao, titleEN) \ \ 109 | #text(weight: "bold", size: FONTSIZE.XiaoSan, "ABSTRACT") \ \ 110 | ] 111 | abstractEN 112 | 113 | [\ \ ] 114 | text(weight: "bold", size: FONTSIZE.XiaoSi, h(2em) + "KEY WORDS") 115 | text(size: FONTSIZE.XiaoSi, 116 | for value in keywordsEN { 117 | h(1em) + value 118 | } 119 | ) 120 | pagebreak() 121 | 122 | // 目录 123 | set page( 124 | footer: locate(loc => { 125 | [ 126 | #align(center)[ 127 | #text(font: FONTSET.at("English"), size: FONTSIZE.XiaoWu)[ 128 | #romanNumMap(counter(page).at(loc).at(0)) 129 | ] 130 | ] 131 | ] 132 | }) 133 | ) 134 | counter(page).update(1) 135 | 136 | show outline: it => locate(loc => { 137 | set par(first-line-indent: 0em) 138 | 139 | align(center)[ 140 | #text(font: FONTSET.at("Hei"), weight: "bold", tracking: 2em, size: FONTSIZE.SanHao, [目录\ \ ]) 141 | ] 142 | 143 | let chapterCounter = 1 144 | let sectionCounter = 1 145 | let subsectionCounter = 1 146 | 147 | let headingList = query(selector(heading).after(loc), loc) 148 | for i in headingList { 149 | if i.outlined == false { 150 | break 151 | } 152 | 153 | if i.level == 1 { 154 | set text(font: (FONTSET.at("Hei")), size: FONTSIZE.XiaoSi, weight: "bold") 155 | 156 | if i.body != [参考文献] and i.body != [致#h(2em)谢] and i.body != [附#h(2em)录] { 157 | [第#chineseNumMap(chapterCounter)章#h(1em)] 158 | } 159 | 160 | if i.body == [致#h(2em)谢] { 161 | [致#h(2em)谢 #box(width: 1fr, repeat[.]) #counter(page).at(i.location()).at(0)\ ] 162 | } else if i.body == [附#h(2em)录] { 163 | [附#h(2em)录 #box(width: 1fr, repeat[.]) #counter(page).at(i.location()).at(0)\ ] 164 | } else { 165 | [#i.body #box(width: 1fr, repeat[.]) #counter(page).at(i.location()).at(0)\ ] 166 | } 167 | 168 | chapterCounter = chapterCounter + 1 169 | sectionCounter = 1 170 | } else if i.level == 2 { 171 | [#h(1em)#calc.abs(chapterCounter - 1)\.#sectionCounter#h(1em)#i.body #box(width: 1fr, repeat[.]) #counter(page).at(i.location()).at(0)\ ] 172 | 173 | sectionCounter += 1 174 | subsectionCounter = 1 175 | } else if i.level == 3 { 176 | [#h(2em)#calc.abs(chapterCounter - 1)\.#calc.abs(sectionCounter - 1)\.#subsectionCounter#h(1em)#i.body #box(width: 1fr, repeat[.]) #counter(page).at(i.location()).at(0)\ ] 177 | 178 | subsectionCounter += 1 179 | } 180 | } 181 | }) 182 | 183 | outline(title: none, depth: 3, indent: true) 184 | 185 | // 章节标题配置 186 | set heading(numbering: "1.1") 187 | show heading: it => { 188 | locate(loc => { 189 | let levels = counter(heading).at(loc) 190 | 191 | // 重置段首空格 192 | set par(first-line-indent: 0em) 193 | set text(font: FONTSET.at("Hei"), weight: "bold") 194 | 195 | if it.level == 1 { 196 | // 重置计数器 197 | tableCounter.update(1) 198 | figureCounter.update(1) 199 | equationCounter.update(1) 200 | 201 | align(center)[ 202 | #grid( 203 | rows: (1em), 204 | row-gutter: 0.2em, 205 | columns: (1fr), 206 | [], 207 | text(size: FONTSIZE.SanHao, [第#chineseNumMap(levels.at(0))章#h(1em)#it.body]), 208 | [] 209 | ) 210 | ] 211 | } else if it.level == 2 { 212 | grid( 213 | rows: (0.5em, 1em, 0.5em), 214 | columns: (1fr), 215 | [], 216 | [#numbering("1.1", ..levels) 217 | #text(size: FONTSIZE.SiHao, h(1em) + it.body)], 218 | [] 219 | ) 220 | 221 | } else { 222 | grid( 223 | rows: (0.5em, 1em, 0.5em), 224 | columns: (1fr), 225 | [], 226 | [#h(2em) #numbering("1.1", ..levels) 227 | #text(size: FONTSIZE.XiaoSi, h(1em) + it.body)], 228 | [] 229 | ) 230 | } 231 | }) 232 | text()[#v(-0.6em, weak: true)];text()[#h(0em)] 233 | } 234 | 235 | // 引用 236 | show cite: it => { 237 | text(font: FONTSET.at("English"), it) 238 | } 239 | 240 | // 页眉页脚 241 | set page( 242 | header: [ 243 | #align(center)[ 244 | #pad(bottom: -8pt)[ 245 | #pad(bottom: -8pt, 246 | text(font: FONTSET.at("Song"), size: FONTSIZE.XiaoWu, "北京邮电大学本科毕业设计(论文)") 247 | ) 248 | #line(length: 100%, stroke: 0.5pt) 249 | ] 250 | ] 251 | ], 252 | footer: [ 253 | #align(center)[ 254 | #text(font: FONTSET.at("English"), size: FONTSIZE.XiaoWu)[ 255 | #counter(page).display() 256 | ] 257 | ] 258 | ] 259 | ) 260 | counter(page).update(1) 261 | 262 | // 正文 263 | body 264 | } 265 | 266 | #let primary_heading( 267 | title 268 | ) = { 269 | grid( 270 | columns: (1fr), 271 | row-gutter: 0.2em, 272 | rows: (1em, 1em, 1em), 273 | [], [#title], [] 274 | ) 275 | } 276 | 277 | // 附录部分 278 | #let Appendix( 279 | bibliographyFile: none, 280 | 281 | body 282 | ) = { 283 | show heading: it => locate(loc => { 284 | set par(first-line-indent: 0em) 285 | 286 | let levels = counter(heading).at(loc) 287 | 288 | if it.level == 1 { 289 | align(center)[ 290 | #text(font: FONTSET.at("Hei"), size: FONTSIZE.SanHao, it.body) 291 | ] 292 | } else if it.level == 2 { 293 | text(size: FONTSIZE.SiHao, it.body) 294 | } 295 | }) 296 | 297 | // 参考文献 298 | if bibliographyFile != none { 299 | pagebreak() 300 | primary_heading([= 参考文献]) 301 | 302 | set text( 303 | font: (FONTSET.at("English"), 304 | FONTSET.at("Song")), 305 | size: FONTSIZE.WuHao, 306 | lang: "zh" 307 | ) 308 | set par(first-line-indent: 0em) 309 | bibliography( 310 | bibliographyFile, 311 | title: none, 312 | style: "gb-7714-2015-numeric" 313 | ) 314 | show bibliography: it => { 315 | 316 | } 317 | } 318 | 319 | body 320 | } 321 | 322 | // 图 323 | #let Figure( 324 | file, 325 | caption, 326 | width, 327 | ) = { 328 | show figure: it => locate(loc => { 329 | let chapterLevel = counter(heading).at(loc).at(0) 330 | 331 | align(center)[ 332 | #it.body 333 | #text( 334 | font: (FONTSET.at("English"), FONTSET.at("Kai")), 335 | size: FONTSIZE.WuHao, 336 | [图 #chapterLevel\-#figureCounter.display() #caption] 337 | ) 338 | ] 339 | 340 | figureCounter.step() 341 | }) 342 | 343 | figure( 344 | image(file, width: width) 345 | ) 346 | } 347 | 348 | // 表 349 | #let Table(caption, columnsSet, alignSet, body) = { 350 | show table: it => locate(loc => { 351 | let chapterLevel = counter(heading).at(loc).at(0) 352 | 353 | align(center)[ 354 | #text( 355 | font: (FONTSET.at("English"), FONTSET.at("Kai")), 356 | size: FONTSIZE.WuHao, 357 | [表 #chapterLevel\-#tableCounter.display() #caption] 358 | ) 359 | #it 360 | ] 361 | 362 | tableCounter.step() 363 | }) 364 | 365 | table( 366 | columns: columnsSet, 367 | align: alignSet, 368 | inset: 8pt, 369 | stroke: 0.5pt, 370 | ..body 371 | ) 372 | } --------------------------------------------------------------------------------