Skip to content

怎么把 cal 字体变成 LaTeX 里 mathcal 默认的那种?

怎么把 cal 字体变成 LaTeX 里 mathcal 默认的那种?

Typst 中数学字体默认是 New Computer Modern Math,与 LaTeX 中默认[1]的 Computer Modern Math 略有不同。

若想使用 LaTeX 默认的\mathcal花体,需要更换字体。

  1. 从 matplotlib 的mpl-data/fonts/ttf/文件夹下载cmsy10.ttf
  2. 设置font: "cmsy10"
typst
$ cal(K M Z) $
#let cal(s) = text(s, font: "cmsy10")
$ cal(K M Z) $

image

为何出现 matplotlib?

Computer Modern Math 早于 OpenType 技术标准,通常以 Type 1 字体形式存在,如cmsy10.pfm

今天很多软件都不支持*.pfm。matplotlib 开发者将它转换成了cmsy10.ttf,可供 Typst 等软件使用。

另外,LaTeX 中有 calligraphic 和 script 两种花体,后者请参考如何实现\mathscr的花体符号


  1. 此处指不使用 unicode-math 时的默认数学字体;若使用 unicode-math,默认字体是 New Computer Modern Math,Typst 效果与之相同。 ↩︎

What do you think?
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v3.5.1

基于 MIT 许可发布