 |
Tabular material |
 |
Tables offer a general way to align markup in complex manners. They
can be useful for the presentation of data, but also for typesetting
computer programs or the design of web sites. TeXmacs provides a wide
variety of parameters to control the precise layout of tables and its
cells.
1.Creating tables
In order to create a table, you may either use Insert→Table or one of the following keyboard
shorthands:
-
M-t N t
-
Create a plain table.
-
M-t N T
-
Create a table whose cells are centered.
-
M-t N b
-
Create a “block”, whose cells all have a small border.
-
M-t N B
-
Create a block whose cells are centered.
In math mode, a few other table-like structures are provided:
-
M-t N m
-
Create a matrix.
-
M-t N d
-
Create a determinant.
-
M-t N c
-
Create a choice list.
Examples of a plain table, a centered block and a matrix are shown
below. Notice that the environments with the explanatory text below
the tables were created using Insert→Table→Small table.
The use of “small tables” allows you to put several tables
besides each other on the same line. For a single large table, one may
use Insert→Table→Big table.
| boom |
tree |
| hallo |
hello |
| wiskunde |
mathematics |
|
|
Table 1. A plain table.
|
| boom |
tree |
| hallo |
hello |
| wiskunde |
mathematics |
|
|
Table 2. A centered block.
|
There are several other table-like environments and new ones may be
created by the user. For instance, using Text→Mathematics→Equations
or A-&, you may insert an eqnarray* environment, which allows
mathematically oriented users to align a list of equations which span
over entire lines. An example of such a list of equations is
| sin (f(x)
g(x))' |
= |
(f(x)
g(x))' cos (f(x)
g(x)) |
|
= |
(f'(x) g(x)
+ f(x) g'(x)) cos
(f(x) g(x)) |
When starting a new table, its size is minimal (usually 1×1) and
its cells are empty. New rows and columns are inserted using the
A-left, A-right, A-up
and A-down shorthands. For instance,
A-right creates a new column at the right of the
current cursor position, as illustrated in the figure below. You may
also start a new row below the current cursor position by hitting
return.
|
(
)
⟶
(
)
|
|
Figure 1. Example of the insertion of a new
column in a matrix. Assuming that the cursor is at the position
indicated in the left-hand matrix, insertion of a new column
using A-right results in the right-hand matrix.
|
2.The formatting mode
In TeXmacs, arbitrary blocks of cells in the table may be formatted in
particular ways. For instance, you may give individual cells a
background color, but you may also decide an entire column to be
horizontally centered. By default, formatting commands operate on
individual cells, but this may be changed via Table→Cell operation mode. The following operation
modes are available:
-
M-t m c
-
Operate on individual cells.
-
M-t m h
-
Operate on rows.
-
M-t m v
-
Operate on columns.
-
M-t m t
-
Operate on the entire table.
It is also possible to select a block of cells using the mouse and
perform a single operation on that rectangle.
3.Specifying the cell and table
alignment
The most frequent formatting operation is the horizontal or vertical
alignment of a block of cells. You may use the
M-←, M-→,
M-↑ and M-↓ keystrokes to
quickly align more to the left, right, top or bottom.
A specific alignment can also be selected in the Table→Horizontal cell alignment and Table→Vertical cell alignment menus.
Alternatively, you may use keyboard shorthands of the types M-t
h x and M-t v x for
horizontal resp. vertical alignment.
Similarly, you may specify how the table itself should be aligned with
respect to the surrounding text. This is either done via the Table→Horizontal table
alignment and Table→Vertical table alignment submenus, or using
keyboard shorthands of the form M-t H x or
M-t V x. Here x
represents l for “left”, c
for “centered”, r for “right”,
b for “bottom” and t for
“top”.
4.Specifying the cell and table size
Using Table→Cell
width→Set width resp.
Table→Cell
height→Set height you
may specify the width or height of a cell. In fact, the specified
width (or height) may be taken into account in three different ways:
-
Minimum mode
-
The actual width of the cell will be the minimum of the specified
width and the width of the box inside the cell.
-
Exact mode
-
The width of the cell will be precisely the specified one.
-
Maximum mode
-
The actual width of the cell will be the maximum of the specified
width and the width of the box inside the cell.
The border width and the cell padding (to be explained below) are
taken into account in the size of the box inside the cell.
You may also specify the width and the height of the entire table in
Table→Special table
properties. In particular, you may specify the
table to run over the entire width of a paragraph. When specifying a
width (or height) for the entire table, you may specify how the unused
space is distributed over the cells using Table→Special cell properties→Distribute
unused space. By default, the unused space is
equally distributed.
5.Borders, padding and background color
You may specify the border widths and padding spaces of a cell in all
possible four directions: on the left, on the right, at the bottom and
at the top (see Table→Cell
border). You have keyboard shorthands of the forms
M-t b x and M-t p
x in order to specify border widths and cell
padding.
The default border width for cells in the block environment is 1ln, i.e. the standard line width in the current font
(like the width of a fraction bar). This width occurs at the right and
the bottom of each cell (except when the cell is on the first row or
column). The default horizontal cell padding is 1spc:
the width of a white space in the current font. The default vertical
cell padding is 1sep: the standard minimal separation
between two close boxes.
Cells may be given a background color via Table→Cell background color.
The entire table may also be given a border and a table padding in
Table→Special table
properties→Border. In
this case, the padding occurs outside the border.
6.Advanced table features
In the menus, you also find some other more special features for
tables. Very briefly, these include the following:
-
Change the “span” of a cell and let it run over its
neighbouring cells on its right and below.
-
Creation of entire subtables inside cells.
-
Correction of the depth and height of text, in order to let the
baselines match.
-
Horizontal hyphenation of cell contents and vertical hyphenation of
the entire table.
-
Gluing several rows and/or columns together, so that the glued cells
become “part of the borders” of the remaining cells.
-
Disactivation of the table, in order to see its “source
code”.
-
Setting the “extension center” of a table. From now on,
the formatting properties of this cell will be used for new cells
created around this center.
-
Specification of the minimal and maximum size of a table, which will
be respected during further editing. (this is mainly useful when
creating table macros).
Currently, all tables come inside an environment like tabular, block,
matrix, etc. When creating
your own table macros, you may use Table→Special table properties→Extract
format to extract the format from a given table.
© 1999–2003 Joris van der Hoeven
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".