ma-cb-en-tabulations.tex /size: 5138 b    last modification: 2020-07-01 14:35
1\startcomponent ma-cb-en-tabulations
2
3\enablemode[**en-us]
4
5\project ma-cb
6
7\startchapter[reference=tabulation,title=Tabulation / Paragraph formatting]
8
9\index{tabulation}
10\index{tables+running text}
11\index{columns}
12\Command{\tex{starttabulate}}
13\Command{\tex{definetabulate}}
14\Command{\tex{setuptabulate}}
15\Command{\tex{NR}}
16\Command{\tex{NC}}
17
18Sometimes you want to typeset paragraphs in a specific formatted way. This is
19done with:
20
21\shortsetup{starttabulate}
22
23The tabulation mechanism is closely related to the table mechanism. You can use
24the tabulation mechanism in cases you want to typeset complete paragraphs within
25a cell. The tabulation mechanism also works fine at a page break.
26
27\startbuffer
28\starttabulate[|w(1.5cm)B|p(6.0cm)|p|]
29\NC 1252
30    \NC Hasselt obtains its city charter from bishop Hendrik
31        van Vianden.
32    \NC Hendrik van Vianden was pressed by other towns not
33        to agree with the charter. It took Hasselt a long
34        period of time to convince the Bishop. After
35        supporting the Bishop in a small war against the
36        Drents, the charter was released. \NC\NR
37\NC 1350
38    \NC Hasselt joins the Hanzepact to protect their
39        international trade.
40    \NC The Hanzepact was of great importance for merchants
41        in Hasselt. In those days trading goods were taxed
42        at every city, highway or rivercrossing. After
43        joining the Hanzepact duty free routes all over
44        Europe became available to Hasselt. However
45        important the Hanzepact was, Hasselt always stayed a
46        minor member of the pact. \NC\NR
47\stoptabulate
48\stopbuffer
49
50A tabulate definition could look like this:
51
52\typebuffer
53
54In this case the first column is \unit{1.5 centi meter} wide and is typeset bold
55(\type{B}). The second column has a width of \unit{6 centi meter} and is typeset
56like a paragraph. The remaining horizontal space is used up by the last
57paragraph.
58
59The example is typeset like this:
60
61\getbuffer
62
63The tabulation entries are placed between the \type{\start ... \stoptabulate}
64pair. Between the bracket pair your can specify the tabulate format with the
65column separators \type{|} and the format keys (see \in {table}
66[tab:tabularformattingkeys]).
67
68\placetable[][tab:tabularformattingkeys]
69  {Formatting keys for tabulate.}
70  {\starttable[|lT|l|lT|l|]
71  \HL
72  \NC \rm \bf Key                 \NC \rm \bf Meaning
73  \NC \rm \bf Key                 \NC \rm \bf Meaning
74  \NC \SR
75  \HL
76  \NC l                 \NC left align
77  \NC I                 \NC \it italic
78  \NC \FR
79  \NC c                 \NC center
80  \NC R                 \NC \sl roman
81  \NC \MR
82  \NC r                 \NC right align
83  \NC S                 \NC \sl slanted
84  \NC \MR
85  \NC i\sl n            \NC spacing left
86  \NC T                 \NC \tt teletype
87  \NC \MR
88  \NC j\sl n            \NC spacing right
89  \NC m                 \NC in||line math
90  \NC \MR
91  \NC k\sl n            \NC spacing around
92  \NC M                 \NC display  math
93  \NC \MR
94  \NC w({\sl d})        \NC 1 line,   fixed width
95  \NC f\tex{command}    \NC font specification
96  \NC \MR
97  \NC p({\sl d})        \NC paragraph, fixed width
98  \NC b\arg{..}         \NC place \type{..} before the entry
99  \NC \MR
100  \NC p                 \NC paragraph, maximum width
101  \NC a\arg{..}         \NC place \type{..} after the entry
102  \NC \MR
103  \NC B                 \NC \bf boldface
104  \NC h\tex{command}    \NC apply \tex{command} on the entry
105  \NC \LR
106  \HL
107  \stoptable}
108
109In \in {table} [tab:tabulatestructurecommands] you find an overview
110of the tabulate structuring commands.
111
112\placetable
113  []
114  [tab:tabulatestructurecommands]
115  {Commands to define tabulate.}
116  {\starttable[|l|l|l|]
117  \HL
118  \NC \bf Command                     \NC                 \NC \bf Meaning         \NC\SR
119  \HL
120  \NC \type{\start ... \stoptabulate} \NC                 \NC begin end tabulate  \NC\FR
121  \NC \type{\NC}                      \NC next column     \NC next column         \NC\MR
122  \NC \type{\NR}                      \NC next row        \NC next row            \NC\MR
123  \NC \type{\HL}                      \NC horizontal line \NC horizontal line     \NC\MR
124  \NC \type{\TB}                      \NC table blank     \NC empty line          \NC\MR
125  \NC \type{\definetabulate}          \NC                 \NC define own tabulate \NC\MR
126  \NC \type{\setuptabulate}           \NC                 \NC tabulate setup      \NC\LR
127  \HL
128  \stoptable}
129
130Another example of paragraph formatting could look like this.
131
132\startbuffer
133\definetabulate[ChemPar][|l|p|l|]
134
135\startChemPar
136\NC Limekilns
137    \NC Hasselt has its own limekilns. These were build in 1504
138        and produced quick lime up to 1956. Nowadays they are a
139        tourist attraction.
140    \NC \inlinechemical{CaCO_3,GIVES,CaO,+,CO_2} \NC\NR
141\stopChemPar
142\stopbuffer
143
144\typebuffer
145
146And it would come out like this:
147
148\getbuffer
149
150In \in{chapter}[chemical] your can find some more information on chemistry
151and \CONTEXT.
152
153Here we also introduced the command to define our own paragraph layout.
154
155\shortsetup{definetabulate}
156
157and we also have:
158
159\shortsetup{setuptabulate}
160
161\stopchapter
162
163\stopcomponent
164