11
$\begingroup$

How does one generate custom symbols? For example, the physicist notation for the rotation is "nabla cross function". In this case however, Mathematica complains that the [esc]del[esc] symbol evaluates to the unary operator Del[], which of course cannot take a cross ([esc]*[esc]) after it, since a bracket is expected.

Although a correctly looking output is generated by

Prefix[f[a], "\[Del]\[Times]"]

the result cannot simply be assigned to an operation (Prefix[...] := ...) you can type in using the nicely readable [esc] commands I mentioned above. Is there some way of doing this, i.e. invoking completely custom functionality to (combinations of) existing symbols?

$\endgroup$
5
  • 1
    $\begingroup$ Well, there's the Notation package... $\endgroup$ Jan 18 '12 at 1:12
  • $\begingroup$ Retagged from "Formatting and layout" tags to "Notation". I think this better describes this. $\endgroup$ Jan 18 '12 at 2:05
  • 1
    $\begingroup$ In case you may be interested in, there are three undocumented symbol \[Laplace] \[Divergence] \[Curl] may be useful. $\endgroup$
    – Silvia
    Jan 18 '12 at 23:27
  • $\begingroup$ @Silvia Although those aren't necessarily related to the question, they might prove pretty useful, thanks! $\endgroup$
    – David
    Jan 18 '12 at 23:33
  • $\begingroup$ You should use \[Cross] (ESC cross ESC) rather than \[Times], since it's conceptually a cross product, not scalar multiplication. $\endgroup$ Nov 15 '12 at 21:29
10
$\begingroup$

You may wish to use the Notation package.

It lets you do these things fairly easily. I'd copy and paste some examples but they don't really copy and paste well. Read through the tutorials and you'll see some examples of how to do this.

You may also be interested in the Vector Analysis package.

$\endgroup$
1
  • 1
    $\begingroup$ Notation[ParsedBoxWrapper[\(\[Del] \(\[Cross] a_\)\)] \ \[DoubleLongLeftRightArrow] ParsedBoxWrapper[\(f[a_]\)]] does the trick, actually. $\endgroup$ Jan 18 '12 at 1:18

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.