From 24c08a7ec0aaf87d6dc2e1a2c47b7beb6d5ad2a4 Mon Sep 17 00:00:00 2001 From: Malo <57839069+MDLC01@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:37:32 +0100 Subject: [PATCH] Mention the `calc` module in the operator list (#5595) --- crates/typst-library/src/foundations/calc.rs | 2 +- docs/reference/scripting.md | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/typst-library/src/foundations/calc.rs b/crates/typst-library/src/foundations/calc.rs index e7eb14055..fd4498e07 100644 --- a/crates/typst-library/src/foundations/calc.rs +++ b/crates/typst-library/src/foundations/calc.rs @@ -992,7 +992,7 @@ pub fn div_euclid( /// #calc.rem-euclid(1.75, 0.5) \ /// #calc.rem-euclid(decimal("1.75"), decimal("0.5")) /// ``` -#[func(title = "Euclidean Remainder")] +#[func(title = "Euclidean Remainder", keywords = ["modulo", "modulus"])] pub fn rem_euclid( /// The callsite span. span: Span, diff --git a/docs/reference/scripting.md b/docs/reference/scripting.md index 590bb6ec3..89508eee0 100644 --- a/docs/reference/scripting.md +++ b/docs/reference/scripting.md @@ -340,7 +340,10 @@ packages. For more details on this, see the ## Operators The following table lists all available unary and binary operators with effect, -arity (unary, binary) and precedence level (higher binds stronger). +arity (unary, binary) and precedence level (higher binds stronger). Some +operations, such as [modulus]($calc.rem-euclid), do not have a special syntax +and can be achieved using functions from the +[`calc`]($category/foundations/calc) module. | Operator | Effect | Arity | Precedence | |:----------:|---------------------------------|:------:|:----------:|