Skip to content

confusedkernel/fubell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Fubell ๐Ÿ””

An unofficial Typst thesis template for National Taiwan University (ๅœ‹็ซ‹่‡บ็ฃๅคงๅญธ).

Inspired by the ntu-thesis LaTeX template and follows the official formatting guidelines. The project is named after the iconic Fu Bell on campus.

Quick Start

typst init @preview/fubell:0.1.0 my-thesis
cd my-thesis
typst compile main.typ

Or clone this repository and compile the example directly:

typst compile --root . template/main.typ

Typst Web App Usage

You can use Fubell directly on the Typst web app (no local CLI required):

  1. Create a new project at https://typst.app.
  2. In main.typ, import @preview/fubell:0.1.0 and configure #show: thesis.with(...) (see the Usage snippet below).
  3. Add files for any include paths you use, or replace those include lines with inline content.
  4. Keep watermark: none (default), or upload your own assets/watermark.png and set watermark: image("assets/watermark.png").
  5. Set font-profile: "web" for cleaner fallback behavior on Typst web app.

Project Structure

fubell/
โ”œโ”€โ”€ lib.typ                  # Package entrypoint (exports `thesis`, `appendix`)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ config.typ           # Page geometry, fonts, spacing defaults
โ”‚   โ”œโ”€โ”€ cover.typ            # Cover page layout
โ”‚   โ”œโ”€โ”€ certification.typ    # Oral defense certification page
โ”‚   โ”œโ”€โ”€ front-matter-page.typ # Abstract & acknowledgement pages (zh/en)
โ”‚   โ”œโ”€โ”€ outline-page.typ     # ToC, List of Figures/Tables
โ”‚   โ””โ”€โ”€ appendix.typ         # Appendix numbering helper
โ”œโ”€โ”€ template/                # Scaffolded into user projects
โ”‚   โ”œโ”€โ”€ main.typ             # Thesis entry point (edit this)
โ”‚   โ”œโ”€โ”€ refs.bib             # Bibliography
โ”‚   โ””โ”€โ”€ content/
โ”‚       โ”œโ”€โ”€ abstract-zh.typ
โ”‚       โ”œโ”€โ”€ abstract-en.typ
โ”‚       โ”œโ”€โ”€ acknowledgement-zh.typ
โ”‚       โ”œโ”€โ”€ acknowledgement-en.typ
โ”‚       โ””โ”€โ”€ chapters/
โ”‚           โ””โ”€โ”€ introduction.typ
โ”œโ”€โ”€ typst.toml               # Package manifest
โ”œโ”€โ”€ ROADMAP.md               # Development roadmap
โ””โ”€โ”€ CHANGELOG.md

Usage

#import "@preview/fubell:0.1.0": thesis, appendix

#show: thesis.with(
  university: (zh: "ๅœ‹็ซ‹่‡บ็ฃๅคงๅญธ", en: "National Taiwan University"),
  college:    (zh: "้›ปๆฉŸ่ณ‡่จŠๅญธ้™ข", en: "College of EECS"),
  institute:  (zh: "่ณ‡่จŠๅทฅ็จ‹ๅญธ็ณป", en: "Dept. of CSIE"),
  title: (
    zh: "่ซ–ๆ–‡ไธญๆ–‡ๆจ™้กŒ",
    en: "Thesis English Title",
  ),
  author:  (zh: "็Ž‹ๅฐๆ˜Ž", en: "Xiao-Ming Wang"),
  advisor: (zh: "้™ณๅคงๆ–‡ ๅšๅฃซ", en: "Da-Wen Chen, Ph.D."),
  student-id: "R12345678",
  degree: "master", // or "phd"
  lang: "zh", // or "en" โ€” controls outline titles and document language
  font-profile: "submission", // or "web" / "portable"
  // font-en: ("Times New Roman", "TeX Gyre Termes"), // optional override
  // font-zh: ("BiauKaiTC", "TW-MOE-Std-Kai"), // optional override
  date: (year-zh: "113", year-en: "2024", month-zh: "6", month-en: "June"),
  keywords: (
    zh: ("้—œ้ตๅญ—ไธ€", "้—œ้ตๅญ—ไบŒ"),
    en: ("keyword one", "keyword two"),
  ),

  abstract-zh: include "content/abstract-zh.typ",
  abstract-en: include "content/abstract-en.typ",
  acknowledgement-zh: include "content/acknowledgement-zh.typ", // optional
  acknowledgement-en: include "content/acknowledgement-en.typ", // optional

  bibliography-file: bibliography("refs.bib"),
  watermark: none, // optional: e.g. image("assets/watermark.png") (user-provided)
  doi: none, // optional DOI string, e.g. "doi:10.6342/NTU2024XXXXX"
  // certification-pdf: read("cert.pdf", encoding: none), // optional: replace auto page with scanned PDF
)

#include "content/chapters/introduction.typ"

// Appendices โ€” switches numbering to "Appendix A" / "้™„้Œ„A"
#show: appendix
= Survey Data       // โ†’ "้™„้Œ„A Survey Data" (zh) or "Appendix A Survey Data" (en)
== Raw Results      // โ†’ "A.1 Raw Results"

Appendices

Use #show: appendix after your main chapters to switch heading numbering to appendix style. The prefix adapts to the document language:

lang Level 1 Level 2+
"zh" ้™„้Œ„A A.1
"en" Appendix A A.1
// after your last chapter
#show: appendix
= Supplementary Data
== Experiment Details

Watermark (Optional)

The template defaults to watermark: none, so no watermark file is required.

If you want to add the NTU watermark:

  1. Download it from the official source: https://www.lib.ntu.edu.tw/doc/CL/watermark.pdf
  2. Convert it to PNG and place it in your project, for example assets/watermark.png
  3. Set watermark: image("assets/watermark.png") in #show: thesis.with(...)

Language

The lang option (default "zh") controls the document language and structural titles (Table of Contents, List of Figures, List of Tables). Set lang: "en" for English headings. Cover and certification pages remain bilingual regardless of this setting.

Line spacing follows NTU guidelines: 1.5 ้–“่ท for Chinese (lang: "zh") and double spacing for English (lang: "en").

External Certification PDF (Optional)

By default the template auto-generates the ๅฃ่ฉฆๅง”ๅ“กๆœƒๅฏฉๅฎšๆ›ธ (certification page) with signature blanks. After your oral defense, you can replace it with a scanned PDF of the signed page:

#show: thesis.with(
  // ... other options ...
  certification-pdf: read("certification-scan.pdf", encoding: none),
  certification-pdf-page: 1,       // page to embed (default: 1)
  certification-pdf-fit: "contain", // "contain", "cover", or "stretch"
)

When certification-pdf is set:

  • The auto-generated certification page is skipped entirely.
  • The scanned PDF is rendered full-bleed (zero margins, no watermark, no DOI footer, no page number overlay).
  • The TOC entry for ๅฃ่ฉฆๅง”ๅ“กๆœƒๅฏฉๅฎšๆ›ธ is still emitted so the table of contents remains correct.

When certification-pdf is none (default), the other two options (certification-pdf-page, certification-pdf-fit) are silently ignored.

Caveats

  • Typst's PDF-as-image feature requires the source PDF version to be โ‰ค the export target version. If compilation fails, re-export your scanned PDF as PDF 1.7 or lower.
  • PDF-as-image is not supported when exporting with PDF/A or PDF/UA standards enabled.
  • Tags and accessibility metadata from the source PDF are not preserved.

Fonts

The template supports font profiles so users can choose between submission-accurate fonts and web/CI-friendly fallbacks.

Profile Use case English stack Chinese stack
"submission" (default) Local submission build Times New Roman โ†’ TeX Gyre Termes โ†’ STIX Two Text BiauKaiTC โ†’ DFKai-SB โ†’ TW-MOE-Std-Kai โ†’ Kaiti TC โ†’ Kaiti SC
"web" Typst web app TeX Gyre Termes โ†’ STIX Two Text โ†’ Times New Roman TW-MOE-Std-Kai โ†’ Kaiti TC โ†’ Kaiti SC โ†’ BiauKaiTC โ†’ DFKai-SB
"portable" CI / reproducible open-font-first build Libertinus Serif โ†’ New Computer Modern โ†’ Times New Roman TW-MOE-Std-Kai โ†’ Noto Serif CJK TC โ†’ Noto Serif TC โ†’ BiauKaiTC

You can also bypass profiles and set font-en / font-zh directly in thesis.with(...).

Currently bold/italic do not work for many Chinese Kai fonts; workarounds with stroke and skew are being considered.

Caveats โ€” Typst web app

Times New Roman and ๆจ™ๆฅท้ซ” are proprietary fonts that are not available on the Typst web app. The template will automatically fall back to:

  • TeX Gyre Termes for English โ€” the closest open-source match to Times New Roman (Typst Issue #416).
  • TW-MOE-Std-Kai (ๆ•™่‚ฒ้ƒจๆจ™ๆบ–ๆฅทๆ›ธ) for Chinese โ€” available natively on the Typst web app.

The output will look very similar but not byte-identical to a local build with the proprietary fonts installed. For official submission, it is recommended to compile locally with Times New Roman and ๆจ™ๆฅท้ซ” installed.

For web projects, prefer font-profile: "web".

Font diagnostics (local CLI)

  1. Check the effective font configuration selected by the template:

    typst query --root . main.typ "<fubell-font-config>" --one --format yaml
  2. See font warnings in a compact format:

    typst query --root . main.typ "<heading>" --field body --diagnostic-format short
  3. Run a strict fallback check with system fonts disabled:

    typst query --root . main.typ "<heading>" --field body --diagnostic-format short --ignore-system-fonts
  4. Inspect installed font families on your machine:

    typst fonts

If you see unknown font family warnings, either install that font locally or switch font-profile / font-en / font-zh to fonts available in your environment.

Contributing

Issues and pull requests are welcome! If you spot a formatting bug, have a feature idea, or want to pick up something from the roadmap โ€” please go for it :) Contributions that implement new features are especially appreciated.

License

MIT

About

A Typst template for NTU (National Taiwan University) thesis.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors