OutputFormat is a enum that defines different formats of string representation of expressions in Redberry.
There are several available output formats. In order to specify a particular one one can do:
import cc.redberry.groovy.Redberry
import cc.redberry.core.context.OutputFormat
use(Redberry){
def expr = 'a * F^{A}_{A m n} + g_mn'.t
println expr.toString(OutputFormat.Maple)
}
> a * F[m, n, ~A, A] + g_[m, n]The above result can be directly pasted to Maple system.
The available output formats are:
Redberry,
Cadabra,
LaTeX,
WolframMathematica,
Maple,
UTF8,
SimpleRedberry. The last one can be used to print matrix objects in a convenient and human-readable format.
One can set the default output format in the following way:
//set Cadabra output by default CC.defaultOutputFormat = OutputFormat.Cadabra