Previous Next Contents

B.16  Extra Features

This section describes HEVEA functionalities that extends on plain LATEX, as defined in [LATEX ].

B.16.1  TeX Conditional Macros

Normally, HEVEA does not recognize constructs that are specific to TeX, in the sense that they are not described in the LATEX manual. However HEVEA recognizes à la TeX conditional macros. The \newifname, where name is made of letters only, creates three macros: \ifname, \nametrue and \namefalse. The latter two set the name condition to true and false, respectively. The \ifname command tests the condition name:
\ifname
text1
\else
text2
\fi
Text text1 is processed when name is true, otherwise text2 is processed. If text2 is empty, then the \else keyword can be omitted.

Note that HEVEA also implements LATEX ifthen package and that TeX simple conditional macros are fully compatible with LATEX boolean registers. More precisely, we have the following correspondences:
TeX LATEX

[-.5ex] \newifname    \newboolean{name}
\nametrue    \setboolean{name}{true}
\namefalse    \setboolean{name}{false}
\ifname text1\else text2\fi    \ifthenelse{\boolean{name}}{text1}{text2}

B.16.2  The \verbatiminput Command

The \verbatiminput command (cf. [LATEX -bis, Page 66]) is fully supported. Basically, this command typesets the content of a file whose name is given as argument inside a verbatim environment.

B.16.3  The calc Package

This package enables using traditional, infix, notation for arithmetic operations inside the num argument to the \setcounter{name}{num} and \addtocounter{name}{num} constructs (see [LATEX -bis, Section A.4])

The calc package provides a similar extension of the syntax of the len argument to the \setlength and \addtolength constructs. HEVEA does not implement this extension, since it does not implement length registers in the first place.

B.16.4  The array and tabularx Packages

The array package is described in [LATEX -bis, Section 5.3] and in the local documentation of modern LATEX installations. It is a compatible extension of LATEX arrays (see B.10.2). Basically, it provides new column specifications and a \newcolumntype construct for user-defined column specifications. Table 1 gives a summary of the new column specifications and of how HEVEA implement them.


m{width}    Equivalent to the p column 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 p column specification, except that the entries are bottom-aligned vertically.

>{decl}    Can be used before l, c, r, p{...}, m{...} or b{...}. It inserts decl in front of the entries in the corresponding column.

<{decl}    Can be used after l, c, r, p{...}, m{...} or b{...}. It inserts decl after entries in the corresponding column.

!{decl}    Equivalent to @{decl}


Table 1: Column specifications from the array package

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 (c, l and r) do not specify vertical alignment, which therefore becomes browser dependent.

The >{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 hevea.hva file.)

New column specifications are defined by the \newcolumntype construct:
  \newcolumntype{col}[narg]{body}
Where col is one letter, the optional narg is a number (defaults to 0), and body is built up with valid column specifications and macro-argument references (#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


HEVEA implements column specifications with commands defined in the \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.

The tabularx package [LATEX -bis, Section 5.3.5] provides a new tabular environment 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.

More generally and from the HTML point of view such sophisticated formatting is browser job in the first place. However, the HTML definition allows suggested widths or heights for table entries and table themselves. From HEVEA point of view, drawing the border line between what can be specified and what can be left to the browser is not obvious at all. At the moment HEVEA choice is not to specify too much (in particular, all length arguments, either to column specifications or to the arrays themselves, are ignored). As a consequence, the final, browser viewed, aspect of arrays will usually be different from their printed aspect.

B.16.5  HEVEA as a Back-End for VideoC

HEVEA is one of the back-ends of the VideoC system for producing educational CDROM to teach programming languages. VideoC author is Christian Queinnec and the documentation is available at:
http://www-spi.lip6.fr/~queinnec/VideoC/VideoC.html.

VideoC translates LATEX source into a variety of formats, including HTML. VideoC source may contain some special constructs for typesetting source code or to annotate text in sophisticated ways. HEVEA internal engine implements some of the core constructs needed by VideoC. The rest of VideoC constructs are implemented by the .hva files from VideoC distribution.


Previous Next Contents