PRO ArrayPrint,A,FORMAT=format ;+ ;PROCEDURE Arrayprint,A produces a Latex array ;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 tabular field is desired. Use a text editor to add elements ;such as \hline and so on if you need dividing lines. ; ;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]='r' IF N_Elements(format) LE 0 THEN format='F5.2' fmt='($,'+format+',:," & ")' header=['\begin{array}{' , st ,'}'] 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]) PRINT,' \\' ENDFOR PRINT,'\end{array}' END