TTM: a "TEX to HTML" translator.
Abstract
TTM translates TEX documents that use the Plain macro package or
LATEX, into HTML.
TTM is based on the highly successful translator
TTH, but translates the equations into MathML instead of HTML.
It is extremely fast and completely portable. It
produces web documents that are more compact and managable, and
faster-viewing, than those from other converters, because it really
translates the equations, instead of converting them into images.
Contents
1 Capabilities
1.1 Plain TEX
1.1.1 Mathematics
1.1.2 Formatting and Macro Support
1.2 LATEX
1.2.1 Environments:
1.2.2 LATEX Commands:
1.3 Special TEX usage for TTM
1.4 Unsupported Commands
2 Installation
3 Usage
4 Messages
4.1 Mathematics Layout Style Improvement using CSS
5 Features dependent on external programs.
5.1 Independence of [La]TEX installation and the -L switch.
5.2 BibTeX bibliographies
5.3 Indexing
5.3.1 Glossaries.
5.4 Graphics Inclusion: epsfbox/includegraphics
5.5 Picture Environments
6 Tabular Environment or Halign for Tables
6.1 Tabular
6.2 Halign
6.3 Longtables
7 Boxes, Dimensions, and fills
8 TEX command definitions and other extensions
8.1 Delimited-parameter macros and Conditionals
8.2 Macro- and Style-file inclusion
8.3 Layout to include arguments of unknown commands
8.4 Restrictions on redefinition of internal commands
8.4.1 Footnotes
9 Color
9.1 LATEX Color
9.2 Plain Color
9.3 Limitations
10 Producing output split into different files.
10.1 Overview
10.2 Navigation Controls at File Top and Tail
10.3 Special Precautions when Splitting Output
10.3.1 Floats such as figures or tables
10.3.2 Multiple Bibliographies
11 HTML and output
11.1 Formal HTML validation
11.2 HTML Styles
12 Browser and Server Problems
12.1 Accessing Symbol Fonts: Overview
12.2 Accessing Symbol Fonts: Details
12.3 Printing
12.4 Netscape/Mozilla Composer
12.5 Other Browser Bugs
12.6 Web server problems
13 Code Critique
14 License
15 Acknowledgements
A Appendix: Non-Standard TEX Macros
B Appendix: Frequently Asked Questions
B.1 Building and Running TTM
B.2 [La]TeX constructs TTM does not seem to recognize
B.3 HTML output that does not satisfy
B.4 How to write TEX designed for Web publishing
B.5 Formerly Frequently Asked Now Rarely Asked
Index
1 Capabilities
1.1 Plain TEX
1.1.1 Mathematics
Almost all of TEX's mathematics is supported with the exception of a
few obscure symbols that are absent from the fonts normally available
to browsers. Support includes, for example, in-line equations with
subscripts and superscripts, display equations with built-up
fractions, over accents, large delimiters, operators with limits;
matrix, pmatrix, cases, [but not bordermatrix]; over/underbrace [but
using a rule, not a brace].
1.1.2 Formatting and Macro Support
- Font styles: \it, \bf, \sl, \uppercase, everywhere,
\rm in most situations
1.
- Accented characters written like \"o or \'{e}.
- Guess the intent of font definitions, i.e. \font commands
[optionally, remove contruct].
- Macro definitions that are global: \gdef, \xdef,
\global\def, \global\edef; or local to the
current group: \def, \edef.
- Definitions with delimited arguments.
- Input of files [see 8.2].
- Newcount, number, advance and counter setting [global counter setting
only].
- Conditionals: iftrue,
iffalse,
ifnum,
ifodd,
ifcase,
if [for defined commands and plain characters, not some internals]
2, ifx [only for
defined commands and counters; internals appear undefined], ifvmode,
ifmmode, newif.
- Centerline, beginsection, item, itemitem, obeylines; hang, hangindent,
narrower [for entire paragraphs, hangafter ignored].
Headline is made
into a title, footnote{}{}. Comments: removed.
- Tables: halign [uses border style if the template contains
vrule.]. Settabs, \+.
- Simple uses of \hbox,\vbox and \hsize to align text and
make boxes with restricted widths, but these are discouraged. In
setting the width of a vbox, the value of hsize should be once only,
immediately at the beginning of the vbox.
1.2 LATEX
LATEX support includes essentially all mathematics plus the following
1.2.1 Environments:
em, verbatim, center, flushright, verse, quotation, quote, itemize,
enumerate, description, list [treated as if description], figure,
table, tabular[*,x], equation, displaymath, eqnarray, math, array [not
generally in in-line equations], thebibliography, [raw]html,
index [as description], minipage [ignoring optional argument],
longtable [but see 6.3].
1.2.2 LATEX Commands:
[re]newcommand, newenvironment, chapter, section, subsection,
subsubsection, caption, label, ref, pageref [no number], emph, textit,
texttt, textbf, centering, raggedleft, includegraphics, [e]psfig,
title, author, date [maketitle ignored: title etc inserted when
defined], lefteqn, frac, tableofcontents, input, include [as input,
includeonly ignored], textcolor, color, footnote
[ignoring optional arg], cite, bibitem, bibliography, tiny
... normalsize ... Huge, newcounter, setcounter, addtocounter, value
[inside set or addto counter], arabic, the, stepcounter, newline,
verb[*] [can't use @ as separator], bfseries, itshape, ttfamily,
textsc, ensuremath, listoftables, listoffigures, newtheorem [no
optional arguments permitted], today, printindex, boldmath,
unboldmath, newfont, thanks, makeindex, index, @addtoreset,
verbatiminput, paragraph, subparagraph, url, makebox, framebox, mbox,
fbox, parbox [ignoring optional argument], definecolor, colorbox,
fcolorbox [not in equations], pagecolor [discouraged], savebox, sbox,
usebox.
These cover most of the vital LATEX constructs. Internal hypertext
cross-references are automatically generated (e.g. by ref and
tableofcontents) provided LATEX has previously been run on the
document and the appropriate command-line switch is used.
1.3 Special TEX usage for TTM
A few non-standard TEX commands are supported as follows
3. See
also 5.4.
\epsfbox{file.[e]ps} Puts in an anchor called "Figure" linked to
file.[e]ps (default), or alternatively calls user-supplied script
to convert the [e]ps file to a gif image and optionally inline it.
\special{html:"tags"} inserts ``tags'' into the HTML e.g. for images etc.
\href{reference}{anchor} highlights ``anchor'' with href=``reference''.
\url{URL} like \href but with URL providing both reference and anchor.
\begin{[raw]html} ... \end{[raw]html} environment passed direct to output.
\ttmtensor Subscripts and superscripts immediately following, on simple
characters, are stacked up in displaystyle equations, not staggered.
\ttmdump{...} The group is omitted by ttm. Define \ttmdump as a nop for TeX.
\ttmverbatim{thename} "thename" (or whatever is the group) is taken as the
name of a verbatim environment that must be ended by \end{thename}.
%%ttm:... The rest of the comment line is passed to ttm (not TeX) for parsing.
1.4 Unsupported Commands
When TTM encounters TEX constructs that it cannot handle either
because there is no HTML equivalent, or because it is not clever
enough, it tries to remove the mess they would otherwise cause in the
HTML code, generally giving a warning of the action if it is not sure
what it is doing. The following are
not translated.
\magnification \magstep etc : Removes the whole construct.
Some boxes in equations.
\raisebox, \lowerbox and similar usages.
\accent, \mathaccent.
2 Installation
The source for TTM is flex code which is processed to produce a C program
ttm.c which comprises the distribution. This file is compiled by
gcc -o ttm ttm.c
or whatever C compiler you are using. Compilation takesster C co;boxes&nbtnnenR$re n div classܹSa>