|
\newcolumntype construct for user-defined column
specifications.
Table 1 gives a summary of the new column
specifications and of how HEVEA
implements them.
Note that centered, top-aligned or bottom-aligned in the vertical direction, do not have exactly the same meaning in LATEX and in HTML. However, the aspect is the same when all columns agree w.r.t. vertical alignment. Ordinary column types (
m{width}Equivalent to the pcolumn specification (the width argument is ignored, entries are typeset in paragraph mode with paragraph breaks being reduced to a single line break), except that the entries are centered vertically.
b{width}Equivalent to the pcolumn specification, except that the entries are bottom-aligned vertically.
>{decl}Can be used before l,c,r,p{...},m{...}orb{...}. It inserts decl in front of the entries in the corresponding column.
<{decl}Can be used after l,c,r,p{...},m{...}orb{...}. It inserts decl after entries in the corresponding column.
!{decl}Equivalent to @{decl}
c, l and r)
do not specify vertical alignment, which therefore becomes browser
dependent.>{decl} and <{decl}
constructs permit the encoding of TeX \cases macro as follows:
\def\cases#1{\left\{\begin{array}{l>{$}l<{$}}#1\end{array}\right.}
(This is an excerpt of the latexcommon.hva file.)\newcolumntype
construct:
\newcolumntype{col}[narg]{body}
#int).
Examples are:
\newcolumntype{C}{>{\bf}c}
\newcolumntype{E}[1]{*{#1}{c}}
\begin{tabular}{CE{3}}\hline
one & two & three & four \\
five & six & seven & eight \\ \hline
\end{tabular}
The column specification
C means that entries will be typeset centered and using bold
font, while the column specifications E{num}
stands for num centered columns. We get:| one | two | three | four | |
| five | six | seven | eight | |
\newcommand style. Thus, they have the same behavior as regards
double definition, which is not performed and induces a warning
message.
Thus, a column specification that is
first defined in a macro.hva specific
file, overrides the document definition.tabularx and a new column type X. HEVEA
makes the former equivalent to tabular and the latter
equivalent to p{ignored}. By contrast with the
subtle array formatting that the tabularx package performs,
this may seem a crude implementation. However, rendering is usually
correct, although different.