From 2cccc9db63d30df68ad65153a1b267f83bc25890 Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Tue, 27 May 2025 11:02:11 +0900 Subject: [PATCH 01/14] =?UTF-8?q?=20`/docs/reference/model/par/`=E3=81=AE?= =?UTF-8?q?=E7=BF=BB=E8=A8=B3=E3=82=92=E9=96=8B=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/translation-status.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/translation-status.json b/website/translation-status.json index d1ff89a39..3f27f82c0 100644 --- a/website/translation-status.json +++ b/website/translation-status.json @@ -55,7 +55,7 @@ "/docs/reference/model/enum/": "translated", "/docs/reference/model/numbering/": "untranslated", "/docs/reference/model/outline/": "untranslated", - "/docs/reference/model/par/": "untranslated", + "/docs/reference/model/par/": "translated", "/docs/reference/model/parbreak/": "untranslated", "/docs/reference/model/quote/": "untranslated", "/docs/reference/model/ref/": "translated", From 5a13277faa1f4e553585018845318baf9374d18e Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Tue, 27 May 2025 11:07:33 +0900 Subject: [PATCH 02/14] =?UTF-8?q?`/docs/reference/model/parbreak/`?= =?UTF-8?q?=E3=81=AE=E7=BF=BB=E8=A8=B3=E7=8A=B6=E6=B3=81=E3=82=92`translat?= =?UTF-8?q?ed`=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/translation-status.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/translation-status.json b/website/translation-status.json index 3f27f82c0..3b68e09e1 100644 --- a/website/translation-status.json +++ b/website/translation-status.json @@ -56,7 +56,7 @@ "/docs/reference/model/numbering/": "untranslated", "/docs/reference/model/outline/": "untranslated", "/docs/reference/model/par/": "translated", - "/docs/reference/model/parbreak/": "untranslated", + "/docs/reference/model/parbreak/": "translated", "/docs/reference/model/quote/": "untranslated", "/docs/reference/model/ref/": "translated", "/docs/reference/model/strong/": "untranslated", From e1b387925d90f1bd8c96ca5f673651517c2c70bf Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Tue, 27 May 2025 15:00:33 +0900 Subject: [PATCH 03/14] =?UTF-8?q?=E3=80=8C=E4=BE=8B=E3=80=8D=E3=81=BE?= =?UTF-8?q?=E3=81=A7=E7=BF=BB=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 130 +++++++++++++------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index cf31b5195..a68c18b32 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -10,71 +10,71 @@ use crate::introspection::{Count, CounterUpdate, Locatable}; use crate::layout::{Em, HAlignment, Length, OuterHAlignment}; use crate::model::Numbering; -/// A logical subdivison of textual content. -/// -/// Typst automatically collects _inline-level_ elements into paragraphs. -/// Inline-level elements include [text], [horizontal spacing]($h), -/// [boxes]($box), and [inline equations]($math.equation). -/// -/// To separate paragraphs, use a blank line (or an explicit [`parbreak`]). -/// Paragraphs are also automatically interrupted by any block-level element -/// (like [`block`], [`place`], or anything that shows itself as one of these). -/// -/// The `par` element is primarily used in set rules to affect paragraph -/// properties, but it can also be used to explicitly display its argument as a -/// paragraph of its own. Then, the paragraph's body may not contain any -/// block-level content. -/// -/// # Boxes and blocks -/// As explained above, usually paragraphs only contain inline-level content. -/// However, you can integrate any kind of block-level content into a paragraph -/// by wrapping it in a [`box`]. -/// -/// Conversely, you can separate inline-level content from a paragraph by -/// wrapping it in a [`block`]. In this case, it will not become part of any -/// paragraph at all. Read the following section for an explanation of why that -/// matters and how it differs from just adding paragraph breaks around the -/// content. -/// -/// # What becomes a paragraph? -/// When you add inline-level content to your document, Typst will automatically -/// wrap it in paragraphs. However, a typical document also contains some text -/// that is not semantically part of a paragraph, for example in a heading or -/// caption. -/// -/// The rules for when Typst wraps inline-level content in a paragraph are as -/// follows: -/// -/// - All text at the root of a document is wrapped in paragraphs. -/// -/// - Text in a container (like a `block`) is only wrapped in a paragraph if the -/// container holds any block-level content. If all of the contents are -/// inline-level, no paragraph is created. -/// -/// In the laid-out document, it's not immediately visible whether text became -/// part of a paragraph. However, it is still important for various reasons: -/// -/// - Certain paragraph styling like `first-line-indent` will only apply to -/// proper paragraphs, not any text. Similarly, `par` show rules of course -/// only trigger on paragraphs. -/// -/// - A proper distinction between paragraphs and other text helps people who -/// rely on assistive technologies (such as screen readers) navigate and -/// understand the document properly. Currently, this only applies to HTML -/// export since Typst does not yet output accessible PDFs, but support for -/// this is planned for the near future. -/// -/// - HTML export will generate a `

` tag only for paragraphs. -/// -/// When creating custom reusable components, you can and should take charge -/// over whether Typst creates paragraphs. By wrapping text in a [`block`] -/// instead of just adding paragraph breaks around it, you can force the absence -/// of a paragraph. Conversely, by adding a [`parbreak`] after some content in a -/// container, you can force it to become a paragraph even if it's just one -/// word. This is, for example, what [non-`tight`]($list.tight) lists do to -/// force their items to become paragraphs. -/// -/// # Example +/// テキストコンテンツの論理的な区分。 +/// +/// Typstは _インラインレベル_ の要素を自動的に段落にまとめます。 +/// インラインレベルの要素には、[テキスト]($text)、 [水平方向の空白]($h)、 +/// [ボックス]($box)、[インライン数式]($math.equation)が含まれます。 +/// +/// 段落を区切るには、空行(または明示的な[`parbreak`])を使用します。 +/// 段落は、任意のブロックレベルの要素 +/// ([`block`]、[`place`]、またはこれらのいずれかとして表示されるもの)によっても自動的に区切られます。 +/// +/// `par`要素は主にsetルールにおいて段落のプロパティに影響を与えるために使用されますが、 +/// その引数を明示的に独立した段落として表示するためにも使用できます。 +/// その場合、 +/// その段落の本文にはブロックレベルのコンテンツを含めることはできません。 +/// +/// # ボックスとブロック +/// 上記の通り、通常、段落はインラインレベルのコンテンツのみを含みます。 +/// しかし、[`box`]でラップすることで、 +/// あらゆる種類のブロックレベルのコンテンツを段落に組み込むことができます。 +/// +/// 逆に、インラインレベルのコンテンツを[`block`]でラップすることにより、 +/// コンテンツを段落から分離できます。 +/// この場合、そのコンテンツはどの段落にも属さなくなります。 +/// なぜこれが重要なのか、また単にコンテンツの前後に段落区切りを追加することとどう異なるのかについては、 +/// 次のセクションをお読みください。 +/// +/// # 何が段落になるのか? +/// インラインレベルのコンテンツをドキュメントに追加すると、 +/// Typstは自動的にそれを段落としてラップします。 +/// しかし、一般的なドキュメントには、見出しやキャプションなど、 +/// 意味的に段落の一部ではないテキストも含まれます。 +/// +/// Typstがインラインレベルのコンテンツを +/// 段落としてラップするルールは次の通りです。 +/// +/// - ドキュメントのルート(最上位)にある全てのテキストは段落としてラップされます。 +/// +/// - コンテナ(`block`など)内のテキストは、 +/// そのコンテナにブロックレベルの要素が含まれている場合にのみ段落としてラップされます。 +/// コンテナの内容が全てインラインレベル要素である場合は、段落は作成されません。 +/// +/// 組版された文書では、テキストが段落の一部になったかどうかはすぐにはわかりません。 +/// しかし、いくつかの理由からこれは依然として重要です。 +/// +/// - `first-line-indent`などの特定の段落スタイルは正しい段落に対してのみ適用され、 +/// 任意のテキストには適用されません。 +/// 同様に、`par`に対するshowルールももちろん段落に対してのみ適用されます。 +/// +/// - 段落とその他のテキストを適切に区別することは、 +/// スクリーンリーダーなどの支援技術を利用する人々が文書を正しく読み解き、理解するのに役立ちます。 +/// 現在はTypstがアクセシブルなPDFをまだ出力しないため、 +/// この仕組みはHTMLエクスポートにのみ適用されますが、 +/// 近い将来PDFへのサポートも計画されています。 +/// +/// - HTMLエクスポートでは、段落に対してのみ`

`タグが生成されます。 +/// +/// 独自の再利用可能なコンポーネントを作成する際には、 +/// Typstが段落を作成するかどうかを自分で制御できますし、制御すべきです。 +/// テキストを単に段落区切りで囲むのではなく、 +/// `block`で囲むことで段落を作成させないようにできます。 +/// 逆に、コンテナ内のコンテンツの後に`parbreak`を追加することで、 +/// たとえ1つの単語であっても段落にすることができます。 +/// これは、[非タイト]($list.tight)リストがその項目を段落にするために行う手法の例です。 +/// +/// # 例 /// ```example /// #set par( /// first-line-indent: 1em, From 828e829caf7a7509123052026eaffd0903d6e2cd Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Tue, 27 May 2025 15:48:48 +0900 Subject: [PATCH 04/14] =?UTF-8?q?=E5=8D=8A=E8=A7=92=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E6=8B=AC=E5=BC=A7=E3=82=92?= =?UTF-8?q?=E5=85=A8=E8=A7=92=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index a68c18b32..efe78ac6b 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -45,7 +45,7 @@ use crate::model::Numbering; /// Typstがインラインレベルのコンテンツを /// 段落としてラップするルールは次の通りです。 /// -/// - ドキュメントのルート(最上位)にある全てのテキストは段落としてラップされます。 +/// - ドキュメントのルート(最上位)にある全てのテキストは段落としてラップされます。 /// /// - コンテナ(`block`など)内のテキストは、 /// そのコンテナにブロックレベルの要素が含まれている場合にのみ段落としてラップされます。 From 13bda0fee54d3c963693635964b122ced89a0eff Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Wed, 28 May 2025 13:04:12 +0900 Subject: [PATCH 05/14] =?UTF-8?q?=E3=80=8C=E5=BC=95=E6=95=B0=E3=80=8D?= =?UTF-8?q?=E3=81=BE=E3=81=A7=E7=BF=BB=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 108 +++++++++++++------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index efe78ac6b..2b0453df2 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -95,55 +95,55 @@ use crate::model::Numbering; /// ``` #[elem(scope, title = "Paragraph")] pub struct ParElem { - /// The spacing between lines. - /// - /// Leading defines the spacing between the [bottom edge]($text.bottom-edge) - /// of one line and the [top edge]($text.top-edge) of the following line. By - /// default, these two properties are up to the font, but they can also be - /// configured manually with a text set rule. - /// - /// By setting top edge, bottom edge, and leading, you can also configure a - /// consistent baseline-to-baseline distance. You could, for instance, set - /// the leading to `{1em}`, the top-edge to `{0.8em}`, and the bottom-edge - /// to `{-0.2em}` to get a baseline gap of exactly `{2em}`. The exact - /// distribution of the top- and bottom-edge values affects the bounds of - /// the first and last line. + /// 行間。 + /// + /// leadingは、 + /// ある行の[下端]($text.bottom-edge)と次の行の[上端]($text.top-edge)との間隔を定義します。 + /// デフォルトではこれら2つのプロパティはフォントによって決まりますが、 + /// テキストのsetルールを使用して手動で設定することもできます。 + /// + /// top-edge、bottom-edge、およびleadingを設定することで、 + /// ベースライン間の距離を一定に揃えることも可能です。 + /// たとえば、leadingを `{1em}`、top-edgeを`{0.8em}`、 + /// bottom-edgeを'{-0.2em}'に設定すると、 + /// ちょうど`{2em}`のベースライン間隔になります。 + /// top-edgeとbottom-edgeの値の正確な配分が最初の行と最後の行の境界に影響を与えます。 #[resolve] #[default(Em::new(0.65).into())] pub leading: Length, - /// The spacing between paragraphs. + /// 段落間の間隔。 /// - /// Just like leading, this defines the spacing between the bottom edge of a - /// paragraph's last line and the top edge of the next paragraph's first - /// line. + /// leadingと同様に、 + /// このプロパティはある段落の最終行の下端と、 + /// 次の段落の最初の行の上端との間隔を定義します。 /// - /// When a paragraph is adjacent to a [`block`] that is not a paragraph, - /// that block's [`above`]($block.above) or [`below`]($block.below) property - /// takes precedence over the paragraph spacing. Headings, for instance, - /// reduce the spacing below them by default for a better look. + /// 段落が、段落ではない[`block`]に隣接している場合、 + /// そのブロックの[`above`]($block.above)または[`below`]($block.below)プロパティが段落間の間隔よりも優先されます。 + /// 例えば、 + /// 見出しはより良い外観のためにデフォルトで下側の間隔を狭くしています。 #[resolve] #[default(Em::new(1.2).into())] pub spacing: Length, - /// Whether to justify text in its line. + /// 行内でテキストを両端揃えするかどうか。 /// - /// Hyphenation will be enabled for justified paragraphs if the - /// [text function's `hyphenate` property]($text.hyphenate) is set to - /// `{auto}` and the current language is known. + /// [text関数の`hyphenate`プロパティ]($text.hyphenate)が`{auto}`に設定され、 + /// かつ現在の言語が認識されている場合、 + /// 両端揃えが行われた段落ではハイフネーションが有効になります。 /// - /// Note that the current [alignment]($align.alignment) still has an effect - /// on the placement of the last line except if it ends with a - /// [justified line break]($linebreak.justify). + /// 最後の行が[両端揃えされた改行]($linebreak.justify)で終わらない限り、 + /// 現在の[alignment]($align.alignment)は依然として + /// 最終行の配置に影響を与えることに注意してください。 #[default(false)] pub justify: bool, - /// How to determine line breaks. + /// 改行位置の決定方法 /// - /// When this property is set to `{auto}`, its default value, optimized line - /// breaks will be used for justified paragraphs. Enabling optimized line - /// breaks for ragged paragraphs may also be worthwhile to improve the - /// appearance of the text. + /// このプロパティがデフォルトの`{auto}`に設定されている場合、 + /// 両端揃えされた段落に対して最適化された改行が行われます。 + /// また、段落が不揃いであっても最適化された改行を有効にすることで、 + /// テキストの見栄えが向上することがあります。 /// /// ```example /// #set page(width: 207pt) @@ -161,24 +161,24 @@ pub struct ParElem { /// ``` pub linebreaks: Smart, - /// The indent the first line of a paragraph should have. + /// 段落の最初の行のインデント。 /// - /// By default, only the first line of a consecutive paragraph will be - /// indented (not the first one in the document or container, and not - /// paragraphs immediately following other block-level elements). + /// デフォルトでは、 + /// 連続する段落のうち最初の行のみがインデントされます + /// (文書やコンテナの先頭の段落、あるいは他のブロックレベル要素に続く段落はインデントされません)。 /// - /// If you want to indent all paragraphs instead, you can pass a dictionary - /// containing the `amount` of indent as a length and the pair - /// `{all: true}`. When `all` is omitted from the dictionary, it defaults to - /// `{false}`. + /// 全ての段落をインデントしたい場合は、 + /// インデントの`amount`(長さ)と`{all: true}`を含む辞書を渡してください。 + /// `all`が辞書から省略された場合、 + /// デフォルトでは`{false}`になります。 /// - /// By typographic convention, paragraph breaks are indicated either by some - /// space between paragraphs or by indented first lines. Consider - /// - reducing the [paragraph `spacing`]($par.spacing) to the - /// [`leading`]($par.leading) using `{set par(spacing: 0.65em)}` - /// - increasing the [block `spacing`]($block.spacing) (which inherits the - /// paragraph spacing by default) to the original paragraph spacing using - /// `{set block(spacing: 1.2em)}` + /// タイポグラフィの慣例として、段落の区切りは段落間の空白か最初の行のインデントのどちらかで示されます。 + /// 次の設定を検討してみてください。 + /// - [段落の`spacing`]($par.spacing)を + /// `{set par(spacing: 0.65em)}`を使用して[`leading`]($par.leading)と同じ長さまで減らす + /// - [ブロックの`spacing`]($block.spacing) + /// デフォルトでは段落の間隔を継承します)を`{set block(spacing: 1.2em)}`を使用して + /// 元の段落間隔と同じ長さまで増やす /// /// ```example /// #set block(spacing: 1.2em) @@ -206,7 +206,7 @@ pub struct ParElem { /// ``` pub first_line_indent: FirstLineIndent, - /// The indent that all but the first line of a paragraph should have. + /// 段落の最初の行以外全ての行のインデント。 /// /// ```example /// #set par(hanging-indent: 1em) @@ -216,7 +216,7 @@ pub struct ParElem { #[resolve] pub hanging_indent: Length, - /// The contents of the paragraph. + /// 段落の内容。 #[required] pub body: Content, } @@ -230,12 +230,12 @@ impl ParElem { /// How to determine line breaks in a paragraph. #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Cast)] pub enum Linebreaks { - /// Determine the line breaks in a simple first-fit style. + /// シンプルなファーストフィット方式で改行位置を決定します。 Simple, - /// Optimize the line breaks for the whole paragraph. + /// 段落全体の改行位置を最適化します。 /// - /// Typst will try to produce more evenly filled lines of text by - /// considering the whole paragraph when calculating line breaks. + /// Typstは改行を計算する際に段落全体を考慮し、 + /// より均等に埋まった行を生成しようとします。 Optimized, } From 848c168eedd95836bc18370dc207b1df7ad5266e Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Fri, 30 May 2025 10:58:52 +0900 Subject: [PATCH 06/14] =?UTF-8?q?=E5=BC=95=E7=94=A8=E7=AC=A6=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index 2b0453df2..7a3754560 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -105,7 +105,7 @@ pub struct ParElem { /// top-edge、bottom-edge、およびleadingを設定することで、 /// ベースライン間の距離を一定に揃えることも可能です。 /// たとえば、leadingを `{1em}`、top-edgeを`{0.8em}`、 - /// bottom-edgeを'{-0.2em}'に設定すると、 + /// bottom-edgeを `{-0.2em}` に設定すると、 /// ちょうど`{2em}`のベースライン間隔になります。 /// top-edgeとbottom-edgeの値の正確な配分が最初の行と最後の行の境界に影響を与えます。 #[resolve] From 2a7542ba8ec9bf00e693700e21e7067ce10aa9ad Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Fri, 30 May 2025 13:14:26 +0900 Subject: [PATCH 07/14] =?UTF-8?q?=E7=BF=BB=E8=A8=B3=E5=AE=8C=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 92 +++++++++++++-------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index 7a3754560..fcfa9d249 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -269,13 +269,13 @@ impl From for Dict { } } -/// A paragraph break. +/// 段落区切り。 /// -/// This starts a new paragraph. Especially useful when used within code like -/// [for loops]($scripting/#loops). Multiple consecutive -/// paragraph breaks collapse into a single one. +/// 新しい段落を開始します。 +/// 特に[forループ]($scripting/#loops)などのコード内で使用する場合に便利です。 +/// 複数の連続した段落区切りは、単一の段落区切りにまとめられます。 /// -/// # Example +/// # 例 /// ```example /// #for i in range(3) { /// [Blind text #i: ] @@ -284,9 +284,9 @@ impl From for Dict { /// } /// ``` /// -/// # Syntax -/// Instead of calling this function, you can insert a blank line into your -/// markup to create a paragraph break. +/// # 構文 +/// 関数を呼び出す代わりに、 +/// マークアップ内に空行を挿入することで段落区切りを作成できます。 #[elem(title = "Paragraph Break", Unlabellable)] pub struct ParbreakElem {} @@ -299,13 +299,13 @@ impl ParbreakElem { impl Unlabellable for Packed {} -/// A paragraph line. +/// 段落の行。 /// -/// This element is exclusively used for line number configuration through set -/// rules and cannot be placed. +/// この要素はsetルールを用いた行番号の設定にのみ使用され、 +/// 直接配置することはできません。 /// -/// The [`numbering`]($par.line.numbering) option is used to enable line -/// numbers by specifying a numbering format. +/// [`numbering`]($par.line.numbering)オプションは、 +/// 番号付け形式を指定して行番号を有効化するために使用されます。 /// /// ```example /// >>> #set page(margin: (left: 3em)) @@ -316,10 +316,10 @@ impl Unlabellable for Packed {} /// Typst is there for you. /// ``` /// -/// The `numbering` option takes either a predefined -/// [numbering pattern]($numbering) or a function returning styled content. You -/// can disable line numbers for text inside certain elements by setting the -/// numbering to `{none}` using show-set rules. +/// `numbering`オプションには、予め定義された[番号付けパターン]($numbering)か、 +/// スタイル付きコンテンツを返す関数のいずれかを指定します。 +/// set-showルールを用いてnumberingを`{none}`に設定することで、 +/// 特定要素内のテキストの行番号を無効にすることができます。 /// /// ```example /// >>> #set page(margin: (left: 3em)) @@ -347,15 +347,15 @@ impl Unlabellable for Packed {} /// originating from distant times. /// ``` /// -/// This element exposes further options which may be used to control other -/// aspects of line numbering, such as its [alignment]($par.line.number-align) -/// or [margin]($par.line.number-margin). In addition, you can control whether -/// the numbering is reset on each page through the -/// [`numbering-scope`]($par.line.numbering-scope) option. +/// この要素は、行番号の[alignment]($par.line.number-align)[margin]($par.line.number-margin)など、 +/// 行の番号付けの様々な設定を制御できる追加オプションを提供します。 +/// さらに、 +/// [`numbering-scope`]($par.line.numbering-scope)オプションを使用すると、 +/// ページごとに番号をリセットするかどうかの制御が可能です。 #[elem(name = "line", title = "Paragraph Line", keywords = ["line numbering"], Construct, Locatable)] pub struct ParLine { - /// How to number each line. Accepts a - /// [numbering pattern or function]($numbering). + /// 各行を番号付けする方法。 + /// [番号付けパターンまたは関数]($numbering)を指定できます。 /// /// ```example /// >>> #set page(margin: (left: 3em)) @@ -368,11 +368,11 @@ pub struct ParLine { #[ghost] pub numbering: Option, - /// The alignment of line numbers associated with each line. + /// 各行に付随する行番号の配置。 /// - /// The default of `{auto}` indicates a smart default where numbers grow - /// horizontally away from the text, considering the margin they're in and - /// the current text direction. + /// デフォルトの`{auto}`は、 + /// 行番号が余白や現在のテキストの方向を考慮しつつ、 + /// テキストから離れる方向へ水平に伸びるスマートな設定を示します。 /// /// ```example /// >>> #set page(margin: (left: 3em)) @@ -388,13 +388,13 @@ pub struct ParLine { #[ghost] pub number_align: Smart, - /// The margin at which line numbers appear. + /// 行番号を表示する位置の余白。 /// - /// _Note:_ In a multi-column document, the line numbers for paragraphs - /// inside the last column will always appear on the `{end}` margin (right - /// margin for left-to-right text and left margin for right-to-left), - /// regardless of this configuration. That behavior cannot be changed at - /// this moment. + /// _注意_: 複数段組みの文書では、 + /// この設定に関わらず最後の段の段落につく行番号が常に`{end}`の余白(左から右のテキストでは右の余白、 + /// 右から左のテキストでは左の余白)に表示されます。 + /// 現時点では、 + /// この挙動を変更することはできません。 /// /// ```example /// >>> #set page(margin: (right: 3em)) @@ -411,10 +411,10 @@ pub struct ParLine { #[default(OuterHAlignment::Start)] pub number_margin: OuterHAlignment, - /// The distance between line numbers and text. + /// 行番号とテキストの間隔。 /// - /// The default value of `{auto}` results in a clearance that is adaptive to - /// the page width and yields reasonable results in most cases. + /// デフォルトの値である `{auto}` では、ページ幅に応じて間隔が自動調整され、 + /// ほとんどの場合において適切な間隔が得られます。 /// /// ```example /// >>> #set page(margin: (left: 3em)) @@ -431,12 +431,12 @@ pub struct ParLine { #[default] pub number_clearance: Smart, - /// Controls when to reset line numbering. + /// 行番号をリセットするタイミングを制御する。 /// - /// _Note:_ The line numbering scope must be uniform across each page run (a - /// page run is a sequence of pages without an explicit pagebreak in - /// between). For this reason, set rules for it should be defined before any - /// page content, typically at the very start of the document. + /// _注意:_ 行番号のスコープは、 + /// ページラン(改ページが明示的に挿入されていない連続したページ)内で統一されている必要があります。 + /// そのため、setルールによる設定は、 + /// ページコンテンツの前、通常は文書の最初などで定義する必要があります。 /// /// ```example /// >>> #set page(margin: (left: 3em)) @@ -469,11 +469,11 @@ impl Construct for ParLine { /// supported. #[derive(Debug, Cast, Clone, Copy, PartialEq, Eq, Hash)] pub enum LineNumberingScope { - /// Indicates that the line number counter spans the whole document, i.e., - /// it's never automatically reset. + /// 行番号カウンターが文書全体にまたがり、 + /// 決して自動的にリセットされないことを示します。 Document, - /// Indicates that the line number counter should be reset at the start of - /// every new page. + /// 行番号カウンターが各新規ページの + /// 先頭でリセットされることを示します。 Page, } From b3454afb20e5dc415088690e28eae2048be39ae9 Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Fri, 30 May 2025 13:57:21 +0900 Subject: [PATCH 08/14] =?UTF-8?q?=E3=81=84=E3=81=8F=E3=81=A4=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E7=8F=BE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index fcfa9d249..0d379b217 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -18,7 +18,7 @@ use crate::model::Numbering; /// /// 段落を区切るには、空行(または明示的な[`parbreak`])を使用します。 /// 段落は、任意のブロックレベルの要素 -/// ([`block`]、[`place`]、またはこれらのいずれかとして表示されるもの)によっても自動的に区切られます。 +/// ([`block`]、[`place`]、またはこれらのいずれかとして表示されるもの)によっても自動的に中断されます。 /// /// `par`要素は主にsetルールにおいて段落のプロパティに影響を与えるために使用されますが、 /// その引数を明示的に独立した段落として表示するためにも使用できます。 @@ -54,12 +54,12 @@ use crate::model::Numbering; /// 組版された文書では、テキストが段落の一部になったかどうかはすぐにはわかりません。 /// しかし、いくつかの理由からこれは依然として重要です。 /// -/// - `first-line-indent`などの特定の段落スタイルは正しい段落に対してのみ適用され、 +/// - `first-line-indent`などの特定の段落スタイルは正式な段落に対してのみ適用され、 /// 任意のテキストには適用されません。 /// 同様に、`par`に対するshowルールももちろん段落に対してのみ適用されます。 /// /// - 段落とその他のテキストを適切に区別することは、 -/// スクリーンリーダーなどの支援技術を利用する人々が文書を正しく読み解き、理解するのに役立ちます。 +/// スクリーンリーダーなどの支援技術を利用する人々が文書を正しく読み進め、理解するのに役立ちます。 /// 現在はTypstがアクセシブルなPDFをまだ出力しないため、 /// この仕組みはHTMLエクスポートにのみ適用されますが、 /// 近い将来PDFへのサポートも計画されています。 @@ -72,7 +72,7 @@ use crate::model::Numbering; /// `block`で囲むことで段落を作成させないようにできます。 /// 逆に、コンテナ内のコンテンツの後に`parbreak`を追加することで、 /// たとえ1つの単語であっても段落にすることができます。 -/// これは、[非タイト]($list.tight)リストがその項目を段落にするために行う手法の例です。 +/// これは、[非タイト]($list.tight)リストがその項目を強制的に段落にさせるために行う手法の例です。 /// /// # 例 /// ```example From 80a08f10c1c49c2bc51cea34c5d1b031b311dbbe Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Sat, 31 May 2025 11:51:32 +0900 Subject: [PATCH 09/14] =?UTF-8?q?=E8=A1=A8=E7=8F=BE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index 0d379b217..9b598b789 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -99,7 +99,7 @@ pub struct ParElem { /// /// leadingは、 /// ある行の[下端]($text.bottom-edge)と次の行の[上端]($text.top-edge)との間隔を定義します。 - /// デフォルトではこれら2つのプロパティはフォントによって決まりますが、 + /// デフォルトでは、これら2つのプロパティはフォントによって決まりますが、 /// テキストのsetルールを使用して手動で設定することもできます。 /// /// top-edge、bottom-edge、およびleadingを設定することで、 @@ -285,7 +285,7 @@ impl From for Dict { /// ``` /// /// # 構文 -/// 関数を呼び出す代わりに、 +/// この関数を呼び出す代わりに、 /// マークアップ内に空行を挿入することで段落区切りを作成できます。 #[elem(title = "Paragraph Break", Unlabellable)] pub struct ParbreakElem {} @@ -436,7 +436,7 @@ pub struct ParLine { /// _注意:_ 行番号のスコープは、 /// ページラン(改ページが明示的に挿入されていない連続したページ)内で統一されている必要があります。 /// そのため、setルールによる設定は、 - /// ページコンテンツの前、通常は文書の最初などで定義する必要があります。 + /// ページコンテンツの前、通常は文書の最初などで定義することが望ましいです。 /// /// ```example /// >>> #set page(margin: (left: 3em)) From c462da8236c33e035fa249ad40cff47b46a5f611 Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Sat, 31 May 2025 20:41:24 +0900 Subject: [PATCH 10/14] =?UTF-8?q?=E6=AE=B5=E8=90=BD=E3=81=AB=E3=82=88?= =?UTF-8?q?=E3=82=8B=E3=83=A9=E3=83=83=E3=83=97=E3=81=AE=E8=A1=A8=E7=8F=BE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index 9b598b789..0743ca0f1 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -38,17 +38,17 @@ use crate::model::Numbering; /// /// # 何が段落になるのか? /// インラインレベルのコンテンツをドキュメントに追加すると、 -/// Typstは自動的にそれを段落としてラップします。 +/// Typstは自動的にそれを段落でラップします。 /// しかし、一般的なドキュメントには、見出しやキャプションなど、 /// 意味的に段落の一部ではないテキストも含まれます。 /// /// Typstがインラインレベルのコンテンツを -/// 段落としてラップするルールは次の通りです。 +/// 段落でラップするルールは次の通りです。 /// -/// - ドキュメントのルート(最上位)にある全てのテキストは段落としてラップされます。 +/// - ドキュメントのルート(最上位)にある全てのテキストは段落でラップされます。 /// /// - コンテナ(`block`など)内のテキストは、 -/// そのコンテナにブロックレベルの要素が含まれている場合にのみ段落としてラップされます。 +/// そのコンテナにブロックレベルの要素が含まれている場合にのみ段落でラップされます。 /// コンテナの内容が全てインラインレベル要素である場合は、段落は作成されません。 /// /// 組版された文書では、テキストが段落の一部になったかどうかはすぐにはわかりません。 From fe0535bf828c9f15050d1aab911731ae684c3adf Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Sat, 31 May 2025 20:51:38 +0900 Subject: [PATCH 11/14] =?UTF-8?q?=E9=96=8B=E3=81=8D=E6=8B=AC=E5=BC=A7?= =?UTF-8?q?=E3=82=92=E8=A3=9C=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index 0743ca0f1..dfbde3fae 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -177,7 +177,7 @@ pub struct ParElem { /// - [段落の`spacing`]($par.spacing)を /// `{set par(spacing: 0.65em)}`を使用して[`leading`]($par.leading)と同じ長さまで減らす /// - [ブロックの`spacing`]($block.spacing) - /// デフォルトでは段落の間隔を継承します)を`{set block(spacing: 1.2em)}`を使用して + /// (デフォルトでは段落の間隔を継承します)を`{set block(spacing: 1.2em)}`を使用して /// 元の段落間隔と同じ長さまで増やす /// /// ```example From 45dc0f2e6a639307cc0de728e19fe0c04560e506 Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Sat, 31 May 2025 21:45:14 +0900 Subject: [PATCH 12/14] =?UTF-8?q?=E3=81=9F=E3=81=A8=E3=81=88=E3=81=B0?= =?UTF-8?q?=E2=86=92=E4=BE=8B=E3=81=88=E3=81=B0=20=E3=81=AB=E7=B5=B1?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index dfbde3fae..1d97e4310 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -104,7 +104,7 @@ pub struct ParElem { /// /// top-edge、bottom-edge、およびleadingを設定することで、 /// ベースライン間の距離を一定に揃えることも可能です。 - /// たとえば、leadingを `{1em}`、top-edgeを`{0.8em}`、 + /// 例えば、leadingを `{1em}`、top-edgeを`{0.8em}`、 /// bottom-edgeを `{-0.2em}` に設定すると、 /// ちょうど`{2em}`のベースライン間隔になります。 /// top-edgeとbottom-edgeの値の正確な配分が最初の行と最後の行の境界に影響を与えます。 From d231f67740490552eb46b3d9c90e95949c2eb1d1 Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Sat, 31 May 2025 21:55:44 +0900 Subject: [PATCH 13/14] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=86=E3=83=8A?= =?UTF-8?q?=E5=86=85=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=86=E3=83=B3=E3=83=84?= =?UTF-8?q?=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E8=A1=A8=E7=8F=BE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index 1d97e4310..624826dd1 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -48,8 +48,8 @@ use crate::model::Numbering; /// - ドキュメントのルート(最上位)にある全てのテキストは段落でラップされます。 /// /// - コンテナ(`block`など)内のテキストは、 -/// そのコンテナにブロックレベルの要素が含まれている場合にのみ段落でラップされます。 -/// コンテナの内容が全てインラインレベル要素である場合は、段落は作成されません。 +/// そのコンテナにブロックレベルのコンテンツが含まれている場合にのみ段落でラップされます。 +/// コンテンツが全てインラインレベルである場合は、段落は作成されません。 /// /// 組版された文書では、テキストが段落の一部になったかどうかはすぐにはわかりません。 /// しかし、いくつかの理由からこれは依然として重要です。 From d7c97825c44826c6278c11027f1718a8ea7339b9 Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Sun, 1 Jun 2025 18:35:33 +0900 Subject: [PATCH 14/14] =?UTF-8?q?show-set=E3=83=AB=E3=83=BC=E3=83=AB=20?= =?UTF-8?q?=E3=81=8Cset-show=E3=83=AB=E3=83=BC=E3=83=AB=E3=81=A8=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/model/par.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/typst-library/src/model/par.rs b/crates/typst-library/src/model/par.rs index 624826dd1..7897c6cce 100644 --- a/crates/typst-library/src/model/par.rs +++ b/crates/typst-library/src/model/par.rs @@ -318,7 +318,7 @@ impl Unlabellable for Packed {} /// /// `numbering`オプションには、予め定義された[番号付けパターン]($numbering)か、 /// スタイル付きコンテンツを返す関数のいずれかを指定します。 -/// set-showルールを用いてnumberingを`{none}`に設定することで、 +/// show-setルールを用いてnumberingを`{none}`に設定することで、 /// 特定要素内のテキストの行番号を無効にすることができます。 /// /// ```example