Skip to content

Commit 3dbe449

Browse files
authored
shane-hhu-thesis:0.6.0 (typst#2431)
1 parent 626e0ea commit 3dbe449

28 files changed

+2284
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
hhu-thesis/**/*.pdf
2+
temp/
3+
thesis.pdf
4+
.DS_Store
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Changelog
2+
3+
## 0.6.0 - 2025-05-23
4+
5+
### Added
6+
7+
新增附录外文翻译模版,可在附录部分添加外文文献及其翻译
8+
9+
## 0.5.0 - 2025-05-17
10+
11+
### Fixed
12+
13+
- 修复参考文献格式问题,基于 GB7714-2005 格式,并适当修改:
14+
15+
- 英文文献相关字符用英文表示,如 “等” 使用 “et al” 表示,中文文献反之
16+
- 作者英文名只有首字母大写
17+
18+
- 大括号内多行数学公式字体显示过小问题,增加公式间距
19+
20+
### Added
21+
22+
针对 bib 文件自动导入的参考文献信息参差不齐问题,需手动完善 bib 文件中的参考文献字段信息,README 中新增 BibTex 格式修改指南。
23+
24+
## 0.4.0 - 2025-04-25
25+
26+
### Fixed
27+
28+
编号后不换行问题 ([#2](https://github.com/shaneworld/HHU-Thesis-Template/pull/2))
29+
30+
### Changed
31+
32+
更新 README 中的过时内容,完善本地部署步骤
33+
34+
### Added
35+
36+
- 添加参考文献格式(GB7714-2005)
37+
- 提供了更加灵活的 label-content 框,支持自适应长度和手动换行。([#3](https://github.com/shaneworld/HHU-Thesis-Template/pull/3))
38+
39+
### Contributors
40+
41+
- [@Met4physics](https://github.com/Met4physics)
42+
- [@X1ngChui](https://github.com/X1ngChui)
43+
44+
## 0.3.0 - 2025-02-26
45+
46+
### Fixed
47+
48+
代码块后的首段无首行缩进
49+
50+
### Changed
51+
52+
- 调整目录不同层级缩进,统一目录字号
53+
- 减小图片与上下文距离
54+
55+
## 0.2.0 - 2024-11-15
56+
57+
### Fixed
58+
59+
- 审阅人和 `subject` 参数不生效。
60+
- 图表后的段落需要手动进行首行缩进。
61+
- 修复有序列表序号与文本不对齐的问题。
62+
63+
### Removed
64+
65+
- 移除 `fake-par`
66+
- 移除 `outline-conf` 中对一级标题的设置。
67+
- 移除 `sourcer` 包。
68+
- 移除 `term` 下划线函数。
69+
- 移除 `fieldvalue` 下划线函数。
70+
71+
### Added
72+
73+
- 添加 `form` 参数自定义论文格式。
74+
- 添加参考文献引用格式为 `gb-7714-2005-numeric`
75+
- 添加图表与上下正文之间的间距。
76+
77+
### Changed
78+
79+
- 调整封面下划线文字的上下偏移,视觉效果与前文更协调。
80+
- 更改 `title` 标题配置项为 `[]` 可换行的配置方式。
81+
- 调整目录行距为1.5倍。
82+
- 修改英文封面论文信息的对齐方式。
83+
84+
85+
## 0.1.0 - 2024-11-14
86+
87+
_Initial release._
88+
89+
[0.1.0]: https://github.com/shaneworld/HHU-Thesis-Template/releases/tag/v0.1.0
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MIT License
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# 河海大学本科毕业论文(设计)模板(工科)
2+
3+
使用 Typst 制作的河海大学「本科毕业设计(论文)报告」模板(工科)。参考[河海大学本科毕业设计(论文)规范格式参考](https://bylw.hhu.edu.cn/UpLoadFile/83cd5f1169974a0db06d865c7ee11af4.pdf) 制作,但并非官方模板,可能存在细节问题。
4+
5+
![demo](./demo_images/title.jpg)
6+
7+
## 使用方法
8+
9+
模板已上传 Typst Universe ,可以使用 `typst init` 功能初始化,也可以使用 Web APP 编辑。**Typst Universe 上的模板可能不是最新版本。如果需要使用最新版本的模板,从本 repo 中获取。**
10+
11+
#### 本地使用(推荐)
12+
13+
1. 使用前,请先安装 [fonts](https://github.com/shaneworld/Dots/tree/master/fonts) 中的全部字体。
14+
15+
2. 安装 Typst
16+
17+
**Arch Linux**
18+
19+
```shell
20+
sudo pacman -S typst
21+
```
22+
23+
**Windows**
24+
25+
前往 [Release](https://github.com/typst/typst/releases/) 下载最新版并添加到环境变量。
26+
27+
3. 终端执行 `typst init @preview/shane-hhu-thesis:LATEST_VERSION` 本地初始化模板,其中 LATEST_VERSION 为 [Typst Universe](https://typst.app/universe/package/shane-hhu-thesis) 中已发布的最新版本,如 0.4.0。
28+
29+
#### Web APP 内使用
30+
31+
由于 Typst Web APP 在每次打开页面的时候都会从服务器中下载字体,速度较慢,体验较差,因此不建议使用此方法。
32+
33+
在 [Typst Universe](https://typst.app/universe/package/shane-hhu-thesis) 中点击 `Create project in app` 按钮进入 Web APP 内。
34+
35+
然后,请将 [fonts](https://github.com/shaneworld/Dots/tree/master/fonts) 内的所有字体上传到 Web APP 内该项目的根目录任意位置后按照提示使用。
36+
37+
## 模板内容
38+
39+
此 Typst 模板按照[《河海大学本科毕业设计(论文)基本规范(修订)》](https://bylw.hhu.edu.cn/UpLoadFile/83cd5f1169974a0db06d865c7ee11af4.pdf)制作,制作时参考了[东南大学制作的 Typst 模板](https://github.com/csimide/SEU-Typst-Template)。
40+
41+
此论文模板不仅适用于本科生毕业论文/设计,同样适用于平时的课程报告等规范内容。可以通过自定义 `form` 字段更改论文种类,有以下3种格式可供选择:
42+
43+
- `thesis`:毕业论文
44+
- `design`:毕业设计
45+
- `report`:课程报告
46+
47+
可以通过修改 `heading` 字段修改页眉内容,修改 `thesis-name` 下的 `CN` 字段修改封面页面展示的标题。
48+
49+
### 参考文献格式
50+
51+
本模板按照学校要求采用 GB7714-2005 格式对参考文献进行排版,并针对测试中遇到的格式问题进行适当的修改加工。
52+
53+
由于项目使用 BibTex 方式自动导入参考文献,因此需要确保 BibTex 信息准确全面,可能需要手动检查并完善。
54+
55+
具体修改参见 [hhu-bibliography](https://github.com/shaneworld/HHU-Thesis-Template/blob/master/hhu-thesis/parts/hhu-bibliography.typ) 文件。
56+
57+
### 附录外文翻译
58+
59+
本模版根据河海大学要求,在附录部分新增外文翻译模块。可以在附录最后添加如下内容使用:
60+
61+
```typst
62+
#translation-bilingual(
63+
title : (
64+
CN: [论文标题],
65+
EN: [Thesis Title]
66+
),
67+
authors : (
68+
CN: ("作者1", "作者2", "作者3"),
69+
EN: ("author1", "author2", "author3")
70+
),
71+
abstract : (
72+
CN: [#lorem(80)],
73+
EN: [#lorem(80)]
74+
),
75+
keywords : (
76+
CN: [关键词1, 关键词2, 关键词3],
77+
EN: [keywords1, keywords2, keywords3]
78+
),
79+
content: (
80+
CN: [
81+
= 引言
82+
这里写中文正文内容
83+
],
84+
EN: [
85+
= Introduction
86+
这里写英文原文内容
87+
],
88+
)
89+
)
90+
```
91+
92+
如果发现模板的问题,欢迎提交 issue。
93+
94+
## 致谢
95+
96+
- 东南大学论文模板:[csimide/SEU-Typst-Template](https://github.com/csimide/SEU-Typst-Template)
97+
98+
- 北京大学本科生毕业论文模板:[sigongzi/pkuthss-typst-undergraduate](https://github.com/sigongzi/pkuthss-typst-undergraduate)
99+
100+
- 南京大学学位论文 Typst 模板:[nju-lug/modern-nju-thesis](https://github.com/nju-lug/modern-nju-thesis)
432 KB
Loading
39.4 KB
Loading
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#import "../utils/utils.typ": ziti, zihao
2+
3+
#let abstract-conf(
4+
cn-abstract: none,
5+
cn-keywords: none,
6+
en-abstract: none,
7+
en-keywords: none,
8+
// page-break: none,
9+
) = {
10+
// 摘要使用罗马字符的页码
11+
set page(numbering: "I", number-align: center, margin: (top: 4cm, bottom: 3cm, left: 3.2cm, right: 3.2cm))
12+
counter(page).update(1)
13+
// 一级标题
14+
set text(font: ziti.宋体, size: zihao.小四)
15+
// show heading.where(level: 1): set text(font: ziti.黑体, size: zihao.小二, weight: "bold")
16+
17+
show heading.where(
18+
level: 1
19+
): it => {
20+
set align(center)
21+
set text(font: ziti.黑体, size: zihao.小二, weight: "bold")
22+
it.body
23+
}
24+
25+
set par(first-line-indent: 2em, leading: 1.2em, justify: true)
26+
27+
if not cn-abstract in (none, [], "") or not cn-keywords in (none, ()) {
28+
{
29+
30+
v(1.5cm)
31+
32+
heading(numbering: none, level: 1, outlined: true, bookmarked: true, [摘#h(1em)要])
33+
34+
v(0.5cm)
35+
36+
cn-abstract
37+
38+
v(1em)
39+
40+
parbreak()
41+
42+
if not cn-keywords in (none, ()) {
43+
assert(type(cn-keywords) == array)
44+
text(font: ziti.黑体, size: zihao.小四, weight: "bold")[关键词:] + cn-keywords.join("")
45+
}
46+
}
47+
}
48+
49+
if not en-abstract in (none, [], "") or not en-keywords in (none, ()) {
50+
{
51+
pagebreak(weak: true)
52+
53+
// 计入目录
54+
heading(numbering: none, level: 1, outlined: true, bookmarked: true, [ABSTRACT])
55+
56+
v(1cm)
57+
58+
en-abstract
59+
60+
parbreak()
61+
62+
if not en-keywords in (none, ()) {
63+
assert(type(en-keywords) == array)
64+
text(weight: "bold")[Key words: ] + en-keywords.join("")
65+
}
66+
}
67+
}
68+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#import "../utils/utils.typ": chinese-numbering, part-state, i-figured
2+
3+
#let basic-appendix(
4+
it,
5+
table-numbering: "A.1",
6+
image-numbering: "A-1",
7+
equation-numbering: "(A.1)",
8+
) = {
9+
part-state.update("附录")
10+
counter(heading).update(0)
11+
counter(heading.where(level: 1)).update(0)
12+
set heading(numbering: chinese-numbering.with(in-appendix: true))
13+
14+
show figure: i-figured.show-figure.with(numbering: image-numbering)
15+
show figure.where(kind: table): i-figured.show-figure.with(numbering: table-numbering)
16+
show math.equation.where(block: true): i-figured.show-equation.with(numbering: equation-numbering)
17+
it
18+
}
19+
20+
#let appendix(
21+
it,
22+
table-numbering: "A-1",
23+
image-numbering: "A-1",
24+
equation-numbering: "(A-1)",
25+
) = {
26+
show: basic-appendix.with(
27+
table-numbering: table-numbering,
28+
image-numbering: image-numbering,
29+
equation-numbering: equation-numbering,
30+
)
31+
it
32+
}

0 commit comments

Comments
 (0)