Development build 586e1bd4
Typst文档简体中文版v0.15.1 + dev 586e1bd4

class元素
Question mark
自始可用Go to source

Forced use of a certain math class.

This is useful to treat certain symbols as if they were of a different class, e.g. to make a symbol behave like a relation. The class of a symbol defines the way it is laid out, including spacing around it, and how its scripts are attached by default. Note that the latter can always be overridden using limits and scripts.

Example

#let loves = math.class( "relation", sym.suit.heart, ) $x loves y and y loves 5$

参数
Question mark

math.class() → content

class
str
必需参数
Question mark
位置参数
Question mark

The class to apply to the content.

Expand展开可填值[⚠️]
VariantDetails
"normal"The default class for non-special things.
"punctuation"Punctuation, e.g. a comma.
"opening"An opening delimiter, e.g. (.
"closing"A closing delimiter, e.g. ).
"fence"A delimiter that is the same on both sides, e.g. |.
"large"

A large operator like sum.

If the body is a single glyph, this class vertically centers it on the math axis (where the fraction line sits) and stretches it vertically when in display style.

"relation"A relation like = or prec.
"unary"A unary operator like not.
"binary"A binary operator like times.
"vary"An operator that can be both unary or binary like +.
"diacritic"An accent character.

body
content
必需参数
Question mark
位置参数
Question mark

The content to which the class is applied.