Table primitives

Tables are always present in documents inside evaluable tags which take a tformat operand. All fundamental table structures have inaccessible borders. The basic top-level table tag is tabular.

<tformat|with-1||with-n|table>
(table formatting container)

Every tabular structure in a document contains a tformat tag.

<tformat|table> means the table and cell variables defined in the top-level table tag are not modified. The table argument may be a table or a nested tformat tag, the latter does not appear in documents but is produced by the evaluation of the top-level tag.

<tformat|with-1||with-n|table> is used when the table contains specific formatting information. The with-1 to with-n arguments must all be twith or cwith tags.

<twith|var|val>
(set a table variable)

The formatting of the table as a whole is specified by a number of table variables, which are used internally and do not appear in the environment like regular typesetter variables.

The twith primitive sets the table variable var (literal string) to the value val (evaluated).

<cwith|top-row|bot-row|left-col|right-col|var|val>
(set a cell variable for a range)

The formatting of cells is specified by a number of cell variables, which are used internally and do not appear in the environment like regular typesetter variables. Rows, columns, and generally any rectangular range of cells can associated to a cell variable setting by a single cwith tag.

The cwith primitive sets the cell variable var (literal string) to the value val (evaluated) for the range of cells spanning rows top-row to bot-row and columns left-col to right-col (literal non-zero integers).

Range coordinates must be non-zero literal integers, positive values are counted left to right and top to bottom, negative values are counted right to left and bottom to top. For example, 2 means the second row or column and -1 means the last row or column.

Typical values for (top-row,bot-row,left-col,right-col) are (r,r,1, - 1) for “row r”, (1, - 1,c,c) for “column c”, and (r,r,c,c) for “the cell at row r, column c”. When new cells are inserted, it makes a difference whether the rows are counted from the top or bottom, and the columns are counted from the left or right. If m is the number of rows and n the number of columns, then r and r - m - 1 represent the same rowthe former is relative to the top border while the latter is relative the bottom border. Similarly, c and c - n - 1 represent the same column.

<table|row-1||row-n>
(row container)

The only purpose of the table tag is to contain row tags. The number of rows in a table is the number of subtrees in its table tag.

<row|cell-1||cell-k>
(cell container)

The only purpose of the row tag is to contain cell tags. All row tags in a given table must have exactly as many subtrees, all cell tags, as there are columns in the table.

<cell|content>
(cell data container)

Table cells can contain any document fragment. A cell may directly contain an inline content tag or a concat, if it has block content it must always contain a document tree.

A cell whose operand is a document is a multi-paragraph cell. Since tables are allowed in line context, this is the only construct which allows, indirectly, the nesting of a block context within a line context. Note that most block content can only be typeset correctly within an hyphenated cell, this is controlled by the cell-hyphen table variable.

<subtable|table>
(subtable cell data)

In addition to regular markup, cells can accept subtable as an operand. The operand of subtable is a tformat tree containing regular table data.

A similar effect can be obtained with normal table by setting the cell's padding to zero in all directions, the extra twist of a subtable is its inaccessible border positions.

<tmarker|table>
(decoration origin marker)

This tag is used in the definition of cell decorations, see the documentation of the cell-decoration environment variable.

It is also used outside tables, in the switch tag to mark the currently displayed position.

<tabular|table>
(built-in tabular macro)

This macro implements standard left aligned tables without borders. Although the tabular macro is built-in into TeXmacs, it should not really be considered as a primitive. However, it is not part of any style file either.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".