386 字
2 分钟
Typst 体验

Typst是一个Rust编写的基于标记的排版系统, 正在积极开发中, 截至2023.5最新版本为0.3.0.

暂时取代LaTex不太现实, 因为各报刊杂志只会提供LaTex模板; 但是排版能力比MarkDown强太多, 可读性也比LaTex好, 而且很轻量, 只需要20MB(目前)的单二进制文件便可使用, 所以很适合处理一些轻量的排版任务.

官网: https://typst.app

GitHub: https://github.com/typst/typst

文档: https://typst.app/docs/

安装#

macOS/Linux

brew install typst

Arch Linux

pacman -S typst

其他平台可参考https://github.com/typst/typst#installation

命令行使用#

编译

typst compile file.typ

监听改动自动编译

typst watch file.typ

查看已安装字体

typst fonts

与vscode配合使用#

Typst LSP插件提供了typst的lsp, 支持语法高亮和补全.

示例: 制作简历#

语法很简单, 看一遍文档即可上手.

效果

代码

#set text(
    font: (
        // "Source Han Serif SC",  // 衬线字体, 用于打印
        // "Times New Roman",
        // "Songti SC",
        // "STSong",
        "Source Han Sans SC",  // 无衬线字体, 用于显示
        "Hiragino Sans GB",
        "Helvetica",
    ),
    size: 12pt,
    lang: "zh",
)
#set page(
    paper: "a4",
    margin: (x: 1.5cm, y: 1.5cm),
    footer: [
        #h(1fr) #text(fill: rgb("#d9d9d9"))[powered by typst]
    ]
)

#set par(justify: true)

// #show heading.where(level: 2): it => text(
//     weight: "medium",
//     it.body,
// )

#show link: underline

#let section_line() = {
    v(2pt); 
    line(length: 100%, stroke: 1pt + green); 
    v(-5pt);
}

= Alan

simpleslight\@icloud.com |
195\*\*\*\*2202 |
#link("https://github.com/suransea")[github.com/suransea] | 
#link("https://shoco.top")[shoco.top]

== Summary
#section_line()

#lorem(18)

== Key Skills
#section_line()

- #lorem(7)
- #lorem(6)
- #lorem(8)
- #lorem(7)
- #lorem(6)
- #lorem(9)

== Experience
#section_line()

==== #lorem(4) #h(1fr) 2021 --

- #lorem(10)
- #lorem(18)
- #lorem(15)
- #lorem(12)
- #lorem(19)
- #lorem(13)

==== #lorem(5) #h(1fr) 2020 -- 2021

- #lorem(19)
- #lorem(15)
- #lorem(10)
- #lorem(18)
- #lorem(13)

== Education
#section_line()

#lorem(3)

#lorem(4)

2020
Typst 体验
https://shsuco.com/posts/typst体验/
作者
shsuco
发布于
2023-04-20
许可协议
CC BY-NC-SA 4.0