From 4613a6e87e8f81201980d26ed98dc274b106873b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=83=E5=BE=8BRenAhsAcme?= <130288076+RenAhsAcme@users.noreply.github.com> Date: Sun, 14 Jun 2026 21:08:01 +0800 Subject: [PATCH 1/9] =?UTF-8?q?feat(template):=20=E4=B8=BA=E8=8B=B1?= =?UTF-8?q?=E8=AF=AD=E6=96=87=E5=AD=97=E5=AE=9A=E4=B9=89=E6=96=9C=E4=BD=93?= =?UTF-8?q?=E7=94=A8=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/thesis.typ | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/template/thesis.typ b/template/thesis.typ index 4ab63ca..27a1a8c 100644 --- a/template/thesis.typ +++ b/template/thesis.typ @@ -11,10 +11,14 @@ // #import "@preview/modern-sysu-thesis:0.4.1": postgraduate as thesis #import thesis: abstract, acknowledgement, appendix, contents - // 你首先应该安装 https://gitlab.com/sysu-gitlab/thesis-template/better-thesis/-/tree/main/fonts 里的所有字体, // 如果是 Web App 上编辑,你应该手动上传这些字体文件,否则不能正常使用「楷体」和「仿宋」,导致显示错误。 +// 定义斜体函数。在正文部分,若要使得某些文字(仅限英语)以斜体效果呈现,请像下面这样的示例调用: +// #ita[Sun Yat-sen University] +// 此时,文字“Sun Yat-sen University”将以斜体效果呈现。 +#let ita(body) = text(style: "italic")[#body] + #show: thesis.doc.with( // 毕业论文基本信息 thesis-info: ( From 8cc675c2bc34090aff7450f3b234e5bb8a0f9062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=83=E5=BE=8BRenAhsAcme?= <130288076+RenAhsAcme@users.noreply.github.com> Date: Sun, 14 Jun 2026 21:09:07 +0800 Subject: [PATCH 2/9] =?UTF-8?q?chore:=20=E8=B0=83=E6=95=B4=E6=91=98?= =?UTF-8?q?=E8=A6=81=E6=89=80=E5=9C=A8=E4=BD=8D=E7=BD=AE=E4=BD=BF=E5=85=B6?= =?UTF-8?q?=E6=9B=B4=E7=AC=A6=E5=90=88=E7=9B=B4=E8=A7=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/thesis.typ | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/template/thesis.typ b/template/thesis.typ index 27a1a8c..22adc6e 100644 --- a/template/thesis.typ +++ b/template/thesis.typ @@ -19,6 +19,18 @@ // 此时,文字“Sun Yat-sen University”将以斜体效果呈现。 #let ita(body) = text(style: "italic")[#body] +// 摘要 +#abstract( + [博学、审问、慎思、明辨、笃行是中山大学的校训。], + keywords: ("中山大学", "校训", "学术研究"), +) + +// 英文摘要:当您使用本科论文模板时,可将此处的注释取消以写入英文摘要。 +// #abstract-en( +// [Extensive learning, careful inquiry, prudent thinking, clear discernment, and resolute practice" is the motto of Sun Yat-sen University.], +// keywords: ("Sun Yat-sen University", "School Motto", "Academic Research"), +// ) + #show: thesis.doc.with( // 毕业论文基本信息 thesis-info: ( @@ -191,15 +203,3 @@ $ F_n = floor(1 / sqrt(5) phi.alt^n) $ #acknowledgement[ 感谢 NJU-LUG,感谢 NJUThesis LaTeX 模板。 ] - -// 摘要 -#abstract( - [博学、审问、慎思、明辨、笃行是中山大学的校训。], - keywords: ("中山大学", "校训", "学术研究"), -) - -// 英文摘要:当您使用本科论文模板时,可将此处的注释取消以写入英文摘要。 -// #abstract-en( -// [Extensive learning, careful inquiry, prudent thinking, clear discernment, and resolute practice" is the motto of Sun Yat-sen University.], -// keywords: ("Sun Yat-sen University", "School Motto", "Academic Research"), -// ) From dfcfb0886d52193a85a70caa8e2e97e55d2532f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=83=E5=BE=8BRenAhsAcme?= <130288076+RenAhsAcme@users.noreply.github.com> Date: Sun, 14 Jun 2026 21:40:23 +0800 Subject: [PATCH 3/9] =?UTF-8?q?fix(template):=20=E5=81=9C=E7=94=A8=20Smart?= =?UTF-8?q?quote?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这将禁用 Smartquote 功能,旨在阻止在英文语境部分意外将英文引号转为中文引号。 --- template/thesis.typ | 3 +++ 1 file changed, 3 insertions(+) diff --git a/template/thesis.typ b/template/thesis.typ index 22adc6e..4bec775 100644 --- a/template/thesis.typ +++ b/template/thesis.typ @@ -14,6 +14,9 @@ // 你首先应该安装 https://gitlab.com/sysu-gitlab/thesis-template/better-thesis/-/tree/main/fonts 里的所有字体, // 如果是 Web App 上编辑,你应该手动上传这些字体文件,否则不能正常使用「楷体」和「仿宋」,导致显示错误。 +// 关闭 smart quote,避免英文引号自动转换为弯引号 +#set smartquote(enabled: false) + // 定义斜体函数。在正文部分,若要使得某些文字(仅限英语)以斜体效果呈现,请像下面这样的示例调用: // #ita[Sun Yat-sen University] // 此时,文字“Sun Yat-sen University”将以斜体效果呈现。 From f7240a843416ae14ef06d8a68ded4815901cc25a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=83=E5=BE=8BRenAhsAcme?= <130288076+RenAhsAcme@users.noreply.github.com> Date: Mon, 15 Jun 2026 08:19:16 +0800 Subject: [PATCH 4/9] =?UTF-8?q?feat(lib):=20=E9=87=8D=E6=9E=84=20thesis-in?= =?UTF-8?q?fo.title-en=20=E7=9A=84=E5=A4=84=E7=90=86=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BB=A5=E5=BC=95=E5=85=A5=20content=20=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- specifications/bachelor/lib.typ | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/specifications/bachelor/lib.typ b/specifications/bachelor/lib.typ index 22a7455..77b09b3 100644 --- a/specifications/bachelor/lib.typ +++ b/specifications/bachelor/lib.typ @@ -66,9 +66,13 @@ // 论文信息参数处理。要求必须传递,且符合规格的参数 assert(type(thesis-info) == dictionary) assert(type(thesis-info.title) == array or type(thesis-info.title) == str) - assert(type(thesis-info.title-en) == array - or type(thesis-info.title-en) == str - ) + // 避免大面积破坏:同时允许接受 content 和 str + if type(thesis-info.title-en) == str { + thesis-info.title-en = thesis-info.title-en.split("\n") + } else if type(thesis-info.title-en) != array { + thesis-info.title-en = (thesis-info.title-en,) + } + assert(type(thesis-info.title-en) == array) // 论文信息默认参数。函数传入参数会完全覆盖参数值,因此需要提供默认参数补充。 // 彩蛋:如果论文参数不传递作者参数,那么论文就会被署名论文模板作者 let default-author = ( From 49735b79dbf3d103fbb2ba4b575e26c9d0d60306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=83=E5=BE=8BRenAhsAcme?= <130288076+RenAhsAcme@users.noreply.github.com> Date: Mon, 15 Jun 2026 08:22:18 +0800 Subject: [PATCH 5/9] =?UTF-8?q?feat(lib):=20=E9=87=8D=E6=9E=84=20thesis-in?= =?UTF-8?q?fo.title-en=20=E7=9A=84=E5=A4=84=E7=90=86=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BB=A5=E5=BC=95=E5=85=A5=20content=20=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- specifications/postgraduate/lib.typ | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/specifications/postgraduate/lib.typ b/specifications/postgraduate/lib.typ index 80e761c..bd27370 100644 --- a/specifications/postgraduate/lib.typ +++ b/specifications/postgraduate/lib.typ @@ -62,9 +62,13 @@ // 论文信息参数处理。要求必须传递,且符合规格的参数 assert(type(thesis-info) == dictionary) assert(type(thesis-info.title) == array or type(thesis-info.title) == str) - assert( - type(thesis-info.title-en) == array or type(thesis-info.title-en) == str, - ) + // 避免大面积破坏:同时允许接受 content 和 str + if type(thesis-info.title-en) == str { + thesis-info.title-en = thesis-info.title-en.split("\n") + } else if type(thesis-info.title-en) != array { + thesis-info.title-en = (thesis-info.title-en,) + } + assert(type(thesis-info.title-en) == array) // 论文信息默认参数。函数传入参数会完全覆盖参数值,因此需要提供默认参数补充。 // 彩蛋:如果论文参数不传递作者参数,那么论文就会被署名论文模板作者 let default-author = ( From c9be26ef12dddb9d4dabc3f97bf95fcba8877a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=83=E5=BE=8BRenAhsAcme?= <130288076+RenAhsAcme@users.noreply.github.com> Date: Mon, 15 Jun 2026 08:24:39 +0800 Subject: [PATCH 6/9] =?UTF-8?q?feat(template):=20=E5=BC=95=E5=85=A5?= =?UTF-8?q?=E5=AF=B9=E6=96=B0=E7=9A=84=20title-en=20=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/thesis.typ | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/template/thesis.typ b/template/thesis.typ index 4bec775..c9252b5 100644 --- a/template/thesis.typ +++ b/template/thesis.typ @@ -40,7 +40,10 @@ // 论文标题,将展示在封面、扉页与页眉上 // 多行标题请使用数组传入 `("thesis title", "with part next line")`,或使用换行符:`"thesis title\nwith part next line"` title: ("基于 Typst 的", "中山大学学位论文模板"), - title-en: "A Typst Template for SYSU thesis", + // 当您像这样调用 title-en 时: + // title-en: ([Hello SYSU], [Sun Yat-sen #ita[University]]), + // 实际效果为:“Hello SYSU”与“Sun Yat-sen University”将分为两行显示,其中“University”以斜体效果呈现。 + title-en: ([Hello SYSU], [Sun Yat-sen #ita[University]]), // 论文作者信息:学号、姓名、院系、专业、指导老师 author: ( sno: "1xxxxxxx", From dfd2eb3b93778f73a0518a6de7370689a6c5cc08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=83=E5=BE=8BRenAhsAcme?= <130288076+RenAhsAcme@users.noreply.github.com> Date: Mon, 15 Jun 2026 08:36:30 +0800 Subject: [PATCH 7/9] =?UTF-8?q?feat(abstract-en):=20=E6=9B=B4=E6=94=B9=20K?= =?UTF-8?q?eywords=20=E5=A4=84=E7=90=86=E6=96=B9=E5=BC=8F=E4=BB=A5?= =?UTF-8?q?=E5=BC=95=E5=85=A5=20content=20=E7=89=B9=E6=80=A7=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- specifications/bachelor/abstract-en.typ | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/specifications/bachelor/abstract-en.typ b/specifications/bachelor/abstract-en.typ index 93af98c..56dc34a 100644 --- a/specifications/bachelor/abstract-en.typ +++ b/specifications/bachelor/abstract-en.typ @@ -39,6 +39,15 @@ Both Chinese and English should be in seperated pages. // 摘要正文下方另起一行顶格打印“关键词”款项,后加冒号,多个关键词以逗号分隔。 // (标题“Keywords”加粗) - *Keywords:* #context abstract-en-keywords.final().join(", ") + // 使用逐元素遍历渲染,每个元素直接作为 content 输出,单独处理分隔符 + *Keywords:* #context { + let kws = abstract-en-keywords.final() + for (i, kw) in kws.enumerate() { + kw + if i < kws.len() - 1 { + [, ] + } + } + } ] } From 3e659439ed70bded9e733d6234a6504e3c975bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=83=E5=BE=8BRenAhsAcme?= <130288076+RenAhsAcme@users.noreply.github.com> Date: Mon, 15 Jun 2026 08:37:16 +0800 Subject: [PATCH 8/9] =?UTF-8?q?feat(abstract-en):=20=E6=9B=B4=E6=94=B9=20K?= =?UTF-8?q?eywords=20=E7=9A=84=E5=A4=84=E7=90=86=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BB=A5=E5=BC=95=E5=85=A5=20content=20=E7=89=B9=E6=80=A7?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- specifications/postgraduate/abstract-en.typ | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/specifications/postgraduate/abstract-en.typ b/specifications/postgraduate/abstract-en.typ index 9c537e6..bc75c42 100644 --- a/specifications/postgraduate/abstract-en.typ +++ b/specifications/postgraduate/abstract-en.typ @@ -44,6 +44,15 @@ // 摘要正文下方另起一行顶格打印“关键词”款项,后加冒号,多个关键词以逗号分隔。 // (标题“Keywords”加粗) - *Keywords:* #context abstract-en-keywords.final().join(", ") + // 使用逐元素遍历渲染,每个元素直接作为 content 输出,单独处理分隔符 + *Keywords:* #context { + let kws = abstract-en-keywords.final() + for (i, kw) in kws.enumerate() { + kw + if i < kws.len() - 1 { + [, ] + } + } + } ] } From ff03a3d8255d6f5dd84a1558ef9613931abf7eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=83=E5=BE=8BRenAhsAcme?= <130288076+RenAhsAcme@users.noreply.github.com> Date: Mon, 15 Jun 2026 08:41:46 +0800 Subject: [PATCH 9/9] =?UTF-8?q?feat(template):=20=E5=BC=95=E5=85=A5?= =?UTF-8?q?=E5=AF=B9=E6=96=B0=E7=9A=84=20Keywords=20=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/thesis.typ | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/template/thesis.typ b/template/thesis.typ index c9252b5..1abadab 100644 --- a/template/thesis.typ +++ b/template/thesis.typ @@ -29,9 +29,12 @@ ) // 英文摘要:当您使用本科论文模板时,可将此处的注释取消以写入英文摘要。 +// 其中当您像这样调用 keywords 时: +// keywords: ([Sun Yat-sen #ita[University]], [School Motto], [Academic Research]), +// 实际效果为:包含三个关键词,其中“University”以斜体效果呈现。 // #abstract-en( // [Extensive learning, careful inquiry, prudent thinking, clear discernment, and resolute practice" is the motto of Sun Yat-sen University.], -// keywords: ("Sun Yat-sen University", "School Motto", "Academic Research"), +// keywords: ([Sun Yat-sen #ita[University]], [School Motto], [Academic Research]), // ) #show: thesis.doc.with(