Skip to content

Commit cb22871

Browse files
authored
Merge branch 'main' into translate-math/binom
2 parents 86dca06 + 4546034 commit cb22871

File tree

10 files changed

+107
-137
lines changed

10 files changed

+107
-137
lines changed

crates/typst-library/src/math/attach.rs

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::foundations::{elem, Content, Packed};
22
use crate::layout::{Length, Rel};
33
use crate::math::{EquationElem, Mathy};
44

5-
/// A base with optional attachments.
5+
/// オプションのアタッチメントを持つベースとなる関数。
66
///
77
/// ```example
88
/// $ attach(
@@ -12,33 +12,30 @@ use crate::math::{EquationElem, Mathy};
1212
/// ```
1313
#[elem(Mathy)]
1414
pub struct AttachElem {
15-
/// The base to which things are attached.
15+
/// アタッチメントを取り付けるベース。
1616
#[required]
1717
pub base: Content,
1818

19-
/// The top attachment, smartly positioned at top-right or above the base.
19+
/// 右上かベースの上にスマート配置された上部アタッチメント。
2020
///
21-
/// You can wrap the base in `{limits()}` or `{scripts()}` to override the
22-
/// smart positioning.
21+
/// ベースを`{limits()}`か`{scripts()}`でラップするとスマート配置を上書きできます。
2322
pub t: Option<Content>,
2423

25-
/// The bottom attachment, smartly positioned at the bottom-right or below
26-
/// the base.
24+
/// 右下かベースの下にスマート配置された下部アタッチメント。
2725
///
28-
/// You can wrap the base in `{limits()}` or `{scripts()}` to override the
29-
/// smart positioning.
26+
/// ベースを`{limits()}`か`{scripts()}`でラップするとスマート配置を上書きできます。
3027
pub b: Option<Content>,
3128

32-
/// The top-left attachment (before the base).
29+
/// 左上のアタッチメント(ベースの前)。
3330
pub tl: Option<Content>,
3431

35-
/// The bottom-left attachment (before base).
32+
/// 左下のアタッチメント(ベースの前)。
3633
pub bl: Option<Content>,
3734

38-
/// The top-right attachment (after the base).
35+
/// 右上のアタッチメント(ベースの後)。
3936
pub tr: Option<Content>,
4037

41-
/// The bottom-right attachment (after the base).
38+
/// 右下のアタッチメント(ベースの後)。
4239
pub br: Option<Content>,
4340
}
4441

@@ -97,33 +94,32 @@ pub struct PrimesElem {
9794
pub count: usize,
9895
}
9996

100-
/// Forces a base to display attachments as scripts.
97+
/// アタッチメントを添え字として表示することをベースに強制。
10198
///
10299
/// ```example
103100
/// $ scripts(sum)_1^2 != sum_1^2 $
104101
/// ```
105102
#[elem(Mathy)]
106103
pub struct ScriptsElem {
107-
/// The base to attach the scripts to.
104+
/// 添え字を取り付けるベース。
108105
#[required]
109106
pub body: Content,
110107
}
111108

112-
/// Forces a base to display attachments as limits.
109+
/// アタッチメントをlimitsとして表示することをベースに強制。
113110
///
114111
/// ```example
115112
/// $ limits(A)_1^2 != A_1^2 $
116113
/// ```
117114
#[elem(Mathy)]
118115
pub struct LimitsElem {
119-
/// The base to attach the limits to.
116+
/// limitsを取り付けるベース。
120117
#[required]
121118
pub body: Content,
122119

123-
/// Whether to also force limits in inline equations.
120+
/// インライン数式でもlimits表示を強制するかどうか。
124121
///
125-
/// When applying limits globally (e.g., through a show rule), it is
126-
/// typically a good idea to disable this.
122+
/// (例えばshowルールを用いて)limitsをグローバルに適用する場合、通常は無効にすることをおすすめします。
127123
#[default(true)]
128124
pub inline: bool,
129125
}

crates/typst-library/src/math/lr.rs

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@ use crate::foundations::{elem, func, Content, NativeElement, SymbolElem};
22
use crate::layout::{Length, Rel};
33
use crate::math::Mathy;
44

5-
/// Scales delimiters.
5+
/// 区切り文字の拡大縮小。
66
///
7-
/// While matched delimiters scale by default, this can be used to scale
8-
/// unmatched delimiters and to control the delimiter scaling more precisely.
7+
/// 対応が取れている区切り文字はデフォルトで拡大縮小しますが、これは対応が取れていない区切り文字を拡大縮小させたり、区切り文字の拡大縮小をより正確に制御するのに便利です。
98
#[elem(title = "Left/Right", Mathy)]
109
pub struct LrElem {
11-
/// The size of the brackets, relative to the height of the wrapped content.
10+
/// ラップしたコンテンツの高さを基準とした括弧の大きさ。
1211
#[resolve]
1312
#[default(Rel::one())]
1413
pub size: Rel<Length>,
1514

16-
/// The delimited content, including the delimiters.
15+
/// 区切り文字を含めた、区切られるコンテンツ。
1716
#[required]
1817
#[parse(
1918
let mut arguments = args.all::<Content>()?.into_iter();
@@ -24,93 +23,93 @@ pub struct LrElem {
2423
pub body: Content,
2524
}
2625

27-
/// Scales delimiters vertically to the nearest surrounding `{lr()}` group.
26+
/// 最も近くで囲んでいる`{lr()}`グループに対して、垂直方向に区切り文字を拡大縮小します。
2827
///
2928
/// ```example
3029
/// $ { x mid(|) sum_(i=1)^n w_i|f_i (x)| < 1 } $
3130
/// ```
3231
#[elem(Mathy)]
3332
pub struct MidElem {
34-
/// The content to be scaled.
33+
/// 拡大縮小させるコンテンツ。
3534
#[required]
3635
pub body: Content,
3736
}
3837

39-
/// Floors an expression.
38+
/// 式に床関数を作用させます。
4039
///
4140
/// ```example
4241
/// $ floor(x/2) $
4342
/// ```
4443
#[func]
4544
pub fn floor(
46-
/// The size of the brackets, relative to the height of the wrapped content.
45+
/// ラップしたコンテンツの高さを基準とした括弧の大きさ。
4746
#[named]
4847
size: Option<Rel<Length>>,
49-
/// The expression to floor.
48+
/// 床関数を作用させる式。
5049
body: Content,
5150
) -> Content {
5251
delimited(body, '⌊', '⌋', size)
5352
}
5453

55-
/// Ceils an expression.
54+
/// 式に天井関数を作用させます。
5655
///
5756
/// ```example
5857
/// $ ceil(x/2) $
5958
/// ```
6059
#[func]
6160
pub fn ceil(
62-
/// The size of the brackets, relative to the height of the wrapped content.
61+
/// ラップしたコンテンツの高さを基準とした括弧の大きさ。
6362
#[named]
6463
size: Option<Rel<Length>>,
65-
/// The expression to ceil.
64+
/// 天井関数を作用させる式。
6665
body: Content,
6766
) -> Content {
6867
delimited(body, '⌈', '⌉', size)
6968
}
7069

71-
/// Rounds an expression.
70+
/// 式を丸めます。
7271
///
7372
/// ```example
7473
/// $ round(x/2) $
7574
/// ```
7675
#[func]
7776
pub fn round(
78-
/// The size of the brackets, relative to the height of the wrapped content.
77+
/// ラップしたコンテンツの高さを基準とした括弧の大きさ。
7978
#[named]
8079
size: Option<Rel<Length>>,
81-
/// The expression to round.
80+
/// 丸める式。
8281
body: Content,
8382
) -> Content {
8483
delimited(body, '⌊', '⌉', size)
8584
}
8685

87-
/// Takes the absolute value of an expression.
86+
/// 式の絶対値を取ります。
8887
///
8988
/// ```example
9089
/// $ abs(x/2) $
9190
/// ```
9291
#[func]
9392
pub fn abs(
94-
/// The size of the brackets, relative to the height of the wrapped content.
93+
/// ラップしたコンテンツの高さを基準とした括弧の大きさ。
9594
#[named]
9695
size: Option<Rel<Length>>,
97-
/// The expression to take the absolute value of.
96+
/// 絶対値を取る式。
9897
body: Content,
9998
) -> Content {
10099
delimited(body, '|', '|', size)
101100
}
102101

103-
/// Takes the norm of an expression.
102+
/// 式のノルムを取ります。
104103
///
105104
/// ```example
106105
/// $ norm(x/2) $
107106
/// ```
108107
#[func]
109108
pub fn norm(
110-
/// The size of the brackets, relative to the height of the wrapped content.
109+
/// ラップしたコンテンツの高さを基準とした括弧の大きさ。
111110
#[named]
112111
size: Option<Rel<Length>>,
113-
/// The expression to take the norm of.
112+
/// ノルムを取る式。
114113
body: Content,
115114
) -> Content {
116115
delimited(body, '‖', '‖', size)

crates/typst-library/src/math/matrix.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,21 @@ use crate::visualize::Stroke;
1515
const DEFAULT_ROW_GAP: Em = Em::new(0.2);
1616
const DEFAULT_COL_GAP: Em = Em::new(0.5);
1717

18-
/// A column vector.
18+
/// 列ベクトル。
1919
///
20-
/// Content in the vector's elements can be aligned with the
21-
/// [`align`]($math.vec.align) parameter, or the `&` symbol.
20+
/// ベクトルの要素内のコンテンツは[`align`]($math.vec.align)パラメーターか`&`記号を用いて配置できます。
2221
///
23-
/// # Example
22+
/// #
2423
/// ```example
2524
/// $ vec(a, b, c) dot vec(1, 2, 3)
2625
/// = a + 2b + 3c $
2726
/// ```
2827
#[elem(title = "Vector", Mathy)]
2928
pub struct VecElem {
30-
/// The delimiter to use.
29+
/// 用いる区切り文字。
3130
///
32-
/// Can be a single character specifying the left delimiter, in which case
33-
/// the right delimiter is inferred. Otherwise, can be an array containing a
34-
/// left and a right delimiter.
31+
/// 単一の文字で左区切り文字を指定する場合、右区切り文字は自動的に推論されます。
32+
/// それ以外の場合は、左区切り文字と右区切り文字を含む配列を指定します。
3533
///
3634
/// ```example
3735
/// #set math.vec(delim: "[")
@@ -40,7 +38,7 @@ pub struct VecElem {
4038
#[default(DelimiterPair::PAREN)]
4139
pub delim: DelimiterPair,
4240

43-
/// The horizontal alignment that each element should have.
41+
/// 各要素の水平方向の配置。
4442
///
4543
/// ```example
4644
/// #set math.vec(align: right)
@@ -50,7 +48,7 @@ pub struct VecElem {
5048
#[default(HAlignment::Center)]
5149
pub align: HAlignment,
5250

53-
/// The gap between elements.
51+
/// 要素間の間隔。
5452
///
5553
/// ```example
5654
/// #set math.vec(gap: 1em)
@@ -60,7 +58,7 @@ pub struct VecElem {
6058
#[default(DEFAULT_ROW_GAP.into())]
6159
pub gap: Rel<Length>,
6260

63-
/// The elements of the vector.
61+
/// ベクトルの要素。
6462
#[variadic]
6563
pub children: Vec<Content>,
6664
}

crates/typst-library/src/math/op.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,25 @@ use crate::layout::HElem;
55
use crate::math::{upright, Mathy, THIN};
66
use crate::text::TextElem;
77

8-
/// A text operator in an equation.
8+
/// 数式中のテキスト演算子。
99
///
10-
/// # Example
10+
/// #
1111
/// ```example
1212
/// $ tan x = (sin x)/(cos x) $
1313
/// $ op("custom",
1414
/// limits: #true)_(n->oo) n $
1515
/// ```
1616
///
17-
/// # Predefined Operators { #predefined }
18-
/// Typst predefines the operators `arccos`, `arcsin`, `arctan`, `arg`, `cos`,
19-
/// `cosh`, `cot`, `coth`, `csc`, `csch`, `ctg`, `deg`, `det`, `dim`, `exp`,
20-
/// `gcd`, `lcm`, `hom`, `id`, `im`, `inf`, `ker`, `lg`, `lim`, `liminf`,
21-
/// `limsup`, `ln`, `log`, `max`, `min`, `mod`, `Pr`, `sec`, `sech`, `sin`,
22-
/// `sinc`, `sinh`, `sup`, `tan`, `tanh`, `tg` and `tr`.
17+
/// # 定義済み演算子 { #predefined }
18+
/// Typstではあらかじめ以下の演算子が定義されています。
19+
/// `arccos`、`arcsin`、`arctan`、`arg`、`cos`、`cosh`、`cot`、`coth`、`csc`、`csch`、`ctg`、`deg`、`det`、`dim`、`exp`、`gcd`、`lcm`、`hom`、`id`、`im`、`inf`、`ker`、`lg`、`lim`、`liminf`、`limsup`、`ln`、`log`、`max`、`min`、`mod`、`Pr`、`sec`、`sech`、`sin`、`sinc`、`sinh`、`sup`、`tan`、`tanh`、`tg`、`tr`。
2320
#[elem(title = "Text Operator", Mathy)]
2421
pub struct OpElem {
25-
/// The operator's text.
22+
/// 演算子のテキスト。
2623
#[required]
2724
pub text: Content,
2825

29-
/// Whether the operator should show attachments as limits in display mode.
26+
/// ディスプレイモードのときに演算子のアタッチメントをlimitsのように表示するかどうか。
3027
#[default(false)]
3128
pub limits: bool,
3229
}

crates/typst-library/src/model/enum.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use crate::model::{
4141
/// ```
4242
///
4343
/// setルールを用いることで、
44-
/// すべてのリストを異なるナンバリングスタイルに簡単に切り替えることができます
44+
/// すべてのリストを異なる番号付けスタイルに簡単に切り替えることができます
4545
/// ```example
4646
/// #set enum(numbering: "a)")
4747
///
@@ -64,7 +64,7 @@ use crate::model::{
6464
/// この関数には専用の構文もあります。
6565
///
6666
/// - 行の先頭にプラス記号をつけると、
67-
/// 自動的にナンバリングされたリスト項目が作成されます
67+
/// 自動的に番号付けされたリスト項目が作成されます
6868
/// - 行の先頭に数字とピリオドを付けると、
6969
/// 明示的に番号を指定したリスト項目が作成されます。
7070
///
@@ -97,10 +97,10 @@ pub struct EnumElem {
9797
#[default(true)]
9898
pub tight: bool,
9999

100-
/// リストをどのようにナンバリングするかを指定します
101-
/// [ナンバリングパターンまたは関数]($numbering)を受け付けます。
100+
/// リストをどのように番号付けするかを指定します
101+
/// [番号付けパターンまたは関数]($numbering)を受け付けます。
102102
///
103-
/// ナンバリングのパターンに複数のカウント記号が含まれている場合
103+
/// 番号付けのパターンに複数のカウント記号が含まれている場合
104104
/// それらはネストされたリストに適用されます。
105105
/// 関数が指定された場合、`full`が`{false}`の場合は1つの引数を受け取り、`{true}`の場合は複数の引数を受け取ります。
106106
///
@@ -132,7 +132,7 @@ pub struct EnumElem {
132132
pub start: Smart<usize>,
133133

134134
/// 親リストの番号も含めて、
135-
/// 完全なナンバリングを表示するかどうかを指定します
135+
/// 完全な番号付けを表示するかどうかを指定します
136136
///
137137
///
138138
/// ```example
@@ -145,7 +145,7 @@ pub struct EnumElem {
145145
#[default(false)]
146146
pub full: bool,
147147

148-
/// このリストのナンバリングを逆順にするかどうかを指定します
148+
/// このリストの番号付けを逆順にするかどうかを指定します
149149
///
150150
/// ```example
151151
/// #set enum(reversed: true)
@@ -160,7 +160,7 @@ pub struct EnumElem {
160160
#[resolve]
161161
pub indent: Length,
162162

163-
/// 各項目のナンバリングと本文の間隔を指定します
163+
/// 各項目の番号付けと本文の間隔を指定します
164164
#[resolve]
165165
#[default(Em::new(0.5).into())]
166166
pub body_indent: Length,

crates/typst-library/src/model/list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::text::TextElem;
1616
/// 各項目の先頭にマーカーを付け、
1717
/// 一連の項目を縦に並べて表示します。
1818
///
19-
/// # Example
19+
/// #
2020
/// ```example
2121
/// Normal list.
2222
/// - Text

0 commit comments

Comments
 (0)