PRO MatrixIntPrint,A ;+ ;PROCEDURE MatrixIntPrint,A produces a Latex matrix ;that is printed on the screen and can be cut and pasted ;into a Latex document as a TeX field. Can be used wherever ;a math array is desired. Use the ArrayPrint procedure to ;get a tabular array. ; ;Produces output in integer format. Use MatrixPrint for a ;floating point output ; ;USAGE ;ArrayPrint,A ;Prints results on the screen. ; ;KEYWORDS: None ; ;Version 1.0 Harvey Rhody June 5, 2000 ;- SIZA=SIZE(A) IF SIZA[0] GT 2 THEN MESSAGE,'Array must be dimension 1 or 2' st=STRARR(SIZA[1]) & FOR i=0,SIZA[1]-1 DO st[i]='l' header=['\[ \left[ \begin{array}{' , st ,'}'] PRINT,header IF SIZA[0] EQ 1 THEN BEGIN PRINT,STRING(FORMAT='($,I5,:," & ")',A) ENDIF $ ELSE FOR i=0,SIZA[2]-1 DO BEGIN PRINT,STRING(FORMAT='($,I5,:," & ")',A[*,i]) PRINT,' \\' ENDFOR PRINT,'\end{array}\right] \]' END