File: manual024.html

package info (click to toggle)
hevea-doc 2.36-1
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, forky, sid, trixie
  • size: 1,764 kB
  • sloc: makefile: 9
file content (98 lines) | stat: -rw-r--r-- 6,081 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="generator" content="hevea 2.36">
<meta name="Author" content="Luc Maranget">
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"></script><link rel="stylesheet" type="text/css" href="manual.css">
<title>The Structure of the Document</title>
</head>
<body>
<a href="manual023.html"><img src="previous_motif.svg" alt="Previous"></a>
<a href="manual022.html"><img src="contents_motif.svg" alt="Up"></a>
<a href="manual025.html"><img src="next_motif.svg" alt="Next"></a>
<hr>
<h2 class="section" id="sec108">B.2&#X2003;The Structure of the Document</h2>
<p><a id="structure"></a>
Document structure is a bit simplified with respect to L<sup>A</sup>T<sub>E</sub>X, since
documents consist of only two parts.
The <em>preamble</em> starts as soon as H<span class="c020"><sup>E</sup></span>V<span class="c020"><sup>E</sup></span>A starts to operate and
ends with the <code class="verb">\begin{document}</code> construct.
Then, any input occurring before
<code class="verb">\end{document}</code> is translated to html.
However, the preamble is processed
and the preamble comprises the content of the files given as command-line
arguments to H<span class="c020"><sup>E</sup></span>V<span class="c020"><sup>E</sup></span>A, see section&#XA0;<a href="manual041.html#comline">C.1.1.1</a>).
As a consequence, command and environment definitions that
occur before <code class="verb">\begin{document}</code> are performed.
and they remain
valid during all the processing.</p><p><a id="hevea_default148"></a>
<a id="hevea_default149"></a>
In particular one can define a <em>header</em> and a <em>footer</em>, by using the
<code class="verb">\htmlhead</code> and <code class="verb">\htmlfoot</code> 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 H<span class="c020"><sup>E</sup></span>V<span class="c020"><sup>E</sup></span>A output is later cut into pieces by
H<span class="c020"><sup>A</sup></span>C<span class="c020"><sup>H</sup></span>A, since both header and footer are replicated
at the start and end of any file generated by H<span class="c020"><sup>A</sup></span>C<span class="c020"><sup>H</sup></span>A.
For instance, to append a copyright notice at the end of all the html
pages, it suffices to invoke the <code class="verb">\htmlfoot</code> command as follows
in the document preamble:
</p><pre class="verbatim">\htmlfoot{\copyright to me}
</pre><p><a id="hevea_default150"></a>
<a id="hevea_default151"></a>
<a id="hevea_default152"></a>
<a id="hevea_default153"></a><a id="metadef"></a>
The <code class="verb">\htmlhead</code> 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 H<span class="c020"><sup>E</sup></span>V<span class="c020"><sup>E</sup></span>A default (empty) attribute of
the opening <code class="verb">&lt;body ...&gt;</code> tag by redefining
<code class="verb">\@bodyargs</code>.
For instance, you get black text on a white background, when the
following declaration occurs before <code class="verb">\begin{document}</code>:
</p><pre class="verbatim">\renewcommand{\@bodyargs}{style="color:black;background:white"}
</pre><p>
Since version 1.08, a recommended alternative is to use style sheets:
</p><pre class="verbatim">\newstyle{body}{color:black; background:white;}
</pre><p>One can also change the default (empty) attribute of the opening
<code class="verb">&lt;html ...&gt;</code> tag by redefining
<code class="verb">\@htmlargs</code>. For instance you can set the language attribute
of the whole document by issuing the following redefinition in
the document preamble:
</p><pre class="verbatim">\renewcommand{\@htmlargs}{lang=en}
</pre><p><a id="hevea_default154"></a><a id="hevea_default155"></a>
<a id="exlet"></a>Similarly, some elements can be inserted into the output file
<code class="verb">head</code> element by redefining the <code class="verb">\@meta</code> command
(Such elements typically are <code class="verb">meta</code>, <code class="verb">link</code>, etc.).
As such text is pure html, it should be included in a
<code class="verb">rawhtml</code> environment. For instance, you can specify
author information as follows:
</p><pre class="verbatim">\let\oldmeta=\@meta
\renewcommand{\@meta}{%
\oldmeta
\begin{rawhtml}
&lt;meta name="Author" content="Luc Maranget"&gt;
\end{rawhtml}}
</pre><p>
Note how <code class="verb">\@meta</code> is first bound to
<code class="verb">\oldmeta</code> before being redefined and how <code class="verb">\oldmeta</code> is
invoked in the new definition of <code class="verb">\@meta</code>.
Namely, simply overriding the old definition of <code class="verb">\@meta</code> would
imply not outputting default meta-information.</p><p><a id="hevea_default156"></a>
The <code class="verb">\@charset</code> command holds the value of the (html) document character
set. By default, this value is <span class="c017">US-ASCII</span>.
In previous versions of H<span class="c020"><sup>E</sup></span>V<span class="c020"><sup>E</sup></span>A, one could change the
value of the document character set by simply redefining
<code class="verb">\@charset</code>. Then, it was users responsability to provide a
(L<sup>A</sup>T<sub>E</sub>X) document in the correspounding encoding.
This is no longer so, and users should <em>not</em> redefine
<code class="verb">\@charset</code> directly. Please, see Section&#XA0;<a href="manual018.html#encodings">8.6</a> for details.</p>
<hr>
<a href="manual023.html"><img src="previous_motif.svg" alt="Previous"></a>
<a href="manual022.html"><img src="contents_motif.svg" alt="Up"></a>
<a href="manual025.html"><img src="next_motif.svg" alt="Next"></a>
</body>
</html>