main
1#import "../utils/style.typ": 字体, 字号, 英文
2#import "../utils/invisible-heading.typ": invisible-heading
3
4// 本科生英文摘要页
5#let bachelor-abstract-en(
6 // documentclass 传入的参数
7 twoside: false,
8 fonts: (:),
9 // 其他参数
10 keywords: (),
11 outline-title: "英文摘要",
12 outline-title-en: "Abstract in English",
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(
30 size: 字号.小三,
31 font: 英文(fonts.宋体),
32 weight: "bold",
33 )[Abstract])
34 v(spacing * 2)
35
36 [
37 #set par(
38 justify: true,
39 first-line-indent: (amount: 2em, all: true),
40 leading: leading,
41 spacing: spacing,
42 )
43 #set text(size: 字号.小四, font: 英文(fonts.宋体))
44
45 #body
46 ]
47
48 v(spacing)
49
50 text(size: 字号.小四, font: 英文(fonts.宋体), weight: "bold")[Key Words: ]
51 text(
52 size: 字号.小四,
53 font: 英文(fonts.宋体),
54 (("",) + keywords.intersperse("; ")).sum(),
55 )
56}