![]() |
Table layout | ![]() |
The environment variables for tables can be subdivided in variables (prefixed by table-) which apply to the whole table and those (prefixed by cell-) which apply to individual cells. Whereas usual environment variables are set with assign and with, the tabular environment variables are rather set with the tformat primitive. This makes it possible to apply certain settings to any rectangular subtable of the entire table and in particular to rows or columns. For more details, see the documentation of the twith and cwith primitives.
table-width\(:=\)
These parameters indicate a hint for the dimensions of the table. The table-hmode and table-vmode variables determine how to take into account these settings.
table-hmode\(:=\)auto
These parameters specify how to determine the dimensions of the table. When no table-width is specified, the width is determined automatically from the contents (mode auto). When table-width is specified, the possible values of table-hmode are exact (the default in that case: the table gets exactly the specified width), min (the table is at most as wide as table-width, but no wider than needed for its contents) and max (the table is at least as wide as table-width). In the non-automatic modes, unused space is distributed over the columns according to cell-hpart (see below). The height is determined similarly using table-height, table-vmode and cell-vpart.
table-halign\(:=\)l
These parameters determine how the table should be aligned in the surrounding text. Possible values for table-halign are l (left), c (center) and r (right), and possible values for table-valign are t (top), f (centered at fraction bar height), c (center) and b (bottom).
In addition to the above values, the alignment can take place with respect to the baselines of particular cells. Such values for table-halign are L (align w.r.t. the left column), C (align w.r.t. the middle column), R (align w.r.t. the right column) and O (align w.r.t. the privileged origin column table-col-origin). Similarly, table-valign may take the additional values T (align w.r.t. the top row), C (align w.r.t. the middle row), B (align w.r.t. the bottom row) and O (align w.r.t. the privileged origin row table-row-origin).
table-row-origin\(:=\)0
Table coordinates of a privileged “origin cell” which may be used for aligning the table in the surrounding text (see above). Rows and columns are numbered from 1; negative values count from the bottom resp. right of the table.
table-lsep\(:=\)0fn
table-rsep\(:=\)0fn
table-bsep\(:=\)0fn
Padding around the table (in addition to the padding of individual cells).
table-lborder\(:=\)0ln
table-rborder\(:=\)0ln
table-bborder\(:=\)0ln
Border width for the table (in addition to borders of the individual cells).
A flag which specifies whether page breaks may occur at the middle of rows in the table. When table-hyphen is set to y, then such page breaks may only occur when
The table is not surrounded by other markup in the same paragraph.
The rows where the page break occurs have no borders.
An example of a tabular environment which allows for page breaks is eqnarray*.
table-min-rows\(:=\)
table-min-cols\(:=\)
table-max-rows\(:=\)
It is possible to specify a minimal and maximal numbers of rows or columns for the table. Such settings constraint the behaviour of the editor for operations which may modify the size of the table (like the insertion and deletion of rows and columns). This is particularly useful for tabular macros. For instance, table-min-cols and table-max-cols are both set to \(3\) for the eqnarray* environment.
A background color for the cell. Besides colors, patterns and gradients are also allowed; the special value foreground stands for the current foreground color.
cell-width\(:=\)
Hints for the width and the height of the cell. The real width and height also depend on the modes cell-hmode and cell-vmode, possible filling (see cell-hpart and cell-vpart below), and, of course, on the dimensions of other cells in the same row or column.
cell-hpart\(:=\)
When the sum \(s\) of the widths of all columns in a table is smaller than the width \(w\) of the table itself, then it should be specified what should be done with the unused space. The cell-hpart parameter specifies a part in the unusued space which will be taken by a particular cell. The horizontal part taken by a column is the maximum of the horizontal parts of its composing cells. Now let \(p_i\) the so determined part for each column (\(i \in \{1, \ldots, n\}\)). Then the extra horizontal space which will be distributed to this column is \(p_i (w - s) / (p_1 + \cdots + p_n)\). A similar computation determines the extra vertical space which is distributed to each row.
cell-hmode\(:=\)auto
These parameters specify how to determine the width and the height of the cell. If no cell-width is specified, the width is determined by the content (mode auto). Otherwise, if cell-hmode is exact (the default when a width is given), then the width is given by cell-width. If cell-hmode is min or max, then the width is the minimum resp. maximum of cell-width and the width of the content. The height is determined similarly.
cell-halign\(:=\)l
These parameters determine the horizontal and vertical alignment of the cell. Possible values of cell-halign are l (left), c (center) and r (right). The upper case variants L, C and R align the cells of a column w.r.t. a common vertical axis; such a value may be followed by a string at whose position the alignment takes place. For instance, L. aligns on the decimal dot and L, on the decimal comma. Possible values of cell-valign are t (top), c (center), b (bottom) and B (baseline); the less common values T and C align the cells of a row w.r.t. common horizontal axes near the top resp. the center.
cell-lsep\(:=\)1spc
cell-rsep\(:=\)1spc
cell-bsep\(:=\)1sep
The amount of padding around the cell (at the left, right, bottom and top).
cell-lborder\(:=\)0ln
cell-rborder\(:=\)0ln
cell-bborder\(:=\)0ln
The borders of the cell (at the left, right, bottom and top). The displayed border between cells \(T_{i, j}\) and \(T_{i, j + 1}\) at positions \((i, j)\) and \((i, j + 1)\) is the maximum of the borders between the right border of \(T_{i, j}\) and the left border of \(T_{i, j + 1}\). Similarly, the displayed border between cells \(T_{i, j}\) and \(T_{i + 1, j}\) is the maximum of the bottom border of \(T_{i, j}\) and the top border of \(T_{i + 1, j}\).
As described above, the dimensions and the alignment of a cell may depend on the dimensions of its content. When cells contain text boxes, the vertical bounding boxes of such text may vary as a function of the text (the letter “k” resp. “y” ascends resp. descends further than “x”). Such differences sometimes leads to unwanted, non-uniform results. The vertical cell correction allows for a more uniform treatment of text of the same font, by descending and/or ascending the bounding boxes to a level which only depends on the font. Possible values for cell-vcorrect are n (no vertical correction), b (vertical correction of the bottom), t (vertical correction of the top), a (vertical correction of bottom and the top).
By default, the cells contain inline content which is not hyphenated. The cell-hyphen variable, which can be set through Cell\(\rightarrow\)Line wrapping, determines whether and how the content is broken into several lines. Possible values are n (disable line breaking) and b, c and t (enable line breaking and align at the bottom, center resp. top line). When line breaking is enabled, the cell content is typeset as a paragraph whose width is the width of the cell.
This variable determines whether the cell contains block content, i.e. whether its content is wrapped into a document tag. Possible values are no, yes and auto (block content if and only if line wrapping is enabled through cell-hyphen). The editor uses this setting in order to insert or remove the document tags around cell contents.
When positive, cells without line wrapping whose content is exceptionally high or deep receive additional vertical padding of at most cell-swell at the top resp. bottom (except at the top and bottom borders of the table). As for par-swell, the amount of padding depends on the thresholds math-top-swell-start, math-top-swell-end, math-bot-swell-start and math-bot-swell-end. This variable is used for instance by matrices.
cell-row-span\(:=\)1
Certain cells in a table are allowed to span over other cells at their right or below them. The cell-row-span and cell-col-span specify the row span and column span of the cell.
This environment variable may contain a decorating table for the cell. Such a decoration enlarges the table with extra columns and cells. The tmarker primitive determines the location of the original decorated cell and its surroundings in the enlarged table are filled up with the decorations. Cell decorations are not really used at present and may disappear in future versions of TeXmacs.
Other orientations for cells than portrait have not yet been implemented.
cell-row-nr\(:=\)1
During the typesetting of a table, these environment variables contain the position of the cell which is currently being typeset. Notice that the typesetter numbers rows and columns starting from 0 here, contrary to the cwith primitive.