From c2bd114914513c8ff450b9dcc67aa9b17cf275e1 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 31 Jan 2023 13:00:20 +0100 Subject: [PATCH] Symbol improvements --- library/src/math/accent.rs | 2 +- library/src/math/attach.rs | 3 +-- library/src/math/op.rs | 4 ++++ library/src/math/symbols.rs | 3 ++- library/src/text/symbols.rs | 2 +- tests/typ/math/accents.typ | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/library/src/math/accent.rs b/library/src/math/accent.rs index 9183b93bf..8cae4268b 100644 --- a/library/src/math/accent.rs +++ b/library/src/math/accent.rs @@ -34,7 +34,7 @@ const ACCENT_SHORT_FALL: Em = Em::new(0.5); /// | ------------ | --------------- | --------- | /// | Grave | `grave` | ` | /// | Acute | `acute` | `´` | -/// | Circumflex | `circum` | `^` | +/// | Circumflex | `hat` | `^` | /// | Tilde | `tilde` | `~` | /// | Macron | `macron` | `¯` | /// | Breve | `breve` | `˘` | diff --git a/library/src/math/attach.rs b/library/src/math/attach.rs index 0d7748399..3f4d28d27 100644 --- a/library/src/math/attach.rs +++ b/library/src/math/attach.rs @@ -5,8 +5,7 @@ use super::*; /// /// ## Syntax /// This function also has dedicated syntax: Use the underscore (`_`) to -/// indicate a bottom attachment and the circumflex (`^`) to indicate a top -/// attachment. +/// indicate a bottom attachment and the hat (`^`) to indicate a top attachment. /// /// ## Example /// ``` diff --git a/library/src/math/op.rs b/library/src/math/op.rs index 5665a6371..6e52cea5f 100644 --- a/library/src/math/op.rs +++ b/library/src/math/op.rs @@ -58,6 +58,10 @@ macro_rules! ops { limits: ops!(@limit $($tts)*), }.pack() );)* + + let dif = |d| HNode::strong(THIN).pack() + UprightNode(TextNode::packed(d)).pack(); + math.define("dif", dif('d')); + math.define("Dif", dif('D')); } }; (@name $name:ident) => { stringify!($name) }; diff --git a/library/src/math/symbols.rs b/library/src/math/symbols.rs index 34330d473..c68616fa2 100644 --- a/library/src/math/symbols.rs +++ b/library/src/math/symbols.rs @@ -330,7 +330,7 @@ symbols! { // Logic. forall: '∀', exists: ['∃', "not": '∄'], - top: '⟙', + top: '⊤', bot: '⊥', not: '¬', and: [ @@ -412,6 +412,7 @@ symbols! { ], prop: '∝', divides: ['∣', "not": '∤'], + compose: '∘', // Miscellaneous. diff: '∂', diff --git a/library/src/text/symbols.rs b/library/src/text/symbols.rs index 8bc6222a8..17ab6f4fc 100644 --- a/library/src/text/symbols.rs +++ b/library/src/text/symbols.rs @@ -150,7 +150,7 @@ symbols! { breve: '˘', caret: '‸', caron: 'ˇ', - circum: '^', + hat: '^', diaer: '¨', grave: '`', macron: '¯', diff --git a/tests/typ/math/accents.typ b/tests/typ/math/accents.typ index 7a896e5d8..284e86f3d 100644 --- a/tests/typ/math/accents.typ +++ b/tests/typ/math/accents.typ @@ -5,7 +5,7 @@ $ grave(a), acute(a), - circum(a), + hat(a), tilde(a), macron(a), breve(a),