![]() | ![]() | ![]() | How it works | Contents | Index |
A few words about Hyperlatex internals. This section cannot be confused with exhaustive documentation of the internal function of Hyperlatex, but there are no design documents for the system, and so this is a place where I am accumulating notes as I figure them out. Eventually, one hopes, this section will become design documentation, at which point, I will delete this lame disclaimer. Until then, one shouldn't regard the text in this section as 100% reliable.
Like LaTeX, Hyperlatex needs to run through the input file two times. The
first time through is for finding cross references, checking labels,
accumulating TOC entries and so on. The second time through is for
actually putting characters in HTML files. The
hyperlatex-final-pass
variable contains a boolean value to indicate
which pass is underway.
Hyperlatex makes extensive use of "meta" characters, also called "magic"
characters in its passes.2 The meta characters are the regular
character, plus hyperlatex-meta-offset
. Broadly, the meta
characters have two uses, protecting characters from being
interpreted, and as single-character document processing commands.
Most magic characters are used to protect characters from final
substitution. After Hyperlatex conversion, all &
, <
, and >
characters in the file are converted to XML symbols (i.e. & <
and >), while the meta-&
, meta-<
and meta->
are converted
to the normal &
, <
, >
characters.
In addition to the space, these are the characters converted for this reason:
& < > % { } " ~ - ' `
For example, the <
and >
characters are meaningless to LaTeX,
but meaningful as HTML. So as LaTeX macros are turned into HTML directives, they are bracketed with these meta brackets for the
duration of the processing. The last processing step (in
hyperlatex-final-substitutions
) puts them all back.
Meta characters are used a single-character marks for various kinds of text layout directives. These are outlined below.
{
and }
) to
escape the magic characters, if they appear in the input file, like
this: C{}
.
\section{abc}
will generate an automatic label, an <h>
tag, and then a meta-l
marker. If now a \label
command follows, Hyperlatex checks the
presence of meta-l to make sure that the label before the
section heading is used.
<a name="xxx">xxx</a>
tag). This is then done in the final substitution
stage.
Paragraph tags are controlled by two flags:
\suspendpars
and \resumepars
.
![]() | ![]() | ![]() | How it works | Contents | Index |