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
14 changes: 7 additions & 7 deletions crates/typst-library/src/math/style.rs
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
use crate::foundations::{func, Cast, Content, Smart};
use crate::math::EquationElem;

/// Bold font style in math.
/// 数式中の太字フォントスタイル。
///
/// ```example
/// $ bold(A) := B^+ $
/// ```
#[func(keywords = ["mathbf"])]
pub fn bold(
/// The content to style.
/// スタイルを適用するコンテンツ。
body: Content,
) -> Content {
body.styled(EquationElem::set_bold(true))
}

/// Upright (non-italic) font style in math.
/// 数式中の立体(非斜体)フォントスタイル。
///
/// ```example
/// $ upright(A) != A $
/// ```
#[func(keywords = ["mathup"])]
pub fn upright(
/// The content to style.
/// スタイルを適用するコンテンツ。
body: Content,
) -> Content {
body.styled(EquationElem::set_italic(Smart::Custom(false)))
}

/// Italic font style in math.
/// 数式中の斜体フォントスタイル。
///
/// For roman letters and greek lowercase letters, this is already the default.
/// これがローマ字とギリシャ文字の小文字のデフォルトです。
#[func(keywords = ["mathit"])]
pub fn italic(
/// The content to style.
/// スタイルを適用するコンテンツ。
body: Content,
) -> Content {
body.styled(EquationElem::set_italic(Smart::Custom(true)))
Expand Down
5 changes: 2 additions & 3 deletions docs/reference/groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
path: ["math"]
filter: ["upright", "italic", "bold"]
details: |
Alternate letterforms within formulas.
数式中の別字体。

These functions are distinct from the [`text`] function because math fonts
contain multiple variants of each letter.
数式フォントは各文字に対して複数の異体字を持つため、これらの関数は[`text`]関数とは異なります。

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