main
1#import "../utils/style.typ": 字体, 字号
2#import "../utils/invisible-heading.typ": invisible-heading
3
4// 本科生中文摘要页
5#let bachelor-abstract(
6 // documentclass 传入的参数
7 twoside: false,
8 fonts: (:),
9 // 其他参数
10 keywords: (),
11 outline-title: "中文摘要",
12 outline-title-en: "Abstract in Chinese",
13 outlined: false,
14 leading: 1.28em,
15 spacing: 1.28em,
16 body,
17) = {
18 // 1. 默认参数
19 fonts = 字体 + fonts
20
21 // 2. 正式渲染
22 pagebreak(weak: true, to: if twoside { "odd" })
23
24 invisible-heading(level: 1, outlined: outlined, [#outline-title#metadata((
25 en: outline-title-en,
26 ))])
27
28 v(spacing)
29 align(center, text(size: 字号.小三, font: fonts.黑体)[摘#h(1.5em)要])
30 v(spacing * 2)
31
32 [
33 #set par(
34 justify: true,
35 first-line-indent: (amount: 2em, all: true),
36 leading: leading,
37 spacing: spacing,
38 )
39 #set text(size: 字号.小四, font: fonts.宋体)
40
41 #body
42 ]
43
44 v(spacing)
45
46 text(size: 字号.小四, font: fonts.黑体)[关键词:]
47 text(
48 size: 字号.小四,
49 font: fonts.宋体,
50 (("",) + keywords.intersperse(";")).sum(),
51 )
52}