Giter Club home page Giter Club logo

sysu-thesis-typst's Introduction

sysu-thesis-typst

Gitee 仓库镜像(自动同步 GitHub 主仓库,仅供只读访问)

中山大学学位论文 Typst 模板,项目基于 PKUTHSS-Typst 重构。

当前还未完全符合学位论文格式要求,欢迎同学们贡献代码!模板交流 QQ 群:797942860(点此直接加入

输出成品文件预览(每 6 小时自动更新):thesis.pdf

Q:我不会 LaTeX,可以用这个模板写论文吗?

A:完全可以!Typst 是一个比 LaTeX 更简单的排版语言,同时安装更加方便,编译更加快速!

使用方法

由于 Typst 还处于初期的快速开发阶段,本项目需要使用从源码编译的 Typst 版本才能正常生成 PDF。仓库提供了一键安装脚本,按照使用说明运行即可。

Windows 用户

  1. 下载本仓库,或者使用 git clone https://github.com/howardlau1999/sysu-thesis-typst 命令克隆本仓库。
  2. 右键 install_typst.ps1 文件,选择“用 Powershell 运行”,等待 Typst 安装完成。
  3. 根据 Typst 文档,参考 项目结构 中的说明,按照你的需要修改论文的各个部分。
  4. 双击运行 compile.bat,即可生成 thesis.pdf 文件。

Linux/macOS 用户

  1. 下载本仓库,或者使用 git clone https://github.com/howardlau1999/sysu-thesis-typst 命令克隆本仓库。
  2. 使用命令行安装 Rust 工具链以及 Typst:
# 安装 Rust 环境并激活,之前安装过则不需要执行下面这两行
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env

# 安装 Typst CLI
cargo install --git https://github.com/typst/typst.git typst-cli

# 访问缓慢的话,执行以下命令设置清华镜像源,并从镜像站安装
cat << EOF > $HOME/.cargo/config
[source.crates-io]
replace-with = "tuna"

[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"
EOF
cargo install --git https://ghproxy.com/https://github.com/typst/typst.git
  1. 根据 Typst 文档,参考 项目结构 中的说明,按照你的需要修改论文的各个部分。
  2. 执行 make 命令,即可生成 thesis.pdf 文件。

项目结构

主要文件

  • info.typ 文件中包含论文的基本信息,包括作者、学位、导师、学位论文题目等。
  • custom.typ 文件中包含论文的自定义设置,包括行距,字体等。
  • thesis.typ 文件是论文的主体,包含论文的各个章节。在添加或者删除章节文件后,需要同步修改这个文件中的 #include 命令。
  • template.typ 文件是论文的模板,包含论文的各个部分的格式。一般不需要修改。

文件夹

  • chapters 文件夹包含了论文的各个章节文件,你可以自由地增加或删除章节文件,按你自己需要的方式组织文件。在添加或删除文件后,需要同步修改 thesis.typ 文件中的 #include 命令。
  • templates 文件夹包含了论文的各个部分的模板文件,你可以自由地增加或删除模板文件,按你自己需要的方式组织文件。在添加或删除文件后,需要同步修改 template.typ 文件中的 #include 命令。欢迎贡献新的模板文件。
  • functions 文件夹包含了模板使用到的各种自定义辅助函数,如果你想贡献代码,可以在这个文件夹中添加新的辅助函数。
  • fonts 文件夹包含了模板使用到的字体文件,你可以按需要添加或者删除字体文件。在添加或删除文件后,可以运行 typst --font-path fonts fonts 查看 Typst 检测到的字体文件。
  • bibs 文件夹包含了论文的参考文献文件,你可以按需要添加或者删除参考文献文件,目录结构没有特殊需求。
  • images 文件夹包含了论文中使用到的图片文件,你可以按需要添加或者删除图片文件,目录结构没有特殊需求。vi 文件夹包含了校徽的矢量图文件。

sysu-thesis-typst's People

Contributors

howardlau1999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sysu-thesis-typst's Issues

error: module `calc` does not contain `rem`

命令行输入: typst --font-path fonts compile thesis.typ
显示如下内容,抱歉从命令行拷贝过来,位置都发生变化了,主要意思就是calc里面没有rem,然后这个就造成了一系列的问题。
我采用的是windows版本的typst.exe,最新版本的,刚才下载的。
不知道有什么建议可以处理这个问题,谢谢了!

error: module calc does not contain rem
┌─ functions\booktab.typ:17:39

17 │ content_aligns.push(aligns.at(calc.rem(i, aligns.len())))
│ ^^^

help: error occurred in this call of function booktab
┌─ chapters\ch01.typ:180:5

180 │ #booktab(
│ ╭──────^
181 │ │ width: 100%,
182 │ │ aligns: (left, center, right),
183 │ │ columns: (1fr, 1fr, 1fr),
· │
188 │ │ [10], [], [11],
189 │ │ )
│ ╰─────^

help: error occurred while importing this module
┌─ thesis.typ:13:9

13 │ #include "chapters/ch01.typ"
│ ^^^^^^^^^^^^^^^^^^^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.