Skip to content

About

Typst template for thesis writing at National Cheng Kung University (NCKU), Tainan Taiwan

Resources

Stars

33 stars

Watchers

1 watching

Forks

Repository files navigation

國立成功大學碩博士論文 Typst 模板

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

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: 匯出中英文摘要本文與 keywords
  • extended-abstract-en.typ: 匯出英文延伸摘要 summary、keywords、body
  • acknowledgement.typ: 匯出中英文致謝
  • mainmatter.typ: 本文章節,只放章節內容,不需要設定頁碼或章節樣式
  • appendix.typ: 附錄章節,只放附錄內容,不需要設定 appendix 樣式

本文與附錄的 layout 由 thesis 自動套用。

本地開發

編譯目前 repo 的本地 source:

make compile

compile-local 是同一件事的顯式 target:

make compile-local

若要刻意測試已發布的 @preview package,可使用:

make compile-preview

格式與本地編譯檢查:

make check

視覺回歸檢查

重構時的最高原則是:PDF 看起來不可以變。

先建立 baseline:

make render-baseline

重構後逐頁轉成 PNG 並比對:

make visual-check

visual-check 會確認頁數相同,並用 cmp 比對每一頁 PNG。只要有任何頁面像素不同,檢查就會失敗。

開發環境

此 repo 提供 Nix dev shell,包含:

  • typst
  • typstyle
  • tinymist

進入開發環境後可使用上面的 make targets。

致謝

本模板參考了下列專案的想法與格式:

  1. canonical-nthu-thesis
  2. ncku-thesis-template-latex
  3. modern-nju-thesis

About

Typst template for thesis writing at National Cheng Kung University (NCKU), Tainan Taiwan

Resources

Stars

33 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages