Using HyperlatexTopIntroductionContentsIndex

Introduction

The basic idea of Hyperlatex is to make it possible to write a document that will look like a flawless LaTeX document when printed and like a handwritten HTML document when viewed with an HTML browser. In this it completely follows the philosophy of latexinfo (and texinfo). Like latexinfo, it defines its own input format--the Hyperlatex markup language--and provides two converters to turn a document written in Hyperlatex markup into a DVI file or a set of HTML documents.

Obviously, this approach has the disadvantage that you have to learn a "new" language to generate HTML files. However, the mental effort for this is quite limited. The Hyperlatex markup language is simply a well-defined subset of LaTeX that has been extended with commands to create hyperlinks, to control the conversion to HTML, and to add concepts of HTML such as horizontal rules and embedded images. Furthermore, you can use Hyperlatex perfectly well without knowing anything about HTML markup.

The fact that Hyperlatex defines only a restricted subset of LaTeX does not mean that you have to restrict yourself in what you can do in the printed copy. Hyperlatex provides many commands that allow you to include arbitrary LaTeX commands (including commands from any package that you'd like to use) which will be processed to create your printed output, but which will be ignored in the HTML document. However, you do have to specify that explicitly. Whenever Hyperlatex encounters a LaTeX command outside its restricted subset, it will complain bitterly.

The rationale behind this is that when you are writing your document, you should keep both the printed document and the HTML output in mind. Whenever you want to use a LaTeX command with no defined HTML equivalent, you are thus forced to specify this equivalent. If, for instance, you have marked a logical separation between paragraphs with LaTeX's \bigskip command (a command not in Hyperlatex's restricted set, since there is no HTML equivalent), then Hyperlatex will complain, since very probably you would also want to mark this separation in the HTML output. So you would have to write

   \texonly{\bigskip}
   \htmlrule

to imply that the separation will be a \bigskip in the printed version and a horizontal rule in the HTML-version. Even better, you could define a command \separate in the preamble and give it a different meaning in DVI and HTML output. If you find that for your documents \bigskip should always be ignored in the HTML version, then you can state so in the preamble as follows. (It is also possible that you setup personal definitions like these in your personal init.hlx file, and Hyperlatex will never bother you again.)

   \W\newcommand{\bigskip}{}

This philosophy implies that in general an existing LaTeX-file will not make it through Hyperlatex. In many cases, however, it will suffice to go through the file once, adding the necessary markup that specifies how Hyperlatex should treat the unknown commands.


July 13, 2005

Using HyperlatexTopIntroductionContentsIndex