Tag Info

New answers tagged


I guess this is too easy, but \[CenterDot], or Esc.Esc, is all set up for use as an infix operator, with no need to mess with box structures or confuse the user by changing the built-in meaning of .. You can just set CenterDot = myDot and then call a·b (* myDot[a, b] *)


I am guessing that you intend for a transformation into myDot[a, b] rather than myDot[a.b] and I will answer accordingly. Different output formatting would remain possible. There is not much that you can do to affect the parsing of code as that is handled by the Front End before even CellEvaluationFunction is called. To see how an expression is parsed you ...


Updated First, let's stop Dot from creating these box structures. MakeBoxes[Dot[x__], form_] := RowBox[{"Dot", "[", RowBox@Riffle[MakeBoxes /@ {x}, ","], "]"}] Next, let's specify that these structures should instead be interpreted as myDot: MakeExpression[RowBox@(row : {PatternSequence[_, "."] .., _}), form_] := MakeExpression[ RowBox@{"myDot", ...

Top 50 recent answers are included