[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Experiments with tables

From: esh
Subject: Experiments with tables
Date: Tue, 03 Jan 95 09:31:08 -0800

I thought I'd try to duplicate some tables to see how easy it is to
use @Tab and friends. Things went quite smoothly. I've tacked on a
lout file that reproduces some examples from the LaTeX Companion. You
will need a mydefs that contains definitions for @TeX and
@LaTex. These are:

   def @TeX
   { @OneCol { T &0.4fo {-0.2f @VShift E} &0.45fo X }

   def @LaTeX
   { @OneCol { L &0.3fo { +0.1f @VShift 0.8f @Font A } &0.4fo @TeX }

The tables follow.


| Edward S. Hirgelt             |
| address@hidden                        |
| Direct Interfaces Corporation |
| 128 Arbor Drive               |
| Piedmont, Ca 94610            |

#---------------------- Cut Here -----------------------------#
# This assumes that @LaTeX is defined somewhere (mydefs).
@Heading {Table Experiments}
This is originally from the @LaTeX Companion, page 135. The primary
trick is to remove all horizontal margins from the outer and inner
tables then put it back within the formats. The second and third
columns must also be of fixed width (use "@Wide" as in 
{Courier Base} @Font 
"@Col 1.5c @Wide {{} |0.3c |0.5rt B |0.3c {}}")). 
The @I vertical centering of the upper left hand slot is accomplished
with ({Courier Base} @Font "@Rowb A{//0.4rt 100}"). This is mostly
automatic. The 0.4 was selected to make it look better. I would have
thought that 0.5rt was the answer.
    above{yes} below{yes} side{yes} between{yes}
    @address@hidden {{} |0.3c |0.5rt A |0.3c {}} ! 
          @Col 1.5c @Wide {{} |0.3c |0.5rt B |0.3c {}} ! 
          @Col 1.5c @Wide {{} |0.3c |0.5rt C |0.3c {}}}
    @address@hidden {{} |0.3c |0.5rt A |0.3c {}} ! @Col T @Over B,C}
    @Rowb A{//0.4rt 100} 
        @Tab hmargin{0i} 
            above{no} below{no} side{no} between{yes} 
            @Fmtd{ @Col 1.5c @Wide {{} |0.3c |0.5rt A |0.3c {}} !
                   @Col 1.5c @Wide {{} |0.3c |0.5rt B |0.3c {}}}
            @Fmte{ @Col @CC S @Over A,B}
#           @Rowe below{yes} S{1.5c @Wide{Something else is going on here.}}
            @Rowe below{yes} S{Something}
            @Rowd A{A} B{B} 
    } vmargin{0.0i}
    @Rowa A{20000000} B{1000} C{100}
This next one from page 324 is an example of rotation used within
tables. The most straight-forward approach results in the second one
displayed there. Setting the horizontal margin to 0 approaches the
first (shown below). It isn't obvious how to get other one. Too bad
there isn't a way to lie about the width of an object.
    @address@hidden 45d @Rotate A ! @Col 45d @Rotate B ! @Col 45d @Rotate C}
    @address@hidden @CC A ! @Col @CC B ! @Col @CC C}
    @Rowa A{Column 1} B{Column 2} C{Column 3}
    @Rowb A{1} B{2} C{3} above{yes}
    @Rowb A{4} B{5} C{6}
    @Rowb A{7} B{8} C{9} below{yes}
This one is from page 130 and is representative of many real
tables. This doesn't exactly duplicate the @LaTeX layout. I like the
positioning of Year, Comments, and Other better raised than at the
bottom of their slot. The price column heading was done with the "/"
operator and {Courier Base} @Font "@Rule".
    above{yes} below{yes} between{yes} side{yes}
    @address@hidden @CC T @Over A,B,C,D}
    @address@hidden {/0.3f @CC Y} !between{double}
          @Col @CC P !
          @Col {/0.3f @CC C} !
          @Col {/0.3f @CC O} }
    @address@hidden {|1rt Y} !between{double}
          @Col @CC P !
          @Col C !
          @Col {|1rt O}}
    @Rowa T{"GG&A" Hoofed Stock} below{double}
    @Rowh Y{Year} 
        P{Price /0.3f @Rule /0.3f low-high} 
        C{Comments} O{Other}
    @Rowi Y{1971} P{97-245} C{Bad year for farmers in the West.} O{23,45}    
    @Rowi Y{72} P{245-245} C{Light trading due to a heavy winter.} O{435,23}
    @Rowi Y{73} P{245-2001} C{No gnus was very good gnus this year.} O{287,56}

@End @Text

reply via email to

[Prev in Thread] Current Thread [Next in Thread]