next up previous contents index
Next: Getting Started in NCAlgebra Up: The Most Basic NCAlgebra Previous: The Most Basic NCAlgebra   Contents   Index

Pretty Output

Beautifying NCAlgebra

In[104]:= SetOutput[ all -> True ]; 
In[105]:= inv[ tp[k] ] 
             T -1
Out[105]= (k)


In[106]:= SetOutput[ all -> True ]; 	
In[107]:= rt[x - inv[y + aj[z]]] + tp[x]
            T              * -1 1/2
Out[107]=  x  + (x - (y + z )  )


In[108]:= SetOutput[ all -> True, inv -> False ]; 
In[109]:= inv[1 + tp[1-x]]

                   T
Out[109]= inv[2 - x ]


TeX

In[110]:= mat = {{a + tp[b],aj[c]},{inv[d],e}}
Out[110]= {{a + tp[b], aj[c]}, {inv[d], e}}

In[111]:= Get["Extra.TeXForm"];LookAtMatrix[mat]
outputs

This is TeX, C Version 2.96 (no format preloaded)
(file.tex
LaTeX Version 2.09 <29 Apr 1987>
(/usr/local/lib/tex/macros/latex/article.sty
Document Style `article'. Released 4 September 1986.
(/usr/local/lib/tex/macros/latex/art12.sty)) (file.aux) [1] (file.aux)
Output written on file.dvi (1 page, 540 bytes).
Transcript written on file.log.

The above command takes the Mathematica matrix mat, converts it to LATEX, outputs the string and surrounding LATEX to a file, LATEXs the file and displays the LATEXed output to the screen using the program xdvi (this can be easily changed to other previewers such as dvipage or xpreview). This window contains the following formula in its display.

$\displaystyle \pmatrix { a + b^T & c^{*} \cr d^{-1} & e \cr }
$

The LATEX file generated can be displayed by typing !!file.tex which produces

\documentstyle [12pt]{article} 
\begin{document} 
$$ 
\pmatrix { a + b^T & c^{*} \cr d^{-1} & e \cr }
$$ 
\end{document}

In[113]:= LookAtLongExpression[Sum[a[i],{i,1,50}]];

generates a window which contains the following formula in its display.

$\displaystyle \displaylines{
a(1)+a(2)+a(3)+a(4)+a(5)+a(6)+a(7)+a(8)+ \cr
a(9...
...(40)+a(41)+a(42)+a(43)+a(44)+a(45)+ \cr
a(46)+a(47)+a(48)+a(49)+a(50) \cr
}
$

The above examples in this chapter demonstrate the most commonly used features in NCAlgebra.



NCAlgebra Project 2002-09-09