# Prints available subcommands and options. typst help
# Prints detailed usage of a subcommand. typst help watch
静态编译
使用 compile 子命令:
1 2 3 4 5
# Creates `file.pdf` in working directory. typst compile file.typ
# Creates PDF file at the desired path. typst compile path/to/source.typ path/to/output.pdf
即时编译
用 watch 子命令:
1 2
# Watches source files and recompiles on changes. typst watch file.typ
查看可用字体
1
typst fonts
会打印出 font 列表.
添加字体
结合 compile 和 fonts 子命令:
1 2 3 4 5 6 7 8
# Adds additional directories to search for fonts. typst compile --font-path path/to/fonts file.typ
# Lists all of the discovered fonts in the system and the given directory. typst fonts --font-path path/to/fonts
# Or via environment variable (Linux syntax). TYPST_FONT_PATHS=path/to/fonts typst fonts
Typst 基本语法
Typst 文件一般以 typ 结尾.
添加标题
用 =, 如:
1 2 3 4 5 6
= Introduction In this report, we will explore the various factors that influence _fluid dynamics_ in glaciers and how they contribute to the formation and behaviour of these natural structures.
二级标题用 ==, 三级用 === 等. 分自然段直接空行即可:
1 2 3 4 5 6 7 8 9 10
= Introduction == second === third In this report, we will explore the various factors that influence _fluid dynamics_ in glaciers and how they contribute to the formation and behaviour of these natural structures.
hello newline
列表
有序列表用 +, 如:
1 2 3
+ The climate + The topography + The geology
编译的结果如:
无序列表则用 -, 如:
1 2 3
- The climate - The topography - The geology
编译结果如:
子列表如:
1 2 3 4 5
+ The climate - Temperature - Precipitation + The topography + The geology