PRO MatrixPrint,A,FORMAT=format ;+ ;PROCEDURE MatrixPrint,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. ; ;USAGE ;ArrayPrint,A ;Prints results on the screen. ; ;KEYWORDS: None ; ;Version 1.0 Harvey Rhody June 5, 2000 ;- IF N_Elements(format) LE 0 THEN format='F6.2' fmt='($,'+format+',:," & ")' SIZA=SIZE(A) IF SIZA[0] GT 2 THEN MESSAGE,'Array must be dimension 1 or 2' header=['\[ \begin{bmatrix}'] PRINT,header IF SIZA[0] EQ 1 THEN BEGIN PRINT,STRING(FORMAT=fmt,A) ENDIF $ ELSE FOR i=0,SIZA[2]-1 DO BEGIN PRINT,STRING(FORMAT=fmt,A[*,i]) IF i LT sizA[2]-1 then PRINT,' \\' ENDFOR PRINT,'\end{bmatrix} \]' END