i1 : R = ZZ[a..f];
i2 : tex matrix {{a^2+2,b,c},{d,e,f^3-a}} o2 = $\bgroup\begin{pmatrix}a^{2}+2& b& c\\ d& e& f^{3}-a\\ \end{pmatrix}\egroup$