2
$\begingroup$

I know that I can use the Notation package to define my own custom notation. This works great for StandardForm output, but I would like the notation to apply when I convert it to TraditionalForm`. For example:

Notation[△ θ_ ⟸ △[θ_]]

This tells Mathematica that if it finds a laplacian operator, mathematica should display it without the brackets. This works fine in StandardForm. However, if I use TraditionalForm, then Mathematica inserts parentheses instead of following the rule.

How can I make the rule apply to TraditionalForm?

$\endgroup$
1
$\begingroup$

This seems to work

Format[△[θ_], TraditionalForm] := HoldForm[△ θ]
$\endgroup$
1
$\begingroup$

The Notation function has the Option WorkingForm that defines in which form the notation will be defined. So you have to define your Notation for StandardForm and TraditionalForm

Notation[△ θ_ ⟸ △[θ_]]
Notation[△ θ_ ⟸ △[θ_], WorkingForm -> TraditionalForm]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.