From ddce645ef006ac86109a7dfe8cc9d3565598fbf0 Mon Sep 17 00:00:00 2001 From: Yip Coekjan <69834864+Coekjan@users.noreply.github.com> Date: Sat, 22 Jun 2024 16:40:10 +0800 Subject: [PATCH] =?UTF-8?q?Add=20named=20symbols:=20`=E2=8C=88`,=20`?= =?UTF-8?q?=E2=8C=89`,=20`=E2=8C=8A`,=20`=E2=8C=8B`=20(#4267)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst/src/math/mod.rs | 2 -- crates/typst/src/symbols/sym.rs | 8 ++++++++ docs/src/lib.rs | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/typst/src/math/mod.rs b/crates/typst/src/math/mod.rs index 4b5ce56b4..dc79f48b4 100644 --- a/crates/typst/src/math/mod.rs +++ b/crates/typst/src/math/mod.rs @@ -187,8 +187,6 @@ pub fn module() -> Module { math.define_elem::(); math.define_func::(); math.define_func::(); - math.define_func::(); - math.define_func::(); math.define_func::(); math.define_func::(); math.define_func::(); diff --git a/crates/typst/src/symbols/sym.rs b/crates/typst/src/symbols/sym.rs index d09cb4c21..1dec0039e 100644 --- a/crates/typst/src/symbols/sym.rs +++ b/crates/typst/src/symbols/sym.rs @@ -64,6 +64,14 @@ pub(crate) const SYM: &[(&str, Symbol)] = symbols! { spheric.rev: '⦠', spheric.top: '⦡', ], + ceil: [ + #[call(crate::math::ceil)] l: '⌈', + r: '⌉', + ], + floor: [ + #[call(crate::math::floor)] l: '⌊', + r: '⌋', + ], // Punctuation. amp: ['&', inv: '⅋'], diff --git a/docs/src/lib.rs b/docs/src/lib.rs index 231fe97cf..7575817a7 100644 --- a/docs/src/lib.rs +++ b/docs/src/lib.rs @@ -542,7 +542,7 @@ fn group_page( let mut outline_items = vec![]; for name in &group.filter { let value = group.module().scope().get(name).unwrap(); - let Value::Func(func) = value else { panic!("not a function") }; + let Ok(ref func) = value.clone().cast::() else { panic!("not a function") }; let func = func_model(resolver, func, &path, true); let id_base = urlify(&eco_format!("functions-{}", func.name)); let children = func_outline(&func, &id_base);