p

pointless-size

@preview

中文字号的号数制及字体度量单位 Chinese size system (hào-system) and type-related measurements units

v0.1.3
MIT
1 downloads

Package Information

Last Updated
Authors
Y.D.X.
Categories
textlanguages

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/pointless-size:0.1.3

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/pointless-size:0.1.3": *

Version History

0.1.3
bdd4f60aba11...
0.1.2
335e55c458d4...
0.1.1
545904e46bf8...
0.1.0
f6bb55eee159...

Typst Pointless Size——字号 zìhào

Typst Universe
GitHub Repo stars
Changelog

中文字号的号数制及字体度量单位。
Chinese size system (hào-system) and type-related measurements units.

#import "@preview/pointless-size:0.1.3": zh, zihao

#set text(size: zh(5)) // 五号(10.5pt)
// or
#set text(zh(5))
#show: zihao(5)

// 小号用负数或 .5 表示 Use negative numbers or .5 for small sizes 
#zh(-4)   #zh(4.5) // 小四(12pt)
#zh(1)    #zh(1.0) // 一号(26pt)
#zh(-1)   #zh(1.5) // 小一(24pt)
#zh("-0") #zh(0.5) // 小初(36pt)
#zh(0)    #zh(0.0) // 初号(42pt)

// 写汉字也可以 Han characters are also acceptable
#zh("五号") #zh("五")
#zh("小五")

转换表 Conversion table
倍数关系 Multiples

覆盖定义 Override

字号没有统一规定,本包默认与 CTeX、MS Word、WPS、Adobe 的中文规则一致。
Chinese size systems were not standardized. By default, this package is consistent with Chinese rules of CTeX, MS Word, WPS, Adobe.

如想覆盖定义:If you want to override:

#import "@preview/pointless-size:0.1.3": zh as _zh

#let zh = _zh.with(overrides: ((7, 5.25pt),))

#assert.eq(_zh(7), 5.5pt)
#assert.eq(zh(7), 5.25pt)

参考资料 References