%\documentstyle{mmcc}
\documentstyle[htx, 12pt]{article}

\me{rms@cs.oberlin.edu}

\paleGreen
\begin{document}

\docheader{HtX to Latex}{1}{Test Document}

\begin{goallist}
\item To demonstrate mmcc style translation to \LaTeX
\item To serve as a model.
\end{goallist}

\begin{prereqs}
\item None
\end{prereqs}

{\bf\large
To fully understand this document, you must have the HtX source.
Compare the various features described below with their
implementations in the HtX source.}

\indx[link to source]{source}
\htxonly{To view the source, click \xlink{demo.htx}{Here}}

\robinsEggBlue
\section*{Some \LaTeX-like features}

\indx[.. and <p> tag]{HTML} 
It is a design goal of \htx\ to be as compatable as possible with
\LaTeX.  Note that, as with \LaTeX, line breaks are usually
meaningless (except in verbatim environments).  Double-line breaks
produce the HTML \verb/<p>/ tag.  

Now, if you look at the HtX source, you find that you can use < and >
without worry .. HtX takes care of turning them into entities.

\indx[ .. and \latex-like features]{source}
Other obvious correspondences are {\it italics\/} and {\bf bold-face}
commands (using \verb/\bf/ and \verb/\it/; see the HtX source.

\subsection*{Itemize-Enumerate-Description}
HtX maps the LaTeX itemize-enumerate-description list environments to 
HTML unordered lists, ordered lists and definition lists, respectively.

We begin with the ``itemize'' environment.  It's very much like what
you find in LaTeX.  

\begin{itemize}
\item This is item number 1, which is followed by:
\item item number 2.
\item Finally, we have the third item.
\end{itemize}

Similar to itemize, we have an ``enumerate'' environment:

\begin{enumerate}
\item one
\item two
\item buckle
\item my shoe
\end{enumerate}


Finally, there is ``description'' (or definition):
\begin{description}
\item[\bf the first] number one
\item[\bf the second] number two, and
\item[\bf the third] number six
\end{description}

\subsection*{Tables}
\indx[Tables section]{tables}
HtX implements versions of \LaTeX's tabular and array environments
using Netscape tables:

\begin{tabular}{lcr}
left&center&right\\
1&2&3\\
\hline
a&b&c\\
\end{tabular}

Also try:

\begin{tabular}{|l|c|r|}
\hline
left&center&right\\
1&2&3\\
\hline
a&b&c\\
\hline
\end{tabular}

The array environment is similar for math displays

\subsection*{Headers-fonts-alignment}

We can put in headlines:

\header{3}{Hello}

in various sizes:

\header{2}{Hello Again}

and center them if need be:

\begin{center}
\header{1}{And Hello Again}
\end{center}

\centerline{You also can center this way}

{\centering and this way\par}

We can {\em italicize} and {\bf bold-face} and {\tt
typewriter-font} our text.  Soon, math mode will be available.  In the
meantime we have some limited math mode commands:

Inline:  $T(n) = T(\frac{n}{2}) + T(\frac{n}{2}) + a$; or in displays:

$$
T(n) = T(\frac{n}{2}) + T(\frac{n}{2}) + a\break
T(1) = b
$$

or:

$$\begin{array}{lll}
T(n)&=&T(2^{m})\\
    &=&U(m)\\
    &=&O(m log(m))\\
    &=&O(log(n) (log (log (n))))\\
  \end{array}$$

To engage a typewriter font, as we often do for including sections of
program code, we can use the ``code'' environment.  It switches to a
fixed-width font and produces HTML that respects the layout of the HtX
file. 

\begin{verbatim}
(define i-am-a-program-sample
  (lambda (x y)
    (cond
      ((= x y) 'now-i-stop)
      ((or (not (integer x)) (not (integer y)))
       (display "This program works with two integers")
       (newline))
      ((> x y) (display "x is too big")
               (newline)
               (i-am-a-program-sample x (+ 1 y)))
      ((< x y) (display "x is too small")
               (newline)
               (i-am-a-program-sample (+ 1 x) y)))))
\end{verbatim}

You can also enter a similar environment ``in-line'' with 
\verb/(i-am-a-program-sample 2 8)/.

\paleGreen
\section{Some neat HTML paradigms}

\subsection{The gloss* (i.e. footnote) environment}

\indx[Glossary/footnotes]{glossary}
Sometimes it's handy \begin{gloss*}{to jump elsewhere} for a little
while.  Of course, you can always return to the main window.  This
feature is useful, for example, for footnotes or for linking to an
external program file.
\end{gloss*}
.  If you do not follow the link to the footnote, you can just keep
reading.


\end{document}
