如何设置中文字体的斜体?
用其它字体代替
一般使用其他字体(如楷体)代替斜体:
typst
#show emph: text.with(font: ("(西文字体)", "STKaiti"))
孔乙己_上大人_

log
warning: unknown font family: (西文字体)
┌─ <stdin>:3:28
│
3 │ #show emph: text.with(font: ("(西文字体)", "STKaiti"))
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unknown font family: stkaiti
┌─ <stdin>:3:28
│
3 │ #show emph: text.with(font: ("(西文字体)", "STKaiti"))
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
另法:强行倾斜
伪斜体也可使用skew
函数:
typst
#skew(ax: -12deg)[111]111

但是针对一大段效果并不好。
typst
#set text(font: ("New Computer Modern", "Noto Serif CJK SC"), lang: "zh")
#skew(ax: -12deg)[
Typst 是可用于出版的可编程标记语言,拥有变量、函数、包管理与错误检查等现代编程语言的特性,同时也提供了闭包等特性,便于进行函数式编程。以及包括了 [标记模式]、{脚本模式} 与 数学模式 等多种模式的作用域,并且它们可以不限深度地、交互地嵌套。并且通过 包管理,你不再需要像 TexLive 一样在本地安装一大堆并不必要的宏包,而是按需自动从云端下载。
]

log
warning: unknown font family: noto serif cjk sc
┌─ <stdin>:3:16
│
3 │ #set text(font: ("New Computer Modern", "Noto Serif CJK SC"), lang: "zh")
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^