blob: ec86f6db0f06b9de915a992d3f4d1a46cc07d50d (
plain) (
blame)
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
|
@Section
@Title { Vertical alignment of tables }
@Tag { tbl_mark }
@Begin
@PP
Occasionally the vertical alignment of a table with objects to its left
tables. @RawIndex { tables }
tables.vertical.alignment @SubIndex { vertical alignment of }
vertical.alignment @Index { vertical alignment of tables }
and right becomes an issue. Examples are hard to find, but let's say
that we need to construct a symbol
@ID @AmberLight
and include it in running text. The obvious first attempt at a table
with three rows is
@ID -1px @Break @OneRow @Code @Verbatim {
@Tbl
aformat { @Cell A }
margin { 0i }
strut { no }
{
@Rowa A { @OpenCircle }
@Rowa A { @ClosedCircle }
@Rowa A { @OpenCircle }
}
}
where @Code "@OpenCircle" and @Code "@ClosedCircle" produce open and
closed circles (they may be defined using the @Code "@Diag" package);
but this produces
@Tbl
aformat { @Cell A }
margin { 0i }
strut { no }
{
@Rowa A { @OpenCircle }
@Rowa A { @ClosedCircle }
@Rowa A { @OpenCircle }
}
in running text, because vertical alignment is by default through the
top boundary of the table. To make the alignment pass through one of
the rows, replace its @Code "@Row" symbol by a corresponding
tables. @RawIndex { tables }
tables.markrow @SubIndex { @Code "@MarkRow" symbols }
thing.tables @Index { @Code "@MarkRow" symbols (tables) }
@Code "@MarkRow" symbol. Here is the revised table, enclosed in a
definition for ease of use:
amberlight @Index { @Code "@AmberLight" symbol }
@ID -1px @Break @OneRow @Code @Verbatim {
import @TblSetup
def @AmberLight
{
@OneRow @Tbl
aformat { @Cell indentvertical { align } A }
margin { 0i }
strut { no }
paint { no }
rule { no }
{
@Rowa A { @OpenCircle }
@MarkRowa A { @ClosedCircle }
@Rowa A { @OpenCircle }
}
}
}
Now when we write
@ID @Code "produces @AmberLight in running text"
we find that this definition produces @AmberLight in running text, as
desired. We have enclosed the table in @Code "@OneRow" to ensure that
its rows will never become separated, and added some options just in
case the definition is ever used with a setup file (Section
{@NumberOf tbl_setu}) that has default painting or rules.
@End @Section
|