3. Formatting of indexed objects

Formatting in versions 0.7and 0.8 was rather limited. Version 0.9 has introduced cut-and-paste,  but still no editing of the tensor expressions. This section will be much expanded in future versions.

Most symbols in xTensor` can be formatted in StandardForm. The output form of a symbol is a string "<output>" chosen at definition time using the option PrintAs, which defines an upvalue PrintAs[symbol]="<output>". The value of the option can be directly the string "<output>" or a function which returns the string when applied on symbol. Formatting of a type of objects (or of all allowed objects to be formatted) can be turned on/off using the functions xTensorFormStart[type] / xTensorFormStop[type].

Those symbols automatically generated with GiveSymbol have a parallel function to generate their output strings, called GiveOutputString.
Indices are always formatted if a PrintAs upvalue has been given for them. Note that the formatting of indices is not given at definition time; it must be explicitly set as upvalues for PrintAs.

Basis and component indices are formatted using a color associated to the corresponding basis. Components are numbered, but for coordinate systems it is possible to use the name of the corresponding coordinate (CIndexForm, $CIndexForm).

Covariant derivatives and their indices can be formatted in StandardForm in two possible ways, stored as values in the global variable $CovDFormat: Prefix and Postfix, with obvious meanings. The associated symbols to be used in each of those cases are stored in SymbolOfCovD for each covariant derivative.


Created by Mathematica  (May 16, 2008) Valid XHTML 1.1!