## B.2 The Structure of the Document

Document structure is a bit simplified with respect to LATEX, since documents consist of only two parts. The preamble starts as soon as HEVEA starts to operate and ends with the `\begin{document}` construct. Then, any input occurring before `\end{document}` is translated to HTML. However, the preamble is processed and the preamble comprises the content of the files given as command-line arguments to HEVEA, see section C.1.1.1). As a consequence, command and environment definitions that occur before `\begin{document}` are performed. and they remain valid during all the processing.

In particular one can define a header and a footer, by using the `\htmlhead` and `\htmlfoot` commands in the preamble. Those commands register their argument as the header and the footer of the final HTML document. The header appears first while the footer appears last in (visible) HTML output. This is mostly useful when HEVEA output is later cut into pieces by HACHA, since both header and footer are replicated at the start and end of any file generated by HACHA. For instance, to append a copyright notice at the end of all the HTML pages, it suffices to invoke the `\htmlfoot` command as follows in the document preamble:

    \htmlfoot{\copyright to me}

The `\htmlhead` command cannot be used for changing anything outside of the HTML document body, there are specific commands for doing this. Those command must be used in the document preamble. One can change HEVEA default (empty) attribute for the opening `<BODY ...>` tag by redefining `\@bodyargs`. For instance, you get black text on a white background, when the following declaration occurs before `\begin{document}`:

    \renewcommand{\@bodyargs}{TEXT=black BGCOLOR=white}

Since version 1.08, a recommended alternative is to use style sheets:

    \newstyle{BODY}{color:black; background:white;}

Similarly, some elements can be inserted into the output file `HEAD` element by redefining the `\@meta` command (Such elements typically are `META`, `LINK`, etc.). As such text is pure HTML, it should be included in a `rawhtml` environment. For instance, you can specify author information as follows:

    \let\oldmeta=\@meta
    \renewcommand{\@meta}{%
    \oldmeta
    \begin{rawhtml}
    <META name="Author" content="Luc Maranget">
    \end{rawhtml}}

Note how `\@meta` is first bound to `\oldmeta` before being redefined and how `\oldmeta` is invoked in the new definition of `\@meta`. Namely, simply overriding the old definition of `\@meta` would imply not outputting default meta-information.

The `\@charset` command holds the value of the (HTML) document character set. By default, this value is `US-ASCII`. In previous versions of HEVEA, one could change the value of the document character set by simply redefining `\@charset`. Then, it was users responsability to provide a (LATEX) document in the correspounding encoding. This is no longer so, and users should not redefine `\@charset` directly. Please, see Section 8.6 for details.