|
Preprogrammed table making utility: Gams2tbl |
Top Previous Next |
|
Rutherford has developed a preprogrammed table making utility using put commands called Gams2tbl.gms that he documents and distributes through http://www.mpsge.org/inclib/gams2tbl.htm Gams2tbl is a gms file that users can include in their program through a Libinclude or Batinclude that contains numerous formatting options. Gams2tbl and some of its formatting capabilities are illustrated in the following example (canput.gms)
set columns / a Horses,b Cows,c Chickens/ set rows /r1 Housing,r2 Land,r3 Feed/ table data (rows,columns) Table with default formatting a b c r1 1 14.8233 12.99 r2 2 12 2.2 r3 3 11 3.2; file ruthput ; put ruthput ; $libinclude GAMS2tbl $libinclude GAMS2tbl data parameter roworder(rows) /r1 3,r2 1,r3 2/; parameter colorder(columns) /a 2,b 3, c 1/ ; $setglobal row_order roworder $setglobal col_order colorder $setglobal title "Table 2 where item ordering is controlled" $libinclude GAMS2tbl data $setglobal row_label rows $setglobal col_label columns $setglobal title "Table 3 where labels for sets are used" $libinclude GAMS2tbl data parameter decimals(columns) /a 0,b 4 ,c 1/ ; $setglobal c_decimals decimals $setglobal title "Table 4 where decimals are controlled" $libinclude GAMS2tbl data
Yields the resultant output
Tables can be made in regular text, HTML or Latex formats. |