|
4 | 4 | * @project: modern-ecnu-thesis
|
5 | 5 | * @author: OrangeX4, Juntong Chen ([email protected])
|
6 | 6 | * @created: 2025-01-06 22:37:34
|
7 |
| - * @modified: 2025-01-11 15:11:45 |
| 7 | + * @modified: 2025-01-11 16:46:35 |
8 | 8 | *
|
9 | 9 | * 华东师范大学学位论文模板
|
10 | 10 | * Repo: https://github.com/jtchen2k/modern-ecnu-thesis
|
|
54 | 54 | fonts: (:), // 字体,应传入「宋体」、「黑体」、「楷体」、「仿宋」、「等宽」
|
55 | 55 | info: (:),
|
56 | 56 | ) = {
|
| 57 | + |
| 58 | + // 开发用,用 sys input 覆盖 doctype 以方便编译多种类型的文档 |
| 59 | + if "doctype" in sys.inputs { |
| 60 | + doctype = sys.inputs.at("doctype") |
| 61 | + } |
| 62 | + if "degree" in sys.inputs { |
| 63 | + degree = sys.inputs.at("degree") |
| 64 | + } |
| 65 | + |
57 | 66 | // 默认参数
|
58 | 67 | fonts = 字体 + fonts
|
59 | 68 | info = (
|
|
105 | 114 | preface(doctype: doctype, twoside: twoside, ..args)
|
106 | 115 | },
|
107 | 116 | mainmatter: (..args) => {
|
108 |
| - mainmatter(doctype: doctype, twoside: twoside, display-header: true, ..args, fonts: fonts + args.named().at("fonts", default: (:))) |
| 117 | + if doctype == "bachelor" { |
| 118 | + mainmatter(doctype: doctype, twoside: twoside, display-header: true, |
| 119 | + heading-size: (字号.小四, 字号.小四,), |
| 120 | + numbering: custom-numbering.with(first-level: "1. ", depth: 4, "1.1 "), |
| 121 | + heading-align: (left, auto), |
| 122 | + heading-above: (0em, 1.8em), |
| 123 | + heading-below: (1.8em, 1.5em), |
| 124 | + ..args, fonts: fonts + args.named().at("fonts", default: (:))) |
| 125 | + } else { |
| 126 | + mainmatter(doctype: doctype, twoside: twoside, display-header: true, ..args, fonts: fonts + args.named().at("fonts", default: (:))) |
| 127 | + } |
109 | 128 | },
|
110 | 129 | mainmatter-end: (..args) => {
|
111 | 130 | mainmatter-end(..args)
|
112 | 131 | },
|
113 | 132 | appendix: (..args) => {
|
114 |
| - appendix(..args) |
| 133 | + if doctype == "bachelor" { |
| 134 | + appendix( |
| 135 | + doctype: doctype, |
| 136 | + numbering: custom-numbering.with(first-level: "", depth: 4, "1.1 "), |
| 137 | + ..args, |
| 138 | + fonts: fonts + args.named().at("fonts", default: (:)) |
| 139 | + ) |
| 140 | + } else { |
| 141 | + appendix(doctype: doctype, ..args) |
| 142 | + } |
115 | 143 | },
|
116 | 144 | // 字体展示页
|
117 | 145 | fonts-display-page: (..args) => {
|
|
228 | 256 | doctype: doctype,
|
229 | 257 | twoside: twoside,
|
230 | 258 | size: (字号.小四, 字号.小四),
|
231 |
| - font: (fonts.黑体, fonts.宋体), |
| 259 | + font: (fonts.宋体, fonts.宋体), |
232 | 260 | weight: ("bold", "regular"),
|
233 |
| - title-text-args: (font: 字体.黑体, size: 字号.三号, weight: "bold"), |
| 261 | + title-text-args: (font: 字体.黑体, size: 字号.小三, weight: "bold"), |
234 | 262 | show-heading: true,
|
235 | 263 | vspace: (1.2em, 1em),
|
236 |
| - indent: (0em, 2.38em, 2em, 2.8em), |
| 264 | + indent: (0em, 1.4em, 2em, 2.8em), |
237 | 265 | ..args,
|
238 | 266 | fonts: fonts + args.named().at("fonts", default: (:)),
|
239 | 267 | )
|
|
257 | 285 | list-of-figures(
|
258 | 286 | twoside: twoside,
|
259 | 287 | show-heading: true,
|
260 |
| - title-text-args: (font: 字体.黑体, size: 字号.三号, weight: "bold"), |
| 288 | + title-text-args: (font: 字体.黑体, size: if doctype == "master" { 字号.三号 } else { 字号.小三 } , weight: "bold"), |
261 | 289 | doctype: doctype,
|
262 | 290 | ..args,
|
263 | 291 | fonts: fonts + args.named().at("fonts", default: (:)),
|
|
270 | 298 | twoside: twoside,
|
271 | 299 | doctype: doctype,
|
272 | 300 | show-heading: true,
|
273 |
| - title-text-args: (font: 字体.黑体, size: 字号.三号, weight: "bold"), |
| 301 | + title-text-args: (font: 字体.黑体, size: if doctype == "master" { 字号.三号 } else { 字号.小三 } , weight: "bold"), |
274 | 302 | ..args,
|
275 | 303 | fonts: fonts + args.named().at("fonts", default: (:)),
|
276 | 304 | )
|
|
281 | 309 | notation(
|
282 | 310 | twoside: twoside,
|
283 | 311 | show-heading: true,
|
284 |
| - title-text-args: (font: 字体.黑体, size: 字号.三号, weight: "bold"), |
285 |
| - doctype: doctype, |
| 312 | + title-text-args: (font: 字体.黑体, size: if doctype == "master" { 字号.三号 } else { 字号.小三 } , weight: "bold"), |
| 313 | + doctype: doctype, |
286 | 314 | ..args,
|
287 | 315 | fonts: fonts + args.named().at("fonts", default: (:)),
|
288 | 316 | )
|
|
0 commit comments