diff --git a/docs/src/reference/details.yml b/docs/src/reference/details.yml index 5d740336c..1926fb774 100644 --- a/docs/src/reference/details.yml +++ b/docs/src/reference/details.yml @@ -31,7 +31,7 @@ math: | ```example $ A = pi r^2 $ - $ "area" = pi dot.op "radius"^2 $ + $ "area" = pi dot "radius"^2 $ $ cal(A) := { x in RR | x "is natural" } $ #let x = 5 @@ -39,7 +39,7 @@ math: | ``` Math mode makes a wide selection of [symbols]($category/symbols/sym) like - `pi`, `dot.op`, or `RR` available. Many mathematical symbols are available in + `pi`, `dot`, or `RR` available. Many mathematical symbols are available in different variants. You can select between different variants by applying [modifiers]($type/symbol) to the symbol. Typst further recognizes a number of shorthand sequences like `=>` that approximate a symbol. When such a shorthand diff --git a/library/src/math/matrix.rs b/library/src/math/matrix.rs index f2a9fe97e..368cd5c48 100644 --- a/library/src/math/matrix.rs +++ b/library/src/math/matrix.rs @@ -10,7 +10,7 @@ const VERTICAL_PADDING: Ratio = Ratio::new(0.1); /// /// ## Example /// ```example -/// $ vec(a, b, c) dot.op vec(1, 2, 3) +/// $ vec(a, b, c) dot vec(1, 2, 3) /// = a + 2b + 3c $ /// ``` /// @@ -135,7 +135,7 @@ impl LayoutMath for MatElem { /// ## Example /// ```example /// $ f(x, y) := cases( -/// 1 "if" (x dot.op y)/2 <= 0, +/// 1 "if" (x dot y)/2 <= 0, /// 2 "if" x "is even", /// 3 "if" x in NN, /// 4 "else", diff --git a/library/src/symbols/sym.rs b/library/src/symbols/sym.rs index e48452ebe..421efe856 100644 --- a/library/src/symbols/sym.rs +++ b/library/src/symbols/sym.rs @@ -64,12 +64,12 @@ pub(crate) const SYM: &[(&str, Symbol)] = symbols! { // Punctuation. amp: ['&', inv: '⅋'], ast: [ - '*', + basic: '*', + op: '∗', low: '⁎', double: '⁑', triple: '⁂', small: '﹡', - op: '∗', circle: '⊛', sq: '⧆', ], @@ -89,8 +89,8 @@ pub(crate) const SYM: &[(&str, Symbol)] = symbols! { wave.double: '〰', ], dot: [ - '.', op: '⋅', + basic: '.', c: '·', circle: '⊙', circle.big: '⨀', @@ -111,10 +111,10 @@ pub(crate) const SYM: &[(&str, Symbol)] = symbols! { section: '§', semi: [';', rev: '⁏'], slash: ['/', double: '⫽', triple: '⫻'], - dots: [h: '…', h.c: '⋯', v: '⋮', down: '⋱', up: '⋰'], + dots: [h.c: '⋯', h: '…', v: '⋮', down: '⋱', up: '⋰'], tilde: [ - '~', op: '∼', + basic: '~', eq: '≃', eq.not: '≄', eq.rev: '⋍', diff --git a/tests/ref/math/syntax.png b/tests/ref/math/syntax.png index f223ba5ae..3779f9a8f 100644 Binary files a/tests/ref/math/syntax.png and b/tests/ref/math/syntax.png differ diff --git a/tests/typ/math/cases.typ b/tests/typ/math/cases.typ index 83a5ab66f..d591ae50e 100644 --- a/tests/typ/math/cases.typ +++ b/tests/typ/math/cases.typ @@ -2,7 +2,7 @@ --- $ f(x, y) := cases( - 1 quad &"if" (x dot.op y)/2 <= 0, + 1 quad &"if" (x dot y)/2 <= 0, 2 &"if" x divides 2, 3 &"if" x in NN, 4 &"else", diff --git a/tests/typ/math/matrix.typ b/tests/typ/math/matrix.typ index e57e102e4..c1fba6277 100644 --- a/tests/typ/math/matrix.typ +++ b/tests/typ/math/matrix.typ @@ -3,12 +3,12 @@ --- // Test semicolon syntax. #set align(center) -$mat() dot.op - mat(;) dot.op - mat(1, 2) dot.op +$mat() dot + mat(;) dot + mat(1, 2) dot mat(1, 2;) \ - mat(1; 2) dot.op - mat(1, 2; 3, 4) dot.op + mat(1; 2) dot + mat(1, 2; 3, 4) dot mat(1 + &2, 1/2; &3, 4)$ --- diff --git a/tests/typ/math/multiline.typ b/tests/typ/math/multiline.typ index 4f42ea63a..b1f438006 100644 --- a/tests/typ/math/multiline.typ +++ b/tests/typ/math/multiline.typ @@ -4,13 +4,13 @@ // Test basic alignment. $ x &= x + y \ &= x + 2z \ - &= sum x dot.op 2z $ + &= sum x dot 2z $ --- // Test text before first alignment point. $ x + 1 &= a^2 + b^2 \ y &= a + b^2 \ - z &= alpha dot.op beta $ + z &= alpha dot beta $ --- // Test space between inner alignment points. diff --git a/tests/typ/math/syntax.typ b/tests/typ/math/syntax.typ index 26d3e4449..17633357b 100644 --- a/tests/typ/math/syntax.typ +++ b/tests/typ/math/syntax.typ @@ -12,6 +12,10 @@ $ underline(f' : NN -> RR) \ 2 * 3 &"if" n != 5, 1 - 0 thick &..., ) $ + +--- +// Test common symbols. +$ dot \ dots \ ast \ tilde \ star $ --- // Error: 1:3 expected dollar sign