diff --git a/crates/typst-library/src/model/footnote.rs b/crates/typst-library/src/model/footnote.rs index dfa3933bb6..7b64516862 100644 --- a/crates/typst-library/src/model/footnote.rs +++ b/crates/typst-library/src/model/footnote.rs @@ -15,30 +15,30 @@ use crate::model::{Destination, Numbering, NumberingPattern, ParElem}; use crate::text::{SuperElem, TextElem, TextSize}; use crate::visualize::{LineElem, Stroke}; -/// A footnote. +/// 脚注。 /// -/// Includes additional remarks and references on the same page with footnotes. -/// A footnote will insert a superscript number that links to the note at the -/// bottom of the page. Notes are numbered sequentially throughout your document -/// and can break across multiple pages. +/// 脚注を用いて追加のコメントや参考文献を同じページに記述します。 +/// 脚注は、ページ下部の注釈にリンクする上付きの番号を挿入します。 +/// 注釈は文書全体で連続してナンバリングされ、 +/// 複数のページにまたがることができます。 /// -/// To customize the appearance of the entry in the footnote listing, see -/// [`footnote.entry`]($footnote.entry). The footnote itself is realized as a -/// normal superscript, so you can use a set rule on the [`super`] function to -/// customize it. You can also apply a show rule to customize only the footnote -/// marker (superscript number) in the running text. +/// 脚注リストの項目の外観をカスタマイズするには、 +/// [`footnote.entry`]($footnote.entry)を参照してください。 +/// 脚注自体は通常の上付き文字として実現されているため、 +/// [`super`]関数に対してsetルールを適用してカスタマイズ出来ます。 +/// また、showルールを適用して、本文中の脚注マーカー(上付き番号)のみをカスタマイズすることもできます。 /// -/// # Example +/// # 例 /// ```example /// Check the docs for more details. /// #footnote[https://typst.app/docs] /// ``` /// -/// The footnote automatically attaches itself to the preceding word, even if -/// there is a space before it in the markup. To force space, you can use the -/// string `[#" "]` or explicit [horizontal spacing]($h). +/// 脚注は、マークアップにおいて前の単語との間にスペースがあったとしても、 +/// 自動的にその単語に付加されます。 +/// スペースを強制するには、文字列の`[#" "]`や明示的な[horizontal spacing]($h)を使用できます。 /// -/// By giving a label to a footnote, you can have multiple references to it. +/// 脚注にラベルをつけることにより、脚注に対して複数の参照を持つことができます。 /// /// ```example /// You can edit Typst documents online. @@ -47,18 +47,18 @@ use crate::visualize::{LineElem, Stroke}; /// And the online app. #footnote() /// ``` /// -/// _Note:_ Set and show rules in the scope where `footnote` is called may not -/// apply to the footnote's content. See [here][issue] for more information. +/// _注意:_ `footnote`が呼び出されるスコープ内でのsetルールやshowルールは、脚注の内容に適用されない場合があります。 +/// 詳細については[こちら][issue]を参照してください。 /// /// [issue]: https://github.com/typst/typst/issues/1467#issuecomment-1588799440 #[elem(scope, Locatable, Show, Count)] pub struct FootnoteElem { - /// How to number footnotes. + /// 脚注のナンバリング方法。 /// - /// By default, the footnote numbering continues throughout your document. - /// If you prefer per-page footnote numbering, you can reset the footnote - /// [counter] in the page [header]($page.header). In the future, there might - /// be a simpler way to achieve this. + /// デフォルトでは、脚注のナンバリングは文書全体で連続します。 + /// ページごとに脚注のナンバリングを行いたい場合は、 + /// ページの[header]($page.header)で脚注の[counter]をリセットできます。 + /// 将来的には、これを簡単に実現する方法が提供されるかもしれません。 /// /// ```example /// #set footnote(numbering: "*") @@ -71,8 +71,8 @@ pub struct FootnoteElem { #[default(Numbering::Pattern(NumberingPattern::from_str("1").unwrap()))] pub numbering: Numbering, - /// The content to put into the footnote. Can also be the label of another - /// footnote this one should point to. + /// 脚注に挿入するコンテンツ。 + /// この脚注が参照すべき他の脚注のラベルを指定することもできます。 #[required] pub body: FootnoteBody, } @@ -175,10 +175,10 @@ cast! { v: Label => Self::Reference(v), } -/// An entry in a footnote list. +/// 脚注リストの項目。 /// -/// This function is not intended to be called directly. Instead, it is used in -/// set and show rules to customize footnote listings. +/// この関数は直接呼び出されることを意図されていません。 +/// 代わりに、setルールやshowルールで脚注リストをカスタマイズするために使用されます。 /// /// ```example /// #show footnote.entry: set text(red) @@ -188,14 +188,14 @@ cast! { /// has red text! /// ``` /// -/// _Note:_ Footnote entry properties 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 and show rules for footnote entries should be defined -/// before any page content, typically at the very start of the document. +/// _注意:_ 脚注項目のプロパティは、 +/// 各ページラン(ページ間に明示的な改ページがないページ群)全体で一貫している必要があります。 +/// このため、脚注項目に対するsetルールやshowルールは通常はドキュメントの最初の部分など、 +/// ページコンテンツの前に定義される必要があります。 #[elem(name = "entry", title = "Footnote Entry", Show, ShowSet)] pub struct FootnoteEntry { - /// The footnote for this entry. Its location can be used to determine - /// the footnote counter state. + /// この項目の脚注。 + /// その位置を指定して、脚注カウンターの状態を決定する事ができます。 /// /// ```example /// #show footnote.entry: it => { @@ -213,7 +213,7 @@ pub struct FootnoteEntry { #[required] pub note: Packed, - /// The separator between the document body and the footnote listing. + /// 文書の本文と脚注リストの間の区切り記号。 /// /// ```example /// #set footnote.entry( @@ -237,7 +237,7 @@ pub struct FootnoteEntry { )] pub separator: Content, - /// The amount of clearance between the document body and the separator. + /// 文書の本文と区切り記号の間の余白の量。 /// /// ```example /// #set footnote.entry(clearance: 3em) @@ -251,7 +251,7 @@ pub struct FootnoteEntry { #[resolve] pub clearance: Length, - /// The gap between footnote entries. + /// 脚注項目同士の間隔。 /// /// ```example /// #set footnote.entry(gap: 0.8em) @@ -264,7 +264,7 @@ pub struct FootnoteEntry { #[resolve] pub gap: Length, - /// The indent of each footnote entry. + /// 各脚注項目の字下げ。 /// /// ```example /// #set footnote.entry(indent: 0em)