summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Ekdahl <alexander@ekdahl.io>2023-03-25 13:32:25 +0100
committerGitHub <noreply@github.com>2023-03-25 13:32:25 +0100
commit766d1be72b046c1ee0db2602d8573b206fa81fe5 (patch)
tree21e47eac70d6c6fde8d8ca4c8590ca1b49523a73
parenta25a69154919569f032333388876f14d16a75ea9 (diff)
Newton's notation for derivatives (#281)
-rw-r--r--library/src/symbols/sym.rs12
-rw-r--r--src/eval/symbol.rs2
-rw-r--r--tests/ref/math/accent.pngbin6816 -> 29997 bytes
-rw-r--r--tests/typ/math/accent.typ4
4 files changed, 17 insertions, 1 deletions
diff --git a/library/src/symbols/sym.rs b/library/src/symbols/sym.rs
index 90c89fc3..f1cf6649 100644
--- a/library/src/symbols/sym.rs
+++ b/library/src/symbols/sym.rs
@@ -88,7 +88,17 @@ pub(crate) const SYM: &[(&'static str, Symbol)] = symbols! {
circle: '⊝',
wave.double: '〰',
],
- dot: ['.', op: '⋅', c: '·', circle: '⊙', circle.big: '⨀', square: '⊡'],
+ dot: [
+ '.',
+ op: '⋅',
+ c: '·',
+ circle: '⊙',
+ circle.big: '⨀',
+ square: '⊡',
+ double: '¨',
+ triple: '\u{20db}',
+ quad: '\u{20dc}',
+ ],
excl: ['!', double: '‼', inv: '¡', quest: '⁉'],
quest: ['?', double: '⁇', excl: '⁈', inv: '¿'],
interrobang: '‽',
diff --git a/src/eval/symbol.rs b/src/eval/symbol.rs
index 6a199a1d..d15d5a79 100644
--- a/src/eval/symbol.rs
+++ b/src/eval/symbol.rs
@@ -114,6 +114,8 @@ impl Symbol {
'\u{0306}' | '˘' => '\u{0306}',
'\u{0307}' | '.' | '˙' | '⋅' => '\u{0307}',
'\u{0308}' | '¨' => '\u{0308}',
+ '\u{20db}' => '\u{20db}',
+ '\u{20dc}' => '\u{20dc}',
'\u{030a}' | '∘' | '○' => '\u{030a}',
'\u{030b}' | '˝' => '\u{030b}',
'\u{030c}' | 'ˇ' => '\u{030c}',
diff --git a/tests/ref/math/accent.png b/tests/ref/math/accent.png
index a87a684d..a324d3f0 100644
--- a/tests/ref/math/accent.png
+++ b/tests/ref/math/accent.png
Binary files differ
diff --git a/tests/typ/math/accent.typ b/tests/typ/math/accent.typ
index b67614dd..ff1f87c1 100644
--- a/tests/typ/math/accent.typ
+++ b/tests/typ/math/accent.typ
@@ -6,6 +6,10 @@ $grave(a), acute(b), hat(f), tilde(§), macron(ä), diaer(a), ä \
breve(\&), dot(!), circle(a), caron(@), arrow(Z), arrow.l(Z)$
---
+
+$ x &= p \ dot(x) &= v \ dot.double(x) &= a \ dot.triple(x) &= j \ dot.quad(x) &= s $
+
+---
// Test `accent` function.
$accent(ö, .), accent(v, <-), accent(ZZ, \u{0303})$