Skip to content

Commit

Permalink
feat: 完成了专业型研究生的封面页支持
Browse files Browse the repository at this point in the history
  • Loading branch information
OrangeX4 committed Dec 2, 2023
1 parent 9236cee commit 49eb4f4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ PS: 虽然与 Overleaf 看起来相似,但是它们底层原理并不相同。
### 特性 / 路线图

- **说明文档**
- [ ] 编写更详细的说明文档,考虑使用 [tidy](https://github.com/typst/packages/tree/main/packages/preview/tidy/0.1.0) 编写
- [ ] 编写更详细的说明文档,后续考虑使用 [tidy](https://github.com/typst/packages/tree/main/packages/preview/tidy/0.1.0) 编写,你现在可以先参考 [NJUThesis](https://mirror-hk.koddos.net/CTAN/macros/unicodetex/latex/njuthesis/njuthesis.pdf) 的文档,参数大体保持一致,或者直接查阅对应源码函数的参数
- **类型检查**
- [ ] 应该对所有函数入参进行类型检查,及时报错
- **全局配置**
Expand All @@ -73,11 +73,8 @@ PS: 虽然与 Overleaf 看起来相似,但是它们底层原理并不相同。
- [x] **自定义字体配置**,可以配置「宋体」、「黑体」与「楷体」等字体对应的具体字体
- [ ] **字体解耦合**:将字体配置进一步解耦合,让用到字体的地方加上一层字体名称配置项(从「标题(宋体)」-「具体字体」重构为「标题」-「宋体」-「具体字体」)
- [x] **数学字体配置**:模板不提供配置,用户可以自己使用 `#show math.equation: set text(font: "Fira Math")` 更改
- **其他模板**
- [ ] 硕士研究生模板
- [ ] 博士研究生模板
- [ ] 博士后模板
- **独立页面** (`templates` 目录)
- **模板**
- [x] 本科生模板
- [x] 字体测试页
- [x] 封面
- [x] 声明页
Expand All @@ -88,23 +85,29 @@ PS: 虽然与 Overleaf 看起来相似,但是它们底层原理并不相同。
- [x] 表格目录
- [x] 符号表
- [x] 致谢
- [x] 研究生模板
- [x] 封面
- [x] 声明页
- [x] 摘要
- [x] 页眉
- [ ] 国家图书馆封面
- [ ] 学位论文出版授权书
- [ ] 出版授权书
- [ ] 博士后模板
- **编号**
- [x] 前言使用罗马数字编号
- [x] 附录使用罗马数字编号
- [x] 表格使用 `1.1` 格式进行编号
- [x] 数学公式使用 `(1.1)` 格式进行编号
- **环境**
- [ ] 定理环境
- [ ] 定理环境(这个也可以自己使用第三方包配置)
- **其他文件**
- [x] 本科生开题报告
- [x] 研究生开题报告


## 其他文件

我还用 Typst 实现本科生和研究生的开题报告,只需要预览和编辑 `others` 目录下的文件即可。
还实现了本科生和研究生的开题报告,只需要预览和编辑 `others` 目录下的文件即可。

![开题报告](./images/proposal.png)

Expand Down
20 changes: 18 additions & 2 deletions nju-thesis/templates/master-cover.typ
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@
if (is.type(datetime, info.bottom-date)) {
info.bottom-date = datetime-display(info.bottom-date)
}
// 2.4 处理 degree
if (info.degree == auto) {
if (type == "doctor") {
info.degree = "工程博士"
} else {
info.degree = "工程硕士"
}
}

// 3. 内置辅助函数
let info-key(body, info-inset: info-inset, is-meta: false) = {
Expand Down Expand Up @@ -171,8 +179,16 @@
..info.title.map((s) => info-value("title", s)).intersperse(info-key(" ")),
info-key("作者姓名"),
info-value("author", info.author),
info-key("专业名称"),
info-value("major", info.major),
..(if degree == "professional" {(
{
set text(font: fonts.楷体, size: 字号.三号, weight: "bold")
move(dy: 0.3em, scale(x: 55%, box(width: 10em, "专业学位类别(领域)")))
},
info-value("major", info.degree + "" + info.major + ""),
)} else {(
info-key("专业名称"),
info-value("major", info.major),
)}),
info-key("研究方向"),
info-value("field", info.field),
info-key("导师姓名"),
Expand Down
2 changes: 1 addition & 1 deletion nju-thesis/typst.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nju-thesis"
version = "0.1.0"
version = "0.2.0"
entrypoint = "template.typ"
authors = ["OrangeX4"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion thesis.typ
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
doc, preface, mainmatter, mainmatter-end, appendix,
fonts-display-page, cover, decl-page, abstract, abstract-en, outline-page, list-of-figures, list-of-tables, notation, acknowledgement,
) = documentclass(
type: "master", // "bachelor" | "master" | "doctor" | "postdoc", 文档类型,默认为本科生 bachelor
// type: "bachelor", // "bachelor" | "master" | "doctor" | "postdoc", 文档类型,默认为本科生 bachelor
// degree: "academic", // "academic" | "professional", 学位类型,默认为学术型 academic
// anonymous: true, // 盲审模式
twoside: twoside, // 双面模式,会加入空白页,便于打印
Expand Down

0 comments on commit 49eb4f4

Please sign in to comment.