Skip to content

Commit 4c2ea1f

Browse files
authored
modern-nenu-thesis:0.1.0 (#3071)
1 parent f334555 commit 4c2ea1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+5380
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 [fullname]
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.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# NENU-Thesis-Typst-Template
2+
3+
东北师范大学毕业论文的 `Typst` 模板,可以在 [`template/thesis.typ`](./template/thesis.typ) 查看使用方法与生成的效果
4+
5+
![Editor](./images/editor.png)
6+
7+
> [!IMPORTANT]
8+
> 此模板是民间模板,有不被学校认可的风险。
9+
>
10+
> 本模板虽已尽力尝试复原 Word 模板,但可能仍然存在诸多格式问题,详细请看[存在的问题](#存在的问题)
11+
12+
> [!NOTE]
13+
> 我们在 `other` 文件夹中放了其他的模板,例如:
14+
>
15+
> 1. 实验报告模板(lab-report.typ)
16+
> 2. 研究生/博士生 开题报告模板(master-proposal.typ)
17+
>
18+
> 这些模板暂时没有集成到 `thesis` 模板中,要使用的话只能将仓库克隆(或复制该文件到本地)
19+
> 需要注意的是,这些文件会使用 `other``asset` 中的一些资源文件,请一并下载
20+
21+
## 使用方法
22+
23+
模板可以下载到本地使用,也可以通过导入包使用:
24+
25+
```typ
26+
#import "@preview/modern-nenu-thesis:0.1.0": thesis
27+
```
28+
29+
> [!IMPORTANT]
30+
> 需要下载[隶书字体](https://github.com/dolbydu/font/blob/master/unicode/Lisu.TTF)(如果使用 MacOS/Linux)
31+
32+
### 本地使用
33+
34+
1. 安装一个文本编辑器,这里推荐使用 `VS Code`,并安装 [Tinymist Typst](https://github.com/Myriad-Dreamin/tinymist)[Typst Preview](https://github.com/Enter-tainer/typst-preview) 插件
35+
36+
- 克隆/下载本仓库到本地,并使用 `VS Code` 打开项目文件夹
37+
38+
- 打开 `template/thesis.typ` 文件,开始编写你的论文内容,可以按下 `<C-K> V` (Ctrl+K V) 快捷键在 `VS Code` 中打开预览窗口,实时查看你的论文效果
39+
40+
## TODO
41+
42+
- [x] 学士学位论文模板
43+
- [x] 封面
44+
- [x] 扉页
45+
- [x] 中文摘要
46+
- [x] 英文摘要
47+
- [x] 目录页
48+
- [x] 正文
49+
- [x] 致谢
50+
- [x] 附录
51+
52+
- [x] 硕士(博士)学位论文模板
53+
- [ ] 一些微调,主要是空行上的
54+
55+
- [ ] 博士后研究报告
56+
57+
- [ ] 加入打印选项,用于生成装订版本的论文
58+
59+
- [ ] 更多其它模板
60+
61+
- [ ] 完善使用文档
62+
63+
## 存在的问题
64+
65+
1. 使用 `subpar` 时,无法正确显示子图的编号,如下图所示:
66+
![subfigure-error](images/subfigure-error.png)
67+
因此暂时不支持使用子图
68+
69+
> [!IMPORTANT]
70+
>
71+
> [Issue#12](https://github.com/RubixDev/typst-i-figured/issues/12) 这里有一个迂回的方法用以解决子图问题
72+
73+
74+
2. 扉页中作者签名无法直接插入图片/PDF
75+
76+
## 致谢
77+
78+
- 感谢 [modern-nju-thesis](https://github.com/nju-lug/modern-nju-thesis) 开发的 `Typst` 模板,架构清晰,文档注释详细,本项目在架构上参考良多。
79+
- 感谢 [SEU-Typst-Template](https://github.com/csimide/SEU-Typst-Template/) 开发的 `Typst` 模板

packages/preview/modern-nenu-thesis/0.1.0/assets/nenu-logo-blue.svg

Lines changed: 60 additions & 0 deletions
Loading

packages/preview/modern-nenu-thesis/0.1.0/assets/nenu-logo-green.svg

Lines changed: 60 additions & 0 deletions
Loading

packages/preview/modern-nenu-thesis/0.1.0/assets/nenu-logo-red.svg

Lines changed: 60 additions & 0 deletions
Loading

packages/preview/modern-nenu-thesis/0.1.0/assets/nenu-logo.svg

Lines changed: 60 additions & 0 deletions
Loading

packages/preview/modern-nenu-thesis/0.1.0/assets/nenu-title-blue.svg

Lines changed: 50 additions & 0 deletions
Loading

packages/preview/modern-nenu-thesis/0.1.0/assets/nenu-title.svg

Lines changed: 252 additions & 0 deletions
Loading
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
#import "@preview/gentle-clues:1.2.0": *
2+
#import "style.typ": module, project, ref-fn, tidy
3+
4+
#let current-version = "0.1.0"
5+
6+
#show: project.with(
7+
color: rgb("#143f85"),
8+
title: "NENU毕业论文模板手册",
9+
top-text: "Start Your Thesis with Typst",
10+
subtitle: "v" + current-version,
11+
pic: "/assets/nenu-logo-blue.svg",
12+
publisher: "NENU IST",
13+
signature: "Dian Ling <virgiling7@gmail.com>",
14+
)
15+
16+
= 基础使用
17+
18+
我们通过向 #ref-fn("thesis()") 输入论文的参数,得到对应的返回页面,并通过类似 `React` 的方式将这些页面组装起来,例如:
19+
20+
```typ
21+
#let (
22+
twoside,
23+
doc,
24+
preface,
25+
mainmatter,
26+
appendix,
27+
fonts-display-page,
28+
cover,
29+
committee-page,
30+
decl-page,
31+
abstract,
32+
abstract-en,
33+
bilingual-bibliography,
34+
outline-page,
35+
list-of-figures,
36+
list-of-tables,
37+
notation,
38+
acknowledgement,
39+
publication,
40+
decision,
41+
) = thesis(
42+
doctype: "master",
43+
degree: "professional",
44+
anonymous: false,
45+
twoside: false,
46+
info: (
47+
title: ("毕业论文中文题目", "有一点长有一点长有一点长有一点长有一点长有一点长"),
48+
title-en: "Analysis of the genetic diversity within and between the XX population revealed by AFLP marker",
49+
grade: "20XX",
50+
student-id: "1234567890",
51+
author: "张三",
52+
author-en: "San Zhang",
53+
secret-level: "无",
54+
secret-level-en: "Unclassified",
55+
department: "信息科学与技术学院",
56+
department-en: "School of Information Science and Technology",
57+
discipline: "计算机科学与技术",
58+
discipline-en: "Computer Science and Technology",
59+
major: "计算机科学",
60+
major-en: "Computer Science",
61+
field: "人工智能",
62+
field-en: "Artificial Intelligence",
63+
supervisor: ("李四", "教授"),
64+
supervisor-en: "Professor My Supervisor",
65+
submit-date: datetime.today(),
66+
),
67+
bibliography: bibliography.with("ref.bib"),
68+
)
69+
```
70+
71+
#warning[
72+
注意,有一些页面是通过 #ref-fn("thesis.doctype") 以及 #ref-fn("thesis.degree") 来进行分发的,具体为:
73+
74+
- `commitee-page` 只存在与硕博论文中
75+
- `decision` 只存在于博士论文中
76+
]
77+
78+
除去这些特定学位论文才有的页面,其余页面可以根据需求自己选择是否加入到论文中。
79+
80+
在开始搭配页面前,我们需要明确文档的设置以及页面构成的顺序,这些都需要去阅读论文装订规范。
81+
82+
一般而言,设置的顺序为:
83+
84+
+ 页面 & 元数据设置
85+
+ 封面页
86+
+ 扉页
87+
+ 前言设置
88+
+ 摘要
89+
+ 目录
90+
+ 正文设置
91+
+ 参考文献
92+
+ 附录设置
93+
+ 后记
94+
+ ...
95+
96+
== 文档设置 <pdf-setting>
97+
98+
我们在 #ref-fn("doc()") 中可以找到完整的参数信息,在使用时,只需要导入后输入:
99+
100+
```typ
101+
#show: doc
102+
```
103+
104+
即可,如果需要对文稿的配置进行修改,例如修改页面边距,那么可以使用:
105+
106+
```typ
107+
#show: doc.with(margin: (top: 3cm, bottom: 3cm, left: 1.5cm, right: 1.5cm))
108+
```
109+
110+
111+
== 封面
112+
113+
对于本科生封面,其参数我们可以参考 #ref-fn("bachelor-cover()")
114+
115+
但对于我们使用来说,当我们从 #ref-fn("thesis()") 中获得 `cover` 这个函数后,我们即可以通过调用 `#cover()` 来得到封面
116+
117+
#pagebreak()
118+
119+
= 页面文档
120+
121+
我们通过此文件中定义的函数进行论文的书写,输入参数后,函数会返回对应的模板
122+
123+
== 入口文件
124+
125+
#module(
126+
read("../lib.typ"),
127+
name: "Lib",
128+
)
129+
130+
== 文档设置
131+
132+
#module(
133+
read("../layouts/doc.typ"),
134+
name: "文档与页面设置",
135+
)
136+
137+
== 封面
138+
139+
#module(
140+
read("../pages/bachelor-cover.typ"),
141+
name: "本科生封面",
142+
)
143+
144+
#module(
145+
read("../pages/master-cover.typ"),
146+
name: "硕博封面",
147+
)
148+
149+
== 委员会
150+
151+
#module(
152+
read("../pages/master-comm-page.typ"),
153+
name: "硕博委员会页",
154+
)
155+
156+
157+
== 声明页
158+
159+
#module(
160+
read("../pages/master-decl-page.typ"),
161+
name: "硕博声明页",
162+
)
163+
164+
165+
166+
= 工具函数与变量
167+
168+
#module(
169+
read("../utils/style.typ"),
170+
name: "字体与字号",
171+
)
172+
173+
#module(
174+
read("../utils/datetime-display.typ"),
175+
name: "日期显示辅助函数",
176+
)
177+

0 commit comments

Comments
 (0)