i1 : R = ZZ[a..f] o1 = R o1 : PolynomialRing
i2 : tex matrix {{a^2+2,b,c},{d,e,f^3-a}} o2 = $\pmatrix{{a}^{2}+{2}& {b}& {c}\cr {d}& {e}& {f}^{3}-a\cr }$ o2 : String
See also TeX and texMath.