diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/LICENSE b/packages/preview/strict-modern-uestc-thesis/2.0.0/LICENSE
new file mode 100644
index 0000000000..59711bc927
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/LICENSE
@@ -0,0 +1,51 @@
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/README.md b/packages/preview/strict-modern-uestc-thesis/2.0.0/README.md
new file mode 100644
index 0000000000..1c4627822e
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/README.md
@@ -0,0 +1,106 @@
+
+
+
+# 📚电子科技大学学位论文Typst模板实例
+
+> [!NOTE]
+> ✅ **学术博士学位论文已通过学校格式验证**:本模板严格遵循《电子科技大学研究生学位论文撰写规范》,可直接用于学术博士学位论文撰写。其他类型论文应当只有扉页有所区别,如有笔误等错误,欢迎在[模板](https://github.com/uestc-typst/thesis-template)提issue。
+
+> [!IMPORTANT]
+> 本仓库是一个模板仓库, 在[Github主页](https://github.com/qujihan/uestc-typst-thesis-example)右上角可以看到一个 `Use this template` 按钮, 可以直接使用本仓库作为模板创建一个新的仓库.
+>
+> 各位同学可以在本仓库的基础上进行修改
+>
+> 模板本着内容于样式分离的原则, 本仓库基本除了内容不包含任何样式代码
+
+# 🚀 快速开始
+```shell
+# 如果想尝试一下就下载这个
+git clone https://github.com/qujihan/uestc-typst-thesis-example.git thesis
+# 如果想使用Fork的仓库
+git clone https://github.com/{YOUR-NAME}/uestc-typst-thesis-example.git thesis
+
+cd thesis;
+git submodule update --init --recursive
+
+cd example
+
+# 生成一个名为 学位论文写作指南及例子.pdf 的文件
+# 可以在 makefile 中修改生成的文件名
+make build
+
+# 生成一个名为 学位论文写作指南及例子.pdf 的文件, 并且随着写作实时预览
+# 可以在 makefile 中修改生成的文件名
+make watch
+```
+
+## 🪶 使用 VS Code(推荐)
+
+本仓库已预配置 Tinymist Typst 扩展,**直接用 VS Code 打开仓库根目录**即可获得实时预览和 PDF 导出,无需手动配置。
+
+1. **安装扩展**:在 VS Code 扩展市场搜索并安装Tinymist Typst
+
+2. **打开项目**:用 VS Code 直接打开目录。
+
+3. 打开tinymnist的预览即可,同时此扩展可以直接输出pdf。
+
+# 📄 文档
+
+本仓库生成的 `学位论文写作指南及例子.pdf` 是一份完整的论文写作指南,涵盖模板的使用方法和排版示例。
+
+> PDF 文件**不纳入 git 主分支管理**(避免仓库体积膨胀),通过 CI 自动构建并推送到 `output` 分支。
+
+**在线预览**:[点击预览 PDF](https://cdn.jsdelivr.net/gh/uestc-typst/thesis-example@output/%E5%AD%A6%E4%BD%8D%E8%AE%BA%E6%96%87%E5%86%99%E4%BD%9C%E6%8C%87%E5%8D%97%E5%8F%8A%E4%BE%8B%E5%AD%90.pdf)
+
+**下载到本地**:
+```shell
+git clone https://github.com/uestc-typst/thesis-example.git thesis
+cd thesis
+# 从 output 分支检出 PDF(不会切换分支)
+git restore --source=origin/output --worktree "学位论文写作指南及例子.pdf"
+```
+
+# 当 Fork 本仓库后需要更改的事情
+## 建议修改
+- 修改`.vscode/settings.json`文件
+ - 将`学位论文写作指南及例子.pdf`修改为需要的名字(务必以.pdf结尾)
+ - 修改`tinymist.exportPdf`参数(我不需要自动构建, 因为会卡, 你可以通过需求修改)
+
+## 🏔️ 流水线构建(如果只想本地写可以忽略)
+可以在 `.github/workflows/ci.yml` 文件中修改流水线构建的配置. 比如流水线的名称, 触发条件, 构建命令等
+
+**默认操作是:向任意分支push代码后, 会将所有pdf文件强制推送到output分支(之前生成的文件会被覆盖)**
+
+
+如果在linux系统使用,可能会提示缺少字体文件,从[uestc-fonts](https://github.com/uestc-typst/uestc-fonts)下载字体到`uestc-thesis-template/fonts`即可。
\ No newline at end of file
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/main.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/main.typ
new file mode 100644
index 0000000000..8dd3009892
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/main.typ
@@ -0,0 +1,140 @@
+// 电子科技大学学位论文模板 - 示例文档
+// 本文件展示如何使用 uestc-thesis-template 模板
+// 详细使用说明请参考第一章(src/chapter1.typ)
+
+// 导入模板库
+#import "uestc-thesis-template/lib.typ": *
+
+// 使用 thesis 函数作为 show rule 来配置论文
+// 所有参数通过 info 字典传递
+#show: thesis.with(
+ info: (
+ // ============================================
+ // 调试开关
+ // 取消注释以下行可以开启调试模式,显示边框等调试信息
+ // ============================================
+ // DEBUG: true,
+ // ============================================
+ // 论文排版基础信息
+ // ============================================
+ // 匿名模式:开启后隐藏作者、导师等个人信息
+ // 用于匿名评审场景
+ info-keys.匿名: false,
+ /*
+ 论文排版模式
+ 论文模式.修订模式: 用于审稿修订,#revise[修改内容] 会标红显示
+ 论文模式.电子档定稿模式: 用于提交电子档定稿,revise 不标红,
+ 独创性声明页替换为扫描页(需设置 info-keys.独创性声明扫描页 路径)
+ 论文模式.打印模式: 用于双面打印,奇数页起始,revise 不标红
+ */
+ info-keys.论文模式: 论文模式.修订模式,
+ // 电子档定稿模式下需要设置独创性声明扫描页路径(A4 大小的 PDF/PNG 扫描件)
+ info-keys.独创性声明扫描页: "src/独创性声明.pdf",
+ // 字体设置
+ // Windows 默认使用 SimHei(黑体)和 SimSun(宋体)
+ // macOS/Linux 建议使用思源字体:
+ // 黑体字体: "Source Han Sans SC"
+ // 宋体字体: "Source Han Serif SC"
+ info-keys.黑体字体: "SimHei",
+ info-keys.宋体字体: "SimSun",
+ info-keys.加粗粗度: 250, // 只有在不使用 Sim* 系列字体的时候会起作用
+ // ============================================
+ // 封面信息 - 作者基本参数
+ // 这些参数会影响总体封面效果
+ // ============================================
+ info-keys.申请学位级别: "博士", // 可选:学士、硕士、博士
+ info-keys.学位类型: "学术型", // 可选:学术型、专业型
+ // ============================================
+ // 封面
+ // 可以在标题以及学院中使用 \n 来换行
+ // 也支持 \t 等其他转义字符
+ // ============================================
+ info-keys.论文中文标题: "UESTC-Typst学位论文模板\n使用指南及使用示例",
+ info-keys.作者学科专业: "排版学", // 学术型填写,专业型忽略
+ info-keys.作者专业学位类别: "排版学", // 专业型填写,学术型忽略
+ info-keys.作者学号: "2022XXXXXXXX",
+ info-keys.作者中文名: "作者姓名",
+ info-keys.指导老师中文名: "导师姓名",
+ info-keys.指导老师职称中文: "教授",
+ info-keys.作者学院: "计算机科学与工程学院\n(网络空间安全学院)",
+ // ============================================
+ // 中文扉页
+ // ============================================
+ info-keys.分类号: "TP309.2",
+ info-keys.密级: "公开",
+ info-keys.UDC: "004.78",
+ // 标题已在封面中定义
+ // 作者中文名已在封面中定义
+ // 指导老师中文名已在封面中定义
+ // 指导老师职称中文已在封面中定义
+ info-keys.指导老师单位: "电子科技大学 成都",
+ info-keys.合作导师中文名: "合作导师姓名",
+ info-keys.合作导师职称中文: "教授",
+ info-keys.合作导师单位: "合作导师单位",
+ // 申请学位级别已在作者基本参数中定义
+ // 专业型: 专业学位类型 已在封面中定义
+ // 学术型: 作者学科专业 已在封面中定义
+ info-keys.专业学位领域: "Typst排版", // 专业型填写,学术型忽略
+ info-keys.提交日期: "2025年3月17日",
+ info-keys.答辩日期: "2025年4月15日",
+ info-keys.学位授予单位: "电子科技大学",
+ info-keys.学位授予日期: "2025年6月1日",
+ info-keys.答辩委员会主席: "主席名称",
+ info-keys.答辩委员会主席职称: "主席职称",
+ info-keys.评阅人: (),
+ // info-keys.评阅人: ("a", "b"),
+ // ============================================
+ // 英文扉页
+ // ============================================
+ info-keys.论文英文标题: "UESTC-Typst Thesis Template Usage Guide and Usage Examples",
+ info-keys.作者学科专业英文: "Imitate the Heaven and Earth", // 学术型填写
+ // info-keys.作者专业学位类别英文: "Three heads and six arms", // 专业型填写
+ info-keys.作者英文名: "Nezha",
+ info-keys.指导老师英文名: "Taiyi Zhenren",
+ info-keys.指导老师职称英文: "Sage",
+ info-keys.作者学院英文: "Jinguang Cave on Qianyuan Mountain",
+ // ============================================
+ // 论文内容信息
+ // 注意区分两种传值方式:
+ // 1. 直接传字符串路径(如参考文献):info-keys.参考文献: "src/bib/参考文献.bib"
+ // 2. 使用 include 引入内容(如摘要):info-keys.中文摘要: include "src/摘要-中文.typ"
+ // ============================================
+ info-keys.中文摘要: include "src/摘要-中文.typ",
+ info-keys.中文摘要关键字: ("电子科技大学", "Typst", "学位论文", "前程似锦"),
+ info-keys.英文摘要: include "src/摘要-英语.typ",
+ info-keys.英文摘要关键字: ("UESTC", "Typst", "Thesis", "Future"),
+ info-keys.附录: (include "src/附录-1.typ", include "src/附录-2.typ"),
+ info-keys.致谢: include "src/致谢.typ",
+ info-keys.参考文献: "src/bib/参考文献.bib",
+ // ============================================
+ // 成果列表
+ // 使用成果列表功能需要配置以下参数:
+ // 成果文件: bib 文件路径,包含所有成果条目
+ // 作者姓名: 在 bib 文件中作者的名字格式,模板会自动在成果列表中加粗该作者
+ // 条目: 元组,每个元素为 (, "作者排序", "分类")
+ // 其他成果: include 其他成果文件(如专利等)
+ // 其他成果-匿名: 匿名模式时使用的版本(当 info-keys.匿名: true 时自动切换)
+ // 如果不需要成果列表功能,可以改为直接 include:
+ // info-keys.攻读学位期间取得成果: include "src/攻读学位期间取得成果.typ"
+ // ============================================
+ info-keys.成果列表: (
+ 成果列表-keys.成果文件: "src/bib/参考文献.bib",
+ 成果列表-keys.作者姓名: "Kopka H", // 填写你的名字,模板会自动在成果列表中加粗
+ 成果列表-keys.条目: (
+ (, "第一作者", "示例分类"),
+ ),
+ 成果列表-keys.其他成果: include "src/攻读学位期间取得成果.typ",
+ 成果列表-keys.其他成果-匿名: include "src/攻读学位期间取得成果-匿名.typ",
+ ),
+ info-keys.攻读学位期间取得成果: true,
+ // 浮动表图标题页置底:当页面包含一级标题时,浮动图表放在页面底部
+ info-keys.浮动表图标题页置底: true,
+ ),
+)
+
+// ============================================
+// 引用各章节内容
+// 使用 #include 引入各章节文件
+// ============================================
+#include "src/chapter1.typ"
+#include "src/chapter2.typ"
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/makefile b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/makefile
new file mode 100644
index 0000000000..af276db8b6
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/makefile
@@ -0,0 +1,21 @@
+# 有时候可能安装了多个版本的typst(homebrew安装 / cargo安装 / scoop安装 ...) 需要指定使用哪个版本
+# 例如
+# typst := /opt/homebrew/bin/typst
+# typst := ~/.cargo/bin/typst
+typst := typst
+
+# 输出文件名
+file_name := "学位论文写作指南及例子.pdf"
+
+.PHONY: all build
+
+all: build
+
+build:
+ ${typst} c main.typ ${file_name} --font-path ./uestc-thesis-template/fonts --root .
+
+watch:
+ ${typst} w main.typ ${file_name} --font-path ./uestc-thesis-template/fonts --root .
+
+clean:
+ git clean -df -X
\ No newline at end of file
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/bib/\345\217\202\350\200\203\346\226\207\347\214\256.bib" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/bib/\345\217\202\350\200\203\346\226\207\347\214\256.bib"
new file mode 100644
index 0000000000..a7bfcb309a
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/bib/\345\217\202\350\200\203\346\226\207\347\214\256.bib"
@@ -0,0 +1,14 @@
+@misc{uestc2022guide,
+ title = {电子科技大学研究生学位论文撰写规范},
+ author = {{电子科技大学研究生院}},
+ year = {2022},
+ url = {https://gr.uestc.edu.cn/xiazai/114/3917},
+}
+
+@book{kopka2004guide,
+ title = {Guide to LATEX},
+ author = {Kopka, Helmut and Daly, Patrick W and Rahtz, SPQ},
+ volume = {4},
+ year = {2004},
+ publisher = {Addison-Wesley Boston, MA}
+}
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/chapter1.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/chapter1.typ
new file mode 100644
index 0000000000..b23b5985f5
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/chapter1.typ
@@ -0,0 +1,1345 @@
+#import "lib.typ": *
+
+= 模板使用说明
+
+本模板是电子科技大学学位论文的 Typst 模板,本章节将详细介绍模板提供的各种功能及其用法。
+
+
+== `main.typ` 配置参数说明
+
+本节列出 `main.typ` 中所有可配置的参数,按功能分组说明。
+
+=== 匿名模式与论文排版模式
+
+以下参数控制模板的匿名评审和论文排版模式:
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 匿名模式:隐藏作者、导师等个人信息,用于匿名评审
+ info-keys.匿名: false,
+ /*
+ 论文排版模式
+ 论文模式.修订模式: 用于审稿修订,#revise[修改内容] 会标红显示
+ 论文模式.电子档定稿模式: 用于提交电子档定稿,revise 不标红,
+ 独创性声明页替换为扫描页(需设置 info-keys.独创性声明扫描页 路径)
+ 论文模式.打印模式: 用于双面打印,奇数页起始,revise 不标红
+ */
+ info-keys.论文模式: 论文模式.打印模式,
+ // 电子档定稿模式下需要设置独创性声明扫描页路径(A4 大小的 PDF/PNG 扫描件)
+ info-keys.独创性声明扫描页: "src/独创性声明.pdf",
+ ```
+ ]
+]
+
+=== 字体设置
+
+模板支持自定义宋体、黑体等字体:
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 黑体字体(Windows 默认 SimHei,macOS/Linux 建议 "Source Han Sans SC")
+ info-keys.黑体字体: "SimHei",
+ // 宋体字体(Windows 默认 SimSun,macOS/Linux 建议 "Source Han Serif SC")
+ info-keys.宋体字体: "SimSun",
+ // 加粗粗度:仅在不使用 Sim* 系列字体时生效
+ info-keys.加粗粗度: 250,
+ ```
+ ]
+]
+
+=== 封面信息
+
+封面包含论文标题、作者、导师、学院等基本信息:
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 基本参数(影响封面总体效果)
+ info-keys.申请学位级别: "硕士", // 可选:学士、硕士、博士
+ info-keys.学位类型: "专业型", // 可选:学术型、专业型
+
+ // 封面信息(支持使用 \\n 换行)
+ info-keys.论文中文标题: "论文标题",
+ info-keys.作者学科专业: "学科专业", // 学术型填写,专业型忽略
+ info-keys.作者专业学位类别: "专业学位类别", // 专业型填写,学术型忽略
+ info-keys.作者学号: "2022XXXXXXXX",
+ info-keys.作者中文名: "作者姓名",
+ info-keys.指导老师中文名: "导师姓名",
+ info-keys.指导老师职称中文: "教授",
+ info-keys.作者学院: "学院名称",
+ ```
+ ]
+]
+
+=== 中文扉页信息
+
+中文扉页包含分类号、密级、答辩信息等详细内容:
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ info-keys.分类号: "TP309.2",
+ info-keys.密级: "公开",
+ info-keys.UDC: "004.78",
+ info-keys.指导老师单位: "电子科技大学 成都",
+ info-keys.合作导师中文名: "合作导师姓名",
+ info-keys.合作导师职称中文: "教授",
+ info-keys.合作导师单位: "合作导师单位",
+ info-keys.专业学位领域: "领域名称", // 专业型填写,学术型忽略
+ info-keys.提交日期: "2025年3月17日",
+ info-keys.答辩日期: "2025年4月15日",
+ info-keys.学位授予单位: "电子科技大学",
+ info-keys.学位授予日期: "2025年6月1日",
+ info-keys.答辩委员会主席: "主席名称",
+ info-keys.答辩委员会主席职称: "主席职称",
+ // 以下两个参数为元组类型
+ info-keys.评阅人: ("成员1", "成员2"),
+ ```
+ ]
+]
+
+=== 英文扉页信息
+
+英文扉页对应中文扉页的英文版本:
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ info-keys.论文英文标题: "English Thesis Title",
+ info-keys.作者学科专业英文: "Discipline", // 学术型填写
+ // info-keys.作者专业学位类别英文: "Category", // 专业型填写
+ info-keys.作者英文名: "Author Name",
+ info-keys.指导老师英文名: "Advisor Name",
+ info-keys.指导老师职称英文: "Professor",
+ info-keys.作者学院英文: "School Name",
+ ```
+ ]
+]
+
+=== 论文内容信息
+
+以下参数配置论文正文内容,包括摘要、附录、参考文献等:
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 使用 include 引入内容的参数
+ info-keys.中文摘要: include "src/摘要-中文.typ",
+ info-keys.英文摘要: include "src/摘要-英语.typ",
+ info-keys.致谢: include "src/致谢.typ",
+ // 附录为元组(可包含多个 include)
+ info-keys.附录: (include "src/附录-1.typ", include "src/附录-2.typ"),
+
+ // 使用字符串路径的参数
+ info-keys.参考文献: "src/bib/参考文献.bib",
+
+ // 关键字为元组
+ info-keys.中文摘要关键字: ("关键字1", "关键字2"),
+ info-keys.英文摘要关键字: ("Keyword1", "Keyword2"),
+
+ // 成果列表(字典格式)和攻读学位期间取得成果
+ // 详见"攻读学位期间取得成果"章节
+ info-keys.成果列表: (...),
+ info-keys.攻读学位期间取得成果: true,
+
+ // 浮动表图:当页面包含一级标题时,浮动图表放在页面底部
+ info-keys.浮动表图标题页置底: true,
+ ```
+ ]
+]
+
+== 图片相关
+
+=== 插入图片
+
+使用 `picture-figure` 函数插入图片,它会自动按章节编号(如图1-1)。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ #picture-figure(
+ "这是一个测试图片的标题",
+ image("/uestc-thesis-template/pics/logo.svg"),
+ )
+ ```
+ ]
+]
+
+效果如下:
+
+#picture-figure(
+ "这是一个测试图片的标题",
+ image("/uestc-thesis-template/pics/logo.svg"),
+)
+
+*参数说明:*
+- 第一个参数:图片标题(字符串或 content)
+- 第二个参数:图片内容(使用 `image()` 函数)
+- `placement`:可选,浮动位置,可选值为 `top`、`bottom` 或不传(不浮动)。如果图片放置的位置在大章节标题页,并设置了浮动位置,会自动调整为 `bottom`,以避免与章节标题重叠。
+
+=== 子图
+
+使用 `grid` + `picture-figure` 嵌套的方式实现子图。子图会自动编号为 (a)、(b) 等。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ #picture-figure(
+ [子图示例:使用 grid 排列多张子图],
+ grid(
+ columns: 2,
+ column-gutter: 1em,
+ row-gutter: 0.5em,
+ picture-figure(
+ [子图(a)的标题],
+ image("/uestc-thesis-template/pics/logo.svg", width: 90%),
+ ),
+ [#picture-figure(
+ [子图(b)的标题],
+ image("/uestc-thesis-template/pics/logo.svg", width: 90%),
+ ) ],
+ picture-figure(
+ [子图(c)的标题],
+ image("/uestc-thesis-template/pics/logo.svg", width: 90%),
+ ),
+ picture-figure(
+ [子图(d)的标题],
+ image("/uestc-thesis-template/pics/logo.svg", width: 90%),
+ ),
+ ),
+ placement: top,
+ )
+ // @subfig-b 显示为"图1-x (b)",@subfig-example 显示为"图1-x"
+ ```
+ ]
+]
+
+效果如下:
+
+#picture-figure(
+ [子图示例:使用 grid 排列多张子图],
+ grid(
+ columns: 2,
+ column-gutter: 1em,
+ row-gutter: 0.5em,
+ picture-figure(
+ [子图(a)的标题],
+ image("/uestc-thesis-template/pics/logo.svg", width: 90%),
+ ),
+ [#picture-figure(
+ [子图(b)的标题],
+ image("/uestc-thesis-template/pics/logo.svg", width: 90%),
+ ) ],
+
+ picture-figure(
+ [子图(c)的标题],
+ image("/uestc-thesis-template/pics/logo.svg", width: 90%),
+ ),
+ picture-figure(
+ [子图(d)的标题],
+ image("/uestc-thesis-template/pics/logo.svg", width: 90%),
+ ),
+ ),
+ placement: top,
+)
+
+*参数说明:*
+- `columns`:设置列数(即每行几张子图)
+- `column-gutter`:子图之间的列间距
+- `row-gutter`:子图之间的行间距
+- `gutter`:同时设置行列间距(设置后 `column-gutter` 和 `row-gutter` 会被覆盖)
+- 子图的 `picture-figure` 的标题为空 `[]` 时,只显示 (a)、(b) 等编号
+- 子图的 `picture-figure` 的标题为 `none` 时,不显示编号
+- 子图引用:需要用 `[#picture-figure(...) ]` 包裹,引用时显示为"图x-y (a)",此例中为@subfig-b。
+
+=== 调整子图的列数和间距
+
+通过修改 `grid` 的 `columns`、`column-gutter` 和 `row-gutter` 参数来调整子图的布局。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 三列子图,列间距 0.5em,行间距 0.3em
+ #picture-figure(
+ [三列子图示例],
+ grid(
+ columns: 3,
+ column-gutter: 0.5em,
+ row-gutter: 0.3em,
+ picture-figure([], image("path1.png", width: 90%)),
+ picture-figure([], image("path2.png", width: 90%)),
+ picture-figure([], image("path3.png", width: 90%)),
+ ),
+ placement: top,
+ )
+ ```
+ ]
+]
+
+=== 子图标题为空与 none 的区别
+
+子图标题有三种情况:
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 情况1:有标题文字 —— 显示 (a) + 标题文字
+ picture-figure([子图标题], image("path.png"))
+
+ // 情况2:标题为空 content [] —— 只显示 (a),无标题文字
+ picture-figure([], image("path.png"))
+
+ // 情况3:标题为 none —— 不显示 (a),也不显示标题
+ picture-figure(none, image("path.png"))
+ ```
+ ]
+]
+
+=== 嵌套子图
+
+可以通过嵌套 `grid` 来实现更复杂的布局,例如两行两列,其中第一行占两列。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ #picture-figure(
+ [复杂子图布局],
+ grid(
+ columns: 2,
+ gutter: 1em,
+ // 第一行占两列的子图
+ grid(
+ columnspan: 2,
+ picture-figure([横跨两列的子图], image("wide.png", width: 95%)),
+ ),
+ // 第二行两个子图
+ picture-figure([子图(c)], image("left.png", width: 90%)),
+ picture-figure([子图(d)], image("right.png", width: 90%)),
+ ),
+ )
+ ```
+ ]
+]
+
+=== 调整图片尺寸
+
+使用 `image()` 的 `width` 参数来调整图片大小,接受百分比或绝对长度。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 百分比宽度(相对于容器)
+ image("path.png", width: 80%)
+ image("path.png", width: 50%)
+
+ // 绝对宽度
+ image("path.png", width: 10cm)
+ ```
+ ]
+]
+
+== 表格相关
+
+=== 基本表格(三线表)
+
+模板使用 `table-figure` 函数创建表格,推荐使用三线表格式。使用 `toprule()`、`midrule()`、`bottomrule()` 来绘制横线。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ #table-figure(
+ [三线表示例],
+ table(
+ columns: 3,
+ align: center + horizon,
+ stroke: none, // 先取消所有边框
+ toprule(), // 顶部粗线
+ table.header([列1], [列2], [列3]),
+ midrule(), // 中间细线
+ [数据1], [数据2], [数据3],
+ [数据4], [数据5], [数据6],
+ bottomrule(), // 底部粗线
+ ),
+ placement: top,
+ )
+ ```
+ ]
+]
+
+效果如下:
+
+#table-figure(
+ [三线表示例],
+ table(
+ columns: 3,
+ align: center + horizon,
+ stroke: none,
+ toprule(),
+ table.header([列1], [列2], [列3]),
+ midrule(), [数据1], [数据2],
+ [数据3], [数据4], [数据5],
+ [数据6], bottomrule(),
+ ),
+ placement: top,
+)
+
+*参数说明:*
+- `columns`:列数或列宽配置
+- `align`:单元格对齐方式
+- `stroke: none`:取消所有默认边框
+- `toprule()`:顶部粗线(1.5pt)
+- `midrule()`:中间细线(0.75pt)
+- `bottomrule()`:底部粗线(1.5pt)
+- `table.header()`:表头行
+
+=== 合并单元格
+
+使用 `table.cell(rowspan: n)` 或 `table.cell(colspan: n)` 来合并单元格。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ #table-figure(
+ [合并单元格示例],
+ table(
+ columns: 4,
+ align: center + horizon,
+ stroke: none,
+ toprule(),
+ table.cell(colspan: 4)[跨四列表头],
+ midrule(),
+ table.cell(rowspan: 2)[跨两行],
+ [B1], [B2], [B3],
+ [C1], [C2], [C3],
+ bottomrule(),
+ ),
+ )
+ ```
+ ]
+]
+
+效果如下:
+
+#table-figure(
+ [合并单元格示例],
+ table(
+ columns: 4,
+ align: center + horizon,
+ stroke: none,
+ toprule(),
+ table.cell(colspan: 4)[跨四列表头],
+ midrule(),
+ table.cell(rowspan: 2)[跨两行],
+ [B1], [B2], [B3],
+ [C1], [C2], [C3],
+ bottomrule(),
+ ),
+)
+
+=== 表格中的横线和竖线
+
+默认使用三线表(`stroke: none`),但也可以添加竖线或额外的横线。
+
+#table-figure(
+ [添加竖线示例],
+ table(
+ columns: 4,
+ stroke: none,
+ toprule(),
+ // 在第1、3列后添加灰色竖线
+ table.vline(x: 1, stroke: 0.75pt + gray),
+ table.vline(x: 3, stroke: 0.75pt + gray),
+ table.header([A], [B], [C], [D]),
+ midrule(),
+ [1], [2], [3], [4],
+ bottomrule(),
+ ),
+)
+
+#table-figure(
+ [添加竖线示例],
+ table(
+ columns: 3,
+ stroke: none,
+ toprule(),
+ table.header([名称], [值1], [值2]),
+ midrule(),
+ [项目1], [10], [20],
+ table.hline(start: 1, end: 3, stroke: 0.5pt),
+ // 部分横线
+ [项目2], [30], [40],
+ bottomrule(),
+ ),
+)
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 添加竖线
+ table(
+ columns: 4,
+ stroke: none,
+ toprule(),
+ // 在第1、3列后添加灰色竖线
+ table.vline(x: 1, stroke: 0.75pt + gray),
+ table.vline(x: 3, stroke: 0.75pt + gray),
+ table.header([A], [B], [C], [D]),
+ midrule(),
+ [1], [2], [3], [4],
+ bottomrule(),
+ )
+
+ // 添加自定义横线(仅在特定位置)
+ table(
+ columns: 3,
+ stroke: none,
+ toprule(),
+ table.header([名称], [值1], [值2]),
+ midrule(),
+ [项目1], [10], [20],
+ table.hline(start: 1, end: 3, stroke: 0.5pt), // 部分横线
+ [项目2], [30], [40],
+ bottomrule(),
+ )
+ ```
+ ]
+]
+
+=== 复杂表格示例
+
+以下是一个包含多级表头和竖线的复杂表格示例。
+
+#table-figure(
+ [复杂表格示例],
+ table(
+ columns: 5,
+ align: center + horizon,
+ stroke: none,
+ toprule(),
+ table.cell(rowspan: 2)[方法],
+ table.cell(colspan: 2)[数据集A],
+ table.cell(colspan: 2)[数据集B],
+ midrule(),
+ [精度], [召回], [精度], [召回],
+ midrule(),
+ [方法1], [95.2], [90.1], [88.5], [85.3],
+ [方法2], [*96.1*], [91.0], [*90.2*], [*87.1*],
+ bottomrule(),
+ ),
+)
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ #table-figure(
+ [复杂表格示例],
+ table(
+ columns: 5,
+ align: center + horizon,
+ stroke: none,
+ toprule(),
+ table.cell(rowspan: 2)[方法],
+ table.cell(colspan: 2)[数据集A],
+ table.cell(colspan: 2)[数据集B],
+ midrule(),
+ [精度], [召回], [精度], [召回],
+ midrule(),
+ [方法1], [95.2], [90.1], [88.5], [85.3],
+ [方法2], [*96.1*], [91.0], [*90.2*], [*87.1*],
+ bottomrule(),
+ ),
+ )
+ ```
+ ]
+]
+
+== 算法相关
+
+=== 算法(Algorithm)
+
+使用 `algorithm-figure` 函数创建算法伪代码。算法内部使用 `algorithmic` 模块提供的指令。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ #algorithm-figure(
+ [快速排序算法],
+ {
+ import algorithmic: *
+ Line[*Input:* 待排序数组 $A$,起始索引 $"lo"$,结束索引 $"hi"$]
+ Line[*Output:* 排序后的数组 $A$]
+ If[$"lo" < "hi"$][
+ Line[$p arrow.l "Partition"(A, "lo", "hi")$]
+ Line[$"QuickSort"(A, "lo", p - 1)$]
+ Line[$"QuickSort"(A, p + 1, "hi")$]
+ ]
+ Return[$A$]
+ },
+ placement: top,
+ )
+ ```
+ ]
+]
+
+效果如下:
+
+#algorithm-figure(
+ [快速排序算法],
+ {
+ import algorithmic: *
+ Line[*Input:* 待排序数组 $A$,起始索引 $"lo"$,结束索引 $"hi"$]
+ Line[*Output:* 排序后的数组 $A$]
+ If[$"lo" < "hi"$][
+ Line[$p arrow.l "Partition"(A, "lo", "hi")$]
+ Line[$"QuickSort"(A, "lo", p - 1)$]
+ Line[$"QuickSort"(A, p + 1, "hi")$]
+ ]
+ Return[$A$]
+ },
+ placement: top,
+)
+
+*`algorithmic` 模块提供的指令:*
+- `Line[内容]`:普通行
+- `LineBreak`:空行
+- `LineComment[注释内容][代码行]`:行内注释(注释在右侧)
+- `If[条件][代码块]`:if 语句
+- `IfElseChain[条件1][代码块1][条件2][代码块2]...[代码块n]`:if-else if-...-else 链
+- `For[条件][代码块]`:for 循环
+- `While[条件][代码块]`:while 循环
+- `Return[内容]`:return 语句
+
+*注意:* 在算法的公式中,普通变量名(如 `lo`、`hi`)需要用引号包裹写成 `$"lo"$`,否则 Typst 会将其解析为乘法(`l dot o`)等数学表达式。函数名同理,如 `$"QuickSort"(A)$`。
+
+*`algorithm-figure` 的参数:*
+- 第一个参数:算法标题(会自动加粗)
+- 第二个参数:算法体(使用 `algorithmic` 指令)
+- `placement`:浮动位置,`top`、`bottom` 或不传
+- `supplement`:前缀文字,默认为"算法"
+- `line-numbers`:是否显示行号,默认 `true`
+
+=== 算法引用
+
+在算法后添加 `` 标签,然后使用 `@label` 引用。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 定义算法并添加标签
+ #algorithm-figure(...)
+
+ // 引用算法(显示为"算法1-1")
+ 如 @my-algo 所示。
+ ```
+ ]
+]
+
+== Figure 的 placement 设置
+
+所有 `picture-figure`、`table-figure`、`algorithm-figure` 都支持 `placement` 参数,用于控制浮动位置。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 浮动到页面顶部
+ #picture-figure("标题", image("path.png"), placement: top)
+
+ // 浮动到页面底部
+ #table-figure("标题", table(...), placement: bottom)
+
+ // 不浮动(在当前位置显示)
+ #algorithm-figure("标题", {...})
+ ```
+ ]
+]
+
+*说明:*
+- `placement: top`:图表浮动到页面顶部
+- `placement: bottom`:图表浮动到页面底部
+- 不传 `placement`:图表在当前位置显示
+- 当页面包含一级标题且开启了 `浮动表图标题页置底` 时,浮动图表会自动放到页面底部
+
+== 定理、证明、引理等
+
+=== 定理(Theorem)
+
+使用 `theorem` 函数定义定理,可以通过 `label` 参数指定标签用于后续引用。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 不带 label 的定理
+ #theorem[
+ 这里写定理的内容。
+ ]
+
+ // 带 label 的定理(可用于证明引用和交叉引用)
+ #theorem(label: )[
+ 若 $f$ 满足 Lipschitz 条件,则...
+ ]
+ ```
+ ]
+]
+
+效果如下:
+
+#theorem(label: )[
+ 对任意满足条件的函数 $f$,存在常数 $C > 0$ 使得下式成立:$f(x + y) <= C (x + y)$。
+]
+
+=== 引理(Lemma)
+
+使用 `lemma` 函数定义引理,用法与 `theorem` 类似。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 带 label 的引理
+ #lemma(label: )[
+ 对于联合分布 $gamma$,有如下不等式成立...
+ ]
+ ```
+ ]
+]
+
+效果如下:
+
+#lemma(label: )[
+ 对于任意 $x in bb(R)^n$,有 $norm(x)_2 <= sqrt(n) norm(x)_infinity$。
+]
+
+=== 证明(Proof)
+
+使用 `proof` 函数定义证明。证明会自动在末尾添加 $qed$ 符号(方框)。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 不引用特定定理的证明(无标题)
+ #proof[
+ 这里写证明过程...
+ ]
+
+ // 引用某一定理/引理的证明
+ // title 使用 @ 引用,会显示为"定理1.1的证明"或"引理1.1的证明"
+ #proof(title: [@thm1])[
+ 证明内容...
+ ]
+ ```
+ ]
+]
+
+效果如下:
+
+#proof(title: [@lemma1])[
+ 根据范数的定义,$norm(x)_infinity = max(|x_i|)$,而 $norm(x)_2 = sqrt(sum x_i^2) <= sqrt(n max(x_i^2)) = sqrt(n) norm(x)_infinity$。证毕。
+]
+
+=== 定理、引理、证明的引用
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 定义带 label 的定理
+ #theorem(label: )[内容...]
+
+ // 引用定理(显示为"定理1.1")
+ 如 @my-thm 所述...
+
+ // proof 使用 title 引用定理,显示为"定理1.x的证明"
+ #proof(title: [@my-thm])[证明内容...]
+ ```
+ ]
+]
+
+如 @thm1 所述。引用 @lemma1 也可以正常工作。
+
+== 公式相关
+
+=== 行间公式
+
+行间公式使用 ` $ $ ` 包裹(前后美元符号与文本里面有空格,或者换行),会自动编号。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 带编号的行间公式(添加 用于引用)
+ $ E = m c^2 $
+
+ ```
+ ]
+]
+
+效果如下:
+
+$ E = m c^2 $
+
+$ cal(L) = sum_(i=1)^n (y_i - f(x_i))^2 $
+
+公式编号格式为 `(章节号-序号)`,如公式在本章中编号为 (1-x)。
+
+=== 行内公式
+
+行内公式使用单个 `$ $` 包裹(美元符号与内容之间没有空格),不会编号。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ 变量 $x$ 的值为 $x = 42$,其中 $x in bb(R)$。
+ ```
+ ]
+]
+
+效果如下:
+
+变量 $x$ 的值为 $x = 42$,其中 $x in bb(R)$。
+
+=== 公式引用
+
+为公式添加 `` 标签后,可以使用 `@label` 引用。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ $ E = m c^2 $
+
+ 如公式 @einstein 所示...
+ // 显示为"公式(1-x)"
+ ```
+ ]
+]
+
+如 @einstein 和 @loss-function 所示。
+
+=== 常用数学符号
+
+本章列出一些常用的数学符号,更详细的可以参考 Typst 的数学模式文档。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 分数
+ $ a/b $ 或 $ frac(a, b) $
+
+ // 上下标
+ $ x^2 $, $ x_i $
+
+ // 求和与积分
+ $ sum_(i=1)^n x_i $, $ integral_0^infinity f(x) dif x $
+
+ // 矩阵和向量(加粗)
+ $ bold(x) $, $ bold(A) $
+
+ // 希腊字母
+ $ alpha $, $ beta $, $ gamma $, $ epsilon $, $ theta $
+
+ // 特殊字体
+ $ cal(L) $ (花体), $ bb(R) $ (实数集), $ bb(E) $ (期望)
+
+ // 分段函数
+ $ f(x) = cases(
+ 1 & "if" x > 0,
+ 0 & "otherwise",
+ ) $
+
+ // 多行公式对齐(使用 & 对齐)
+ $ a &= b + c \
+ &= d + e $
+ ```
+ ]
+]
+
+== 引用相关
+
+=== 图片/表格/算法的引用
+
+在被引用的对象后添加 `` 标签,然后在正文中使用 `@label` 进行引用。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 定义带标签的图片
+ #picture-figure("图片标题", image("path.png"))
+
+ // 定义带标签的表格
+ #table-figure("表格标题", table(...))
+
+ // 定义带标签的算法
+ #algorithm-figure("算法标题", {...})
+
+ // 引用(显示为"图1-1"、"表1-1"、"算法1-1")
+ 如 @fig-label 所示。
+ 如 @tbl-label 所示。
+ ```
+ ]
+]
+
+如 @my-label、@subfig-example、@table-example、@merge-example 和 @algo-example 所示。
+
+=== 文献引用
+
+文献引用使用 `@bib-key` 的格式,其中 `bib-key` 是 bib 文件中条目的标识符。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 单个引用
+ 如 @kopka2004guide 所述。
+
+ // 多个引用(连续引用多篇文献)
+ 扩散模型@ddpm @score-based 的提出标志着...
+
+ // 注意:多个 @ 引用之间用空格分隔
+ ```
+ ]
+]
+
+效果如下:
+
+如 @kopka2004guide 所述,这是一本关于 LaTeX 的参考书籍。
+
+=== `#c()` 函数(不上标的引用)
+
+模板提供了一个特殊的 `#c()` 函数,用于引用文献时不显示上标。这在某些场景下很有用,例如"文献\#c(\, \)指出"。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 普通引用(带上标)
+ 相关研究@kopka2004guide @uestc2022guide 指出...
+
+ // 使用 #c() 引用(不上标)
+ 相关研究#c(, )指出...
+
+ // #c() 接受多个标签参数,用逗号分隔
+ ```
+ ]
+]
+
+效果如下:
+
+普通引用(带上标):相关研究@kopka2004guide @uestc2022guide 指出。
+
+使用 `#c()` 引用(不上标):相关研究#c(, )也提到了这一点。
+
+=== 标题引用
+
+引用章节标题时会自动显示"第x章"或"第x.x节"。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 一级标题引用(显示为"第x章")
+ 如 @usage-table 所述...
+
+ // 多级标题引用(显示为"第x.x.x节")
+ 如 @usage-subfigure 所述...
+ ```
+ ]
+]
+
+如 @usage-picture 和 @usage-subfigure 所述。
+
+=== 如何添加 Label
+
+在任何元素后面都可以添加 `` 标签,用于后续引用。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 图片标签
+ #picture-figure(...)
+
+ // 表格标签
+ #table-figure(...)
+
+ // 公式标签
+ $ E = m c^2 $
+
+ // 章节标签(在标题行末尾添加)
+ == 章节标题
+
+ // 定理/引理标签(label 通过参数传入,不需要后面加 <...>)
+ #theorem(label: )[内容]
+
+ // 注意:theorem/lemma/proof 的 label 通过参数传入
+ // 不像图片、表格等使用后缀 <...> 语法
+ // 推荐使用英文、数字和短横线,如 my-figure、eq-1
+ ```
+ ]
+]
+
+== 列表相关
+
+=== 无序列表(Itemize)
+
+使用 `-` 创建无序列表。可以使用 `*...*` 加粗或 `_..._` 斜体。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ - 普通列表项
+ - *加粗的列表项*
+ - _斜体的列表项_
+ - *加粗且_斜体_的列表项*
+ ```
+ ]
+]
+
+效果如下:
+
+- 普通列表项
+- *加粗的列表项*
+- _斜体的列表项_
+- *加粗且_斜体_的列表项*
+
+=== 有序列表(Enumerate)
+
+使用 `+` 创建有序列表。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ + 第一项
+ + 第二项
+ + 第三项
+
+ // 也可以手动指定编号
+ (1) 第一项
+ (2) 第二项
+ ```
+ ]
+]
+
+效果如下:
+
++ 第一项
++ 第二项
++ 第三项
+
+=== 嵌套列表
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ - 一级列表项
+ - 二级列表项
+ - 另一个二级列表项
+ - 另一个一级列表项
+ + 二级有序列表
+ + 第二项
+ ```
+ ]
+]
+
+效果如下:
+
+- 一级列表项
+ - 二级列表项
+ - 另一个二级列表项
+- 另一个一级列表项
+ + 二级有序列表
+ + 第二项
+
+== 攻读学位期间取得成果
+
+成果列表有两种配置方式:
+
+=== 方式一:使用成果列表功能(推荐)
+
+此方式会自动从 bib 文件中提取文献信息并格式化输出。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 在 main.typ 中配置成果列表
+ info-keys.成果列表: (
+ 成果列表-keys.成果文件: "src/bib/参考文献1.bib", // bib 文件路径
+ 成果列表-keys.作者姓名: "Kopka H", // 填写你的名字,模板会自动在成果列表中加粗
+ 成果列表-keys.条目: (
+ // 每个元素为 (, "作者排序", "分类说明")
+ (, "第一作者", "CCF-A类会议"),
+ (, "共同一作", "CCF-B期刊"),
+ (, "第二作者", "中科院JCR1区"),
+ ),
+ // 非论文成果(如专利、软件著作权等)
+ 成果列表-keys.其他成果: include "src/攻读学位期间取得成果.typ",
+ // 匿名评审时使用的非论文成果版本
+ 成果列表-keys.其他成果-匿名: include "src/攻读学位期间取得成果-匿名.typ",
+ ),
+ info-keys.攻读学位期间取得成果: true,
+ ```
+ ]
+]
+
+*参数说明:*
+- `成果文件`:包含所有论文条目的 bib 文件路径
+- `作者姓名`:在 bib 文件中的姓名格式,用于高亮(加粗)作者
+- `条目`:元组,每个元素为 `(, "排序", "分类")` 格式
+ - ``:bib 文件中的 cite key
+ - `"排序"`:如 "第一作者"、"共同一作"、"第二作者"
+ - `"分类"`:如 "CCF-A类会议"、"SCI期刊" 等说明
+- `其他成果`:用于列出专利、软件著作权等非论文成果
+- `其他成果-匿名`:匿名评审时使用的非论文成果版本。当开启匿名模式(`info-keys.匿名: true`)时,模板会自动使用此字段替代 `其他成果`
+
+=== 方式二:直接 include 文件
+
+如果不使用成果列表功能,可以直接 include 一个包含成果内容的文件。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 在 main.typ 中
+ info-keys.攻读学位期间取得成果: include "src/攻读学位期间取得成果.typ"
+
+ // 在 src/攻读学位期间取得成果.typ 中直接写成果内容
+ // 注意:不需要写 = 标题,模板会自动添加
+ ```
+ ]
+]
+
+== 其他用法
+
+=== 脚注
+
+使用 `#footnote(...)` 添加脚注。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ 这是一段文字#footnote[这是一个脚注]。
+ 这是一段带链接的脚注#footnote(link("https://typst.app")[Typst官网])。
+ ```
+ ]
+]
+
+效果如下:
+
+这是一段文字#footnote[这是一个脚注]。这是一段带链接的脚注#footnote(link("https://typst.app")[Typst官网])。
+
+=== 链接
+
+使用 `link()` 函数或 `#link()` 添加超链接。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 方式一
+ #link("https://typst.app")[Typst官网]
+
+ // 方式二
+ #link("https://typst.app") // 显示URL本身
+
+ // 方式三(快捷写法)
+ 参见 https://typst.app
+ ```
+ ]
+]
+
+=== 代码块
+
+使用三个反引号创建代码块。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 行内代码
+ 使用 `typst compile main.typ` 编译。
+
+ // 代码块
+ ```python
+ def hello():
+ print("Hello, World!")
+ ```
+ ```
+ ]
+]
+
+=== 取消首行缩进
+
+在公式后的文字等场景,需要取消首行缩进时使用 `#noindent`。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ $ E = m c^2 $
+ #noindent 其中 $E$ 为能量,$m$ 为质量,$c$ 为光速。
+ ```
+ ]
+]
+
+=== 修改标记(revise)
+
+使用 `#revise[文字]` 标记论文中修改的内容。在修订模式下,标记的文字会显示为红色,方便审阅;在打印模式或电子档定稿模式下,红色标记会自动取消,恢复正常显示。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 标记修改内容(修订模式显示红色,打印/定稿模式正常显示)
+ #revise[这里是修改后的内容]
+
+ // 也可以标记较长的段落
+ #revise[
+ 这是一段较长的修改内容,
+ 可以包含多行文字。
+ ]
+ ```
+ ]
+]
+
+效果如下(当前为打印模式,修改内容正常显示;切换为修订模式时此处会变红):
+
+#revise[这是使用 revise 标记的修改内容。]
+
+*工作原理:*
+- 修订模式(`info-keys.论文模式: 论文模式.修订模式`):标记内容显示为红色
+- 打印模式(`info-keys.论文模式: 论文模式.打印模式`):标记内容正常显示,不添加任何颜色
+- 电子档定稿模式(`info-keys.论文模式: 论文模式.电子档定稿模式`):标记内容正常显示,不添加任何颜色
+
+=== 路径说明
+
+本章介绍在 `main.typ` 中配置路径时的注意事项。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 编译时需要指定根目录(在 makefile 中使用 --root .)
+ // 路径以 / 开头表示相对于根目录(main.typ 所在目录)
+ image("/src/pic/第一章/图片.png")
+ ```
+ ]
+]
+
+=== include 与直接传值的区别
+
+在 `main.typ` 中配置论文信息时,部分字段可以直接传字符串,部分需要使用 `include`。
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```typ
+ // 直接传字符串(适用于路径、简短文本等)
+ info-keys.参考文献: "src/bib/参考文献1.bib", // bib 文件路径
+ info-keys.论文中文标题: "论文标题", // 字符串
+
+ // 使用 include(适用于较长内容、需要排版的文本)
+ info-keys.中文摘要: include "src/摘要-中文.typ",
+ info-keys.致谢: include "src/致谢.typ",
+
+ // 附录是元组(可以包含多个 include)
+ info-keys.附录: (include "src/附录-1.typ", include "src/附录-2.typ"),
+
+ // 成果列表是字典
+ info-keys.成果列表: (
+ 成果列表-keys.成果文件: "src/bib/参考文献1.bib",
+ 成果列表-keys.作者姓名: "Kopka H", // 填写你的名字,模板会自动在成果列表中加粗
+ 成果列表-keys.条目: ((, "排序", "分类"),),
+ 成果列表-keys.其他成果: include "src/攻读学位期间取得成果.typ",
+ 成果列表-keys.其他成果-匿名: include "src/攻读学位期间取得成果-匿名.typ",
+ ),
+ ```
+ ]
+]
+
+== 已知问题
+
+=== 标题间只有 `#block` 时空行被删除
+
+标题之间只有文字、图表等元素时,会被识别到有内容,排版正常。但如果标题之间只有一个 `#block`(代码展示块),Typst 会认为标题之间没有内容,导致标题之间的空行被删除,从而影响排版效果。
+
+*解决方法:* 在 `#block` 前后添加任意文字内容即可避免此问题。本模板中的章节已尽量在 `#block` 前添加说明文字。
+
+=== 特殊字符导致跳转失效
+
+使用特殊字符(如中文引号“”、黑体标注等)会导致预览跳转到文字功能失效,不影响生成的文字,无需特别关注。对于“”,可以使用英文引号`""`或者`''`替代,会自动替换为中文引号,而不会跳转失效。
+
+
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/chapter2.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/chapter2.typ
new file mode 100644
index 0000000000..321ef1720e
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/chapter2.typ
@@ -0,0 +1,36 @@
+#import "lib.typ": *
+
+= 补充说明
+
+== 贡献代码
+
+本仓库为示例代码,模板代码位于 `uestc-thesis-template` 目录中。欢迎大家贡献代码。
+
+== 常见问题
+
+=== 编译命令
+
+编译需要指定根目录参数 `--root .`,在 makefile 中已配置好:
+
+#block(width: 100%)[
+ #set align(center)
+ #block(breakable: false)[
+ #set align(left)
+ ```bash
+ typst compile --root . main.typ output.pdf
+ ```
+ ]
+]
+
+=== 字体问题
+
+如果中英文之间、符号与中文中间出现错位,通常是字体原因。
+
+- Windows 默认字体 `SimHei`(黑体)和 `SimSun`(宋体)无需额外安装
+- macOS/Linux 建议使用思源字体,修改 `main.typ` 中的字体设置:
+ - `info-keys.黑体字体: "Source Han Sans SC"`
+ - `info-keys.宋体字体: "Source Han Serif SC"`
+
+=== Typst 版本
+
+本模板要求 Typst 版本 >= 0.13.0,可以通过 `typst --version` 检查。
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/lib.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/lib.typ
new file mode 100644
index 0000000000..b432497e1a
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/lib.typ
@@ -0,0 +1 @@
+#import "../uestc-thesis-template/lib.typ": *
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/pic/\345\255\246\344\275\215\350\256\272\346\226\207\345\256\236\347\216\260\345\275\242\345\274\217\344\270\215\345\201\232\350\246\201\346\261\202.png" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/pic/\345\255\246\344\275\215\350\256\272\346\226\207\345\256\236\347\216\260\345\275\242\345\274\217\344\270\215\345\201\232\350\246\201\346\261\202.png"
new file mode 100644
index 0000000000..ae430339ce
Binary files /dev/null and "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/pic/\345\255\246\344\275\215\350\256\272\346\226\207\345\256\236\347\216\260\345\275\242\345\274\217\344\270\215\345\201\232\350\246\201\346\261\202.png" differ
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\221\230\350\246\201-\344\270\255\346\226\207.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\221\230\350\246\201-\344\270\255\346\226\207.typ"
new file mode 100644
index 0000000000..fc210db405
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\221\230\350\246\201-\344\270\255\346\226\207.typ"
@@ -0,0 +1,7 @@
+本文是电子科技大学 Typst 学位论文模板的使用说明与示例。
+
+本模板旨在帮助同学们使用 Typst 排版工具快速、规范地完成学位论文的撰写。文中详细介绍了图片插入(包括子图、嵌套子图)、表格创建(三线表、合并单元格)、算法伪代码、定理/引理/证明、数学公式、文献引用、列表等所有常用功能的用法。
+
+源代码托管于 Github:#link("https://github.com/uestc-typst/thesis-example")。
+
+模板代码托管于 Github:#link("https://github.com/uestc-typst/thesis-template")。
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\221\230\350\246\201-\350\213\261\350\257\255.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\221\230\350\246\201-\350\213\261\350\257\255.typ"
new file mode 100644
index 0000000000..7a9e41a46e
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\221\230\350\246\201-\350\213\261\350\257\255.typ"
@@ -0,0 +1,9 @@
+This document is the user manual and example for the UESTC Typst degree thesis template.
+
+The template aims to help students use the Typst typesetting tool to quickly and standardizedly complete the writing of degree theses. This document introduces in detail the usage of all common functions such as figure insertion (including subfigures, nested subfigures), table creation (three-line tables, merged cells), algorithm pseudocode, theorems/lemmas/proofs, mathematical formulas, bibliography citations, and lists.
+
+The source code is hosted on GitHub: #link("https://github.com/uestc-typst/thesis-example").
+
+The template code is hosted on GitHub: #link("https://github.com/uestc-typst/thesis-template").
+
+#lorem(100)
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\224\273\350\257\273\345\255\246\344\275\215\346\234\237\351\227\264\345\217\226\345\276\227\346\210\220\346\236\234-\345\214\277\345\220\215.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\224\273\350\257\273\345\255\246\344\275\215\346\234\237\351\227\264\345\217\226\345\276\227\346\210\220\346\236\234-\345\214\277\345\220\215.typ"
new file mode 100644
index 0000000000..8b7216325c
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\224\273\350\257\273\345\255\246\344\275\215\346\234\237\351\227\264\345\217\226\345\276\227\346\210\220\346\236\234-\345\214\277\345\220\215.typ"
@@ -0,0 +1,10 @@
+/*
+ 匿名模式下的其他成果
+ 此处写的是匿名评审时的"其他成果"
+ 即专利、软件著作权等非论文成果
+ 在匿名模式下会替换原始的"攻读学位期间取得成果.typ"内容
+
+ 请注意:匿名模式下不应出现任何个人身份信息
+*/
+== 其他成果
+[1] 专利:一种基于Typst的学位论文模板,专利号:xxxxxxxxxxxxxxxxx
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\224\273\350\257\273\345\255\246\344\275\215\346\234\237\351\227\264\345\217\226\345\276\227\346\210\220\346\236\234.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\224\273\350\257\273\345\255\246\344\275\215\346\234\237\351\227\264\345\217\226\345\276\227\346\210\220\346\236\234.typ"
new file mode 100644
index 0000000000..1fae7bfa4f
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\346\224\273\350\257\273\345\255\246\344\275\215\346\234\237\351\227\264\345\217\226\345\276\227\346\210\220\346\236\234.typ"
@@ -0,0 +1,13 @@
+/*
+ 这里直接写成果内容就可以
+ 不用使用` = 成果 `这种方式写标题
+ 模板会自动添加标题
+
+ 当使用成果列表功能时,此处写的是"其他成果"
+ 即专利、软件著作权等非论文成果
+
+ 如果不使用成果列表功能,而是直接 include 此文件,
+ 则所有成果都写在这里(包括论文和专利等)
+*/
+== 其他成果
+[1] 作者:xxxx。专利:一种基于Typst的学位论文模板,专利号:xxxxxxxxxxxxxxxxx
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\350\207\264\350\260\242.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\350\207\264\350\260\242.typ"
new file mode 100644
index 0000000000..1ec28b6ede
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\350\207\264\350\260\242.typ"
@@ -0,0 +1,5 @@
+/*
+ 这里直接写致谢内容就可以
+ 不用使用` = 致谢 `这种方式写标题
+*/
+这是致谢内容
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\351\231\204\345\275\225-1.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\351\231\204\345\275\225-1.typ"
new file mode 100644
index 0000000000..8ccd262fcd
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\351\231\204\345\275\225-1.typ"
@@ -0,0 +1,27 @@
+#import "../uestc-thesis-template/template/thesis.typ":*
+
+= 电子科技大学参考网站
+#block(width: 100%)[
+ #set align(center + horizon)
+ #set text(size: 10pt)
+ #table(
+ columns: 2,
+ stroke: none,
+ // 这是顶头的粗线
+ table.hline(stroke: 1pt),
+ table.header([名称], [网站]),
+ // 这是中间的细线
+ table.hline(stroke: 0.5pt),
+ // 第一行
+ [电子科技大学研究生学位论文撰写规范#linebreak()(2022年1月修订)],
+ [#link("https://gr.uestc.edu.cn/xiazai/114/3917")],
+ // 第二行
+ [电子科技大学视觉形象],
+ [#link("https://vi.uestc.edu.cn/")],
+ // 第三行
+ [Typst 模板地址],
+ [#link("https://github.com/qujihan/uestc-thesis-typst-template")],
+ // 这是下面的粗线
+ table.hline(stroke: 1pt),
+ )
+]
\ No newline at end of file
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\351\231\204\345\275\225-2.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\351\231\204\345\275\225-2.typ"
new file mode 100644
index 0000000000..4ab602b0ca
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/src/\351\231\204\345\275\225-2.typ"
@@ -0,0 +1 @@
+= 电子科技大学其他网址
\ No newline at end of file
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/LICENSE b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/LICENSE
new file mode 100644
index 0000000000..1b5ec8b78e
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/LICENSE
@@ -0,0 +1,176 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/README.md b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/README.md
new file mode 100644
index 0000000000..977faa4f8e
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/README.md
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 📚 电子科技大学学位论文模板
+> [!CAUTION]
+> 模板所需 [Typst](https://typst.app/home/) 版本 >= `0.13.0` (可以通过`typst --version`检查)
+>
+> 安装Typst: [官网安装方式](https://github.com/typst/typst?tab=readme-ov-file#installation)
+
+# 🙋 为什么使用 Typst?
+> [!IMPORTANT]
+> 学校文件里并没有说明必须使用 Word/LaTex, 只要格式正确既可. 且在所有流程中提交的**只是PDF**格式文件
+>
+> 此外还可以参考[一只方橙](https://github.com/OrangeX4)在知乎的[一篇回答](https://www.zhihu.com/question/591143170/answer/3304601296),该回答详细说明了Typst的优势
+
+# 🚀 快速开始
+ 移步[电子科技大学学位论文 Typst 快速开始](https://github.com/qujihan/uestc-typst-thesis-example)
+
+ 该仓库使用了本模板编写了使用文档, 包含算法/三线表/图文引用等学位论文会使用的多种格式
+
+# 🔗 参考
+- [研究生学位论文](https://gr.uestc.edu.cn/xiazai/114/3917)
+- [本科学位论文](https://www.jwc.uestc.edu.cn/upload/电子科技大学本科毕业设计(论文)管理办法(2018修订版).pdf)
+- [视觉形象识别系统](https://vi.uestc.edu.cn/)
+
+# 💖 贡献者们
+
+
+
\ No newline at end of file
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/lib.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/lib.typ
new file mode 100644
index 0000000000..2bd0edf214
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/lib.typ
@@ -0,0 +1,10 @@
+#import "template/consts.typ": font-size, info-keys, 成果列表-keys, 论文模式
+#import "template/thesis.typ": thesis
+#import "template/tools/lib.typ": (
+ algorithm-figure, algorithmic, bottomrule, code-figure, figure-env-set, midrule, picture-figure, table, table-figure,
+ toprule,
+)
+#import "template/tools/term.typ": print-glossary, term
+#import "template/utils/ref.typ": c
+#import "template/utils/common.typ": noindent, revise
+#import "template/utils/equation.typ": lemma, proof, theorem
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/pics/bachelor_font.svg b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/pics/bachelor_font.svg
new file mode 100644
index 0000000000..038be47f2b
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/pics/bachelor_font.svg
@@ -0,0 +1,1236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 电
+
+
+
+
+
+
+
+ 子
+
+
+
+
+
+
+
+ 科
+
+
+
+
+
+
+
+ 技
+
+
+
+
+
+
+
+ 大
+
+
+
+
+
+
+
+ 学
+
+
+
+
+
+
+
+ UNIVERSITY OF ELECTRONIC SCIENCE AND TECHNOLOGY OF CHINA
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 学士
+
+
+
+
+ 学位论文
+
+
+
+
+
+
+
+ BACHELOR
+
+
+
+
+
+
+
+ THESIS
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 论文题目
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 学
+
+
+
+
+
+
+
+ 院
+
+
+
+
+
+
+
+ 专
+
+
+
+
+
+
+
+ 业
+
+
+
+
+
+
+
+
+
+
+ 学
+
+
+
+
+
+
+
+ 号
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 作者姓名
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 指导教师
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/pics/logo.svg b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/pics/logo.svg
new file mode 100644
index 0000000000..d9fa0f9a97
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/pics/logo.svg
@@ -0,0 +1,1946 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 电
+ 子
+ 科
+ 技
+ 大
+ 学
+ UNIVERSITYOFELECTRONICSCIENCEANDTECHNOLOGYOFCHINA
+ 博
+ 士
+ 学
+ 位
+ 论
+ 文
+ DOCTORALDISSERTATION
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 论
+ 文
+ 题
+ 目
+
+
+
+ 基
+
+
+
+
+
+
+ 于
+
+
+
+
+
+
+ 东
+
+
+
+
+
+
+ 拼
+
+
+
+
+
+
+ 西
+
+
+
+
+
+
+ 凑
+
+
+
+
+
+
+ 的
+
+
+
+
+
+
+ 电
+
+
+
+
+
+
+ 子
+
+
+
+
+
+
+ 科
+
+
+
+
+
+
+ 技
+
+
+
+
+
+
+ 大
+
+
+
+
+
+
+ 学
+
+
+
+
+
+
+ 毕
+
+
+
+
+
+
+ 业
+
+
+
+
+
+
+ 论
+
+
+
+
+
+
+ 文
+ L
+ A
+ T E X
+ 模
+
+
+
+
+
+
+ 板
+
+
+
+ 生
+
+
+
+
+
+
+ 成
+
+
+
+
+
+
+ 样
+
+
+
+
+
+
+ 例
+ 学
+ 科
+ 专业
+
+
+
+
+
+
+ 软
+
+
+
+
+
+
+ 件
+
+
+
+
+
+
+ 工
+
+
+
+
+
+
+ 程
+
+
+
+ 学
+ 号
+
+
+
+
+
+
+ 2923000000
+
+
+
+ 作
+ 者
+ 姓
+ 名
+
+
+
+
+
+
+ 时
+
+
+
+
+
+
+ 富
+
+
+
+
+
+
+ 军
+
+
+
+ 指
+ 导
+ 教
+ 师
+
+
+
+
+
+
+ 某
+
+
+
+
+
+
+ 老
+
+
+
+
+
+
+ 师
+ A
+
+
+
+
+
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/pics/uestc-love-typst.png b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/pics/uestc-love-typst.png
new file mode 100644
index 0000000000..e95027e9b3
Binary files /dev/null and b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/pics/uestc-love-typst.png differ
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/lib.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/lib.typ
new file mode 100644
index 0000000000..3305fada9f
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/lib.typ
@@ -0,0 +1,14 @@
+#import "前置-1-封面.typ": 封面
+#import "前置-2-1-中文扉页.typ": 中文扉页
+#import "前置-2-2-英文扉页.typ": 英文扉页
+#import "前置-3-独创性声明和论文使用授权.typ": 独创性声明和论文使用授权
+#import "前置-4-摘要.typ": 中文摘要, 英文摘要
+#import "前置-5-目录.typ": 目录
+#import "前置-6-1-图目录.typ": 图目录
+#import "前置-6-2-表目录.typ": 表目录
+#import "前置-7-缩略词表等注释表.typ": 缩略词表等注释表
+#import "正文.typ": 正文
+#import "结尾-1-致谢.typ": 致谢
+#import "结尾-2-参考文献.typ": 参考文献
+#import "结尾-3-附录.typ": 附录
+#import "结尾-4-攻读学位期间取得成果.typ": 攻读学位期间取得成果
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-1-\345\260\201\351\235\242.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-1-\345\260\201\351\235\242.typ"
new file mode 100644
index 0000000000..e0ee6244db
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-1-\345\260\201\351\235\242.typ"
@@ -0,0 +1,142 @@
+#import "../consts.typ": *
+#import "../tools/lib.typ": *
+
+#let 学士封面字段(info: (:)) = [
+ #justified-text-with-underline(4em, 16em, "学院", info.at(info-keys.作者学院))
+ #justified-text-with-underline(4em, 16em, "专业", info.at(info-keys.作者学科专业))
+ #justified-text-with-underline(4em, 16em, "学号", info.at(info-keys.作者学号))
+ #justified-text-with-underline(4em, 16em, "作者姓名", info.at(info-keys.作者中文名))
+ #justified-text-with-underline(
+ 4em,
+ 16em,
+ "指导老师",
+ info.at(info-keys.指导老师中文名) + " " + info.at(info-keys.指导老师职称中文),
+ )
+]
+
+#let 硕博封面字段(info: (:)) = [
+ #if info.at(info-keys.学位类型) == "专业型" {
+ justified-text-with-underline(
+ 4em,
+ 16em,
+ box(width: 6em, scale(x: 66.6%, "专业学位类型")),
+ info.at(info-keys.作者专业学位类别),
+ )
+ } else if info.at(info-keys.学位类型) == "学术型" {
+ justified-text-with-underline(4em, 16em, "学科专业", info.at(info-keys.作者学科专业))
+ }
+ #justified-text-with-underline(4em, 16em, "学号", info.at(info-keys.作者学号))
+ #justified-text-with-underline(4em, 16em, "作者姓名", info.at(info-keys.作者中文名))
+ #let text-to-display = info.at(info-keys.指导老师中文名)
+ #if info.at(info-keys.指导老师职称中文) != "" {
+ text-to-display += " " + info.at(info-keys.指导老师职称中文)
+ }
+ #justified-text-with-underline(
+ 4em,
+ 16em,
+ "指导老师",
+ text-to-display,
+ )
+ #justified-text-with-underline(4em, 16em, "学院", info.at(info-keys.作者学院))
+]
+
+#let 封面(info: (:)) = [
+ #set page(margin: (bottom: 1cm))
+
+ // for debug
+ #set block(stroke: if info.at(info-keys.DEBUG) { red } else { none })
+
+ #set align(center)
+
+ #block(height: 50pt, inset: 0pt)[
+ #text(size: font-size.二号)[
+ #set text(size: font-size.一号, font: "STXingkai") if info.at(info-keys.申请学位级别) == "学士"
+ 电 子 科 技 大 学
+ #linebreak()
+ ]
+ #text(size: font-size.小四)[
+ UNIVERSITY OF ELECTRONIC SCIENCE AND TECHNOLOGY OF CHINA
+ #linebreak()
+ ]
+ ]
+
+ #block(height: 20pt)[#sym.space]
+
+ #let title-chinese = ""
+ #let title-english = ""
+ #if info.at(info-keys.申请学位级别) == "硕士" {
+ if info.at(info-keys.学位类型) == "学术型" {
+ title-chinese = "硕士学位论文"
+ title-english = " MASTER THESIS "
+ } else if info.at(info-keys.学位类型) == "专业型" {
+ title-chinese = "专业学位硕士学位论文"
+ title-english = " MASTER THESIS FOR PROFESSIONAL DEGREE "
+ }
+ } else if info.at(info-keys.申请学位级别) == "博士" {
+ if info.at(info-keys.学位类型) == "学术型" {
+ title-chinese = "博士学位论文"
+ title-english = " DOCTORAL DISSERTATION "
+ } else if info.at(info-keys.学位类型) == "专业型" {
+ title-chinese = "专业学位博士学位论文"
+ title-english = " DOCTORAL DISSERTATION FOR PROFESSIONAL DEGREE "
+ }
+ } else if info.at(info-keys.申请学位级别) == "学士" {
+ title-chinese = "学士学位论文"
+ title-english = "BACHELOR THESIS "
+ }
+ #block(height: 70pt, inset: 0pt)[
+ #text(size: font-size.初号)[#title-chinese]
+ #linebreak()
+ #text(size: font-size.三号)[#title-english]
+ ]
+
+ #block(height: 10pt)[#sym.space]
+
+ #block(height: 160pt, inset: 0pt)[
+ #image("../../pics/logo.svg", width: auto)
+ ]
+
+ #v(1.5cm)
+
+ #block(height: 70pt, inset: 0pt)[
+ #set text(size: font-size.小二, weight: "bold")
+ #set align(center + top)
+ #box(height: 100%)[ 论文题目 ]
+ #box(height: 100%)[
+ #let title = info.at(info-keys.论文中文标题)
+ #let after-split = title.split("\n")
+
+ // 如果有换行符
+ // 需要换行且每一行都有下划线
+ #if after-split.len() > 1 {
+ for str in after-split {
+ fixed-width-underline(width: 18em, str)
+ }
+ } else if after-split.len() == 1 {
+ fixed-width-underline(width: 18em, after-split.at(0))
+ }
+ ]
+ ]
+
+ // #block(height: 0pt)[#sym.space]
+ #v(10pt)
+
+ #block(
+ height: 180pt,
+ inset: 0pt,
+ )[
+
+ #set text(size: font-size.三号, weight: "bold")
+
+ #if info.at(info-keys.申请学位级别) == "学士" {
+ 学士封面字段(info: info)
+ } else {
+ 硕博封面字段(info: info)
+ }
+ ]
+
+ #pagebreak(weak: true)
+ #if info.at(info-keys.论文模式) == 论文模式.打印模式 {
+ pagebreak(weak: true, to: "odd")
+ }
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-2-1-\344\270\255\346\226\207\346\211\211\351\241\265.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-2-1-\344\270\255\346\226\207\346\211\211\351\241\265.typ"
new file mode 100644
index 0000000000..c9d919f384
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-2-1-\344\270\255\346\226\207\346\211\211\351\241\265.typ"
@@ -0,0 +1,322 @@
+#import "../consts.typ": *
+#import "../tools/lib.typ": *
+
+#let 中文扉页(info: (:)) = [
+ #set page(margin: (bottom: 1cm))
+ // for debug
+ #set block(stroke: if info.at(info-keys.DEBUG) { red } else { none })
+
+ #set block(inset: 0pt, outset: 0pt)
+ #set grid(inset: 0pt)
+ #set grid.cell(inset: 0pt)
+ #set align(center)
+
+ #block(height: 40pt, width: 100%)[
+ #set text(size: font-size.小四)
+ #set align(left)
+ #grid(
+ columns: (1fr, 1fr),
+ rows: (2em, 2em),
+ text("分类号") + fixed-width-underline(width: 14em, align(center, info.at(info-keys.分类号))),
+ text("密级") + fixed-width-underline(width: 14em, align(center, info.at(info-keys.密级))),
+
+ text()[UDC#super("注1")] + fixed-width-underline(width: 14em, align(center, info.at(info-keys.UDC))),
+ )
+ ]
+
+ #v(3em)
+
+ #block()[
+ #text(size: font-size.小初, weight: "bold")[#fixed-width-text-justified(width: 7em, "学位论文")]
+ ]
+
+ #layout(size => context {
+ let txt = info.at(info-keys.论文中文标题).replace("\n", "")
+ let line-h = measure(block(text(size: font-size.小二, weight: "bold", fixed-width-underline(
+ width: size.width,
+ "面向应用的扩散模高效训练、隐私审计与离散编码研究",
+ )))).height
+ let title-h = measure(block(text(size: font-size.小二, weight: "bold", fixed-width-underline(
+ width: size.width,
+ txt,
+ )))).height
+ let title-shrink = if title-h > line-h * 1.3 { 1em } else { 0em }
+
+ v(3em - title-shrink)
+
+ let width_name = size.width
+ if title-shrink > 0em {
+ width_name = width_name * 0.9
+ }
+
+ block()[
+ #text(size: font-size.小二, weight: "bold")[
+ #fixed-width-underline(width: width_name, txt)
+ ]
+ #block()[
+ #set text(size: font-size.小四)
+ #fixed-width-text(width: 20em, align(center)[(题名和副题名)])
+ ]
+ ]
+
+ let shrink = 0em
+ if info.at(info-keys.合作导师中文名) != none and info.at(info-keys.合作导师中文名) != "" {
+ shrink = 1.5em
+ }
+ v(3em - shrink - title-shrink)
+
+ block(height: auto)[
+ #block()[
+ #set text(size: font-size.三号, weight: "bold")
+ #fixed-width-underline(width: 7em, info.at(info-keys.作者中文名))
+ ]
+ #block()[
+ #set text(size: font-size.小四)
+ #fixed-width-text(width: 20em, align(center)[(作者姓名)])
+ ]
+ ]
+
+ v(3em - shrink)
+
+ // 注意:使用 layout 时,相关的使用这套高度的代码必须写在 layout 内部
+ })
+
+ #let height_name_block = 60pt
+ #if info.at(info-keys.合作导师中文名) != none and info.at(info-keys.合作导师中文名) != "" {
+ height_name_block = 120pt
+ } else {}
+
+ #block(height: height_name_block)[
+ #block()[
+ #let adviser-text-to-display = info.at(info-keys.指导老师中文名)
+ #let collabrator-text-to-display = info.at(info-keys.合作导师中文名)
+ #if info.at(info-keys.指导老师职称中文) != "" {
+ adviser-text-to-display = adviser-text-to-display + " " + info.at(info-keys.指导老师职称中文)
+ }
+ #if info.at(info-keys.合作导师职称中文) != "" {
+ collabrator-text-to-display = collabrator-text-to-display + " " + info.at(info-keys.合作导师职称中文)
+ }
+ #if info.at(info-keys.合作导师中文名) != none and info.at(info-keys.合作导师中文名) != "" {
+ grid(
+ rows: (1fr, 1fr, 1fr, 1fr),
+ justified-text-with-underline(
+ 4em,
+ 18em,
+ "指导老师",
+ align(
+ center,
+ text(weight: "bold", adviser-text-to-display),
+ ),
+ ),
+ justified-text-with-underline(
+ 4em,
+ 18em,
+ "",
+ align(center, text(weight: "bold", info.at(info-keys.指导老师单位))),
+ ),
+ justified-text-with-underline(
+ 4em,
+ 18em,
+ "合作导师",
+ align(
+ center,
+ text(weight: "bold", collabrator-text-to-display),
+ ),
+ ),
+ justified-text-with-underline(
+ 4em,
+ 18em,
+ "",
+ align(center, text(weight: "bold", info.at(info-keys.合作导师单位))),
+ ),
+ block()[
+ #set text(size: font-size.小四)
+ #fixed-width-text-justified(width: 4em, "")
+ #fixed-width-text(width: 18em, align(center)[(姓名、职称、单位名称)])
+ ],
+ )
+ } else {
+ grid(
+ rows: (1fr, 1fr, 1fr),
+ justified-text-with-underline(
+ 4em,
+ 18em,
+ "指导老师",
+ align(
+ center,
+ text(weight: "bold", adviser-text-to-display),
+ ),
+ ),
+ justified-text-with-underline(
+ 4em,
+ 18em,
+ "",
+ align(center, text(weight: "bold", info.at(info-keys.指导老师单位))),
+ ),
+ block()[
+ #set text(size: font-size.小四)
+ #fixed-width-text-justified(width: 4em, "")
+ #fixed-width-text(width: 18em, align(center)[(姓名、职称、单位名称)])
+ ],
+ )
+ }
+ ]
+ ]
+
+ #v(3em)
+
+ #let 论文提交以及答辩日期行 = grid(
+ columns: (1fr, 1fr),
+ justified-text-with-underline(
+ 6em,
+ 10em,
+ "论文提交时间",
+ align(center, text(weight: "bold", info.at(info-keys.提交日期))),
+ ),
+ justified-text-with-underline(
+ 6em,
+ 9.5em,
+ "论文答辩日期",
+ align(center, text(weight: "bold", info.at(info-keys.答辩日期))),
+ ),
+ )
+
+ #let 授予单位与日期行 = justified-text-with-underline(
+ 9em,
+ 24.5em,
+ "学位授予单位和日期",
+ align(center, text(weight: "bold", info.at(info-keys.学位授予单位) + " " + info.at(info-keys.学位授予日期))),
+ )
+
+ #let 答辩委员会主席显示文本 = info.at(info-keys.答辩委员会主席)
+ #if info.at(info-keys.答辩委员会主席职称) != none and info.at(info-keys.答辩委员会主席职称) != "" {
+ 答辩委员会主席显示文本 = 答辩委员会主席显示文本 + " " + info.at(info-keys.答辩委员会主席职称)
+ }
+ #let 答辩委员会主席行 = justified-text-with-underline(
+ 7em,
+ 26.5em,
+ "答辩委员会主席",
+ align(center, text(weight: "bold", 答辩委员会主席显示文本)),
+ )
+
+ #let 评阅人行 = justified-text-with-underline(
+ 3em,
+ 30.5em,
+ "评阅人",
+ align(
+ center,
+ text(weight: "bold", info.at(info-keys.评阅人).fold("", (prev, it) => { prev + it + " " })),
+ ),
+ )
+
+ #block(height: 150pt)[
+ #if info.at(info-keys.学位类型) == "专业型" {
+ grid(
+ columns: 1fr,
+ rows: (1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
+ grid(
+ inset: 0pt,
+ columns: (1fr, 1fr),
+ justified-text-with-underline(
+ 6em,
+ 10em,
+ "申请学位级别",
+ align(center, text(weight: "bold", info.at(info-keys.申请学位级别))),
+ ),
+ justified-text-with-underline(
+ 6em,
+ 10em,
+ "专业学位类别",
+ align(center, text(weight: "bold", info.at(info-keys.作者专业学位类别))),
+ ),
+ ),
+ justified-text-with-underline(
+ 6em,
+ 27.8em,
+ "专业学位领域",
+ align(center, text(weight: "bold", info.at(info-keys.专业学位领域))),
+ ),
+ 论文提交以及答辩日期行,
+ 授予单位与日期行,
+ 答辩委员会主席行,
+ 评阅人行,
+ )
+ } else if info.at(info-keys.学位类型) == "学术型" {
+ grid(
+ columns: 1fr,
+ rows: (1fr, 1fr, 1fr, 1fr, 1fr),
+ grid(
+ inset: 0pt,
+ columns: (1fr, 1fr),
+ justified-text-with-underline(
+ 6em,
+ 10em,
+ "申请学位级别",
+ align(center, text(weight: "bold", info.at(info-keys.申请学位级别))),
+ ),
+ justified-text-with-underline(
+ 4em,
+ 11.5em,
+ "学科专业",
+ align(center, text(weight: "bold", info.at(info-keys.作者学科专业))),
+ ),
+ ),
+ 论文提交以及答辩日期行,
+ 授予单位与日期行,
+ 答辩委员会主席行,
+ 评阅人行,
+ )
+ }
+ ]
+
+ // #block(
+ // height: 150pt,
+ // )[
+ // #set align(left)
+ // #grid(
+ // columns: (1fr),
+ // rows: (1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
+ // grid(
+ // inset: 0pt,
+ // columns: (1fr, 1fr),
+ // justified-text-with-underline(6em, 10em, "申请学位级别", align(center, text(weight: "bold", info.at(info-keys.申请学位级别)))),
+ // justified-text-with-underline(6em, 10em, "专业学位类别", align(center, text(weight: "bold", info.at(info-keys.作者专业学位类别)))),
+ // ),
+ // justified-text-with-underline(6em, 31em, "专业学位领域", align(center, text(weight: "bold", info.at(info-keys.专业学位领域)))),
+ // grid(
+ // columns: (1fr, 1fr),
+ // justified-text-with-underline(6em, 10em, "论文提交时间", align(center, text(weight: "bold", info.at(info-keys.提交日期)))),
+ // justified-text-with-underline(6em, 10em, "论文答辩日期", align(center, text(weight: "bold", info.at(info-keys.答辩日期)))),
+ // ),
+ // justified-text-with-underline(
+ // 9em,
+ // 28em,
+ // "学位授予单位和日期",
+ // align(center, text(weight: "bold", info.at(info-keys.学位授予单位) + " " + info.at(info-keys.学位授予日期))),
+ // ),
+ // justified-text-with-underline(7em, 30em, "答辩委员会主席", align(center, text(weight: "bold", info.at(info-keys.答辩委员会主席)))),
+ // justified-text-with-underline(
+ // 3em,
+ // 34em,
+ // "评阅人",
+ // align(center, text(weight: "bold", info.at(info-keys.答辩委员会成员).fold("", (prev, it) => { prev + it + " " }))),
+ // ),
+ // )
+ // ]
+
+ #let shrink = 0em
+ #if info.at(info-keys.合作导师中文名) != none and info.at(info-keys.合作导师中文名) != "" {
+ shrink = 1.5em
+ }
+
+ #v(2em - shrink)
+
+ #block(width: 100%)[
+ #set align(left)
+ #text(size: font-size.五号)[注1:注明《国际十进分类法UDC》的类号。]
+ ]
+ #pagebreak(weak: true)
+ #if info.at(info-keys.论文模式) == 论文模式.打印模式 {
+ pagebreak(weak: true, to: "odd")
+ }
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-2-2-\350\213\261\346\226\207\346\211\211\351\241\265.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-2-2-\350\213\261\346\226\207\346\211\211\351\241\265.typ"
new file mode 100644
index 0000000000..33dabf2d40
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-2-2-\350\213\261\346\226\207\346\211\211\351\241\265.typ"
@@ -0,0 +1,89 @@
+#import "../consts.typ": *
+#import "../utils/lib.typ": *
+#import "../tools/lib.typ": *
+
+#let 英文扉页(info: (:)) = [
+ #set page(margin: (bottom: 1cm))
+ // for debug
+ #set block(stroke: if info.at(info-keys.DEBUG) { red } else { none })
+
+ #set block(inset: 0pt, outset: 0pt)
+ #set grid(inset: 0pt)
+ #set grid.cell(inset: 0pt)
+ #set align(center)
+
+ #v(4em)
+
+ #block()[
+ #set align(center)
+ #set text(font: get-hei-font(info), size: font-size.小二, weight: "bold", lang: "en")
+ #info.at(info-keys.论文英文标题)
+ ]
+
+ #v(16em)
+
+ #block()[
+ #set align(center)
+ #set text(font: get-hei-font(info), size: font-size.小三)
+ #if info.at(info-keys.申请学位级别) == "硕士" {
+ text("A Master Thesis Submitted to \n University of Electronic Science and Technology of China")
+ } else if info.at(info-keys.申请学位级别) == "博士" {
+ text("A Doctoral Dissertation Submitted to \n University of Electronic Science and Technology of China")
+ }
+ ]
+
+ #v(12em)
+
+ #block(height: 140pt)[
+ #set align(center)
+ #let 学科名称 = if info.at(info-keys.学位类型) == "学术型" {
+ info.at(info-keys.作者学科专业英文)
+ } else if info.at(info-keys.学位类型) == "专业型" {
+ info.at(info-keys.作者专业学位类别英文)
+ } else {
+ ""
+ }
+
+ #let text-to-display = info.at(info-keys.指导老师英文名)
+ #if info.at(info-keys.指导老师职称英文) != "" {
+ text-to-display = text-to-display + " " + info.at(info-keys.指导老师职称英文)
+ }
+ #grid(
+ columns: 1fr,
+ rows: (1fr, 1fr, 1fr, 1fr, 1fr),
+ fixed-text-with-underline(5em, 25em, align(right)[Discipline], align(center, text(weight: "bold", 学科名称))),
+ fixed-text-with-underline(
+ 5em,
+ 25em,
+ align(right)[Student ID],
+ align(center, text(weight: "bold", info.at(info-keys.作者学号))),
+ ),
+ fixed-text-with-underline(
+ 5em,
+ 25em,
+ align(right)[Author],
+ align(center, text(weight: "bold", info.at(info-keys.作者英文名))),
+ ),
+ fixed-text-with-underline(
+ 5em,
+ 25em,
+ align(right)[Supervisor],
+ align(
+ center,
+ text(weight: "bold", text-to-display),
+ ),
+ ),
+ fixed-text-with-underline(
+ 5em,
+ 25em,
+ align(right)[School],
+ align(center, text(weight: "bold", info.at(info-keys.作者学院英文))),
+ ),
+ )
+ ]
+
+ #pagebreak(weak: true)
+ #if info.at(info-keys.论文模式) == 论文模式.打印模式 {
+ pagebreak(weak: true, to: "odd")
+ }
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-3-\347\213\254\345\210\233\346\200\247\345\243\260\346\230\216\345\222\214\350\256\272\346\226\207\344\275\277\347\224\250\346\216\210\346\235\203.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-3-\347\213\254\345\210\233\346\200\247\345\243\260\346\230\216\345\222\214\350\256\272\346\226\207\344\275\277\347\224\250\346\216\210\346\235\203.typ"
new file mode 100644
index 0000000000..8d3725eec6
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-3-\347\213\254\345\210\233\346\200\247\345\243\260\346\230\216\345\222\214\350\256\272\346\226\207\344\275\277\347\224\250\346\216\210\346\235\203.typ"
@@ -0,0 +1,80 @@
+#import "../consts.typ": *
+#import "../tools/lib.typ": *
+
+#let 独创性声明和论文使用授权(info: (:)) = [
+ // 电子档定稿模式:使用扫描页替换
+ #if info.at(info-keys.论文模式) == 论文模式.电子档定稿模式 {
+ [
+ #let scan-path = info.at(info-keys.独创性声明扫描页, default: none)
+ #if scan-path == none or scan-path == "" {
+ panic("电子档定稿模式下必须设置 info-keys.独创性声明扫描页 为扫描件路径")
+ }
+ // 用户提供的路径相对于项目根目录(main.typ 所在位置)
+ // 而本文件位于 template/component/ 下,需要回溯到项目根目录
+ #let resolved-path = "../../../" + scan-path
+ // 检查文件是否存在
+ #let _ = read(resolved-path, encoding: none)
+ // 检查扫描页是否为 A4 大小(宽高比 210:297)
+ #context {
+ let img = image(resolved-path)
+ let s = measure(img)
+ let ratio = s.width / s.height
+ let a4-ratio = 210mm / 297mm
+ if calc.abs(ratio - a4-ratio) > 0.002 {
+ panic("独创性声明扫描页尺寸不是 A4 (210mm × 297mm),请检查扫描件")
+ }
+ }
+ #page(paper: "a4", margin: 0pt, header: none, footer: none)[
+ #image(resolved-path, width: 100%, height: 100%)
+ ]
+ ]
+ } else {
+ [
+ // 修订模式 / 打印模式:使用 Typst 排版生成
+ // for debug
+ #set block(stroke: if info.at(info-keys.DEBUG) { red } else { none })
+
+ #set par(first-line-indent: 2em, justify: true, leading: 1.2em, linebreaks: "optimized", spacing: 2em)
+ #set text(size: font-size.四号)
+
+ #let 作者签名 = [#fixed-width-underline(
+ width: 7em,
+ info.at(info-keys.作者电子签名, default: ""),
+ ) #fixed-width-space(2em)]
+
+ #let 导师签名 = [#fixed-width-underline(
+ width: 7em,
+ info.at(info-keys.导师电子签名, default: ""),
+ ) #fixed-width-space(2em)]
+
+ #let 日期 = info.at(
+ info-keys.独创性声明时间,
+ default: [#fixed-width-space(2em)年#fixed-width-space(2em)月#fixed-width-space(2em)日],
+ )
+
+ #block()[
+ #block(width: 100%, align(center, text(size: font-size.小二, weight: "bold")[独创性声明]))
+
+ #h(2em)本人声明所呈交的学位论文是本人在导师指导下进行的研究工作及取得的研究成果。据我所知,除了文中特别加以标注和致谢的地方外,论文中不包含其他人已经发表或撰写过的研究成果,也不包含为获得电子科技大学或其它教育机构的学位或证书而使用过的材料。与我一同工作的同志对本研究所做的任何贡献均已在论文中作了明确的说明并表示谢意。
+
+ #align(right)[作者签名:#作者签名 日期:#日期]
+ ]
+
+ #v(2em)
+ #block()[
+ #block(width: 100%, align(center, text(size: font-size.小二, weight: "bold")[论文使用授权]))
+ #h(2em)本学位论文作者完全了解电子科技大学有关保留、使用学位论文的规定,同意学校有权保留并向国家有关部门或机构送交论文的复印件和数字文档,允许论文被查阅。本人授权电子科技大学可以将学位论文的全部或部分内容编入有关数据库进行检索及下载,可以采用影印、扫描等复制手段保存、汇编学位论文。
+
+ (涉密的学位论文须按照国家及学校相关规定管理,在解密后适用于本授权。)
+
+ #align(right)[作者签名:#作者签名 导师签名:#导师签名]
+ #align(right)[日期:#日期]
+ ]
+
+ #pagebreak(weak: true)
+ #if info.at(info-keys.论文模式) == 论文模式.打印模式 {
+ pagebreak(weak: true, to: "odd")
+ }
+ ]
+ }
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-4-\346\221\230\350\246\201.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-4-\346\221\230\350\246\201.typ"
new file mode 100644
index 0000000000..5f51b1e5eb
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-4-\346\221\230\350\246\201.typ"
@@ -0,0 +1,65 @@
+#import "../consts.typ": *
+
+#let abstract-template(info, title, abstract, keywords-title, keywords-split-char, keywords) = {
+ heading(title)
+ abstract
+ if (keywords != none) {
+ par[
+ #linebreak()
+ #strong(keywords-title)
+ #str(
+ keywords.fold(
+ "",
+ (str, item) => {
+ if str == "" {
+ str + item
+ } else {
+ str + keywords-split-char + item
+ }
+ },
+ ),
+ )]
+ }
+}
+
+#let 中文摘要(info: (:)) = [
+ #let abstract = info.at(info-keys.中文摘要)
+ #let keywords = info.at(info-keys.中文摘要关键字)
+ #if abstract == none or keywords == none {
+ return
+ }
+ #abstract-template(info, "摘要", abstract, "关键词:", ",", keywords)
+ #pagebreak(weak: true)
+ #set page(header: none, footer: none)
+ #if info.at(info-keys.论文模式) == 论文模式.打印模式 {
+ context {
+ let current-page = here().page()
+ if calc.even(current-page) {
+ counter(page).update(n => n - 1)
+ }
+ }
+ pagebreak(weak: true, to: "odd")
+ }
+]
+
+#let 英文摘要(info: (:)) = [
+ #set text(region: "en", lang: "en")
+ #let abstract = info.at(info-keys.英文摘要)
+ #let keywords = info.at(info-keys.英文摘要关键字)
+ #if abstract == none or keywords == none {
+ return
+ }
+
+ #abstract-template(info, "ABSTRACT", abstract, "Keywords: ", ", ", keywords)
+ #pagebreak(weak: true)
+ #set page(header: none, footer: none)
+ #if info.at(info-keys.论文模式) == 论文模式.打印模式 {
+ context {
+ let current-page = here().page()
+ if calc.even(current-page) {
+ counter(page).update(n => n - 1)
+ }
+ }
+ pagebreak(weak: true, to: "odd")
+ }
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-5-\347\233\256\345\275\225.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-5-\347\233\256\345\275\225.typ"
new file mode 100644
index 0000000000..e549b201b7
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-5-\347\233\256\345\275\225.typ"
@@ -0,0 +1,42 @@
+#import "../consts.typ": *
+#import "../tools/figure-i.typ": *
+
+#let 目录(info: (:)) = [
+ #set align(center)
+
+ #set par(leading: above-leading-space()) // 设置条目行距
+ #set outline.entry(fill: repeat(text(top-edge: 0em, bottom-edge: -0.3em)[.], gap: 0.1em))
+
+ #show outline.entry.where(level: 1): it => {
+ let prefix = if it.prefix() != none {
+ strong(it.prefix())
+ } else {
+ h(-0.5em)
+ }
+ it.indented(
+ prefix,
+ [#strong(it.body())
+ #box(width: 1fr, it.fill)
+ #it.page()],
+ gap: 0.5em,
+ )
+ }
+
+ #show cite: none
+
+ #heading("目 录")
+ #outline(title: none, depth: 4, indent: 2em)
+
+ #set page(header: none, footer: none)
+ #pagebreak(weak: true)
+ #set page(header: none, footer: none)
+ #if info.at(info-keys.论文模式) == 论文模式.打印模式 {
+ context {
+ let current-page = here().page()
+ if calc.even(current-page) {
+ counter(page).update(n => n - 1)
+ }
+ }
+ pagebreak(weak: true, to: "odd")
+ }
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-6-1-\345\233\276\347\233\256\345\275\225.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-6-1-\345\233\276\347\233\256\345\275\225.typ"
new file mode 100644
index 0000000000..d3caf6befb
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-6-1-\345\233\276\347\233\256\345\275\225.typ"
@@ -0,0 +1,62 @@
+// https://github.com/typst/typst/discussions/4515
+#import "../consts.typ": *
+#import "../tools/figure-i.typ": *
+
+#let 图目录(info: (:)) = [
+ #set outline.entry(fill: repeat(text(top-edge: 0em, bottom-edge: -0.3em)[.], gap: 0.1em))
+
+ #show outline.entry: it => {
+ // 定义空隙宽度,方便统一调整
+ // let gap = 1.5em
+
+ let min-box(min-width: 0pt, body) = context {
+ let size = measure(body)
+ let size_abs = measure(h(min-width))
+ let final-width = calc.max(size_abs.width, size.width)
+ box(width: final-width, body)
+ }
+ let num-total = counter(it.element.kind + "total").get().first()
+ counter(it.element.kind + "total").step()
+ let head-num = counter(heading).at(it.element.location()).first()
+ let element-num = counter(it.element.kind + str(head-num)).at(it.element.location()).first()
+ if num-total != 0 and element-num == 0 {
+ v(12pt)
+ }
+
+ link(it.element.location())[
+ #grid(
+ // columns: (auto, 1fr, gap),
+ columns: (auto, 1fr),
+ // stroke: 0.5pt,
+ gutter: 0pt,
+ // 关键:左右栏必须紧贴,物理间隙为0
+ min-box(min-width: 3.5em)[#it.prefix()],
+ [#set par(justify: true)
+ #it.body()
+ #box(width: 1fr)[
+ #set text(top-edge: 0em, bottom-edge: -0.25em)
+ #it.fill
+ ]
+ #it.page()
+ ],
+ )
+ ]
+ }
+ #show cite: none
+ #outline(
+ title: "插图清单",
+ target: figure.where(kind: figure-kind-pic),
+ indent: 2em, // 这是一个排版优化,让条目稍微缩进一点
+ )
+ #pagebreak(weak: true)
+ #set page(header: none, footer: none)
+ #if info.at(info-keys.论文模式) == 论文模式.打印模式 {
+ context {
+ let current-page = here().page()
+ if calc.even(current-page) {
+ counter(page).update(n => n - 1)
+ }
+ }
+ pagebreak(weak: true, to: "odd")
+ }
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-6-2-\350\241\250\347\233\256\345\275\225.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-6-2-\350\241\250\347\233\256\345\275\225.typ"
new file mode 100644
index 0000000000..ed033e96c4
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-6-2-\350\241\250\347\233\256\345\275\225.typ"
@@ -0,0 +1,62 @@
+// https://github.com/typst/typst/discussions/4515
+#import "../consts.typ": *
+#import "../tools/figure-i.typ": *
+
+#let 表目录(info: (:)) = [
+ #set outline.entry(fill: repeat(text(top-edge: 0em, bottom-edge: -0.3em)[.], gap: 0.1em))
+
+ #show outline.entry: it => {
+ // 定义空隙宽度,方便统一调整
+ // let gap = 1.5em
+
+ let min-box(min-width: 0pt, body) = context {
+ let size = measure(body)
+ let size_abs = measure(h(min-width))
+ let final-width = calc.max(size_abs.width, size.width)
+ box(width: final-width, body)
+ }
+ let num-total = counter(it.element.kind + "total").get().first()
+ counter(it.element.kind + "total").step()
+ let head-num = counter(heading).at(it.element.location()).first()
+ let element-num = counter(it.element.kind + str(head-num)).at(it.element.location()).first()
+ if num-total != 0 and element-num == 0 {
+ v(12pt)
+ }
+
+ link(it.element.location())[
+ #grid(
+ // columns: (auto, 1fr, gap),
+ columns: (auto, 1fr),
+ // stroke: 0.5pt,
+ gutter: 0pt,
+ // 关键:左右栏必须紧贴,物理间隙为0
+ min-box(min-width: 3.5em)[#it.prefix()],
+ [#set par(justify: true)
+ #it.body()
+ #box(width: 1fr)[
+ #set text(top-edge: 0em, bottom-edge: -0.25em)
+ #it.fill
+ ]
+ #it.page()
+ ],
+ )
+ ]
+ }
+ #show cite: none
+ #outline(
+ title: "表格清单",
+ target: figure.where(kind: figure-kind-tbl),
+ indent: 2em,
+ )
+ #pagebreak(weak: true)
+ #set page(header: none, footer: none)
+ #if info.at(info-keys.论文模式) == 论文模式.打印模式 {
+ context {
+ let current-page = here().page()
+ if calc.even(current-page) {
+ counter(page).update(n => n - 1)
+ }
+ }
+ pagebreak(weak: true, to: "odd")
+ }
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-7-\347\274\251\347\225\245\350\257\215\350\241\250\347\255\211\346\263\250\351\207\212\350\241\250.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-7-\347\274\251\347\225\245\350\257\215\350\241\250\347\255\211\346\263\250\351\207\212\350\241\250.typ"
new file mode 100644
index 0000000000..e1fed3ac3a
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\345\211\215\347\275\256-7-\347\274\251\347\225\245\350\257\215\350\241\250\347\255\211\346\263\250\351\207\212\350\241\250.typ"
@@ -0,0 +1,17 @@
+#import "../consts.typ": *
+#import "../tools/term.typ": *
+
+#let 缩略词表等注释表(info: (:)) = [
+ // #pagebreak()
+ // #set align(center)
+ // #set heading(supplement: "术语表", numbering: none, outlined: false)
+ // = 术语表
+
+ // #set align(left)
+ // #print-glossary()
+
+ // #pagebreak(weak: true)
+ // #if info.at(info-keys.论文模式) == 论文模式.打印模式 {
+ // pagebreak(weak: true, to: "odd")
+ // }
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\346\255\243\346\226\207.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\346\255\243\346\226\207.typ"
new file mode 100644
index 0000000000..b3f7ff1cfc
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\346\255\243\346\226\207.typ"
@@ -0,0 +1,5 @@
+#import "../consts.typ": *
+
+#let 正文(info: (:), body) = [
+ #body
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-1-\350\207\264\350\260\242.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-1-\350\207\264\350\260\242.typ"
new file mode 100644
index 0000000000..b46a5578bc
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-1-\350\207\264\350\260\242.typ"
@@ -0,0 +1,13 @@
+#import "../consts.typ": *
+
+#let 致谢(info: (:)) = [
+ = 致谢
+ #if (info.at(info-keys.匿名)) {
+ "*****"
+ return
+ }
+ #if (info.at(info-keys.致谢) == none) {
+ return
+ }
+ #info.at(info-keys.致谢)
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-2-\345\217\202\350\200\203\346\226\207\347\214\256.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-2-\345\217\202\350\200\203\346\226\207\347\214\256.typ"
new file mode 100644
index 0000000000..d590c9d899
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-2-\345\217\202\350\200\203\346\226\207\347\214\256.typ"
@@ -0,0 +1,21 @@
+#import "../consts.typ": *
+#import "../utils/lib.typ": *
+
+#let 参考文献(info: (:)) = [
+ #if info.at(info-keys.参考文献) == none {
+ return
+ }
+
+ #set pagebreak(weak: true)
+
+ #let prefix-path = "../../../"
+ #let bibs = info.at(info-keys.参考文献)
+ #let path = if type(bibs) == str {
+ prefix-path + bibs
+ } else if type(bibs) == array {
+ bibs = bibs.map(item => { prefix-path + item })
+ }
+
+ #set text(size: font-size.五号)
+ #bilingual-bibliography(body: path, full: false)
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-3-\351\231\204\345\275\225.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-3-\351\231\204\345\275\225.typ"
new file mode 100644
index 0000000000..a7115e6126
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-3-\351\231\204\345\275\225.typ"
@@ -0,0 +1,10 @@
+#import "../consts.typ": *
+
+#let 附录(info: (:)) = [
+ #if info.at(info-keys.附录) == none {
+ return
+ }
+ #for item in info.at(info-keys.附录) {
+ item
+ }
+]
diff --git "a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-4-\346\224\273\350\257\273\345\255\246\344\275\215\346\234\237\351\227\264\345\217\226\345\276\227\346\210\220\346\236\234.typ" "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-4-\346\224\273\350\257\273\345\255\246\344\275\215\346\234\237\351\227\264\345\217\226\345\276\227\346\210\220\346\236\234.typ"
new file mode 100644
index 0000000000..71877f28be
--- /dev/null
+++ "b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/component/\347\273\223\345\260\276-4-\346\224\273\350\257\273\345\255\246\344\275\215\346\234\237\351\227\264\345\217\226\345\276\227\346\210\220\346\236\234.typ"
@@ -0,0 +1,61 @@
+#import "../consts.typ": *
+#import "../utils/lib.typ": *
+
+#let 攻读学位期间取得成果(info: (:)) = [
+ #if (info.at(info-keys.攻读学位期间取得成果) == none) {
+ return
+ }
+
+ #let title = "攻读"
+ #if info.at(info-keys.学位类型) == "专业型" {
+ title = title + "专业"
+ } else if info.at(info-keys.学位类型) == "学术型" {
+ title = title + "学术"
+ }
+ #if info.at(info-keys.申请学位级别) == "硕士" {
+ title = title + "硕士"
+ } else if info.at(info-keys.申请学位级别) == "博士" {
+ title = title + "博士"
+ }
+ #let title = title + "学位期间取得的成果"
+
+ #set par(first-line-indent: 0em)
+ #set enum(numbering: "[1]")
+
+ #let prefix-path = "../../../"
+ #let bibs = info.at(info-keys.成果列表).at(成果列表-keys.成果文件)
+ #let path = if type(bibs) == str {
+ prefix-path + bibs
+ } else if type(bibs) == array {
+ bibs = bibs.map(item => { prefix-path + item })
+ }
+ #show heading.where(level: 2): set heading(outlined: false)
+ #show heading.where(level: 3): set heading(outlined: false)
+ #show heading.where(level: 4): set heading(outlined: false)
+ #set text(size: font-size.五号)
+ = #title
+ #let style = "cite-style.csl"
+ #if (info.at(info-keys.匿名)) {
+ style = "cite-style-anonymous.csl"
+ }
+ #if not (
+ info.at(info-keys.成果列表).at(成果列表-keys.条目) == none
+ or info.at(info-keys.成果列表).at(成果列表-keys.条目).len() == 0
+ ) {
+ heading(level: 2, "发表论文")
+ achievement-list(
+ path,
+ title: title,
+ highlight-names: info.at(info-keys.成果列表).at(成果列表-keys.作者姓名),
+ // 2. 核心数据列表:(BibKey, 作者顺序, 注释)
+ // 顺序非常重要!列表显示的顺序将严格按照这里写的顺序排列
+ items: info.at(info-keys.成果列表).at(成果列表-keys.条目),
+ style: style,
+ )
+ }
+ #if (info.at(info-keys.匿名) and info.at(info-keys.成果列表).at(成果列表-keys.其他成果-匿名) != none) {
+ info.at(info-keys.成果列表).at(成果列表-keys.其他成果-匿名)
+ } else {
+ info.at(info-keys.成果列表).at(成果列表-keys.其他成果)
+ }
+]
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/consts.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/consts.typ
new file mode 100644
index 0000000000..a502ae6d0d
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/consts.typ
@@ -0,0 +1,132 @@
+// 论文排版模式枚举
+// 论文模式.修订模式: 用于审稿修订,revise 标记的内容会显示为红色
+// 论文模式.电子档定稿模式: 用于提交电子档定稿,revise 不标红,独创性声明页替换为扫描页
+// 论文模式.打印模式: 用于双面打印,奇数页起始,revise 不标红
+#let 论文模式 = (
+ 修订模式: "修订模式",
+ 电子档定稿模式: "电子档定稿模式",
+ 打印模式: "打印模式",
+)
+
+#let font-size = (
+ 初号: 42pt,
+ 小初: 36pt,
+ 一号: 26pt,
+ 小一: 24pt,
+ 二号: 22pt,
+ 小二: 18pt,
+ 三号: 16pt,
+ 小三: 15pt,
+ 四号: 14pt,
+ 中四: 13pt,
+ 小四: 12pt,
+ 五号: 10.5pt,
+ 小五: 9pt,
+ 六号: 7.5pt,
+ 小六: 6.5pt,
+ 七号: 5.5pt,
+ 小七: 5pt,
+)
+
+#let info-keys = (
+ DEBUG: "DEBUG",
+ // 一些模板信息
+ 宋体字体: "宋体字体",
+ 浮动表图标题页置底: "浮动表图标题页置底",
+ 黑体字体: "黑体字体",
+ 等宽字体: "等宽字体",
+ 加粗粗度: "加粗粗度",
+ 匿名: "匿名",
+ 论文模式: "论文模式",
+ /*
+ 封面参数
+ */
+ //
+ // 作者基本参数 会影响总体封面效果
+ //
+ 申请学位级别: "申请学位级别", // 学士、硕士、博士
+ 学位类型: "学位类型", // 学术型、专业型
+ //
+ // 封面
+ //
+ 论文中文标题: "论文中文标题",
+ 作者学科专业: "作者学科专业", // 学术型或学士填写
+ 作者专业学位类别: "作者专业学位类别", // 专业型填写
+ 作者学号: "作者学号",
+ 作者中文名: "作者中文名",
+ 指导老师中文名: "指导老师中文名",
+ 指导老师职称中文: "指导老师职称中文",
+ 作者学院: "作者学院",
+ //
+ // 中文扉页
+ //
+ 分类号: "分类号",
+ 密级: "密级",
+ UDC: "UDC",
+ // 标题与已经在封面中中定义
+ // 作者中文名已经在封面中定义
+ // 指导老师中文名已经在封面中定义
+ // 指导老师职称中文已经在封面中定义
+ 指导老师单位: "指导老师单位",
+ 合作导师中文名: "合作导师中文名",
+ 合作导师职称中文: "合作导师职称中文",
+ 合作导师单位: "合作导师单位",
+ // 申请学位级别已经在作者基本参数中定义
+ // 专业型: 专业学位类型 已经在封面中定义
+ // 学术型: 作者学科专业 已经在封面中定义
+ 专业学位领域: "专业学位领域", // 专业型填写
+ 提交日期: "提交日期",
+ 答辩日期: "答辩日期",
+ 学位授予单位: "学位授予单位",
+ 学位授予日期: "学位授予日期",
+ 答辩委员会主席: "答辩委员会主席",
+ 答辩委员会主席职称: "答辩委员会主席职称",
+ 评阅人: "评阅人",
+ //
+ // 英文扉页
+ //
+ 论文英文标题: "论文英文标题",
+ 作者学科专业英文: "作者学科专业英文", // 学术型填写
+ 作者专业学位类别英文: "作者专业学位类别英文", // 专业型填写
+ 作者英文名: "作者英文名",
+ 指导老师英文名: "指导老师英文名",
+ 指导老师职称英文: "指导老师职称英文",
+ 作者学院英文: "作者学院英文",
+ //
+ // 独创性声明页
+ //
+ 作者电子签名: "作者电子签名",
+ 导师电子签名: "导师电子签名",
+ 独创性声明时间: "独创性声明时间",
+ 独创性声明扫描页: "独创性声明扫描页",
+ /*
+ 论文内容信息
+ */
+ // 章节参数
+ 附录: "附录",
+ 致谢: "致谢",
+ 参考文献: "参考文献",
+ 成果列表: "成果列表",
+ 中文摘要: "中文摘要",
+ 中文摘要关键字: "中文摘要关键字",
+ 英文摘要: "英文摘要",
+ 英文摘要关键字: "英文摘要关键字",
+ 攻读学位期间取得成果: "攻读学位期间取得成果",
+)
+
+#let info-keys-private = (字体: "字体")
+
+#let default-info = (
+ //
+ info-keys.黑体字体: "",
+ info-keys.宋体字体: "",
+ info-keys.等宽字体: "",
+)
+
+#let 成果列表-keys = (
+ 成果文件: "成果文件",
+ 作者姓名: "作者姓名",
+ 条目: "条目",
+ 其他成果: "其他成果",
+ 其他成果-匿名: "其他成果-匿名",
+)
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/thesis.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/thesis.typ
new file mode 100644
index 0000000000..055613ed04
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/thesis.typ
@@ -0,0 +1,82 @@
+#import "component/lib.typ": *
+#import "utils/lib.typ": *
+#import "tools/lib.typ": *
+#import "consts.typ": *
+
+#let thesis(info: (:), body) = {
+ assert(sys.version >= version(0, 13, 0), message: "本模板支持的最小版本为 0.13.0, 当前版本为: " + str(sys.version))
+
+ let info = info-check(info: info)
+ let degree = info.at(info-keys.申请学位级别)
+ [#metadata(degree) <学位>]
+ [#metadata(info) ]
+ show: set-global-page.with()
+ show: set-font.with(info)
+ show: common-set.with(info)
+ show: 其他-space-set.with()
+ show: figure-env-set.with()
+ show: set-global-heading.with(info)
+ show: set-footnote.with()
+ show: set-ref.with()
+ show: set-equation.with()
+ show: set-theoretic.with()
+
+ 封面(info: info)
+ if degree != "学士" {
+ // 学士论文不需要这三页
+ 中文扉页(info: info)
+ 英文扉页(info: info)
+ 独创性声明和论文使用授权(info: info)
+ } else {
+ pagebreak()
+ }
+
+ // 此时到了摘要页,需要重置页码为 1
+ show: commen-space-set.with()
+ counter(page).update(1)
+ show: set-中文摘要-heading.with()
+ show: set-中文摘要-page.with()
+ 中文摘要(info: info)
+
+ show: set-英文摘要-heading.with()
+ show: set-英文摘要-page.with()
+ 英文摘要(info: info)
+
+ show: set-目录-heading.with()
+ show: set-目录-page.with()
+ 目录(info: info)
+
+ show: set-图目录-heading.with()
+ show: set-图目录-page.with()
+ 图目录(info: info)
+
+ show: set-表目录-heading.with()
+ show: set-表目录-page.with()
+ 表目录(info: info)
+
+ 缩略词表等注释表(info: info)
+
+ // 此时到了正文页,需要重置页码为 1
+ counter(page).update(1)
+ show: set-正文-heading.with()
+ show: set-正文-page.with()
+ 正文(info: info, body)
+
+ show: set-致谢-heading.with()
+ show: set-致谢-page.with()
+ 致谢(info: info)
+
+ show: set-参考文献-heading.with()
+ show: set-参考文献-page.with()
+ 参考文献(info: info)
+
+ // 附录页, 从附录A开始重新计数
+ counter(heading).update(0)
+ show: set-附录-heading.with()
+ show: set-附录-page.with()
+ 附录(info: info)
+
+ show: set-攻读学位期间获取成果-heading.with()
+ show: set-附录-page.with()
+ 攻读学位期间取得成果(info: info)
+}
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/README.md b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/README.md
new file mode 100644
index 0000000000..c867338a41
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/README.md
@@ -0,0 +1,16 @@
+# Tools
+因为Typst不够成熟, 所以需要手写一些工具. \
+但是为了以后方便替换成更成熟的工具, 这里单独抽象出来.
+
+# 工具列表
+## dict.typ
+关于操作Typst字典(KV表)的一些函数
+
+## fake-bold.typ
+默认宋体没有加粗功能, 所以手写一个加粗函数
+
+## figure-i.typ
+为图表添加编号的工具
+
+## fixed-witdh-content.typ
+一些固定长度的空格、文字、下划线等
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/dict.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/dict.typ
new file mode 100644
index 0000000000..533ed7292b
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/dict.typ
@@ -0,0 +1,7 @@
+#let check-and-insert(info, key, value) = {
+ assert(type(info) == dictionary, message: "info's type is " + str(type(info)))
+ if not (key in info) {
+ info.insert(key, value)
+ }
+ return info
+}
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/fake-bold-skew.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/fake-bold-skew.typ
new file mode 100644
index 0000000000..01f9a77baa
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/fake-bold-skew.typ
@@ -0,0 +1,24 @@
+// https://csimide.github.io/cuti-docs/zh-CN/
+#import "@preview/cuti:0.3.0": show-cn-fakebold
+
+#let regex-fakeitalic(reg-exp: ".+?", ang: -18.4deg, s) = {
+ show regex(reg-exp): it => {
+ box(skew(ax: ang, reflow: false, text(bottom-edge: 0pt)[#it]))
+ }
+ s
+}
+
+#let fakeitalic(
+ ang: -18.4deg,
+ s,
+) = regex-fakeitalic(
+ reg-exp: "[\p{script=Han}!-・〇-〰—]+",
+ ang: ang,
+ s,
+)
+
+#let set-font(info, body) = {
+ show: show-cn-fakebold.with()
+ show emph: it => fakeitalic(it)
+ body
+}
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/figure-i.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/figure-i.typ
new file mode 100644
index 0000000000..3c24c88218
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/figure-i.typ
@@ -0,0 +1,370 @@
+#import "../consts.typ": *
+#import "../utils/word_spacing.typ": above-leading-space, below-leading-space, 单倍行距
+#let figure-kind-code = "figure-kind-code"
+#let figure-kind-pic = "figure-kind-pic"
+#let figure-kind-tbl = "figure-kind-tbl"
+#let figure-kind-algo = "figure-kind-algorithm"
+#import "@preview/algorithmic:1.0.7": algorithm, iflike
+#import "@preview/algorithmic:1.0.7"
+
+#let figure-numering(_, kind: "figure", element: none, only-sub: false, step: false) = {
+ let loc = if element != none { element.location() } else { here() }
+ let chapter-num = str(counter(heading.where(level: 1)).at(loc).first())
+ if str(kind).starts-with("sub-") {
+ let num = figure-numering((), kind: str(kind).replace("sub-", ""), element: element)
+ let counter-name = "sub-" + kind + "-" + str(num)
+ if step {
+ counter(counter-name).step()
+ } else {
+ let sub-num = counter(counter-name).at(loc).first() + 1
+ if not only-sub {
+ num + " " + numbering("(a)", sub-num)
+ } else {
+ numbering("(a)", sub-num)
+ }
+ }
+ } else {
+ if step {
+ counter(kind + chapter-num).step()
+ } else {
+ let type-num = counter(kind + chapter-num).at(loc).first() + 1
+ numbering("1", counter(heading.where(level: 1)).at(loc).first()) + "-" + str(int(type-num))
+ }
+ }
+}
+
+#let count-step(kind) = {
+ figure-numering((), kind: kind, step: true)
+}
+
+#let get-counter-name(kind: "figure", element: none) = {
+ let num = figure-numering((), kind: kind, element: element)
+ let loc = if element != none { element.location() } else { here() }
+ let counter-name = "sub-" + kind + "-" + str(num)
+ let sub-num = counter(counter-name).at(loc).first() + 1
+ (sub-num, num, counter-name)
+}
+
+#let subfigure-numering(_, kind: "figure", element: none) = {
+ let num = get-counter-name(kind: kind, element: element).first()
+ numbering("(a)", num)
+}
+
+#let pic-numering = figure-numering.with(kind: figure-kind-pic, element: none)
+#let tbl-numering = figure-numering.with(kind: figure-kind-tbl, element: none)
+#let code-numering = figure-numering.with(kind: figure-kind-code, element: none)
+#let algo-numering = figure-numering.with(kind: figure-kind-algo, element: none)
+
+#let figure-env-set(body) = {
+ // subfigure
+ show grid: it => {
+ show figure: fig => {
+ if str(fig.kind).starts-with("sub-") {
+ fig
+ } else {
+ let new-kind = "sub-" + str(fig.kind)
+ let fields = fig.fields()
+ let body = fields.remove("body")
+ let counter = fields.remove("counter")
+ let kind = fields.remove("kind")
+ let label = fields.remove("label", default: none)
+ let bottom = 0pt
+ if fields.at("caption", default: none) != none {
+ bottom = 6pt
+ }
+ let meta = context {
+ metadata((
+ figure-location: fig.location(),
+ body-location: here(),
+ kind: new-kind,
+ ))
+ }
+ block(inset: (bottom: bottom))[
+ #figure(
+ meta + fig.body,
+ caption: fig.caption,
+ kind: new-kind,
+ supplement: fig.supplement,
+ numbering: figure-numering.with(kind: new-kind, only-sub: true),
+ placement: none,
+ outlined: false,
+ gap: fig.gap / 2,
+ )
+ ]
+ if fig.caption != none {
+ count-step(new-kind)
+ }
+ }
+ }
+ // 渲染 grid 本身
+ it
+ }
+ set block(breakable: true)
+
+ show figure.where(kind: figure-kind-tbl): set figure.caption(position: top)
+ show figure.caption: set text(size: font-size.五号)
+ show figure: set figure(gap: 6pt)
+ let figure-body(it) = {
+ set par(leading: above-leading-space())
+ it
+ }
+ show figure.where(kind: figure-kind-pic): set block(
+ above: above-leading-space(space: 6pt, word-space: 单倍行距),
+ below: below-leading-space(12pt),
+ )
+ show figure.where(kind: figure-kind-tbl): set block(
+ above: above-leading-space(space: 12pt, word-space: 单倍行距),
+ below: below-leading-space(6pt),
+ )
+
+ show figure.caption: it => {
+ let indent-width = measure(h(4em)).width
+ if str(it.kind).starts-with("sub-") {
+ indent-width = measure(h(1.5em)).width
+ }
+ layout(bounds => {
+ let full-caption = if it.numbering != none {
+ if it.body != [] {
+ [#it.supplement#it.counter.display(it.numbering)#h(0.5em)#it.body]
+ } else {
+ [#it.supplement#it.counter.display(it.numbering)]
+ }
+ } else {
+ it.body
+ }
+ let size = measure(full-caption)
+ if it.kind != figure-kind-algo {
+ if size.width > bounds.width - indent-width * 2 {
+ set par(justify: true, leading: above-leading-space())
+ box(
+ width: 100%,
+ inset: (x: indent-width), // 左右缩进
+ align(left, full-caption), // 两端对齐基于左对齐基础
+ )
+ } else {
+ set par(leading: above-leading-space())
+ set align(center)
+ full-caption
+ }
+ } else {
+ align(left)[
+ #h(2em)
+ #full-caption
+ ]
+ }
+ })
+ }
+
+ show figure: it => {
+ // 修复float布局figure页面不正确的问题:https://github.com/typst/typst/issues/4359
+
+ if it.outlined == true {
+ return it
+ }
+
+ if str(it.kind).starts-with("sub-") {
+ return it
+ }
+
+ let new-fig = none
+ let content = {
+ let fields = it.fields()
+ let body = fields.remove("body")
+ let _label = none
+ if fields.keys().contains("label") {
+ _label = fields.remove("label")
+ } else {
+ _label = figure-numering((), element: it, kind: it.kind)
+ }
+ let counter = fields.remove("counter")
+
+ let meta = context {
+ metadata((
+ figure-location: it.location(),
+ body-location: here(),
+ label: _label,
+ kind: it.kind,
+ ))
+
+ let info = query().first().value
+ let bottom_figure = info.at(info-keys.浮动表图标题页置底)
+
+ let page = here().page()
+ let h1-on-page = query(heading.where(level: 1)).any(h => h.location().page() == page)
+ let should-force-bottom = false
+ let next-state = should-force-bottom
+ if h1-on-page and bottom_figure {
+ next-state = true
+ }
+ let marker-lbl = label("marker-" + str(_label))
+ [#metadata(next-state) #marker-lbl]
+ }
+ // text(num) // Force counter evaluation.
+ if it.kind != figure-kind-algo {
+ meta
+ figure(body, ..fields, placement: none, outlined: true)
+ } else {
+ set block(breakable: false, below: below-leading-space(6pt), above: above-leading-space(space: 6pt))
+ let hlines = (grid.hline(stroke: 1.5pt), grid.hline(stroke: 0.75pt), grid.hline(stroke: 1.5pt))
+ let caption-align = start
+ let _ = fields.remove("caption")
+ let algo = figure(
+ meta
+ + grid(
+ columns: 1,
+ stroke: none,
+ gutter: 0pt,
+ inset: 0pt,
+ hlines.at(0),
+ pad(y: (0.7cm - 1em) / 2, align(caption-align, it.caption)),
+ hlines.at(1),
+ align(start, it.body),
+ hlines.at(2),
+ ),
+ ..fields,
+ placement: none,
+ outlined: true,
+ )
+ algo
+ }
+ count-step(it.kind)
+ }
+
+ if it.placement == none { return content }
+
+ let fields = it.fields()
+ let _label = fields.at("label", default: none)
+ if _label == none {
+ _label = figure-numering((), element: it, kind: it.kind)
+ }
+ let should-force-bottom = false
+ if _label != none {
+ let key-lbl = _label
+ let marker-lbl = label("marker-" + str(_label))
+ let history = query(marker-lbl)
+ if history.len() > 0 {
+ should-force-bottom = history.last().value
+ }
+ }
+ let placement = if should-force-bottom { bottom } else { it.placement }
+
+ // clearance目前不支持上下控制。这个实现不能捕捉auto,两张图放在一起的情况也不能完美处理。
+ let clearance = below-leading-space(12pt)
+ if it.kind == figure-kind-pic {
+ if placement == bottom {
+ clearance = above-leading-space(space: 6pt, word-space: 单倍行距)
+ }
+ }
+ if it.kind == figure-kind-tbl {
+ if placement == bottom {
+ clearance = above-leading-space(space: 12pt, word-space: 单倍行距)
+ }
+ if placement == top {
+ clearance = below-leading-space(6pt)
+ }
+ }
+ if it.kind == figure-kind-algo {
+ if placement == bottom {
+ clearance = above-leading-space(space: 6pt)
+ } else {
+ clearance = below-leading-space(6pt)
+ }
+ }
+
+ place(placement, float: true, clearance: clearance, scope: it.scope, block(width: 100%, content))
+ }
+ body
+}
+
+// #let set-placement
+
+#let table-figure(caption, table, placement: none) = {
+ figure(
+ [
+ #set text(size: font-size.五号)
+ #table],
+ caption: caption,
+ supplement: [表],
+ numbering: tbl-numering,
+ kind: figure-kind-tbl,
+ placement: placement,
+ outlined: false,
+ )
+}
+
+#let code-figure(caption, code, placement: none) = {
+ figure(
+ code,
+ caption: caption,
+ supplement: [代码],
+ numbering: code-numering,
+ kind: figure-kind-code,
+ placement: placement,
+ outlined: false,
+ )
+}
+
+#let picture-figure(caption, picture, placement: none) = {
+ figure(
+ picture,
+ caption: caption,
+ supplement: [图],
+ kind: figure-kind-pic,
+ numbering: pic-numering,
+ placement: placement,
+ outlined: false,
+ )
+}
+
+#let algorithm-figure(
+ caption,
+ ..bits,
+ placement: none,
+ supplement: text(font: "SimHei")[算法],
+ inset: 0.2em,
+ indent: 0.5em,
+ vstroke: 0pt,
+ line-numbers: true,
+ line-numbers-format: x => {
+ set align(right)
+ [#x:]
+ },
+ horizontal-offset: 1.63640em,
+) = {
+ return figure(
+ outlined: false,
+ supplement: supplement,
+ kind: figure-kind-algo,
+ placement: placement,
+ caption: strong(caption),
+ numbering: algo-numering,
+ [
+ #set text(size: font-size.五号)
+ #algorithm(
+ indent: indent,
+ inset: (
+ bottom: above-leading-space() / 2,
+ top: above-leading-space() / 2,
+ left: 0.2em,
+ right: 0.2em,
+ ),
+ vstroke: vstroke,
+ line-numbers: line-numbers,
+ line-numbers-format: line-numbers-format,
+ horizontal-offset: horizontal-offset,
+ ..bits,
+ )],
+ )
+}
+
+#let table = table.with(
+ stroke: none,
+ align: horizon + center,
+ rows: auto,
+ gutter: 0pt,
+ inset: (bottom: (0.6cm - 1em) / 2, top: (0.6cm - 1em) / 2),
+)
+
+#let toprule = table.hline.with(stroke: 1.5pt)
+#let bottomrule = table.hline.with(stroke: 1.5pt)
+#let midrule = table.hline.with(stroke: 0.75pt)
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/fixed-witdh-content.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/fixed-witdh-content.typ
new file mode 100644
index 0000000000..eed9089584
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/fixed-witdh-content.typ
@@ -0,0 +1,49 @@
+// 占 width 的宽度, 展开所有字符, 两端对其
+// [ 类 似 这 样 ]
+#let fixed-width-text-justified(width: auto, body) = {
+ if type(body) == str {
+ return box(width: width, stack(dir: ltr, ..body.clusters().map(x => [#x]).intersperse(1fr)))
+ }
+ return box(width: width, body)
+}
+
+// 占 width 的宽度画下划线, 其中包含一些字符
+// [ 类似这样 ]
+// _________________
+#let fixed-width-underline(width: auto, height: auto, body) = box(
+ width: width,
+ stroke: (bottom: 0.5pt),
+ outset: (bottom: 0.2em),
+ height: height,
+ {
+ // 这里设置行间距
+ // 默认 leading 大约是 0.65em
+ set par(leading: 0.5em)
+ body
+ }
+)
+
+// 占 width 的宽度, 其中包含一些字符
+// [ 类似这样 ]
+#let fixed-width-text(width: auto, body) = box(body, width: width, stroke: none, outset: 0pt)
+
+// 画 width 的宽度的空白
+// 类似这样 ↓
+// [ ]
+#let fixed-width-space(width) = box("", width: width)
+
+#let justified-text-with-underline(text-width, underline-width, text-content, underline-content) = {
+ block()[
+ #fixed-width-text-justified(width: text-width, text-content)
+ #h(0.5em)
+ #fixed-width-underline(width: underline-width, underline-content)
+ ]
+}
+
+#let fixed-text-with-underline(text-width, underline-width, text-content, underline-content) = {
+ block()[
+ #fixed-width-text(width: text-width, text-content)
+ #h(0.5em)
+ #fixed-width-underline(width: underline-width, underline-content)
+ ]
+}
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/lib.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/lib.typ
new file mode 100644
index 0000000000..e6bfe39566
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/lib.typ
@@ -0,0 +1,7 @@
+#import "dict.typ": check-and-insert
+#import "fake-bold-skew.typ": set-font
+#import "figure-i.typ": (
+ algorithm-figure, algorithmic, bottomrule, code-figure, figure-env-set, midrule, picture-figure, table, table-figure,
+ toprule,
+)
+#import "fixed-witdh-content.typ": *
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/term.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/term.typ
new file mode 100644
index 0000000000..9eee9a7136
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/tools/term.typ
@@ -0,0 +1,62 @@
+#let term-state = state("glossary-terms", ())
+
+// 函数:输入中文和英文,文中显示 "中文 (英文)" 并后台记录
+#let term(cn, en) = {
+ // 1. 在文中显示文本
+ cn + "(" + en + ")"
+
+ // 2. 获取当前位置并更新状态
+ context {
+ let loc = here() // 获取当前函数被调用时的位置对象
+
+ term-state.update(terms => {
+ // 检查是否已存在(只记录首次出现,因此如果存在则忽略)
+ if terms.any(t => t.cn == cn) {
+ terms
+ } else {
+ // 将中文、英文、以及当前的位置(loc)一起存入
+ terms.push((cn: cn, en: en, loc: loc))
+ terms
+ }
+ })
+ }
+}
+
+#let print-glossary() = {
+ context {
+ let terms = term-state.final()
+ // 按英文首字母排序
+ let sorted-terms = terms.sorted(key: t => lower(t.en))
+
+ if sorted-terms.len() == 0 {
+ [暂无术语记录。]
+ } else {
+ // 设置表格样式(这里用了典型的学术三线表风格)
+ table(
+ columns: (1fr, 2fr, auto), // 三列:中文、英文、页码
+ inset: 5pt,
+ align: (col, row) => (right, left, center).at(col),
+ stroke: (x, y) => {
+ if y == 0 { (bottom: 1pt) } // 表头下粗线
+ else { (bottom: 0.5pt + gray) } // 内容下细线
+ },
+
+ // 表头
+ [*中文名称*], [*英文全称*], [*首次出现*],
+
+ // 数据填充
+ ..sorted-terms.map(item => {
+ // 获取该位置的页码
+ let page-num = item.loc.page()
+
+ (
+ item.cn,
+ item.en,
+ // 创建一个链接,点击页码跳回原文位置
+ link(item.loc)[第 #page-num 页]
+ )
+ }).flatten()
+ )
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/bilingual-bibliography.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/bilingual-bibliography.typ
new file mode 100644
index 0000000000..87d0bace53
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/bilingual-bibliography.typ
@@ -0,0 +1,254 @@
+// ref: https://github.com/nju-lug/modern-nju-thesis/issues/3
+// ref: https://github.com/TideDra/seu-thesis-typst
+// ref: https://github.com/citation-style-language/styles/blob/master/china-national-standard-gb-t-7714-2015-numeric.csl
+// Author: csimide, OrangeX4
+// Tested only on GB-7714-2015-Numeric
+
+#let citation-replace(it,
+ allow-comma-in-name: false,
+ extra-comma-before-et-al-trans: false,
+ mapping: (:)) = {
+ mapping = (
+ (
+ //"等": "et al",
+ "卷": "Vol.",
+ "册": "Bk.",
+ // "译": ", tran",
+ // "等译": "et al. tran",
+ // 注: 请见下方译者数量判断部分。
+ )
+ + mapping
+ )
+
+ let to-string(content) = {
+ if content.has("text") {
+ content.text
+ } else if content.has("children") {
+ content.children.map(to-string).join("")
+ } else if content.has("child") {
+ to-string(content.child)
+ } else if content.has("body") {
+ to-string(content.body)
+ } else if content == [ ] {
+ " "
+ }
+ }
+ let ittext = to-string(it)
+ // 判断是否为中文文献:去除特定词组后,仍有至少两个连续汉字。
+ let pureittext = ittext.replace(regex("[等卷册和版本章期页篇译间者(不详)]"), "")
+ if pureittext.find(regex("\p{sc=Hani}{2,}")) != none {
+ ittext
+ } else {
+ // 若不是中文文献,进行替换
+ // 第xxx卷、第xxx册的情况:变为 Vol. XXX 或 Bk. XXX。
+ let reptext = ittext
+ reptext = reptext.replace(
+ regex("(第\s?)?\d+\s?[卷册]"),
+ itt => {
+ if itt.text.contains("卷") { "Vol. " } else { "Bk. " }
+ itt.text.find(regex("\d+"))
+ },
+ )
+
+ // 第xxx版/第xxx本的情况:变为 1st ed 格式。
+ reptext = reptext.replace(
+ regex("(第\s?)?\d+\s?[版本]"),
+ itt => {
+ let num = itt.text.find(regex("\d+"))
+ num
+ if num.clusters().len() == 2 and num.clusters().first() == "1" {
+ "th"
+ } else {
+ ("1": "st", "2": "nd", "3": "rd").at(num.clusters().last(), default: "th")
+ }
+ " ed"
+ },
+ )
+
+ // 译者数量判断:单数时需要用 trans,复数时需要用 tran 。
+ /*
+ 注:
+ 1. 目前判断译者数量的方法非常草率:有逗号就是多个作者。但是在部分 GB/T 7714-2015 方言中,姓名中可以含有逗号。如果使用的 CSL 是姓名中含有逗号的版本,请将 bilingual-bibliography 的 allow-comma-in-name 参数设为 true。
+ 2. 在 GB/T 7714-2015 原文中有 `等译`(P15 10.1.3 小节 示例 1-[1] 等),但未给出相应的英文缩写翻译。CSL 社区库内的 GB/T 7714-2015 会使用 `等, 译` 和 `et al., tran` 的写法。为使中英文与标准原文写法一致,本小工具会译作 `et al. tran`。若需要添加逗号,请将 bilingual-bibliography 的 extra-comma-before-et-al-trans 参数设为 true。
+ 3. GB/T 7714-2015 P8 7.2 小节规定:“译”前需加逗号。因此单个作者的情形,“译” 会被替换为 ", trans"。与“等”并用时的情况请见上一条注。
+ 如果工作不正常,可以考虑换为简单关键词替换,即注释这段情况,取消 13 行 mapping 内 `译` 条目的注释。
+ */
+ reptext = reptext.replace(
+ regex("\].+?译"),
+ itt => {
+ // 我想让上面这一行匹配变成非贪婪的,但加问号后没啥效果?
+ let comma-in-itt = itt.text.replace(regex(",?\s?译"), "").matches(",")
+ if (type(comma-in-itt) == array and comma-in-itt.len() >= (if allow-comma-in-name { 2 } else { 1 })) {
+ if extra-comma-before-et-al-trans {
+ itt.text.replace(regex(",?\s?译"), ", tran")
+ } else {
+ itt.text.replace(regex(",?\s?译"), " tran")
+ }
+ } else {
+ itt.text.replace(regex(",?\s?译"), ", trans")
+ }
+ },
+ )
+
+ // `等` 特殊处理:`等`后方接内容也需要译作 `et al.`,如 `等译` 需要翻译为 `et al. trans`
+ reptext = reptext.replace(
+ regex("等."),
+ itt => {
+ "et al."
+ // 如果原文就是 `等.`,则仅需简单替换,不需要额外处理
+ // 如果原文 `等` 后没有跟随英文标点,则需要补充一个空格
+ if not itt.text.last() in (".", ",", ";", ":", "[", "]", "/", "\\", "<", ">", "?", "(", ")", " ", "\"", "'") {
+ " "
+ }
+ // 原文有英文句号时不需要重复句号,否则需要将匹配到的最后一个字符吐回来
+ if not itt.text.last() == "." { itt.text.last() }
+ },
+ )
+
+ // 其他情况:直接替换
+ reptext = reptext.replace(
+ regex("\p{sc=Hani}+"),
+ itt => {
+ mapping.at(itt.text, default: itt.text)
+ // 注意:若替换功能工作良好,应该不会出现 `default` 情形
+ },
+ )
+ reptext
+ }
+}
+
+#let bilingual-bibliography(
+ body: none,
+ title: "参考文献",
+ full: false,
+ // style: "gb-7714-2015-numeric",
+ style: "cite-style.csl",
+ mapping: (:),
+ extra-comma-before-et-al-trans: false,
+ // 用于控制多位译者时表现为 `et al. tran`(false) 还是 `et al., tran`(true)
+ allow-comma-in-name: false,
+ // 如果使用的 CSL 中,英文姓名中会出现逗号,请设置为 true
+) = {
+
+ show grid.cell.where(x: 1): it => {
+ citation-replace(it, mapping: mapping, allow-comma-in-name: allow-comma-in-name,
+ extra-comma-before-et-al-trans: extra-comma-before-et-al-trans)
+ }
+
+ set text(lang: "zh")
+ bibliography(body, title: title, full: full, style: style)
+}
+
+#let achievement-list(
+ bib-path,
+ title: none,
+ items: (),
+ highlight-names: (),
+ mapping: (:),
+ style: "cite-style.csl"
+) = {
+ // 1. 预处理
+ import "@preview/alexandria:0.2.2": *
+ show: alexandria(prefix: "__your_work__:", read: path => read(path))
+ items = if type(items.at(0)) == array { items } else { (items,) }
+ let citations = items.map(it => cite(label("__your_work__:" + str(it.at(0))))).join()
+ let entry-counter = counter("achievement-entry")
+ entry-counter.update(0)
+ let highlight-names = if type(highlight-names) == array {
+ highlight-names
+ } else {
+ (highlight-names,)
+ }
+ // 4. 核心拦截逻辑
+ show grid.cell.where(x: 1): it => {
+ // 计数器步进 (这是 State 更新,必须在 Context 外面)
+ entry-counter.step()
+
+ // 【关键修改】:从这里开始进入 context,直到返回最终内容
+ // 所有依赖 idx 的逻辑都在这个大括号里完成
+ context {
+ // 获取索引
+ let idx = entry-counter.get().first() - 1
+ // 获取数据 (现在是在 context 内部,可以直接拿到 array)
+ let item-data = if idx < items.len() { items.at(idx) } else { none }
+
+ // --- 字符串清洗逻辑 ---
+ let reptext = citation-replace(it)
+ // -------------------
+
+ let highlighted-body = {
+ // 1. 转义特殊字符
+ let escape-regex(s) = s.replace(regex("[.\\+*?^$()\[\]{}|]"), m => "\\" + m.text)
+
+ // 2. 准备名字列表 (长度降序)
+ let sorted-names = highlight-names.sorted(key: it => it.len()).rev()
+
+ if sorted-names.len() > 0 {
+ // 3. 构建正则对象 (必须使用 regex() 包裹)
+ let names-pattern = sorted-names.map(escape-regex).join("|")
+ // 捕获组: (1:前缀) (2:名字) (3:后缀)
+ let re = regex("(^|\s)(" + names-pattern + ")(,|\.)")
+
+ // 4. 使用 matches 获取所有匹配,然后取第一个
+ // 这样能确保我们拿到的是 match 对象而不是 int 或 string
+ let all-matches = reptext.matches(re)
+
+ if all-matches.len() > 0 {
+ let m = all-matches.first() // 只取第一个匹配
+
+ // 5. 使用 match 对象的属性进行切片
+ let pre-text = reptext.slice(0, m.start)
+ let post-text = reptext.slice(m.end, reptext.len())
+
+ let caps = m.captures
+ let prefix = caps.at(0) // 对应的 (^|\s)
+ let name = caps.at(1) // 对应的 名字
+ let suffix = caps.at(2) // 对应的 (,|.)
+
+ // 6. 拼接:[前文] [前缀] [**名字**] [后缀] [后文]
+ [#pre-text#prefix#strong(name)#suffix#post-text]
+ } else {
+ reptext // 无匹配
+ }
+ } else {
+ reptext // 列表为空
+ }
+ }
+ // ===========================
+
+ // 拼接成果信息 (rank, comment)
+ let final-content = if item-data != none {
+ // 1. 提取额外信息:去掉第一个元素(BibKey),获取剩余所有项
+ // slice(1) 表示从第2个元素一直取到最后
+ let extras = item-data.slice(1)
+
+ // 2. 过滤空值并拼接
+ // filter: 去掉空字符串或none
+ // join: 用中文逗号连接所有非空项
+ let append-str = extras.filter(it => it != none and it != "").join(",")
+
+ // 3. 最终组合
+ // 如果有附加信息,在引用文本后加 1em 空格,然后加粗显示附加信息
+ if append-str != "" {
+ [#highlighted-body#h(1em)#strong(append-str)]
+ } else {
+ highlighted-body
+ }
+ } else {
+ highlighted-body
+ }
+
+ // 返回最终内容
+ final-content
+ }
+ }
+ // 5. 生成参考文献列表
+
+ box[#bibliographyx(
+ bib-path,
+ title: none,
+ style: style,
+ prefix: "__your_work__:"
+ )]
+ place(hide(citations))
+}
\ No newline at end of file
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/cite-style-anonymous.csl b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/cite-style-anonymous.csl
new file mode 100644
index 0000000000..d1c88df380
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/cite-style-anonymous.csl
@@ -0,0 +1,467 @@
+
+
\ No newline at end of file
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/cite-style.csl b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/cite-style.csl
new file mode 100644
index 0000000000..72bfb21b8c
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/cite-style.csl
@@ -0,0 +1,467 @@
+
+
\ No newline at end of file
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/common.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/common.typ
new file mode 100644
index 0000000000..1ac2c29066
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/common.typ
@@ -0,0 +1,55 @@
+#import "info.typ": *
+#import "font.typ": *
+#import "word_spacing.typ": above-leading-space, below-leading-space
+#import "@preview/cjk-spacer:0.2.0": cjk-spacer
+
+#let common-set(info, body) = {
+ set par(first-line-indent: (amount: 2em, all: true), justify: true)
+ set text(region: "cn", lang: "zh", font: info.at(info-keys-private.字体).宋体, size: font-size.小四)
+ // set text(top-edge: "ascender", bottom-edge: "descender")
+ set text(top-edge: 0.8em, bottom-edge: -0.2em)
+ set strong(delta: info.at(info-keys.加粗粗度))
+ set list(indent: 2em, body-indent: 0.7em)
+ set enum(indent: 2em, body-indent: 0.5em)
+ show: cjk-spacer
+ body
+}
+
+#let commen-space-set(body) = {
+ set par(
+ first-line-indent: (amount: 2em, all: true),
+ justify: true,
+ leading: above-leading-space(),
+ spacing: above-leading-space(),
+ )
+ body
+}
+
+#let 其他-space-set(body) = {
+ set par(leading: 1em, spacing: 1em, justify: true)
+ body
+}
+
+#let noindent = context h(-par.first-line-indent.amount)
+
+// 标记论文修改内容
+// 通过 thesis 中注入的 元数据读取论文模式
+// 仅在「修订模式」下将内容标红,其余模式(电子档定稿模式、打印模式)原样显示
+// 用法: #revise[修改的内容]
+#let revise(body) = context {
+ let infos = query()
+ // infos.len() > 0是因为info包含abstract,而在abstract里面可能会调用revise,此时info是空的,所以默认不标红,然后下次编译再重新设置
+ let silent = if infos.len() > 0 {
+ infos.first().value.at(info-keys.论文模式) != 论文模式.修订模式
+ } else {
+ true
+ }
+ if silent {
+ body
+ } else {
+ [
+ #set text(fill: red)
+ #body
+ ]
+ }
+}
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/equation.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/equation.typ
new file mode 100644
index 0000000000..4d13dd40b9
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/equation.typ
@@ -0,0 +1,247 @@
+#import "../utils/word_spacing.typ": above-leading-space, below-leading-space, 单倍行距
+#import "../consts.typ": *
+#import "@preview/theoretic:0.2.0" as theoretic: fmt-body, proof, theorem
+
+#let equation-code = "equation-code"
+
+#let equation-numering(nums, element: none) = {
+ let chapter-num = counter(heading.where(level: 1)).display()
+ let loc = if element != none { element.location() } else { here() }
+ let type-num = counter(equation-code + chapter-num).at(loc).first()
+ let num-str = (
+ "(" + numbering("1", counter(heading.where(level: 1)).get().first()) + "-" + str(int(type-num) + 1) + ")"
+ )
+ num-str
+}
+
+#let equation-numering-step() = {
+ let chapter-num = counter(heading.where(level: 1)).display()
+ counter(equation-code + chapter-num).step()
+}
+
+#let frac-depth = state("frac-depth", 0)
+#let cases-depth = state("cases-depth", 0)
+
+#let set-equation(body) = {
+ set math.equation(
+ numbering: equation-numering,
+ supplement: [式],
+ number-align: horizon,
+ )
+
+ // 嵌套分数处理. 首层分数不缩小字体。attach里的base不缩小字体。
+ show math.attach: it => {
+ if it.has("label") and it.label == <__stop__> {
+ return it
+ }
+ let fields = it.fields()
+ let base = fields.remove("base")
+ for key in ("t", "b", "tl", "bl", "tr", "br") {
+ if key in fields and fields.at(key) != none {
+ fields.insert(key, {
+ frac-depth.update(d => d + 999)
+ fields.at(key, default: none)
+ frac-depth.update(d => d - 999)
+ })
+ }
+ }
+ [#math.attach(base, ..fields) <__stop__>]
+ }
+
+ set math.cases(gap: 0.6em)
+ show math.cases: it => {
+ if it.has("label") and it.label == <__stop__> {
+ return it
+ }
+ let fields = it.fields()
+ let children = fields.remove("children")
+ children = children.map(item => {
+ cases-depth.update(d => d + 1)
+ item
+ cases-depth.update(d => d - 1)
+ })
+ let tagged-display = [#math.cases(..children, ..fields) <__stop__>]
+ context {
+ let depth = cases-depth.get()
+ if depth < 1 {
+ math.display(tagged-display)
+ } else {
+ it
+ }
+ }
+ }
+
+ show math.equation.where(block: true): it => {
+ show math.frac: it => {
+ if it.has("label") and it.label == <__stop__> {
+ return it
+ }
+ let nested-num = {
+ frac-depth.update(d => d + 1)
+ it.num
+ frac-depth.update(d => d - 1)
+ }
+
+ let nested-denom = {
+ frac-depth.update(d => d + 1)
+ it.denom
+ frac-depth.update(d => d - 1)
+ }
+ let tagged-frac = [#math.frac(nested-num, nested-denom, style: it.style) <__stop__>]
+
+ context {
+ let depth = frac-depth.get()
+ if depth < 1 {
+ math.display(tagged-frac)
+ } else {
+ tagged-frac
+ }
+ }
+ }
+
+ let formatting = math.equation(numbering: none, it.body)
+ set text(size: font-size.小四)
+
+ let eqNumbering = none
+ // if it.has("label"){
+ let eqCounter = counter(math.equation).at(it.location())
+ equation-numering-step()
+ eqNumbering = numbering(it.numbering, ..eqCounter)
+ // }
+
+ // 设置公式内部行距 (防止切断积分号)
+ set par(leading: 单倍行距)
+
+ block(
+ width: 100%,
+ inset: 0pt, // 确保没有额外内边距
+ above: above-leading-space(space: 7pt, word-space: 单倍行距),
+ below: below-leading-space(4pt),
+ // stroke: 0.5pt,
+ grid(
+ columns: (1fr, auto, 1fr),
+ [],
+ align(horizon)[
+ // #set text(top-edge: "cap-height", bottom-edge: "baseline")
+ #set text(top-edge: "bounds", bottom-edge: "bounds")
+ // #set par(leading: 20pt)
+ #formatting
+ ],
+ align(right + horizon)[#eqNumbering],
+ ),
+ )
+ }
+ body
+}
+
+#let theorem-supplement = text(font: "SimHei")[定理]
+#let lemma-supplement = text(font: "SimHei")[引理]
+#let proof-supplement = text(font: "SimHei")[证明]
+
+#let numbering-theorem(kind: none, step: false, ref: none) = {
+ let loc = if ref != none { ref } else { here() }
+ let n = counter(heading.where(level: 1)).at(loc).first()
+ let thm-counter = counter("_thm" + str(n))
+ let name-counter = if kind != none { kind + str(n) } else { "_thm" + str(n) }
+ if step {
+ counter(name-counter).step()
+ }
+ let count = counter(name-counter).at(loc).first() + 1
+ let num = numbering("1", n) + "." + str(count)
+ num
+}
+
+#let new-fmt-body(body, solution) = {
+ [
+ #let body-content = body
+ #if body.has("children") and body.children.first() == [#parbreak()] {
+ // 3. 切片:跳过第 0 个,取从第 1 个开始的所有元素,然后 join 重新拼接成 content
+ body-content = body.children.slice(1).join()
+ }
+ #fmt-body(body-content, solution)
+ #parbreak()
+ ]
+}
+
+#let theorem = theorem.with(
+ fmt-prefix: (s, n, t) => {
+ let num = numbering-theorem(kind: s.child.text, step: true)
+ text[#s#num]
+ if t != none {
+ h(2pt)
+ }
+ h(0.5em)
+ },
+ fmt-body: new-fmt-body,
+ supplement: theorem-supplement,
+ kind: "theorem",
+ toctitle: false,
+)
+
+#let lemma = theorem.with(
+ supplement: lemma-supplement,
+ kind: "lemma",
+)
+
+#let proof = proof.with(
+ fmt-prefix: (s, n, t) => {
+ {
+ if t != none {
+ let ele = query(t.target)
+ let num = numbering-theorem(kind: ele.first().value.supplement.child.text, step: false, ref: t.target)
+ t = link(ele.first().location())[#ele.first().value.supplement#num]
+ }
+
+ if t != none [#t]
+ s
+ if n != none [ #n]
+ h(0.5em)
+ }
+ },
+ fmt-suffix: () => [#h(1fr)$qed$],
+ fmt-body: new-fmt-body,
+ supplement: proof-supplement,
+)
+
+#let show-ref(
+ it,
+) = {
+ let el = it.element
+ if (
+ el != none
+ and el.func() == metadata
+ and type(el.value) == dictionary
+ and el.value.at("theorem-kind", default: none) != none
+ ) {
+ let ele = query(it.target)
+
+ if ele.first().value.theorem-kind == "proof" {
+ assert(ele.first().value.title != none, message: "证明的引用必须有标题")
+ if ele.first().value.title != none {
+ let title-ref = ele.first().value.title.target
+ let title-ele = query(title-ref)
+ let num = numbering-theorem(
+ kind: title-ele.first().value.supplement.child.text,
+ step: false,
+ ref: title-ref,
+ )
+ link(ele.first().location())[#title-ele.first().value.supplement#num#ele.first().value.supplement]
+ }
+ } else {
+ let num = numbering-theorem(
+ kind: ele.first().value.supplement.child.text,
+ step: false,
+ ref: it.target,
+ )
+ link(ele.first().location())[#ele.first().value.supplement#num]
+ }
+ } else {
+ // Other references as usual.
+ it
+ }
+}
+
+#let set-theoretic(body) = {
+ show ref: show-ref
+ body
+}
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/font.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/font.typ
new file mode 100644
index 0000000000..8de6f24d41
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/font.typ
@@ -0,0 +1,13 @@
+#import "info.typ": *
+
+#let get-song-font(info) = {
+ return info.at(info-keys-private.字体).宋体
+}
+
+#let get-hei-font(info) = {
+ return info.at(info-keys-private.字体).黑体
+}
+
+#let get-mono-font(info) = {
+ return info.at(info-keys-private.字体).等宽
+}
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/footnote.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/footnote.typ
new file mode 100644
index 0000000000..639eacd2fe
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/footnote.typ
@@ -0,0 +1,15 @@
+#import "info.typ": *
+#import "font.typ": *
+#import "word_spacing.typ": 单倍行距
+
+#let set-footnote(body) = {
+ set footnote(numbering: "①")
+ set footnote.entry(indent: 0em, clearance: 12pt, gap: 单倍行距, separator: line(length: 30%, stroke: 0.5pt) + v(0.3em))
+ show footnote.entry: it => {
+ set text(size: font-size.小五)
+ set par(hanging-indent: 1.5em, first-line-indent: 0em, leading: 单倍行距, spacing: 单倍行距)
+ let loc = it.note.location()
+ par(numbering(it.note.numbering, ..counter(footnote).at(loc)) + h(0.5em) + it.note.body)
+ }
+ body
+}
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/heading.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/heading.typ
new file mode 100644
index 0000000000..47cd9c0e07
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/heading.typ
@@ -0,0 +1,216 @@
+#import "../tools/lib.typ": *
+#import "info.typ": *
+#import "font.typ": *
+#import "word_spacing.typ": (
+ above-leading-space, below-leading-space, heading-1, heading-2, heading-3, heading-4, word-below-leading-space,
+ word-leading-space,
+)
+
+#let supplement-中文摘要 = "中文摘要"
+#let supplement-英文摘要 = "英文摘要"
+#let supplement-目录 = "目录"
+#let supplement-图目录 = "图目录"
+#let supplement-表目录 = "表目录"
+#let supplement-正文 = "正文"
+#let supplement-致谢 = "致谢"
+#let supplement-附录 = "附录"
+#let supplement-参考文献 = "参考文献"
+#let supplement-攻读学位期间取得成果 = "攻读学位期间取得成果"
+
+// --- 定义状态变量 ---
+#let last-heading-level = state("last-heading-info", (level: 0, excess: 0pt))
+
+#let set-global-heading(info, body) = {
+ // --- 1. 状态重置机制 ---
+ // 遇到正文、图表、公式时,标记"上一个元素不是标题"
+ show par: it => {
+ last-heading-level.update((level: 0, excess: 0pt))
+ it
+ }
+ show figure: it => {
+ last-heading-level.update((level: 0, excess: 0pt))
+ it
+ }
+ show math.equation.where(block: true): it => {
+ last-heading-level.update((level: 0, excess: 0pt))
+ it
+ }
+ show list: it => {
+ last-heading-level.update((level: 0, excess: 0pt))
+ it
+ }
+ show enum: it => {
+ last-heading-level.update((level: 0, excess: 0pt))
+ it
+ }
+
+ // --- 2. 一级标题 (通常强制分页,只需更新状态) ---
+ show heading.where(level: 1): it => context {
+ // 一级标题强制分页,不需要判断 above 为 0,但需要更新状态供二级标题检测
+ pagebreak(weak: false)
+ last-heading-level.update((level: 1, excess: heading-1.below - below-leading-space(heading-1.below)))
+
+ set text(size: font-size.小三, font: get-hei-font(info))
+ set align(center)
+ if it.numbering != none {
+ block(
+ width: 100%,
+ above: heading-1.above,
+ below: below-leading-space(heading-1.below),
+ sticky: true,
+ inset: (top: heading-1.above),
+ )[
+ #counter(heading).display(it.numbering)#h(0.5em)#it.body
+ ]
+ } else {
+ v(heading-1.above)
+ it
+ v(heading-1.below)
+ }
+ }
+
+ // --- 3. 二级标题 (需要判断是否紧跟一级标题) ---
+ show heading.where(level: 2): it => context {
+ let prev-level = last-heading-level.get().level
+ // 如果上一个是标题,则段前为 0;否则使用默认值
+ let spacing-above = if prev-level > 0 { 0pt } else { above-leading-space(space: heading-2.above) }
+
+ // 渲染前先更新状态 (放在 block 后面也行,但 context 内通常顺序执行)
+ last-heading-level.update((level: 2, excess: heading-2.below - below-leading-space(heading-2.below)))
+
+ set align(left)
+ set text(size: font-size.四号, font: get-hei-font(info))
+
+ if last-heading-level.get().excess != 0pt {
+ v(last-heading-level.get().excess + above-leading-space())
+ }
+ block(
+ width: 100%,
+ above: spacing-above, // <--- 应用动态间距
+ sticky: true,
+ below: below-leading-space(heading-2.below),
+ )[
+ #if it.numbering == none {
+ [#it.body]
+ } else {
+ [#counter(heading).display(it.numbering)#h(0.5em)#it.body]
+ }
+ ]
+ }
+
+ // --- 4. 三级标题 (需要判断是否紧跟二级标题) ---
+ show heading.where(level: 3): it => context {
+ let prev-level = last-heading-level.get().level
+ let spacing-above = if prev-level > 0 { 0pt } else { above-leading-space(space: heading-3.above) }
+
+ last-heading-level.update((level: 3, excess: heading-3.below - below-leading-space(heading-3.below)))
+
+ set align(left)
+ set text(size: font-size.四号, font: get-hei-font(info))
+ if last-heading-level.get().excess != 0pt {
+ v(last-heading-level.get().excess + above-leading-space())
+ }
+ block(
+ width: 100%,
+ above: spacing-above, // <--- 应用动态间距
+ sticky: true,
+ below: below-leading-space(heading-3.below),
+ )[
+ #counter(heading).display(it.numbering)#h(0.5em)#it.body
+ ]
+ }
+
+ // --- 5. 四级标题 ---
+ show heading.where(level: 4): it => context {
+ let prev-level = last-heading-level.get().level
+ let spacing-above = if prev-level > 0 { 0pt } else { above-leading-space(space: heading-4.above) }
+
+ last-heading-level.update((level: 4, excess: heading-4.below - below-leading-space(heading-4.below)))
+
+ set align(left)
+ set text(size: font-size.小四, font: get-hei-font(info))
+ if last-heading-level.get().excess != 0pt {
+ v(last-heading-level.get().excess + above-leading-space())
+ }
+ block(
+ width: 100%,
+ above: spacing-above, // <--- 应用动态间距
+ sticky: true,
+ below: below-leading-space(heading-4.below),
+ )[
+ #counter(heading).display(it.numbering)#h(0.5em)#it.body
+ ]
+ }
+
+ body
+}
+
+#let set-中文摘要-heading(body) = {
+ set heading(supplement: supplement-中文摘要, numbering: none, outlined: false)
+ body
+}
+
+#let set-英文摘要-heading(body) = {
+ set heading(supplement: supplement-英文摘要, numbering: none, outlined: false)
+ body
+}
+
+#let set-目录-heading(body) = {
+ set heading(supplement: supplement-目录, numbering: none, outlined: false)
+ body
+}
+
+#let set-图目录-heading(body) = {
+ set heading(supplement: supplement-图目录, numbering: none, outlined: false)
+ body
+}
+
+#let set-表目录-heading(body) = {
+ set heading(supplement: supplement-表目录, numbering: none, outlined: false)
+ body
+}
+
+#let set-正文-heading(body) = {
+ set heading(supplement: supplement-正文, outlined: true)
+ set heading(
+ numbering: (..nums) => {
+ let n = nums.pos().len()
+ if n == 1 {
+ numbering("第一章", ..nums)
+ } else {
+ numbering("1.1.1.1", ..nums)
+ }
+ },
+ )
+ body
+}
+
+#let set-致谢-heading(body) = {
+ set heading(supplement: supplement-致谢, numbering: none, outlined: true)
+ body
+}
+
+#let set-附录-heading(body) = {
+ set heading(supplement: supplement-附录, outlined: true)
+ set heading(
+ numbering: (..nums) => {
+ let n = nums.pos().len()
+ if n == 1 {
+ numbering("附录A", ..nums)
+ } else {
+ numbering("1.1.1", ..nums)
+ }
+ },
+ )
+ body
+}
+
+#let set-参考文献-heading(body) = {
+ set heading(supplement: supplement-参考文献, numbering: none, outlined: true)
+ body
+}
+
+#let set-攻读学位期间获取成果-heading(body) = {
+ set heading(supplement: supplement-参考文献, numbering: none, outlined: true)
+ body
+}
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/info.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/info.typ
new file mode 100644
index 0000000000..3489d0e44d
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/info.typ
@@ -0,0 +1,125 @@
+#import "../consts.typ": *
+#import "../tools/lib.typ": *
+
+#let info-default-kv = (
+ info-keys.DEBUG: false,
+ info-keys.宋体字体: default-info.at(info-keys.宋体字体),
+ info-keys.黑体字体: default-info.at(info-keys.黑体字体),
+ info-keys.等宽字体: default-info.at(info-keys.等宽字体),
+ info-keys.加粗粗度: 500,
+ info-keys.匿名: false,
+ info-keys.论文模式: 论文模式.打印模式,
+ /*
+ 封面参数
+ */
+ //
+ // 作者基本参数 会影响总体封面效果
+ //
+ info-keys.申请学位级别: "硕士", // 硕士、博士
+ info-keys.学位类型: "专业型", // 学术型、专业型
+ //
+ // 封面
+ //
+ info-keys.论文中文标题: "论文中文标题",
+ info-keys.作者学科专业: "作者学科专业", // 学术型填写
+ info-keys.作者专业学位类别: "作者专业学位类别", // 专业型填写
+ info-keys.作者学号: "作者学号",
+ info-keys.作者中文名: "作者中文名",
+ info-keys.指导老师中文名: "指导老师中文名",
+ info-keys.指导老师职称中文: "指导老师职称中文",
+ info-keys.作者学院: "作者学院",
+ //
+ // 中文扉页
+ //
+ info-keys.分类号: "TP309.2",
+ info-keys.密级: "公开",
+ info-keys.UDC: "004.78",
+ // 标题与已经在封面中中定义
+ // 作者中文名已经在封面中定义
+ // 指导老师中文名已经在封面中定义
+ // 指导老师职称中文已经在封面中定义
+ info-keys.指导老师单位: "指导老师单位",
+ info-keys.合作导师中文名: "合作导师中文名",
+ info-keys.合作导师职称中文: "合作导师职称中文",
+ info-keys.合作导师单位: "合作导师单位",
+ // 申请学位级别已经在作者基本参数中定义
+ // 专业型: 专业学位类型 已经在封面中定义
+ // 学术型: 作者学科专业 已经在封面中定义
+ info-keys.专业学位领域: "专业学位领域", // 专业型填写
+ info-keys.提交日期: "提交日期",
+ info-keys.答辩日期: "答辩日期",
+ info-keys.学位授予单位: "学位授予单位",
+ info-keys.学位授予日期: "学位授予日期",
+ info-keys.答辩委员会主席: "答辩委员会主席",
+ info-keys.答辩委员会主席职称: "答辩委员会主席职称",
+ info-keys.评阅人: ("评阅人",),
+ //
+ // 英文扉页
+ //
+ info-keys.论文英文标题: "论文英文标题",
+ info-keys.作者学科专业英文: "作者学科专业英文", // 学术型填写
+ info-keys.作者专业学位类别英文: "作者专业学位类别英文", // 专业型填写
+ info-keys.作者英文名: "作者英文名",
+ info-keys.指导老师英文名: "指导老师英文名",
+ info-keys.指导老师职称英文: "指导老师职称英文",
+ info-keys.作者学院英文: "作者学院英文",
+ /*
+ 论文内容信息
+ */
+ // 章节参数
+ info-keys.附录: none,
+ info-keys.致谢: none,
+ info-keys.参考文献: none,
+ info-keys.中文摘要: none,
+ info-keys.中文摘要关键字: none,
+ info-keys.英文摘要: none,
+ info-keys.英文摘要关键字: none,
+ info-keys.攻读学位期间取得成果: none,
+ info-keys.浮动表图标题页置底: true,
+)
+
+#let set-font-info(宋体字体: "", 黑体字体: "", 等宽字体: "") = {
+ return (
+ 宋体: ("Times New Roman", (name: 宋体字体, covers: "latin-in-cjk")),
+ 黑体: ("Times New Roman", (name: 黑体字体, covers: "latin-in-cjk")),
+ 等宽: (等宽字体),
+ )
+}
+
+#let info-check(info: (:)) = {
+ let info = info
+ for (key, value) in info-default-kv.pairs() {
+ info = check-and-insert(info, key, value)
+ }
+
+ info.insert(
+ info-keys-private.字体,
+ set-font-info(
+ 宋体字体: info.at(info-keys.宋体字体),
+ 黑体字体: info.at(info-keys.黑体字体),
+ 等宽字体: info.at(info-keys.等宽字体),
+ ),
+ )
+
+ if info.at(info-keys.匿名) {
+ info.insert(info-keys.作者中文名, "*****")
+ info.insert(info-keys.作者英文名, "*****")
+ info.insert(info-keys.作者学号, "*****")
+ // info.insert(info-keys.作者学院, "*****")
+ // info.insert(info-keys.作者学院英文, "*****")
+ // info.insert(info-keys.作者专业学位类别, "*****")
+ // info.insert(info-keys.作者专业学位类别英文, "*****")
+ // info.insert(info-keys.申请学位级别, "")
+ // info.insert(info-keys.专业学位领域, "*****")
+
+ info.insert(info-keys.指导老师中文名, "*****")
+ info.insert(info-keys.指导老师英文名, "*****")
+ info.insert(info-keys.指导老师职称中文, "")
+ info.insert(info-keys.指导老师职称英文, "")
+ info.insert(info-keys.指导老师单位, "*****")
+ info.insert(info-keys.合作导师中文名, "*****")
+ info.insert(info-keys.合作导师职称中文, "")
+ info.insert(info-keys.合作导师单位, "*****")
+ }
+ return info
+}
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/lib.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/lib.typ
new file mode 100644
index 0000000000..7dfcfa7eda
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/lib.typ
@@ -0,0 +1,22 @@
+#import "info.typ": info-check, info-default-kv
+
+#import "font.typ": get-hei-font, get-mono-font, get-song-font
+#import "common.typ": commen-space-set, common-set, revise, 其他-space-set
+
+#import "footnote.typ": set-footnote
+
+#import "ref.typ": set-ref
+
+#import "bilingual-bibliography.typ": achievement-list, bilingual-bibliography
+
+#import "heading.typ": (
+ set-global-heading, set-中文摘要-heading, set-参考文献-heading, set-图目录-heading, set-攻读学位期间获取成果-heading,
+ set-正文-heading, set-目录-heading, set-致谢-heading, set-英文摘要-heading, set-表目录-heading, set-附录-heading,
+)
+
+#import "page.typ": (
+ set-global-page, set-中文摘要-page, set-参考文献-page, set-图目录-page, set-攻读学位期间获取成果-page, set-正文-page,
+ set-目录-page, set-致谢-page, set-英文摘要-page, set-表目录-page, set-附录-page,
+)
+
+#import "equation.typ": set-equation, set-theoretic
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/page.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/page.typ
new file mode 100644
index 0000000000..2aff46e597
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/page.typ
@@ -0,0 +1,135 @@
+#import "info.typ": *
+#import "font.typ": *
+
+#let footer-罗马数字页码 = context {
+ set align(center)
+ set text(size: font-size.小五)
+ counter(page).display("I")
+}
+#let footer-阿拉伯数字页码 = context {
+ set align(center)
+ set text(size: font-size.小五)
+ counter(page).display("1")
+}
+
+#let header-help-func(str) = context {
+ set align(center + bottom)
+ set text(size: font-size.五号)
+ set par(spacing: 0.2em, leading: 0.3em)
+ // block(inset: 0pt, height: 90%, stroke: red)[
+ block(inset: 0pt, height: 90%)[
+ #text(str)
+ #line(length: 100%, stroke: 0.75pt)
+ ]
+ // 在Typst中默认footnote编号是连续的, 也就是第一页如果有1 2 3, 那么第二页就会从4开始
+ // 学校要求每一页单独计数, 所以这里需要手动重置一下footnote编号
+ counter(footnote).update(0)
+}
+
+#let header-with-text(s) = context {
+ assert(type(s) == str)
+ header-help-func(s)
+}
+
+#let header-中文摘要 = header-with-text("摘 要")
+
+#let header-英文摘要 = header-with-text("ABSTRACT")
+
+#let header-目录 = header-with-text("目 录")
+
+#let header-图目录 = header-with-text("插图清单")
+
+#let header-表目录 = header-with-text("表格清单")
+
+#let header-正文 = context {
+ let txt = "电子科技大学" + query(<学位>).first().value + "学位论文"
+ let body-page = counter(page).get().at(0, default: 0)
+ // 奇数页为内容
+ if calc.odd(body-page) {
+ // txt = hydra(1, skip-starting: false, use-last: true)
+ let is-heading-1-page = false
+ let h = query(heading.where(level: 1).after(here()))
+ .filter(h => { h.location().page() == here().page() })
+ .at(0, default: none)
+ if h != none {
+ is-heading-1-page = true
+ } else {
+ h = query(heading.where(level: 1).before(here())).at(-1, default: none)
+ }
+ if h != none {
+ let cnt = counter(heading).at(here()).at(0, default: 1)
+ if is-heading-1-page {
+ cnt = cnt + 1
+ }
+
+ let num = if h.numbering != none {
+ h.numbering
+ } else {
+ none
+ }
+
+ let title-body = h.body
+ if num == none {
+ txt = title-body
+ } else {
+ txt = numbering(num, cnt) + " " + title-body
+ }
+ }
+ }
+ header-help-func(txt)
+}
+
+#let header-致谢 = header-with-text("致 谢")
+
+#let set-global-page(body) = {
+ set page(
+ paper: "a4",
+ header: none,
+ footer: none,
+ margin: (top: 3cm, right: 3cm, bottom: 3cm, left: 3cm),
+ header-ascent: 1cm - font-size.小五 - 4.5pt,
+ footer-descent: 1cm - font-size.小五,
+ )
+ body
+}
+
+#let set-中文摘要-page(body) = {
+ set page(header: header-中文摘要, footer: footer-罗马数字页码)
+ body
+}
+
+#let set-英文摘要-page(body) = {
+ set page(header: header-英文摘要, footer: footer-罗马数字页码)
+ body
+}
+
+#let set-目录-page(body) = {
+ set page(header: header-目录, footer: footer-罗马数字页码)
+ body
+}
+
+#let set-图目录-page(body) = {
+ set page(header: header-图目录, footer: footer-罗马数字页码)
+ body
+}
+
+#let set-表目录-page(body) = {
+ set page(header: header-表目录, footer: footer-罗马数字页码)
+ body
+}
+
+#let set-正文-page(body) = {
+ set page(header: header-正文, footer: footer-阿拉伯数字页码)
+ body
+}
+
+#let set-致谢-page(body) = {
+ set page(header: header-致谢, footer: footer-阿拉伯数字页码)
+ body
+}
+
+#let set-附录-page(body) = set-正文-page(body)
+
+#let set-参考文献-page(body) = set-正文-page(body)
+
+#let set-攻读学位期间获取成果-page(body) = set-正文-page(body)
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/ref.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/ref.typ
new file mode 100644
index 0000000000..3d25ea62a2
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/ref.typ
@@ -0,0 +1,49 @@
+#import "equation.typ": equation-numering
+#import "../tools/figure-i.typ": figure-numering
+
+#let set-ref(body) = {
+ show ref: it => {
+ let ele = it.element
+ if ele == none {
+ it
+ } else if ele.func() == math.equation {
+ // 如果引用的数学公式
+ // 显示数学公式自带的方式
+ let num-str = equation-numering((), element: ele)
+ link(ele.location(), "公式" + num-str)
+ } else if ele.func() == heading {
+ // 如果引用的是标题
+ // 显示 1.1.1.1 节这种格式
+ let nums = counter(heading).at(ele.location())
+ let n = nums.len()
+ if n == 1 {
+ link(ele.location(), numbering("第一章", ..nums))
+ } else {
+ link(ele.location(), numbering("第1.1.1.1节", ..nums))
+ }
+ } else if ele.func() == figure {
+ // 图1-1, 表1-1 之类的
+ let fig = it.element
+ if fig.numbering == none { return it }
+ let meta = query(metadata)
+ .find(data => (
+ type(data.value) == dictionary
+ and data.value.at("figure-location", default: none) == it.element.location()
+ ))
+ .value
+ let location = meta.body-location
+ let kind = meta.kind
+ let supplement = (if it.supplement == auto { it.element } else { it }).supplement
+ let num = figure-numering((), kind: kind, element: fig)
+ link(location, [#supplement#num])
+ } else {
+ it
+ }
+ }
+ body
+}
+
+#let c(..keys) = {
+ show super: it => it.body
+ keys.pos().map(k => cite(k)).join()
+}
\ No newline at end of file
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/word_spacing.typ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/word_spacing.typ
new file mode 100644
index 0000000000..74ddc62fac
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/example/uestc-thesis-template/template/utils/word_spacing.typ
@@ -0,0 +1,33 @@
+#import "../consts.typ": *
+
+// 字体 段落 加粗信息等设置
+#let leading-space = 20pt
+#let 单倍行距 = 0.25em
+#let word-leading-space = leading-space - 1em
+#let word-below-leading-space = leading-space - font-size.小四
+#let above-leading-space(space: 0pt, word-space: word-leading-space) = {
+ word-space + space
+}
+#let below-leading-space(space) = {
+ word-below-leading-space + space
+}
+
+#let heading-1 = (
+ above: 24pt,
+ below: 18pt,
+)
+
+#let heading-2 = (
+ above: 18pt,
+ below: 6pt,
+)
+
+#let heading-3 = (
+ above: 12pt,
+ below: 6pt,
+)
+
+#let heading-4 = (
+ above: 12pt,
+ below: 6pt,
+)
\ No newline at end of file
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/thumbnail.png b/packages/preview/strict-modern-uestc-thesis/2.0.0/thumbnail.png
new file mode 100644
index 0000000000..b485761bed
Binary files /dev/null and b/packages/preview/strict-modern-uestc-thesis/2.0.0/thumbnail.png differ
diff --git a/packages/preview/strict-modern-uestc-thesis/2.0.0/typst.toml b/packages/preview/strict-modern-uestc-thesis/2.0.0/typst.toml
new file mode 100644
index 0000000000..314c973c3e
--- /dev/null
+++ b/packages/preview/strict-modern-uestc-thesis/2.0.0/typst.toml
@@ -0,0 +1,16 @@
+[package]
+name = "strict-modern-uestc-thesis"
+version = "2.0.0"
+entrypoint = "example/uestc-thesis-template/lib.typ"
+authors = ["UESTC Typst Community"]
+license = "Apache-2.0"
+description = "电子科技大学本科/硕士/博士学位论文模板,博士模板已经过学校验证,支持常用的表格,图像修订模式等。"
+repository = "https://github.com/uestc-typst/thesis-template"
+keywords = ["UESTC", "thesis", "degree", "template", "Typst", "电子科技大学"]
+categories = ["thesis"]
+compiler = "0.13.0"
+
+[template]
+path = "example"
+entrypoint = "main.typ"
+thumbnail = "thumbnail.png"