git-svn make executable
[texmacs.git] / doc / devel / format / environment / env-table.en.tm
blobedb59dc7e5d90a5cf1045a90557cc6fea25dd888
1 <TeXmacs|1.0.3.11>
3 <style|tmdoc>
5 <\body>
6   <tmdoc-title|Table layout>
8   The environment variables for tables can be subdivided in variables
9   (prefixed by <src-var|table->) which apply to the whole table and those
10   (prefixed by <src-var|cell->) which apply to individual cells. Whereas
11   usual environment variables are set with <markup|assign> and <markup|with>,
12   the tabular environment variables are rather set with the
13   <hyper-link|<markup|tformat> primitive|../regular/prim-table.en.tm>. This
14   makes it possible to apply certain settings to any rectangular subtable of
15   the entire table and in particular to rows or columns. For more details,
16   see the <hyper-link|documentation|../regular/prim-table.en.tm#table-twith>
17   of the <markup|twith> and <markup|cwith> primitives.
19   <paragraph|Layout of the table as a whole>
21   <\explain>
22     <var-val|table-width|>
24     <var-val|table-height|><explain-synopsis|hint for table dimensions>
25   <|explain>
26     These parameters indicate a hint for the dimensions of the table. The
27     <src-var|table-hmode> and <src-var|table-vmode> variables determine how
28     to take into account these settings.
29   </explain>
31   <\explain>
32     <var-val|table-hmode|>
34     <var-val|table-vmode|><explain-synopsis|determination of table
35     dimensions>
36   <|explain>
37     These parameters specify how to determine the dimensions of the table. At
38     the moment, the values of <src-var|table-hmode> and <src-var|table-vmode>
39     are actually ignored and <src-var|table-width> and <src-var|table-height>
40     are interpreted as the minimal width and height of the table.
41   </explain>
43   <\explain>
44     <var-val|table-halign|l>
46     <var-val|table-valign|f><explain-synopsis|alignment inside text>
47   <|explain>
48     These parameters determine how the table should be aligned in the
49     surrounding text. Possible values for <src-var|table-halign> are
50     <verbatim|l> (left), <verbatim|c> (center) and <verbatim|r> (right), and
51     possible values for <src-var|table-valign> are <verbatim|t> (top),
52     <verbatim|f> (centered at fraction bar height), <verbatim|c> (center) and
53     <verbatim|b> (bottom).
55     In addition to the above values, the alignment can take place with
56     respect to the baselines of particular cells. Such values for
57     <src-var|table-halign> are <verbatim|L> (align <abbr|w.r.t.> the left
58     column), <verbatim|C> (align <abbr|w.r.t.> the middle column),
59     <verbatim|R> (align <abbr|w.r.t.> the right column) and <verbatim|O>
60     (align <abbr|w.r.t.> the priviledged origin column
61     <src-var|table-col-origin>). Similarly, <src-var|table-halign> may take
62     the additional values <verbatim|T> (align <abbr|w.r.t.> the top row),
63     <verbatim|C> (align <abbr|w.r.t.> the middle row), <verbatim|B> (align
64     <abbr|w.r.t.> the bottom row) and <verbatim|O> (align <abbr|w.r.t.> the
65     priviledged origin row <src-var|table-row-origin>).
66   </explain>
68   <\explain>
69     <var-val|table-row-origin|0>
71     <var-val|table-col-origin|0><explain-synopsis|priviledged cell>
72   <|explain>
73     Table coordinates of an priviledged ``origin cell'' which may be used for
74     aligning the table in the surrounding text (see above).
75   </explain>
77   <\explain>
78     <var-val|table-lsep|0fn>
80     <var-val|table-rsep|0fn>
82     <var-val|table-bsep|0fn>
84     <var-val|table-tsep|0fn><explain-synopsis|padding around table>
85   <|explain>
86     Padding around the table (in addition to the padding of individual
87     cells).
88   </explain>
90   <\explain>
91     <var-val|table-lborder|0ln>
93     <var-val|table-rborder|0ln>
95     <var-val|table-bborder|0ln>
97     <var-val|table-tborder|0ln><explain-synopsis|border around table>
98   <|explain>
99     Border width for the table (in addition to borders of the individual
100     cells).
101   </explain>
103   <\explain>
104     <var-val|table-hyphen|n><explain-synopsis|allow for hyphenation?>
105   <|explain>
106     A flag which specifies whether page breaks may occur at the middle of
107     rows in the table. When <src-var|table-hyphen> is set to <verbatim|y>,
108     then such page breaks may only occur when
110     <\enumerate>
111       <item> The table is not surrounded by other markup in the same
112       paragraph.
114       <item>The rows whether the page break occurs has no borders.
115     </enumerate>
117     An example of a tabular environment which allows for page breaks is
118     <markup|eqnarray*>.
119   </explain>
121   <\explain>
122     <var-val|table-min-rows|>
124     <var-val|table-min-cols|>
126     <var-val|table-max-rows|>
128     <var-val|table-max-cols|><explain-synopsis|constraints on the table's
129     size>
130   <|explain>
131     It is possible to specify a minimal and maximal numbers of rows or
132     columns for the table. Such settings constraint the behaviour of the
133     editor for operations which may modify the size of the table (like the
134     insertion and deletion of rows and columns). This is particularly useful
135     for tabular macros. For instance, <src-var|table-min-columns> and
136     <src-var|table-max-columns> are both set to <with|mode|math|3> for the
137     <markup|eqnarray*> environment.
138   </explain>
140   <paragraph|Layout of the individual cells>
142   <\explain>
143     <var-val|cell-background|><explain-synopsis|background color>
144   <|explain>
145     A background color for the cell.
146   </explain>
148   <\explain>
149     <var-val|cell-width|>
151     <var-val|cell-height|><explain-synopsis|hint for cell dimensions>
152   <|explain>
153     Hints for the width and the height of the cell. The real width and height
154     also depend on the modes <src-var|cell-hmode> and <src-var|cell-vmode>,
155     possible filling (see <src-var|cell-hpart> and <src-var|cell-vpart>
156     below), and, of course, on the dimensions of other cells in the same row
157     or column.
158   </explain>
160   <\explain>
161     <var-val|cell-hpart|>
163     <var-val|cell-vpart|><explain-synopsis|fill part of unused space>
164   <|explain>
165     When the sum <with|mode|math|s> of the widths of all columns in a table
166     is smaller than the width <with|mode|math|w> of the table itself, then it
167     should be specified what should be done with the unused space. The
168     <src-var|cell-hpart> parameter specifies a part in the unusued space
169     which will be taken by a particular cell. The horizontal part taken by a
170     column is the maximum of the horizontal parts of its composing cells. Now
171     let <with|mode|math|p<rsub|i>> the so determined part for each column
172     (<with|mode|math|i\<in\>{1,\<ldots\>,n}>). Then the extra horizontal
173     space which will be distributed to this column is
174     <with|mode|math|p<rsub|i>*(w-s)/(p<rsub|1>+\<cdots\>+p<rsub|n>)>. A
175     similar computation determines the extra vertical space which is
176     distributed to each row.
177   </explain>
179   <\explain>
180     <var-val|cell-hmode|exact>
182     <var-val|cell-vmode|exact><explain-synopsis|determination of cell
183     dimensions>
184   <|explain>
185     These parameters specify how to determine the width and the height of the
186     cell. If <src-var|cell-hmode> is <verbatim|exact>, then the width is
187     given by <src-var|cell-width>. If <src-var|cell-hmode> is <verbatim|min>
188     or <verbatim|max>, then the width is the minimul <abbr|resp.> maximum of
189     <src-var|cell-width> and the width of the content. The height is
190     determined similarly.
191   </explain>
193   <\explain>
194     <var-val|cell-halign|l>
196     <var-val|cell-valign|B><explain-synopsis|cell alignment>
197   <|explain>
198     These parameters determine the horizontal and vertical alignment of the
199     cell. Possible values of <src-var|cell-halign> are <verbatim|l> (left),
200     <verbatim|c> (center), <verbatim|r> (right), <verbatim|.> (decimal dot),
201     <verbatim|,> (decimal comma) and <verbatim|R> (vertical baseline).
202     Possible values of <src-var|cell-valign> are <verbatim|t> (top),
203     <verbatim|c> (center), <verbatim|b> (bottom) and <verbatim|B> (baseline).
204   </explain>
206   <\explain>
207     <var-val|cell-lsep|0fn>
209     <var-val|cell-rsep|0fn>
211     <var-val|cell-bsep|0fn>
213     <var-val|cell-tsep|0fn><explain-synopsis|cell padding>
214   <|explain>
215     The amount of padding around the cell (at the left, right, bottom and
216     top).
217   </explain>
219   <\explain>
220     <var-val|cell-lborder|0ln>
222     <var-val|cell-rborder|0ln>
224     <var-val|cell-bborder|0ln>
226     <var-val|cell-tborder|0ln><explain-synopsis|cell borders>
227   <|explain>
228     The borders of the cell (at the left, right, bottom and top). The
229     displayed border between cells <with|mode|math|T<rsub|i,j>> and
230     <with|mode|math|T<rsub|i,j+1>> at positions <with|mode|math|(i,j)> and
231     <with|mode|math|(i,j+1)> is the maximum of the borders between the right
232     border of <with|mode|math|T<rsub|i,j>> and the left border of
233     <with|mode|math|T<rsub|i,j+1>>. Similarly, the displayed border between
234     cells <with|mode|math|T<rsub|i,j>> and <with|mode|math|T<rsub|i+1,j>> is
235     the maximum of the bottom border of <with|mode|math|T<rsub|i,j>> and the
236     top border of <with|mode|math|T<rsub|i+1,j>>.
237   </explain>
239   <\explain>
240     <var-val|cell-vcorrect|a><explain-synopsis|vertical correction of text>
241   <|explain>
242     As described above, the dimensions and the alignment of a cell may depend
243     on the dimensions of its content. When cells contain text boxes, the
244     vertical bounding boxes of such text may vary as a function of the text
245     (the letter ``k'' <abbr|resp.> ``y'' ascends <abbr|resp.> descends
246     further than ``x''). Such differences sometimes leads to unwanted,
247     non-uniform results. The vertical cell correction allows for a more
248     uniform treatment of text of the same font, by descending and/or
249     ascending the bounding boxes to a level which only depends on the font.
250     Possible values for <src-var|cell-vcorrect> are <verbatim|n> (no vertical
251     correction), <verbatim|b> (vertical correction of the bottom),
252     <verbatim|t> (vertical correction of the top), <verbatim|a> (vertical
253     correction of bottom and the top).
254   </explain>
256   <\explain>
257     <var-val|cell-hyphen|n><explain-synopsis|allow for hyphenation inside
258     cells>
259   <|explain>
260     By default, the cells contain inline content which is not hyphenated. By
261     selecting <menu|Table|Special cell properties|Hyphenation|Multi-paragraph>,
262     the cell contents becomes multi-paragraph. In that case,
263     <src-var|cell-hyphen> determines how this content is hyphenated. Possible
264     values are <verbatim|n> (disable line breaking) and <verbatim|b>,
265     <verbatim|c> and <verbatim|t> (enable line breaking and align at the
266     bottom, center <abbr|resp.> top line).
267   </explain>
269   <\explain>
270     <var-val|cell-row-span|1>
272     <var-val|cell-col-span|1><explain-synopsis|span of a cell>
273   <|explain>
274     Certain cells in a table are allowed to span over other cells at their
275     right or below them. The <src-var|cell-row-span> and
276     <src-var|cell-col-span> specify the row span and column span of the cell.
277   </explain>
279   <\explain>
280     <var-val|cell-decoration|><explain-synopsis|decorating table for cell>
281   <|explain>
282     This environment variable may contain a decorating table for the cell.
283     Such a decoration enlarges the table with extra columns and cells. The
284     <markup|tmarker> primitive determines the location of the original
285     decorated cell and its surroundings in the enlarged table are filled up
286     with the decorations. Cell decorations are not really used at present and
287     may disappear in future versions of <TeXmacs>.
288   </explain>
290   <\explain>
291     <var-val|cell-orientation|portrait><explain-synopsis|orientation of cell>
292   <|explain>
293     Other orientations for cells than <verbatim|portrait> have not yet been
294     implemented.
295   </explain>
297   <\explain>
298     <var-val|cell-row-nr|1>
300     <var-val|cell-col-nr|1><explain-synopsis|current cell position>
301   <|explain>
302     In the future, these environment variables should contain the current
303     cell position during the typesetting process.
304   </explain>
306   <tmdoc-copyright|2004|Joris van der Hoeven>
308   <tmdoc-license|Permission is granted to copy, distribute and/or modify this
309   document under the terms of the GNU Free Documentation License, Version 1.1
310   or any later version published by the Free Software Foundation; with no
311   Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
312   Texts. A copy of the license is included in the section entitled "GNU Free
313   Documentation License".>
314 </body>