From b05721869c404cbf5a5098aa625662e2b4345c6f Mon Sep 17 00:00:00 2001 From: "Y.D.X." <73375426+YDX-2147483647@users.noreply.github.com> Date: Thu, 24 Jul 2025 18:24:21 +0800 Subject: [PATCH 1/4] Mention `text.costs` and `page.height` in the docs of `pagebreak` --- crates/typst-library/src/layout/page.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/typst-library/src/layout/page.rs b/crates/typst-library/src/layout/page.rs index 64ed99e34..38e4b8492 100644 --- a/crates/typst-library/src/layout/page.rs +++ b/crates/typst-library/src/layout/page.rs @@ -397,6 +397,12 @@ impl LocalName for PageElem { /// == Compound Theory /// In 1984, the first ... /// ``` +/// +/// Note that even without manual page breaks, the content will be automatically +/// paginated based on the size of the content and the page. You could adjust +/// [costs]($text.costs) to fine-tune the algorithm that prevents widows and +/// orphans. You can also set [the page height]($page.height) to `{auto}` to +/// let the page grow dynamically until a manual page break occurs. #[elem(title = "Page Break")] pub struct PagebreakElem { /// If `{true}`, the page break is skipped if the current page is already From 2bbee17978538312fb5f322c4346fc4700bce619 Mon Sep 17 00:00:00 2001 From: "Y.D.X." <73375426+YDX-2147483647@users.noreply.github.com> Date: Thu, 24 Jul 2025 19:08:28 +0800 Subject: [PATCH 2/4] Document that `text.lang` and `text.region` is case-insensitive Resolves #6549 --- crates/typst-library/src/text/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/typst-library/src/text/mod.rs b/crates/typst-library/src/text/mod.rs index f2025f5b8..a6a13b92f 100644 --- a/crates/typst-library/src/text/mod.rs +++ b/crates/typst-library/src/text/mod.rs @@ -411,6 +411,9 @@ pub struct TextElem { /// = Einleitung /// In diesem Dokument, ... /// ``` + /// + /// The language code is case-insensitive, and will be normalized to + /// lowercase before made available to the [context]($context). #[default(Lang::ENGLISH)] #[ghost] pub lang: Lang, @@ -418,6 +421,9 @@ pub struct TextElem { /// An [ISO 3166-1 alpha-2 region code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) /// /// This lets the text processing pipeline make more informed choices. + /// + /// The region code is case-insensitive, and will be normalized to + /// uppercase before made available to the [context]($context). #[ghost] pub region: Option, From 77db88eb98f08b707c6f0a4cee9ac9b99bb71a38 Mon Sep 17 00:00:00 2001 From: "Y.D.X." <73375426+YDX-2147483647@users.noreply.github.com> Date: Thu, 24 Jul 2025 20:10:55 +0800 Subject: [PATCH 3/4] Document that a `where` selector is needed to update figure counters Resolves #6641 It was documented in `figure.counter`, but that field is synthesized and not visible in docs. https://docs.rs/typst-library/0.13.1/typst_library/model/struct.FigureElem.html#method.counter --- .../src/introspection/counter.rs | 2 ++ crates/typst-library/src/model/figure.rs | 35 +++++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/crates/typst-library/src/introspection/counter.rs b/crates/typst-library/src/introspection/counter.rs index f6083303d..a7b0d500b 100644 --- a/crates/typst-library/src/introspection/counter.rs +++ b/crates/typst-library/src/introspection/counter.rs @@ -415,6 +415,8 @@ impl Counter { /// - If it is a [selector], counts through elements that matches with the /// selector. For example, /// - provide an element function: counts elements of that type, + /// - provide a [`where`]($function.where) selector: + /// counts a type of elements with specific fields, /// - provide a [`{