; ; ; tit1 = '\begin{tabular}{|c|r||c|r||c|r|} \hline' tit2 = '{\sl Carrington} & {\sl Starting Date} & {\sl Carrington} & {\sl Starting Date}' tit2 = tit2 + ' & {\sl Carrington} & {\sl Starting Date} \\' tit3 = '{\sl Rotation} & ~ & {\sl Rotation} & ~ & {\sl Rotation} & ~\\ \hline' outfil = 'mk_carr_id.tex openw, lun, outfil, /get_lun printf, lun, tit1 printf, lun, tit2 printf, lun, tit3 ; st_rot = 1846 en_rot = 1887 ;+42*2 for irot=st_rot, en_rot do begin str = string(irot, format='(2x, i4.4)') dummy = irot timarr = clon2ex(dummy) ;clon2ex changes the data type date = gt_day(timarr, /str,/lower) date = str_replace(date, ' ', '~') str = str + ' & {\tt ' + date + '} ' ;--- second pair of columns str = str + ' & ' + string(irot+42, format='(2x, i4.4)') dummy = irot+42 timarr = clon2ex(dummy) ;clon2ex changes the data type date = gt_day(timarr, /str,/lower) date = str_replace(date, ' ', '~') str = str + ' & {\tt ' + date + '} ' ;; str = str + '\\' ;--- third pair of columns str = str + ' & ' + string(irot+42*2, format='(2x, i4.4)') dummy = irot+42*2 timarr = clon2ex(dummy) ;clon2ex changes the data type date = gt_day(timarr, /str,/lower) date = str_replace(date, ' ', '~') str = str + ' & {\tt ' + date + '} ' str = str + '\\' ;--- end of table if (irot eq en_rot) then str = str + ' \hline print, str printf, lun, str if (irot eq en_rot) then printf, lun, '\end{tabular} end ; free_lun, lun end