summaryrefslogtreecommitdiff
path: root/macros/plain/contrib/lextex/txs.doc
blob: 3d6a9059b22328d0deab79a72184e5998659eb2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
% file: TXSruled.doc                             TeXsis version 2.14  
% $Revision: 1.1 $  :  $Date: 91/06/04 13:58:47 $  :  $Author: myers $
%======================================================================*

\def\VT{\char'174}      % the vertical var character ``|'' is needed below

        While |\halign| in Plain \TeX\ is convenient for making simple
tables, it is still difficult to make tables with horizontal and
vertical rules.  Indeed, typesetting ruled tables in \TeX\ has often
been likened to programming a computer in assembler language.  Even
\TeXbook\ acknowledges that ``people who know how to make ruled tables
are generally known as \TeX\ Masters.''\reference{Masters} 
D.E.~Knuth, {\sl The \TeX book} (Addison Wesley, 1986, ISBN
0-201-13448-9), page 245
\endreference\space
The macros described below take a great deal of the difficulty out of
making ruled tables, so that anybody can be a
\TeX\ Master.

        The basic idea behind making a ruled table is similar to
|\halign|, and the syntax is the same as the Princeton table macros
known as |TABLES.TEX| by Ray Cowan,\reference{Cowan} Ray F.~Cowan, {\sl
Making Tables with Macros} (unpublished)
\endreference 
although the \TeXsis\ macros are quite different internally and run
about 5 times faster.  You begin the table material with |\ruledtable|
and end it with |\endruledtable|.  The table material is a list of items
to appear in the rows and columns of the tables.  Just as with |\halign|
you can separate items in different columns with |&| and end a row with
|\cr|.  The |&| alignment character separates columns without putting a
vertical rule between the columns, while |\cr| ends a line and puts a
thin horizontal rule under it.  To get a vertical rule between columns
replace the |&| with a `{\tt\VT}' (the vertical line), and to end a line
without a horizontal rule under it replace the |\cr| with |\crnorule|.
One important thing to remember is to end the last line in the table
with |\endruledtable| instead of |\cr|!

   As an example here is a simple ruled table,
{\singlespaced
\bigskip
\ruledtable
Year      |    World Population \cr
8000 B.C. |   ~~~5000000        \crnorule
~~50 B.C. |   ~200000000        \crnorule
1650 A.D. |   ~500000000        \crnorule
1850 A.D. |   1000000000        \crnorule
1945 A.D. |   2300000000        \crnorule
1980 A.D. |   4400000000        
\endruledtable
\smallskip}
\noindent 
and here are the instructions that created it,
\TeXexample
\ruledtable
Year      |VT    World Population \cr
8000 B.C. |VT   ~~~5000000        \crnorule
~~50 B.C. |VT   ~200000000        \crnorule
1650 A.D. |VT   ~500000000        \crnorule
1850 A.D. |VT   1000000000        \crnorule
1945 A.D. |VT   2300000000        \crnorule
1980 A.D. |VT   4400000000        
\endruledtable
|endTeXexample
This example also appears in \TeXbook, where it is typeset using
|\halign|.  Compare how the two are constructed
and see which way you think is easier.

   By default each item in the table is centered in its column.
Inside a table the tie character ``|~|'' takes up the
space of exactly one digit (it is the same as saying |\phantom{0}|),
and this has been used to line up the digits of the entries in
both columns.  It is also possible to change the definition of
the |\TableItem| macro so that each entry in each column is left
or right justified.  This is described a little bit later.

   Something to note about this example table is that the outer
rules are thicker than the others.  You can also get a thick
vertical rule between columns by using ``{\tt\bs\VT}'' in place of
``{\tt\VT}'', and you can get a thick horizontal rule below a row by
replacing the |\cr| with |\crthick|.  The widths of thick and
thin rules are controlled by the dimensions |\thicksize| and
|\thinsize|.  If you don't want thick rules at all simply say
|\thicksize=\thinsize|, which makes the thick rules as thin
as the thin rules.

   Some synonyms:  |\CR| is the same as |\crthick|, |\nr| is the
same as |\crnorule|, and |\crrule| is the same as |\cr| (actually
it's the other way around!).  |\tab| is the same as |&| --- it
separates columns without a vertical rule.  |\vb| is the same as
{\tt\VT}, it separates columns with a thin vertical bar, while
|\Vb| is the same as {\tt\bs\VT} and separates the columns with a
thick vertical bar.  You can also use |\dbl| to separate columns
with a double vertical rule.

   As in Plain \TeX\ you can use |\span| in place of |&| (or the other
column separators) to join two columns together into one, and you can
use |\omit| as the very first token in a column to tell it to omit the
fancy column layout (the centering or other spacing).  You can also use
|\multispan| to |\span| and |\omit| several columns, just as in an
|\halign|.  The only difference is that the number of columns you tell
it to |\multispan| is the number of columns of the table it spans ---
with an |\halign| you would count the columns {\it and} any vertical
rules.

\table{table-example-II}
\caption{Another example of a ruled table.}
\singlespaced
\ruledtable
\multispan3\hfil AT\&T Common Stock \hfil\CR
 Year \dbl Price | Dividend \cr
 1971 \dbl 41-54 | \$2.60   \cr
 ~~~2 \dbl 41-54 | \$2.70   \cr
 ~~~3 \dbl 46-55 | \$2.87   \cr
 ~~~4 \dbl 40-53 | \$3.24   \cr
 ~~~5 \dbl 45-52 | \$3.40   \cr
 ~~~6 \dbl 51-59 |  ~~.95
\endruledtable
\endtable

  \Tbl{table-example-II} is another sample table, again taken
{from} \TeXbook.  Something important to notice is that the last
ruled table example didn't have a table number or a caption,
while this one does.  That's because the last example was created
using just |\ruledtable|, while this example is inside of
|\table|.  The point is that |\table| and |\ruledtable| do
separate things and can be used either separately or together:
|\table| creates the space for the table and gives it a caption
and a number, while |\ruledtable| actually constructs the body of
the ruled table.  The instructions that created \Tbl{table-example-II}
are:
\TeXexample
\table{table-example-II}
\caption{Another example of a ruled table.}
\singlespaced
\ruledtable
\multispan3\hfil AT\&T Common Stock \hfil\CR
Year \dbl Price |VT Dividend \cr
1971 \dbl 41-54 |VT \$2.60   \cr
~~~2 \dbl 41-54 |VT \$2.70   \cr
~~~3 \dbl 46-55 |VT \$2.87   \cr
~~~4 \dbl 40-53 |VT \$3.24   \cr
~~~5 \dbl 45-52 |VT \$3.40   \cr
~~~6 \dbl 51-59 |VT  ~~.95
\endruledtable
\endtable
|endTeXexample
\bigskip\goodbreak

\table{SiHCl}
\singlespaced
\tenpoint
\tolerance=1000         % here for the caption which is a pain
\ruledtable
\vctr{Molecule} | \vctr{Region} | Radius | 
  \vctr{$\alpha _{\rm HF}$}|\multispan{2} $l_{\rm max}$ \crnorule
\cskip | \cskip | \cskip |\cskip|    \crule     |  \crule \crpart 
       |        | (au)   |      | initial state | final state \CR

SiCl$_4$      | outersphere | 6.21 | 0.7238 | 4 | 7\crnorule
              | Si          | 2.20 | 0.7275 | 2 | 3\crnorule
              | Cl          | 2.40 | 0.7233 | 2 | 3\cr

SiHCl$_3$     | outersphere | 6.21 | 0.7260 | 4 | 7\crnorule
              | Si          | 2.16 | 0.7275 | 2 | 3\crnorule
              | Cl          | 2.40 | 0.7233 | 2 | 3\crnorule
              | H           | 1.20 | 0.7772 | 1 | 2\cr

SiH$_2$Cl$_2$ | outersphere | 6.25 | 0.7295 | 4 | 7\crnorule
              | Si          | 2.20 | 0.7275 | 2 | 3\crnorule
              | Cl          | 2.40 | 0.7233 | 2 | 3\crnorule
              | H           | 1.20 | 0.7772 | 1 | 2\cr

SiH$_3$Cl     | outersphere | 6.30 | 0.7360 | 4 | 7\crnorule
              | Si          | 2.20 | 0.7275 | 2 | 3\crnorule
              | Cl          | 2.40 | 0.7233 | 2 | 3\cr

SiH$_4$       | outersphere | 4.10 | 0.7524 | 4 | 7 \crnorule
              | Si          | 2.04 | 0.7275 | 2 | 3 \crnorule
              | H           | 1.20 | 0.7772 | 1 | 2 
\endruledtable

\caption{Parameters used in the MS-X$\alpha$ calculations for 
        the chlorosilane molecules, H$_{\rm x}$SiCl$_{\rm 4-x}$; 
        x=0-4.}

\endtable

Sometimes it is desirable to have rules across only some of the columns
of a table.  In this case put |\crule| in the columns that are to have
rules, |\cskip| in the columns where no rules are desired, and
end the line with |\crpart|, which signals that the line contains a
partial rule.  The column headings in  \Tbl{SiHCl} are an example of
partial rules in a table.
That table was created with the commands,\reference{Bozek, 1991}
J.D.~Bozek, Ph.D. thesis (unpublished), Department of Chemistry,
University of Western Ontario, London, Ontario CANADA
\endreference\relax
\TeXexample
\table{SiHCl}
\singlespaced\tenpoint\tolerance=1000 

\ruledtable
\vctr{Molecule} |VT \vctr{Region} |VT Radius |VT 
  \vctr{$\alpha _{\rm HF}$}|VT\multispan{2} $l_{\rm max}$ 
\crnorule
\cskip |VT \cskip |VT \cskip |VT\cskip|VT    \crule     |VT  \crule \crpart 
       |VT        |VT (au)   |VT      |VT initial state |VT final state \CR

SiCl$_4$      |VT outersphere |VT 6.21 |VT 0.7238 |VT 4 |VT 7 \crnorule
              |VT Si          |VT 2.20 |VT 0.7275 |VT 2 |VT 3 \crnorule
              |VT Cl          |VT 2.40 |VT 0.7233 |VT 2 |VT 3 ...

\endruledtable
\endtable
|endTeXexample
\bigskip\goodbreak

      Ruled tables are normally centered on the page, but you can turn
off the centering with |\noncenteredtables|. Then the table becomes just
another piece to add to a horizontal list. One thing this lets you do is
have two tables side by side on the page, like so:
\noncenteredtables
\medskip
\line{
\ruledtable
Item ABC | Item DEF \cr
Item GHI | Item JKL \endruledtable
\hfil
\ruledtable
Data 111 | Data 222 \cr
Data 333 | Data 444 \cr
Data 555 | Data 666 \endruledtable}
\smallskip
\noindent This pair of tables was produced by saying:
\TeXexample
\noncenteredtables
\medskip
\line{
\ruledtable
Item ABC |VT Item DEF \cr
Item GHI |VT Item JKL \endruledtable
\hfil
\ruledtable
Data 111 |VT Data 222 \cr
Data 333 |VT Data 444 \cr
Data 555 |VT Data 666 \endruledtable}
\smallskip
|endTeXexample
\noindent Saying |\centeredtables| turns table centering back on.
Tables are then centered across the page, and a table is then 
added to a {\it vertical} list.
\bigskip\goodbreak

        Usually |\ruledtable| makes tables as wide as their natural
width, but it is possible to make them wider by setting the dimension
|\tablewidth| to the width desired before saying |\ruledtable|.  We can
make the same table in \Tbl{table-example-II} but with the width set to
10cm: 
%
\bigskip
\noncenteredtables
\tablewidth=10cm
\line{\hfil\vbox{\singlespaced
\ruledtable
\multispan3\hfill AT\&T Common Stock \hfill\CR
Year \dbl Price | Dividend \cr
1971 \dbl 41-54 | \$2.60   \cr
~~~2 \dbl 41-54 | \$2.70   \cr
~~~3 \dbl 46-55 | \$2.87   \cr
~~~4 \dbl 40-53 | \$3.24   \cr
~~~5 \dbl 45-52 | \$3.40   \cr
~~~6 \dbl 51-59 |  ~~.95\rlap* 
\endruledtable
\hbox{* (first quarter only)}
\vss}\hfil}
\smallskip
\noindent  
The careful reader will notice that the version of
\Tbl{table-example-II} in \TeXbook\ had a footnote to the last entry,
and we have added that here.  To do so we had to put the footnote in an
|\hbox| and stack it under the table, so we had to turn off table
centering.  The table is therefore a bit more complicated to make, but
not much:
\TeXexample
\noncenteredtables
\tablewidth=10cm
\line{\hfil\vbox{\singlespaced
\ruledtable
\multispan3\hfill AT\&T Common Stock \hfill\CR
Year \dbl Price |VT Dividend \cr
1971 \dbl 41-54 |VT \$2.60   \cr
~~~2 \dbl 41-54 |VT \$2.70   \cr
~~~3 \dbl 46-55 |VT \$2.87   \cr
~~~4 \dbl 40-53 |VT \$3.24   \cr
~~~5 \dbl 45-52 |VT \$3.40   \cr
~~~6 \dbl 51-59 |VT  ~~.95\rlap* 
\endruledtable
\hbox{* (first quarter only)}
\vss}\hfil}
|endTeXexample
\centeredtables         % turn back on!
\noindent
If we had not wanted to add the footnote, then the table would have
been typed the same way as \Tbl{table-example-II} except for setting
the |\tablewidth|.

        Important note:  |\tablewidth| is turned ``off'' after the
table is made, so  the next table will have its natural width unless
you explicitly set |\tablewidth| again!
\bigskip\goodbreak

        |\ruledtable| normally inserts a |\quad| of space around each
item. If you have a very wide table, especially one with many columns,
you may wish to reduce this.  |\TightTables| make this spacing a single
space, the minimum acceptable.  |\LooseTables| restores the default
spacing.  You can define this space to be something else by
re-defining |\tablespace|, for example as
\TeXexample
\def\tablespace{\ \ }
|endTeXexample
\noindent 
If the table is still too wide with |\TightTables|, you will probably
have to reformat it or print it in landscape mode.
\bigskip\goodbreak

        The careful reader may also have noticed that in the
examples in \Tbl{table-example-II} and \Tbl{SiHCl}  we said
|\singlespaced|.  That's
because the spacing of the rows of a table can be controlled just like
the spacing of the text with |\singlespaced|, |\doublespaced|,
etc.  The space between the rows of a table is set by a strut called
|\tstrut|, which holds the rows apart.  Its default definition is
\TeXexample
\def\tstrut{\vrule height 3.1ex depth 1.2ex width 0pt}
|endTeXexample
\noindent
You can change the spacing between rows by changing the definition of
this strut.  One of the things |\singlespaced| does is define the
|\tstrut| to be 0.5ex higher and deeper than a parenthesis.
|\doublespaced|, |\triplespaced|, and |\widenspacing| all increase the
height and depth of the strut in proportion to the increase in the
baseline spacing.

        If you put something in a table which is larger than the strut,
then it will touch the rows above or below.  You can fix this by
inserting your own strut into that row.  More simply, you can say
|\bigitem{|\meta{stuff}|}|, and ``stuff'' will be positioned correctly
with a nice amount of space above and below.
\medskip

        You can also decide whether or not you want diagnostic messages
printed when a table is created.  |\tableinfotrue| causes a message to
be printed on your terminal every time a ruled table is created.  The
message tells you how many rows and columns were in the table.  This is
useful information, because it can tell you immediately if you made a
mistake in the table or left out a row or column.  |\tableinfotrue| is
the default, but you can turn off these messages by saying
|\tableinfofalse|. In any case, you will be warned if a row has a
different number of columns from the previous one.
\medskip

        The tables we have demonstrated so far all contain numbers, but
sometimes it is desirable to have an entry in a table which is a
paragraph of text.  For that purpose, you can use
|\para{|\meta{text}|}|.  The width of the paragraph is determined by
the dimension |\parasize|, which defaults to 4 inches.
\medskip

\table{tablemac;a}
\caption{Basic table macros for use with {\tt\bs ruledtable}.}
\intablelist{Basic macros for {\tt\bs ruledtable}}
\tablewidth=\hsize
\LeftJustifyTables
\ruledtable
\sl Macro name\relax         
        | \sl Description \relax \crthick
\tt\bs ruledtable\relax      
        | \para{Starts a ruled table.}\cr
\tt\bs endruledtable\relax        
        | \para{Ends the ruled table.}\cr
\tt\bs cr\relax              
        | \para{Ends the current row, and starts the next
        one.  The completed row will be separated from
        the next with a thin horizontal rule.}\cr
\vtop{\noindent\hsize=1.6in\normalbaselines
\tt\bs crthick \hfil\break \rm or \tt\bs CR\hfil }\relax         
        | \para{Similar to {\tt\bs cr}, but the rows will
        be separated with a thick horizontal rule.}\cr
\vtop{\noindent\hsize=1.6in\normalbaselines
\tt\bs crnorule \hfil\break \rm or \tt\bs nr\hfil }\relax         
        | \para{Similar to {\tt\bs cr}, but the rows will
        not be separated by a rule.}\cr
\vtop{\noindent\hsize=1.6in\normalbaselines
\tt\char124\quad \rm (vertical bar)\hfil\break
or \tt\bs vb\hfil} \relax
        | \para{Separates one column from the next, and
        puts a vertical rule between them.}  \cr
\tt\&\ \rm or\tt\ \bs tab \relax
        | \para{Same as {\tt\char124}, but does not put
        in the vertical rule between the columns.}\cr
\tt\bs\char124 \relax        
        | \para{Same as {\tt\char124}, but puts in a
        thick vertical rule.}
\endruledtable
\line{\hfil {\sl Continued...}}
\endtable

\fulltable{tablemac;b}
\caption{Additional macros for use with {\tt\bs ruledtable}.}
\intablelist{Additional macros for {\tt\bs ruledtable}}
\tablewidth=\hsize
\LeftJustifyTables
\line{{\sl Continued...}\hfil}
\smallskip
\ruledtable
\sl Macro name\relax         
        | \sl Description \relax \crthick
\tt\bs multispan\lb{\it n}\rb\relax 
        | \para{Makes the next entry span the next $n$
        columns, where $n$ is an integer, $n>0$.
        See other notes on {\tt\bs multispan} below.} \cr
\tt\bs omit \relax           
        | \para{This \TeX\ primitive causes the normal
        template for its entry to be omitted, allowing
        the user to do something else with this entry.} \cr
\tt\bs para\lb{\it text}\rb \relax
        | \para{Formats {\it text} into a neat little
        paragraph like this one.  The width of the
        paragraph produced is determined by the dimension 
        {\tt\bs parasize}.  The default is 4 inches.  } \cr
\tt\bs parasize=\meta{dimen} \relax
        | \para{Sets the width of paragraphs for the {\tt\bs para} 
        macro.} \cr
\tt\bs TableItem\lb\#\rb\relax     
        | \para{Used in the standard template, this
        macro centers its argument in the column.  The
        user can redefine it for special effects.} \cr
\tt\bs tablespace
        | \para{The spacing around each item for {\tt\bs TableItem}.}\cr
\vtop{\noindent\hsize=1.4in\normalbaselines
\tt\bs LooseTables \hfil\break
\tt\bs TightTables\hfil}\relax
        | \para{Set {\tt\bs tablespace} to {\tt\bs quad} and {\tt\bs\ } 
        respectively.\hfill\break\ }\cr
\vtop{\noindent\hsize=1.6in\normalbaselines
\tt\bs TrailingSpaces \hfil\break
\tt\bs NoTrailingSpaces \hfil}\relax
        | \para{Use trailing spaces and glue items in table entries
        (default) or ignore them. See text.}\cr
\tt\bs bigitem\lb\#\rb\relax     
        | \para{Use this for something that would normally
        not fit in one line of a table to make the spacing
        between rows large enough for this item.} \cr
\tt\bs vctr\lb\#\rb\relax     
        | \para{Centers the item {\it vertically} so that
        it can appear between two rows.}\cr
\tt\bs centeredtables\relax  
        | \para{Turns table centering on.  Each table
        will be centered left-to-right on the page.
        This is the default.} \cr
\tt\bs noncenteredtables\relax
        | \para{Turns table centering off.  Each table
        is returned as an {\tt\bs hbox}, and it is up
        to the user to place it as desired.} \cr
\vtop{\noindent\hsize=1.6in\normalbaselines
\tt\bs tableinfotrue \hfil\break
\tt\bs tableinfofalse\hfil}\relax
        | \para{Turns on or off the diagnostic message telling
        you how many rows and columns were found in the
        table. }\cr
\tt\bs thicksize=\meta{dimen} \relax
        | \para{This dimension specifies the thickness
        of the thick rules in the table.  The default
        size is 1.5 points.} \cr
\tt\bs thinsize=\meta{dimen} \relax
        | \para{This dimension specifies the thickness
        of thin rules in the table.  The default
        size is 0.8 points.} \cr
\tt\bs tablewidth=\meta{dimen} \relax
        | \para{Specifies how wide to make the next
        table.  If not specified, the table is made to
        its natural width.  This value is reset
        following the construction of each table.} 
\endruledtable
\vss
\endtable

Tables \use{Tb.tablemac;a} and \use{Tb.tablemac;b} summarize the
most important commands for making ruled tables.
\medskip

  Finally we can discuss how you can change how each column of
a table is constructed.  The macros which build the table take
each entry and pass it to a macro called |\TableItem|.  The
default definition of |\TableItem| is:
\TeXexample
\let\TableItem=\@TableItem      % default is centered
\def\@TableItem#1{%             % centers item in ruled table
   \hfil\tablespace             % left glue
   #1\killspace                 % item, no space after
   \tablespace\hfil             % right glue
    }%
|endTeXexample
The |\hfil| glue on both sides of the argument causes the item to be
centered in the column, while |\tablespace| (which defaults to |\quad|)
insures that there will be at least some amount of space between the
item and the vertical rules on each side. Because of the way that
\TeX\ handles macro arguments, if you type a table with spaces between
the text and the next column separator, an extra |\space| will be
inserted into the table. If you first say |\NoTrailingSpaces|, then
|\killspace| in the above macro is defined to remove any trailing glue
items. |\hfill| is redefined by the table macros so that if it is the
last token in an entry, then that entry is properly left justified,
but to insert any other trailing glue, you must say
\example
\meta{text}\meta{glue}\null
\endexample
\noindent
The default is |\TrailingSpaces|, which does incorporate any trailing
spaces into the table but which also treats any trailing glue items
normally. You may wish to change this default in your |TXSpatch.tex|
file.

        You can change the definition of |\TableItem| to suit your own
purpose.  The simplest modification is to omit the |\hfil| on the left
or right so that each entry is right or left justified.  This is so
commonly used that saying |\RightJustifyTables| or
|\LeftJustifyTables| makes the appropriate change for you.  Saying
|\NoJustifyTables| restores |\TableItem| to its original centering
function.

  Since |\TableItem| is used to create every column of the table, you
cannot use it to modify a single column.  To justify just one column
you can simply put |\hfill| to the left or right of each item in the
column, since |\hfill| is infinitely more stretchy than |\hfil|. (The
behavior of glue items other than |\hfill| depends on whether
|\NoTrailingSpaces| has been set.)  With a little more work it is
possible to design special or unusual tables by redefining the
``preamble'' of the table.  This is possible because |\ruledtable|
uses |\halign| with a preamble called |\TablePreamble|.  The default
definition of |\TablePreable| is:
\TeXexample
\def\TablePreamble{%                    % \ruledtable preamble
   \TableItem{####}%                    % the first item
   \plaintab\plaintab                   % && means repeat this
   \TableItem{####}%                    % the subsequent items
   \plaincr}%                           % end of preamble
|endTeXexample
\noindent
The syntax for |\TablePreamble| is like an |\halign| preamble in Plain
\TeX\, but with |&| replaced by |\plaintab|, |\cr| replaced by
|\plaincr|, and |#| replaced by |####|.  If you have read this far and
want to try changing |\TablePreable| then you should read the source
code and the comments that go with it in the file |TXSruled.tex.|

As a final note we point out that it is also possible for you to create
your own column separators with the macro |\nextcolumn|.  This macro
takes a single argument which is used to separate one column of the
table from another. Thus for example, the |\dbl| macro for creating a
double vertical rule between columns is defined as:
\TeXexample
\def\dbl{%                               
   \nextcolumn{\vrule width\thinsize     
   \hskip\thinsize\vrule width\thinsize}}
|endTeXexample

%>>> EOF TXSruled.doc <<<