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.
!!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.
The above examples in this chapter demonstrate the most commonly used features in NCAlgebra.