Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions crates/typst-library/src/foundations/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,25 +478,25 @@ cast! {
MathClass::Vary => "vary",
MathClass::Special => "special",
}),
/// The default class for non-special things.
/// 特別でない要素のデフォルトクラス。
"normal" => MathClass::Normal,
/// Punctuation, e.g. a comma.
/// カンマなどの句読点。
"punctuation" => MathClass::Punctuation,
/// An opening delimiter, e.g. `(`.
/// `(`などの開き区切り文字。
"opening" => MathClass::Opening,
/// A closing delimiter, e.g. `)`.
/// `)`などの閉じ区切り文字。
"closing" => MathClass::Closing,
/// A delimiter that is the same on both sides, e.g. `|`.
/// `|`などの両側が同じ区切り文字。
"fence" => MathClass::Fence,
/// A large operator like `sum`.
/// `sum`のような大型演算子。
"large" => MathClass::Large,
/// A relation like `=` or `prec`.
/// `=``prec`のような関係記号。
"relation" => MathClass::Relation,
/// A unary operator like `not`.
/// `not`のような単項演算子。
"unary" => MathClass::Unary,
/// A binary operator like `times`.
/// `times`のような二項演算子。
"binary" => MathClass::Binary,
/// An operator that can be both unary or binary like `+`.
/// `+`のような単項にも二項にもなる演算子。
"vary" => MathClass::Vary,
}

Expand Down
16 changes: 7 additions & 9 deletions crates/typst-library/src/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,13 @@ impl AlignPointElem {
}
}

/// 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}`](math.limits) and [`{scripts}`](math.scripts).
/// これは、特定の記号を異なるクラスのように扱うのに便利です。例えば、ある記号を関係のように振る舞わせることができます。
/// 記号のクラスは、レイアウトのされ方、周囲の空白の入れ方、添え字がデフォルトでどのように取り付けられるかを定義します。
/// 添え字の取り付け方は[`{limits}`](math.limits)や[`{scripts}`](math.scripts)を使って常に上書きできることに注意してください。
///
/// # Example
/// #
/// ```example
/// #let loves = math.class(
/// "relation",
Expand All @@ -138,11 +136,11 @@ impl AlignPointElem {
/// ```
#[elem(Mathy)]
pub struct ClassElem {
/// The class to apply to the content.
/// コンテンツに適用するクラス。
#[required]
pub class: MathClass,

/// The content to which the class is applied.
/// クラスを適用するコンテンツ。
#[required]
pub body: Content,
}
2 changes: 1 addition & 1 deletion website/translation-status.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"/docs/reference/math/binom/": "translated",
"/docs/reference/math/cancel/": "translated",
"/docs/reference/math/cases/": "translated",
"/docs/reference/math/class/": "untranslated",
"/docs/reference/math/class/": "translated",
"/docs/reference/math/equation/": "translated",
"/docs/reference/math/frac/": "translated",
"/docs/reference/math/lr/": "translated",
Expand Down