Skip to content

Commit 1fe0f56

Browse files
committed
Document ·, ⊠, and ⧢ operators
1 parent 054d577 commit 1fe0f56

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

M2/Macaulay2/m2/help.m2

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,14 @@ documentationValue(Symbol, Package) := (S, pkg) -> if pkg =!= Core then
293293
-- Handling operators
294294
-----------------------------------------------------------------------------
295295

296+
-- for each unicode operator, we give a pair:
297+
-- * unicode name
298+
-- * TeX name (for emacs TeX input mode -- null if not available)
299+
unicodeOperators := hashTable {
300+
symbol · => ("middle dot", "\\cdot"),
301+
symbol ⊠ => ("squared times", "\\boxtimes"),
302+
symbol ⧢ => ("shuffle product",)}
303+
296304
-- e.g. symbol +
297305
getOperator := key -> if operator#?key then (
298306
op := toString key;
@@ -321,7 +329,15 @@ getOperator := key -> if operator#?key then (
321329
PARA {"This operator may be used as a binary operator in an expression like ", TT ("x" | op | "y"), ". ",
322330
"The user may ", TO2{ "Macaulay2Doc :: :=", "install a method" }, " for handling such expressions with code such as"},
323331
PRE (" X "|op|" (x,y) -> ..."),
324-
PARA {"where ", TT "X", " is the class of ", TT "x", "."}}
332+
PARA {"where ", TT "X", " is the class of ", TT "x", "."}},
333+
if unicodeOperators#?key then {
334+
PARA {"To insert this character in Emacs, you may press ", KBD "C-x 8 RET", " or ", KBD "M-x insert-char",
335+
" and then enter ", format unicodeOperators#key#0, " in the minibuffer."},
336+
if (texcmd := unicodeOperators#key#1) =!= null
337+
then PARA {"Alternatively, you may press ", KBD "C-x RET C-\\", " or ", KBD "M-x set-input-method",
338+
" and then enter \"TeX\" in the minibuffer. Afterwards, typing \"", texcmd,
339+
"\" will input the character. You may then toggle the input method using ", KBD "C-\\", " or ",
340+
KBD "M-x toggle-input-method"}},
325341
))
326342

327343
-- TODO: expand this

M2/Macaulay2/packages/Macaulay2Doc/operators/tensor.m2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,13 @@ Node
3434
Example
3535
{1, 2} ** {10, 20, 30}
3636
///
37+
38+
document {
39+
Key => symbol ⊠,
40+
Headline => "a binary operator, usually used for exterior product",
41+
}
42+
43+
document {
44+
Key => symbol ⧢,
45+
Headline => "a binary operator, usually used for shuffle product",
46+
}

M2/Macaulay2/packages/Macaulay2Doc/operators/times.m2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,8 @@ document {
196196
},
197197
SeeAlso => {(degree,Matrix),degrees}
198198
}
199+
200+
document {
201+
Key => symbol ·,
202+
Headline => "a binary operator, usually used for dot product",
203+
}

M2/Macaulay2/packages/Macaulay2Doc/ov_language.m2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,7 @@ document {
10651065
TO symbol + ,
10661066
TO symbol - ,
10671067
TO symbol * ,
1068+
TO symbol · ,
10681069
TO symbol / ,
10691070
TO symbol // ,
10701071
TO symbol % ,
@@ -1073,6 +1074,8 @@ document {
10731074
TO symbol ++ ,
10741075
TO symbol ** ,
10751076
TO symbol ^** ,
1077+
TO symbol ⊠ ,
1078+
TO symbol ⧢ ,
10761079
TO symbol ~ ,
10771080
TO symbol (*) ,
10781081
TO symbol : ,

0 commit comments

Comments
 (0)