I think you're looking for SyntaxForm
. For example:
foo /: MakeBoxes[foo[x,y], StandardForm] := TemplateBox[
{MakeBoxes[x], MakeBoxes[y]},
"foo",
DisplayFunction->(RowBox[{#1, "\[CenterDot]", #2}]&),
SyntaxForm->"\[Star]">Star
]
I used Star
for the SyntaxForm
since its precedence is 390, as requested, in between the precedences for Plus
and Times
:
Precedence /@ {Plus, Star, Times}
{310., 390., 400.}
Then:
a + foo[x, y]
a * foo[x, y]