NCKU Thesis/Dissertation Template in Typst.
這個模板用 Typst 撰寫,目標是讓國立成功大學碩博士論文的基本頁面、章節樣式、頁碼、目錄、參考文獻與附錄流程能用一致的方式產生。
模板的主要入口是 thesis。使用者提供論文 metadata、frontmatter 內容、參考文獻與附錄;模板會負責封面、羅馬頁碼、目錄、阿拉伯頁碼、本文樣式、參考文獻與附錄樣式的順序。
#import "@preview/ncku-later:0.1.0": thesis
#import "contents/abstract.typ": *
#import "contents/acknowledgement.typ": *
#import "contents/extended-abstract-en.typ": *
#show: thesis.with(
metadata: (
degree: "doctor",
institute: "Department of Electrical Engineering",
title: (
en: "A Thesis/Dissertation Template written in Typst for National Cheng Kung University",
zh-tw: "以 Typst 撰寫之國立成功大學碩博士論文模板論文模板",
),
student: (en: "Chun-Hao Chang", zh-tw: "張峻豪"),
advisor: (en: "Dr. Chia-Chi Tsai", zh-tw: "蔡家齊 博士"),
coadvisor: (
(en: "Dr. Ha-Ha Lin", zh-tw: "林哈哈 博士"),
),
main-lang: "en",
),
abstract-zh-tw: (
keywords: abstract-zh-tw-keywords,
body: abstract-zh-tw,
),
abstract-en: (
keywords: abstract-en-keywords,
body: abstract-en,
),
extended-abstract: (
summary: extended-abstract-summary,
keywords: extended-abstract-keywords,
body: extended-abstract-body,
),
acknowledgement-zh-tw: acknowledgement-zh-tw,
acknowledgement-en: acknowledgement-en,
references: bibliography(title: "Reference", full: true, "ref.bib"),
appendix: [
#include "contents/appendix.typ"
],
)
#include "contents/mainmatter.typ"metadata 必填欄位如下:
degree:"master"或"doctor"institute: 系所英文名稱title:(en: "...", zh-tw: "...")student:(en: "...", zh-tw: "...")advisor:(en: "...", zh-tw: "...")main-lang:"en"或"zh-tw"
選填欄位:
coadvisor: 共同指導教授陣列,例如((en: "...", zh-tw: "..."),)date: 封面日期;未提供時使用 Typst 的datetime.today().display()
建議把內容拆在 template/contents/:
abstract.typ: 匯出中英文摘要本文與 keywordsextended-abstract-en.typ: 匯出英文延伸摘要 summary、keywords、bodyacknowledgement.typ: 匯出中英文致謝mainmatter.typ: 本文章節,只放章節內容,不需要設定頁碼或章節樣式appendix.typ: 附錄章節,只放附錄內容,不需要設定 appendix 樣式
本文與附錄的 layout 由 thesis 自動套用。
編譯目前 repo 的本地 source:
make compilecompile-local 是同一件事的顯式 target:
make compile-local若要刻意測試已發布的 @preview package,可使用:
make compile-preview格式與本地編譯檢查:
make check重構時的最高原則是:PDF 看起來不可以變。
先建立 baseline:
make render-baseline重構後逐頁轉成 PNG 並比對:
make visual-checkvisual-check 會確認頁數相同,並用 cmp 比對每一頁 PNG。只要有任何頁面像素不同,檢查就會失敗。
此 repo 提供 Nix dev shell,包含:
typsttypstyletinymist
進入開發環境後可使用上面的 make targets。
本模板參考了下列專案的想法與格式: