Pearu, Actually, I was thinking of an automized Latex output option for general matrices . It might be useful to have this option for illustrating results. The number of c's and \ are given by m,n=shape(A) How can I use this information with respect to your suggestion file.write('\left[\begin{array}{c...}') linesep='\\\\....' Nils