Skip to content

chillcicada/tntt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TnTT: Typst & Tsinghua University Template

Nightly Built PDF

TnTT is Not a Tex Thesis Template for Tsinghua university...

简体中文 | English

介绍

TnTT 是“Tntt is Not a Tex Thesis Template for Tsinghua university”的递归缩写,一个基于 Typst非官方清华大学(THU)学位论文模板。

Important

目前仅支持本科生的综合论文训练。由于 Typst 尚未稳定,本模板会持续追踪最新发布版本。因此,请使用 Typst 的最新版进行编辑,以确保能使用上新的特性并避免兼容性问题。

使用

您可以在 Typst Web 应用中使用此模板:仪表板上单击「Start from template」,搜索 tntt 即可创建项目;或直接单击此处来快速创建。

您也可以使用 typst 命令行工具来创建基于此模板的新项目:

typst init @preview/tntt

当然,您也可以在任意 typst 文件中添加如下内容来导入此模板。

#import "@preview/tntt:0.4.1"
#import tntt: define-config

此外,由于模板更新较为频繁,您也可以通过克隆源仓库代码来使用最新的夜间版本:

git clone https://github.com/chillcicada/tntt.git --depth 1
# 使用 ssh
# git clone git@github.com:chillcicada/tntt.git --depth 1

随后,修改 template/thesis.typ 即可开始编辑您的论文。


若在使用中遇到字体渲染问题,请参阅字体配置部分。

导引

如果您对 Typst 语法并不熟悉,可参阅中文社区导航快速入门。推荐使用 TinymistTypst Webapp 来编辑项目。对于论文等重要材料,请务必及时备份并进行版本管理,以防内容丢失。

在开始编辑之前,如果您对 Typst 字体配置不了解,建议先阅读以下的字体配置说明:

字体配置

本模板主要面向中文排版,并依照论文字体规范设置了相应的中文字族信息,即:

  • SongTi: 宋体,正文字体,通常对应西文中的衬线字体
  • HeiTi: 黑体,标题字体,通常对应西文中的无衬线字体
  • KaiTi: 楷体,适用于说明性文本和主观性表述
  • FangSong: 仿宋,通常用于注释、引文及权威性阐述
  • Mono: 等宽字体,适用于代码。暂不清楚相关规范,默认西文字体为 Typst 内置的 DejaVu Sans Mono,建议中文字体选用黑体或楷体,或使用常见的中文等宽字体,默认为 HeiTi
  • Math: 数学字体。暂不清楚相关规范,默认西文字体为 Typst 内置的 New Computer Modern Math,中文字体为 HeiTi

对于 Windows 10/11 用户或安装了相应字体的 Linux 用户,可使用字体配置 NSimSunSimHeiKaiTiFangSong,这与 Word 论文模板中的字体配置完全相同,也是本模板默认的字体配置;对于 MacOS 用户,除了安装上述字体外,建议配置为 Songti SCHeiti SCKaiti SCFangsong SC。您也可以用 Source Han SerifSource Han Sans 等来替代宋体和黑体。请注意,由于 Typst 目前对可变字体支持有限,请勿使用 Noto 系列(如 Noto Sans CJK SC)等可变字体

本模板已内置适用于 Windows 10/11 系统的字体配置,中文版 Windows 系统通常已预装这些字体。Linux 和 MacOS 用户如需严格使用论文要求的字体,可将本地 Windows 对应字体提取、下载并安装到系统中,或在下载后通过指定字体路径来使用,如:

# 将字体压缩包下载至当前目录,并解压到 fonts 文件夹,仅供参考
curl -sSLf https://github.com/chillcicada/tntt/releases/latest/download/fonts.zip -o fonts.zip
unzip -q fonts.zip && rm fonts.zip

# 在 typst 编译时指定字体路径,假设 thesis.typ 为入口文件
typst compile thesis.typ --font-path fonts
# 或(适用于克隆源代码仓库的用户)
typst compile template/thesis.typ --root . --font-path fonts
# 将 typst 文件视作脚本运行(仅适用于克隆源仓库代码的 UNIX 用户)
# ./template/thesis.typ --font-path fonts

对于使用 VSCode + Tinymist 的用户(其他编辑器及更多设置请参考 Tinymist 文档):

// .vscode/settings.json
{
  "tinymist.fontPaths": [
    "${workspaceFolder}/fonts"
  ]
}

对于使用 Typst Web 应用的用户,由于默认未提供所需中文字体,您需要手动将字体文件上传至项目中,webapp 将自动识别字体文件(请勿上传压缩包)。


更多使用说明与示例已内置在模板中,建议从模板创建项目以获得更好的体验。

预览

preview

致谢

衷心感谢 OrangeX4 为南京大学学位论文 Typst 模板 modern-nju-thesis 所做的贡献。本项目移植自由 OrangeX4 及 nju-lug 维护的 modern-nju-thesis 模板,感谢他们的出色工作。

在移植过程中,主要参考了清华大学学位论文 Word 模板清华大学学位论文 LaTeX 模板以及教务下发的 Word 和 PDF 模板,在此表达感谢。

感谢纸夜开发 Tinymist 工具。

相关资源

许可证

模板源代码采用 MIT 许可证分发,您可以自由使用、修改和分发,但不提供任何担保。

Important

本项目中包含清华大学校徽与校名的图形文件,用于制作制作本科生综合论文训练封面。这些图形取自清华大学视觉形象系统,项目维护者未进行任何修改。

请注意:相关图形与文字都是清华大学的注册商标,除此模板外,请勿用于任何其他用途。


TnTT: Typst & Tsinghua University Template

English | 简体中文

Introduction

TnTT is a recursive acronym for "Tntt is Not a Tex Thesis Template for Tsinghua University", as an unofficial Tsinghua University (THU) thesis template based on Typst.

Important

Currently, it only supports the Comprehensive Thesis Training for undergraduates. Since Typst is not yet stable, this template will continuously track its latest release. Therefore, please use the latest released version of Typst for editing to ensure access to new features and avoid compatibility issues.

Usage

You can use this template in the Typst Web by clicking "Start from template" on the dashboard and searching for tntt to create a project, or simply click here to get started quickly.

Alternatively, you can use the typst command-line tool to create a new project based on this template:

typst init @preview/tntt

Of course, you can also import the template in any Typst file by adding:

#import "@preview/tntt:0.4.1"
#import tntt: define-config

In addition, due to frequency updates, you may clone the source repository to use the latest nightly version:

git clone https://github.com/chillcicada/tntt.git --depth 1
# with ssh
# git clone git@github.com:chillcicada/tntt.git --depth 1

Then modify template/thesis.typ to start editing your thesis.


If you encounter font rendering issues, please refer to the Font Configuration section.

Instructions

If you are not familiar with Typst Syntax, you can refer to Chinese Community Navigation for a quick start. It is recommended to use Tinymist or Typst Webapp for editing. For important materials like your thesis, please back up your work regularly and use version control to prevent data loss.

Before you begin editing, if you have no idea about Typst font configuration, please read the following font configuration notes first:

Font Configuration

This template is designed primarily for Chinese typesetting and includes corresponding Chinese font families according to thesis typography standards:

  • SongTi: Serif typeface, used for the main body text.
  • HeiTi: Sans-serif typeface, used for headings.
  • KaiTi: Standard Chinese typeface, suitable for explanatory text and subjective expressions.
  • FangSong: Standard Chinese typeface, typically used for annotations, citations, and authoritative explanations.
  • Mono: Monospace typeface, used for code. The relevant specifications are not yet clear. The default Western font is Typst's built-in DejaVu Sans Mono. For Chinese typeface, Heiti or KaiTi is recommended, or commonly used Chinese monospace font, default to HeiTi.
  • Math: Math typeface. The relevant specifications are not yet clear. The default Western font is Typst's built-in New Computer Modern Math, with Chinese typeface default to KaiTi.

For Windows 10/11 users or Linux users with corresponding fonts installed, you can use the font configuration NSimSun, SimHei, KaiTi, and FangSong, which matched the Word thesis template exactly. For MacOS users, besides installing the above fonts, the recommended configuration is Songti SC, Heiti SC, Kaiti SC, and Fangsong SC. You may also replace SongTi and HeiTi with fonts such as Source Han Serif or Source Han Sans. Please note that currently Typst has limited support variable fonts, do not use variable fonts like the Noto series (e.g. Noto Sans CJK SC)).

This template includes built-in font configuration for Windows 10/11 systems, Chinese‑language Windows systems usually come with these fonts preinstalled. Linux and MacOS users who need to strictly adhere the required thesis fonts canYou can extract, download, and install the corresponding local Windows font to the system, or use it after downloading by specifying the font path, for example:

# Download the fonts zip to the current directory and extract it to the fonts folder, for reference only
curl -sSLf https://github.com/chillcicada/tntt/releases/latest/download/fonts.zip -o fonts.zip
unzip -q fonts.zip && rm fonts.zip

# Specify the font path when compiling, assuming thesis.typ is the entry file
typst compile thesis.typ --font-path fonts
# Or (for users who cloned the source repository)
typst compile template/thesis.typ --root . --font-path fonts
# Run typst file as script (for UNIX users who cloned the source repository only)
# ./template/thesis.typ --font-path fonts

For users of VSCode with Tinymist (other editors and more options are documented in the Tinymist Documentation):

// .vscode/settings.json
{
  "tinymist.fontPaths": [
    "${workspaceFolder}/fonts"
  ]
}

For users of the Typst Webapp, since the required Chinese fonts are not provided by default, you need to manually upload the font files to your project. The webapp will automatically recognize the font files (please do not upload compressed files).


Further instructions and examples are included in the template. Starting a project from the template is recommended for a better experience.

Preview

preview

Acknowledgments

Special thanks to OrangeX4 for their contributions to the Nanjing University thesis template modern-nju-thesis. This project is adapted from the modern-nju-thesis template maintained by OrangeX4 and nju-lug. We greatly appreciate their work.

During the adaptation process, we mainly referred the Tsinghua University Thesis Word Template, Tsinghua University Thesis LaTeX Template, and Word & PDF templates issued by the Academic Affairs Office. Our gratitude goes to them and their contributors.

Thanks to Myriad-Dreamin for developing the Tinymist tool.

Relevant Resources

License

The template source code is distributed under the MIT license. You are free to use, modify, and distribute it without any warranty.

Important

This project contains the Tsinghua University emblem and name graphics for creating the Comprehensive Thesis Training cover for undergraduates. These graphics are obtained from the Tsinghua University Visual Identity System without any modification by the maintainers.

Please note that the related graphics and text are registered trademarks of Tsinghua University. Except for this template, they must not be used for any other purpose.

About

📄 Tntt is Not a Tex Thesis Template for Tsinghua university (THU)...

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •