The mh2html TeX to HTML Converter
kg, 23.02.99
mh2html is a special-purpose
converter to convert MuPAD help pages written with the Mhelp.sty
TeX style into HTML. It is not intended to be a general-purpose
TeX to HTML converter.
Only simple TeX files may be converted. Especially the converter can
not handle user-defined macros. So do not use \def
or
\chardef
or the like.
The converter is currently intended to be an in-house tool for the MuPAD
Group only. Please do not re-distribute it.
Calling Syntax
Call the converter as follows:
mh2html [-h]
[-d def-file] [-o
out-file]
[-l break-level] [-Ddefinition]*
tex-file
The options are:
-
-h
-
Displays short help.
-
-d def-file
-
The conversion definition file to use.
-
-o out-file
-
Base name of the HTML output files created. Default is the base-name of
tex-file.
-
-l break-level
-
Section level where to break the current page and create a new HTML page.
Default is 6.
-
-D definition
-
Definitions allowing to control conversion. Currently the definition
german
is
used to create german section headings and the like and the definition
ie4
is used to create HTML pages for IE4.x.
The extension .tex may be omitted
for the tex-file.
HTML Files created
Usually several HTML files are created given one TeX file. If a section
heading has a level lower or equal to the break-level given by the -l
option the current HTML page is closed and a new page is started. The pages
have the names out-file.html, out-file1.html,
out-file2.html,...
The first page out-file.html contains a table of contents.
The following levels are assigned to the TeX section macros:
Level |
Macro |
1 |
chapter, Mpacktitle |
2 |
section, appendix, thebibliography, Mhelppage |
3 |
subsection, subsection* |
4 |
subsubsection, subsubsection* |
5 |
subsubsubsection, subsubsubsection* |
6 |
paragraph, paragraph* |
Important: mh2html creates
only alias references. These must be substituted by the ``real''
references after the HTML files have been created. A label alias file out-file.hla
is created by mh2html which contains
the aliases and correct labels. The references must then be fixed with
the perl-script fixrefs.pl.
Fixing the References in the HTML Files
In the directory where the HTML files and the label alias files *.hla
have been created run the perl-script fixrefs.pl
without
arguments. The script catenates all label alias files and then substitutes
all alias references in the HTML files in the directory. This may
take a while...
The Conversion Definition File
Some of the conversion is programmed into the converter, some rules for
conversion are defined by a conversion definition file mh2html.def
which
is read by the converter at run-time. The definition file is searched as
follows:
-
If a definition file is given at the command line using the -d
option
this is used.
-
If the environment variable MH2HTML_PATH
is defined then the file $MH2HTML_PATH/mh2html.def
is
used.
-
Otherwise the file mh2html.def in
the current directory is ued.
The syntax of the definition file is to be described.
Notes
Sometimes a second run of the converter is necessary to fix some references
for library packages. Warnings are printed as a hint. The files out-file.htc,
out-file.hco,
out-file.hhd
are created which contains the references.
The converter includes files defined with the TeX macros \include
or
\Minclude
into the resulting HTML file.
If the definement ie4
is given at the command line or in the conversion definition file the HTML
files generated are suitable for Microsoft Internet Explorer 4.x, but not
for Netscape Navigator 4.x. A special feature of the files generated this
way is the ability to fold and unfold the different sections of a help
page. (This is implemented by using CSS and JavaScript in a way which is
currently not supported by the Netscape browsers.)
If the definement ie4 is not
given, both Microsoft Internet Explorer 3.x, 4.x and Netscape Navigator
4.x should be able to render the HTML files generated.