From 947522b71aa6220ce8f006bfab4700d6e3cb04f1 Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Thu, 22 Dec 2022 01:33:09 +0100 Subject: [PATCH] Symbol table --- library/src/math/mod.rs | 4 ++++ library/src/text/symbol.rs | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs index 6e6c41048..30fbe9108 100644 --- a/library/src/math/mod.rs +++ b/library/src/math/mod.rs @@ -25,6 +25,10 @@ use crate::text::{FontFamily, LinebreakNode, SpaceNode, SymbolNode, TextNode}; /// dollar signs to create a formula. Starting and ending the formula with at /// least one space lifts it into a separate block that is centered /// horizontally. +/// +/// Within math mode, additional shorthands are available to easily type various +/// arrows and other symbols. The page on the [`symbol`](@symbol) function lists +/// all of them. /// /// ## Example /// ``` diff --git a/library/src/text/symbol.rs b/library/src/text/symbol.rs index a59461a7a..4a7c8ad32 100644 --- a/library/src/text/symbol.rs +++ b/library/src/text/symbol.rs @@ -19,6 +19,32 @@ use crate::text::TextNode; /// the notation directly. There, all letter sequence of length at least two are /// automatically parsed as symbols (unless a variable of that name is defined). /// +/// Additionally, some very common but hard to type symbols can be expressed with +/// dedicated shortcuts. These are: +/// +/// | Symmie | Shorthand | Result | +/// | ----------- | --------- | ------ | +/// | `dots:b` | `...` | … | +/// | `dash:en` | `---` | – | +/// | `dash:em` | `--` | — | +/// | none yet | `-?` | A soft hyphen | +/// | none yet | `~` | A non breaking space | +/// +/// Within math mode, additional shorthands are available: +/// +/// | Symmie | Shorthand | Result | +/// | ------------------ | --------- | ------ | +/// | `arrow:r` | `->` | `→` | +/// | `arrow:r:double` | `=>` | `⇒` | +/// | `arrow:l` | `<-` | `←` | +/// | `arrow:r:bar` | |-> | `↦` | +/// | `arrow:l:r` | `<->` | `↔` | +/// | `arrow:l:r:double` | `<=>` | `⇔` | +/// | `eq:not` | `!=` | `≠` | +/// | `eq:gt` | `>=` | `≥` | +/// | `eq:lt` | `<=` | `≤` | +/// | `colon:eq` | `:=` | `≔` | +/// /// ## Example /// ``` /// // In text, with colons.