File: print.tex

package info (click to toggle)
cadabra 1.46-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,244 kB
  • sloc: cpp: 33,188; ansic: 2,724; makefile: 329; yacc: 180; sh: 157; python: 45; lex: 38; lisp: 19
file content (16 lines) | stat: -rw-r--r-- 660 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
\cdbalgorithm{print}{}

Construct output from strings and 
\cdb expressions. Here is an example:
\begin{screen}{1,2}
\Gamma{#}::GammaMatrix(metric=\delta).
@print["The result is : " ~ @join[\Gamma^{a b}\Gamma_{c}] ~ ";"];
The result is : (\Gamma^{a b}_{c} + 2 * \Gamma^{a} * \delta^{b}_{c});
\end{screen}
As you can see in this example, expressions are joined together into
one printable string by using the tilde character.

Note that \subscommand{print} completely overrides the normal output
of expressions: there is no expression number for instance. Also note
that all active nodes are (as usual) completely expanded before the
print algorithm is called.