Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
38 changes: 17 additions & 21 deletions crates/typst-library/src/math/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,19 @@ pub fn bb(
body.styled(EquationElem::set_variant(MathVariant::Bb))
}

/// Forced display style in math.
/// 数式中でディスプレイスタイルを強制します。
///
/// This is the normal size for block equations.
/// これはブロック数式における標準サイズです。

///
/// ```example
/// $sum_i x_i/2 = display(sum_i x_i/2)$
/// ```
#[func(title = "Display Size", keywords = ["displaystyle"])]
pub fn display(
/// The content to size.
/// 大きさを指定したいコンテンツ。
body: Content,
/// Whether to impose a height restriction for exponents, like regular sub-
/// and superscripts do.
/// 通常の下付き文字や上付き文字のように、指数に高さ制限を課すかどうか。
#[named]
#[default(false)]
cramped: bool,
Expand All @@ -161,20 +161,19 @@ pub fn display(
.styled(EquationElem::set_cramped(cramped))
}

/// Forced inline (text) style in math.
/// 数式中でインライン(テキスト)スタイルを強制します。
///
/// This is the normal size for inline equations.
/// これはインライン数式における標準サイズです。
///
/// ```example
/// $ sum_i x_i/2
/// = inline(sum_i x_i/2) $
/// ```
#[func(title = "Inline Size", keywords = ["textstyle"])]
pub fn inline(
/// The content to size.
/// 大きさを指定したいコンテンツ。
body: Content,
/// Whether to impose a height restriction for exponents, like regular sub-
/// and superscripts do.
/// 通常の下付き文字や上付き文字のように、指数に高さ制限を課すかどうか。
#[named]
#[default(false)]
cramped: bool,
Expand All @@ -183,19 +182,18 @@ pub fn inline(
.styled(EquationElem::set_cramped(cramped))
}

/// Forced script style in math.
/// 数式中でスクリプトスタイルを強制します。
///
/// This is the smaller size used in powers or sub- or superscripts.
/// これは、冪乗、下付き文字、上付き文字で使用される小さいサイズです。
///
/// ```example
/// $sum_i x_i/2 = script(sum_i x_i/2)$
/// ```
#[func(title = "Script Size", keywords = ["scriptstyle"])]
pub fn script(
/// The content to size.
/// 大きさを指定したいコンテンツ。
body: Content,
/// Whether to impose a height restriction for exponents, like regular sub-
/// and superscripts do.
/// 通常の下付き文字や上付き文字のように、指数に高さ制限を課すかどうか。
#[named]
#[default(true)]
cramped: bool,
Expand All @@ -204,20 +202,18 @@ pub fn script(
.styled(EquationElem::set_cramped(cramped))
}

/// Forced second script style in math.
/// 数式中で第2スクリプトスタイルを強制します。
///
/// This is the smallest size, used in second-level sub- and superscripts
/// (script of the script).
/// これは、第2レベルの下付き文字や上付き文字(添え字の添え字)で使用される最も小さいサイズです。
///
/// ```example
/// $sum_i x_i/2 = sscript(sum_i x_i/2)$
/// ```
#[func(title = "Script-Script Size", keywords = ["scriptscriptstyle"])]
pub fn sscript(
/// The content to size.
/// 大きさを指定したいコンテンツ。
body: Content,
/// Whether to impose a height restriction for exponents, like regular sub-
/// and superscripts do.
/// 通常の下付き文字や上付き文字のように、指数に高さ制限を課すかどうか。
#[named]
#[default(true)]
cramped: bool,
Expand Down
31 changes: 15 additions & 16 deletions docs/reference/groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,27 @@
path: ["math"]
filter: ["display", "inline", "script", "sscript"]
details: |
Forced size styles for expressions within formulas.
数式中の式に大きさに関するスタイルを強制します。

These functions allow manual configuration of the size of equation elements
to make them look as in a display/inline equation or as if used in a root or
sub/superscripts.
これらの関数を用いると、数式要素の大きさを、ブロック/インライン数式中や、根号、下付き文字、上付き文字の中で使われているかのようなものに手動で設定できます。

- name: underover
title: Under/Over
category: math
path: ["math"]
filter: [
"underline",
"overline",
"underbrace",
"overbrace",
"underbracket",
"overbracket",
"underparen",
"overparen",
"undershell",
"overshell",
]
filter:
[
"underline",
"overline",
"underbrace",
"overbrace",
"underbracket",
"overbracket",
"underparen",
"overparen",
"undershell",
"overshell",
]
details: |
Delimiters above or below parts of an equation.

Expand Down
2 changes: 1 addition & 1 deletion website/translation-status.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"/docs/reference/math/mat/": "untranslated",
"/docs/reference/math/primes/": "untranslated",
"/docs/reference/math/roots/": "translated",
"/docs/reference/math/sizes/": "untranslated",
"/docs/reference/math/sizes/": "translated",
"/docs/reference/math/stretch/": "untranslated",
"/docs/reference/math/styles/": "untranslated",
"/docs/reference/math/op/": "untranslated",
Expand Down