This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / Demos / Notations / ...Functions /


Syntax of notation declarations.

Notation takes both an external representation and an internal representation as arguments. Mathematica translates any input matching the external representation into the corresponding internal representation and, reciprocally, formats any expression matching the internal representation into the corresponding external representation. In this context, representation means a composite structure made up of boxes representing some "notation".

This loads the package.

The following declares a new notation for gplus.

Any input matching is now interpreted as gplus[x,y,n].

Any gplus expression is now formatted in the new notation.

Notations defined using in their definition both parse and format expressions according to the given notation. However, you can restrict the notation to only parsing or only formatting by using or respectively, instead of in your notation statements.

This defines a notation for the parsing of a hypothetical DomainIntegral.

DomainIntegrals are now parsable.

The following defines an output format for Derivative objects that looks more like that of traditional mathematics.

Derivatives are now formatted according to the new derivative notation.

To allow the previous output to be used as input you can define an interpretation of partial derivatives.

You can now use these new notations for derivatives.

You should define your notations in such a way that they both parse and format, since users will generally expect this functionality.

The following notation both formats and parses arrows overscripted by Apply.

Simple rules like linearity can now be entered in a visually intuitive way.

You may at first feel that having underscores on both sides of a Notation statement is somewhat unsettling. However, notational transformations usually work in both directions, therefore having underscores on both sides of a notation statement is natural, and soon becomes intuitive.