\usepackage{tex4ht}
', and activating the translation with a command of
the form `ht latex filename
'.
\documentclass{article} \usepackage{tex4ht} \begin{document} .................. \end{document}
Variations to the default outcome may be requested through parameters of the \usepackage
command. The
package parameters invoke built-in options of TeX4ht.
\documentclass{article} \usepackage[html,3.2]{tex4ht} \begin{document} .................. \end{document}
The `html
' parameter requests HTML output; the `3.2
' parameter asks for HTML version 3.2, instead of the
default setting of the HTML transitional 4.0 version.
The first package parameter is distinguished in that it may refer either to `html
' or to a user-provided
configuration file; other values are ignored. An extension `cfg
' is assumed, if the file name is provided without an
extension.
\documentclass{article} \usepackage[myconfig,html,3.2]{tex4ht} \begin{document} .................. \end{document}
The default environment loaded by the command `\usepackage{tex4ht}
' implicitly assumes an empty
configuration file, and a `html
' parameter. The parameter `htm
' may be used as an alternative to `html
', for cases
where the file names should satisfy the requirements of the DOS operating system.
Most applications might require the knowledge of just a few additional simple features of TeX4ht, if any. Before making any changes to the default configuration, you are strongly advised to check the output obtained just from the inclusion of the `\usepackage{tex4ht}' command in your source file.
The remainder of this document provides much more than that, with an eye directed toward users that want to customize their outcome. Therefore, the reader is encouraged to skim the information provided below for acquiring a general understanding of the system, leaving the tedious learning of the details to when the need arises.
To keep with the spirit of LaTeX and hypertext, in which style is assumed to be separated from content, the users are encouraged to avoid inserting TeX4ht code into their source files. Instead, they should place their modifications, to the default settings, within configuration files to be loaded by the \usepackage command.
STOP! THIS IS A WARNING! Please don't continue without reading the three preceding paragraphs.
1 | \HCode{...} |
2 | \HPage{anchor}content\EndHPage{} |
3 | \Link[target-file arguments]{target-loc}{cur-loc}anchor\EndLink |
4 | \ifHtml... \else... \fi |
1
', `2', `3
', or `4
', in \usepackage
, asks for a tree-structured
set of files, reflecting on the sectioning of the document to the specified depth. Sequential prev-next
links within the hierarchy, instead of the default hierarchical ones, can be requested with the `next
'
parameter. The parameter `sections+
' creates titles for the sectioning commands that link to the tables of
contents.
Finer control is possible with the following commands.
1 | \CutAt{at-unit,until-unit-1,until-unit-2,...} |
2 | \tableofcontents[unit-1,unit-2,...] |
3 | \TocAt{at-unit,unit-1,unit-2,...,/until-unit-1,/until-unit-2,...} |
4 | \ConfigureToc{unit} {before-mark} {before-title} {before-page-number} {at-end} |
5 | \Configure{tableofcontents} {before-toc} {end-of-toc} {after-toc} {before-nonindented-par} {before-indented-par} |
6 | \Configure{TocAt} {before-toc} {after-toc} |
7 | \Configure{TocAt*} {before-toc} {after-toc} |
8 | \Configure{unit} {top} {bottom} {before-title} {after-title} |
9 | \Configure{CutAt} {unit} {before-button} {after-button} |
10 | \Configure{+CutAt} {unit} {before-button} {after-button} |
11 | \NewSection\unit {mark-for-toc} |
12 | \Configure{crosslinks} {left-delimiter} {right-delimiter} {next} {prev} {prev-tail} {front} {tail} {up} |
|
\begin{tabular}{|r||r@{--}l|p{1.25in}|} \hline \multicolumn{4}{|c|}{GG\&A Hoofed Stock} \\ \hline\hline & \multicolumn{2}{c|}{Price}& \\ \cline{2-3} \multicolumn{1}{|c||}{year} & \multicolumn{1}{l@{\,\vline\,}}{high} &low & \multicolumn{1}{c|}{Comments} \\ \hline 1971 & 97 & 245 & Bad year for farmers in the west. \\ \hline 72 & 245 & 245 & Light trading due to a heavy winter. \\ \hline 73 & 245 & 2001 & No gnus was very good gnus this year. \\ \hline \end{tabular} |
Tables with \multicolum
entries need a few LaTeX compilations to stabilize.
1 | \Configure{table} {before-tbl} {after-tbl} {before-row} {after-row} {before-entry} {after-entry} |
1 | \ConfigureList{list-name} {before-list} {after-list} {before-label} {after-label} |
2 | \ConfigureEnv{environment-name} {before-environment} {after-environment} {before-list} {after-list} |
1 | \Picture[replacement-for-textual-browser]{file-name attributes} |
2 | \Picture+[replacement-for-text-browsers]{file-name attributes}content\EndPicture |
3 | \Picture*[replacement-for-text-browsers]{file-name attributes}content\EndPicture |
\(...\)
', and the display math environments `\[...\]
', request
pictorial representations for their content. On the other hand, the math environments `$...$
', and the display math
environments `$$...$$
', ask for no special treatment. Simple features like mathematical symbols, subscripts, and
superscripts, are translated into html, and more complex entities like roots and fractions are translated into pictures
(example).
1 | \Configure{[]} {before$$at-start} {at-end$$after},
\Configure{()}{before$at-start}{at-end$after} \Configure{$$}{before}{after}{at-start} \Configure{$}{before}{after}{at-start} |
2 | \Configure{SUB}{before}{after} \Configure{SUP}{before}{after} \Configure{SUBSUP}{before}{between}{after} |
3 | no_, no^ |
4 | Package parameter `math' |
1 | \Configure{HtmlPar} {noindent-P} {indent-P} {from-noindent-P} {from-indent-P} |
2 | \IgnorePar |
3 | \ShowPar |
4 | \NoIndent |
5 | \Indent |
\usepackage{tex4ht}
implicitly assumes a configuration file of the following form.
\Preamble{html}\begin{document}\EndPreamble
Similarly, a command of the form `\usepackage[html,option,option,...]{tex4ht}' implicitly assumes a file of the following form.
\Preamble{html,
option,
option,...}\begin{document}\EndPreamble
On the other hand, a command of the form `\usepackage[file,options]{tex4ht}' assumes a configuration file
obeying the following format (example). The extension `cfg
' is assumed for names of configuration files that are listed without their
extension.
It is up to the user to decide the distribution of parameters between the \Preamble
and the \usepackage
commands.
One can avoid using configuration files, by including their implicit and explicit content within the source files.
In such a case, the `\begin{document}
' of the source file should be replaced with a code segment of the following
format (example).
Listed below are a few additional parameters available for LaTeX.
1 | pic-array, pic-eqnarray, pic-tabbing, pic-tabular |
2 | pic-displaylines |
3 | no-halign |
4 | pictex |
5 | jpg, png |
.sty
' files define the presentations to the content of source LaTeX files. TeX4ht produces a CSS
file for each document that is translated to HTML transitional 4.0 code. The following are related
commands.
1 | \Css{content} |
2 | \Css content\EndCss |
3 | \CssFile[list-of-css-files]content\EndCssFile |
1 | Package parameter `0.0' |
2 | Parameter `hooks' |
3 | Option `hooks+' |
4 | Package parameter `edit' \Tg<...> \Tg</...> \Tg<.../> |
5 | \Configure{edit} {before} {after} \Configure{ hooks} {before} {after} {}{} |
6 | \Configure<...>{before}{after} \Configure</...>{before}{after} \Configure<.../>{before}{after} |
7 | \Configure<...>-{replacement} \Configure</...>-{replacement} \Configure<.../>-{replacement} |
8 | Package parameter `edit+'
This parameter is a generalization of the ` |
9 | Package parameter `verify' \Verify...\EndVerify |
10 | Package parameter `verify+' |
1 | Package parameter `voyager' |
2 | \Hinclude[*]{unicode.4ht} \Hinclude[*]{mathml.4ht} |
3 | -i/.../ht-fonts/unicode/iso88591/ |
.htf
'
files. Instead of providing a design for each symbol, as is the case in standard fonts, the virtual fonts provide a
content for each symbol. The following commands offer some control, from within the source LaTeX documents, over
the content provided to the symbols.
1 | \NoFonts |
2 | \EndNoFonts |
3 | \Configure{htf} {class} {delimiter} {template-1} {template-2} {template-3} {template-4} {template-5} {template-6} {template-7} |
4 | \Configure{htf-sty} {class/font} {CSS-instructions} |
The htf
fonts might request pictorial representations for symbols. In such cases, the sizes of the pictures
depend on the sizes of the TeX fonts in use. Size changes through the \magnification
command should be made
before loading the tex4ht.sty
package.
The design of a virtual hypertext font might take some labor, but it does not require too much sophistication.
1 | \NewConfigure{name}[i]{body} |
2 | \Configure{name}{parameter-1}...{parameter-i} |
1 | \input ProTex.sty \AlProTex{extension,<<<>>>,list,title,escape-character} |
2 | \<title\><<< code fragment >>> |
3 | `<title`> |
4 | \OutputCode\<...\> |
Scripts produce the content in verbatim format with no decorations.
1 | \ScriptEnv{environment} {prefix} {postfix} |
2 | \ScriptCommand{\command} {prefix} {postfix} |
3 | \JavaScript...\EndJavaScript |
\usepackage
command is not valid in
TeX, implying a requirement for configuration files to be explicitly integrated into the source TeX
files.
The following are possible package parameters of \Preamble
available for TeX only.
1 | plain- |
2 | pic-eqalign |
A \TableOfContents
command, similar to the generalized command of \tableofcontents
offered to LaTeX, is
also provided for TeX.
[up]