Skip to content

Commit f29ad8b

Browse files
committed
Document ·, ⊠, and ⧢ operators
1 parent 8d9b4db commit f29ad8b

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

M2/Macaulay2/m2/help.m2

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,15 @@ getSource(Symbol, Package) := (S, pkg) -> (
300300
)
301301

302302
-- Handling operators
303+
304+
-- for each unicode operator, we give a pair:
305+
-- * unicode name
306+
-- * TeX name (for emacs TeX input mode -- null if not available)
307+
unicodeOperators := hashTable {
308+
symbol · => ("middle dot", "\\cdot"),
309+
symbol ⊠ => ("squared times", "\\boxtimes"),
310+
symbol ⧢ => ("shuffle product",)}
311+
303312
-- e.g. symbol +
304313
getOperator := key -> if operator#?key then (
305314
op := toString key;
@@ -328,7 +337,15 @@ getOperator := key -> if operator#?key then (
328337
PARA {"This operator may be used as a binary operator in an expression like ", TT ("x" | op | "y"), ". ",
329338
"The user may ", TO2{ "Macaulay2Doc :: :=", "install a method" }, " for handling such expressions with code such as"},
330339
PRE (" X "|op|" (x,y) -> ..."),
331-
PARA {"where ", TT "X", " is the class of ", TT "x", "."}}
340+
PARA {"where ", TT "X", " is the class of ", TT "x", "."}},
341+
if unicodeOperators#?key then {
342+
PARA {"To insert this character in Emacs, you may press ", KBD "C-x 8 RET", " or ", KBD "M-x insert-char",
343+
" and then enter ", format unicodeOperators#key#0, " in the minibuffer."},
344+
if (texcmd := unicodeOperators#key#1) =!= null
345+
then PARA {"Alternatively, you may press ", KBD "C-x RET C-\\", " or ", KBD "M-x set-input-method",
346+
" and then enter \"TeX\" in the minibuffer. Afterwards, typing \"", texcmd,
347+
"\" will input the character. You may then toggle the input method using ", KBD "C-\\", " or ",
348+
KBD "M-x toggle-input-method"}},
332349
))
333350

334351
-- 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
@@ -1070,6 +1070,7 @@ document {
10701070
TO symbol + ,
10711071
TO symbol - ,
10721072
TO symbol * ,
1073+
TO symbol · ,
10731074
TO symbol / ,
10741075
TO symbol // ,
10751076
TO symbol % ,
@@ -1078,6 +1079,8 @@ document {
10781079
TO symbol ++ ,
10791080
TO symbol ** ,
10801081
TO symbol ^** ,
1082+
TO symbol ⊠ ,
1083+
TO symbol ⧢ ,
10811084
TO symbol ~ ,
10821085
TO symbol (*) ,
10831086
TO symbol : ,

0 commit comments

Comments
 (0)