% ------------------------ % exstd.htx % A sample HtX source file illustrating the standard style % by members of Oberlin DRAGN Project 1994-1997. % HtX v. 1.0b1 (c) 1995-7, Richard M. Salter % Please read copyright and distribution agreement % ------------------------ \documentstyle{standard} \me{rms@cs.oberlin.edu} \title{Standard Style Example} \author{Richard M. Salter} \date{\today} \wallpaint{ffffff} \flatsect{2} % Create a bibliography file \newbibfile[ffffff][My Document]{stdref} % Used with \cite and \refstart and \refentry to provide a citation % facility. Alternatively. a BibTeX-like master bibliography can be % used; see the HtX reference manual for details. \begin{document} \maketitle This material appears before the table of contents. \xlink{../../Default.html\#exstd}{\it Return to HtX Home Page} \sect{0}{Introduction: } This is a demonstration of how to create standard documents with HtX. It should serve as a template demonstrating the features available with this style. It shares many features in common with the lab style. \sect*{0}{Some TeX-like Features} \sect*{1}{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} You can force lists using capital letters, etc. using an optional argument: \begin{enumerate}[A] \item This is item A, which is followed by: \item item number B. \item Finally, we have the third item (C). \end{enumerate} Also try using [a] and [I]. 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} \sect*{1}{Tables} HtX implements versions of LaTeX's tabular and array environments using Netscape tables: \begin{tabular}{lcr} left¢er&right\\ 1&2&3\\ \hline a&b&c\\ \end{tabular} Also try: \begin{tabular}{|l|c|r|} left¢er&right\\ 1&2&3\\ \hline a&b&c\\ \end{tabular} and (to specifiy cell size) \begin{tabular}[10]{|l|c|r|} left¢er&right\\ 1&2&3\\ \hline a&b&c\\ \end{tabular} The array environment is similar for math displays \sect*{1}{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} 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{code} (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{code} You can also enter a similar environment ``in-line'' with {\code (i-am-a-program-sample 2 8)}. \sect*{0}{Other useful environments} 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 glossary and footnote entries \end{gloss*} . If you do not follow the link to the glossary entry you can just keep reading. Here is another \begin{gloss}[Optional title]{footnote.} You may specify an optional title to the footnote. Also, by using the gloss rather than gloss* environment, you omit the return pointer. This is useful when you have several pointers to the same footnote. \end{gloss} \sect{0}{Reference citations} References may be listed at the end of the source file and cited from within: \cite{Baase}{Baase}. % (See the {\it refentry} entries at the end of this file). Alternatively, a master bibliography can be referenced (analogous to BibTeX). See the Reference Guide for details. \sect*{0}{Incorporating graphics} % All you need to do is to reference a .gif image: Images used only by one document may reside in the document's directory: \image[top]{rotor4.gif} \sect{0}{Linking to other documents} The linking facility is provided by the ``xlink'' command. Here, for example is how to link to the HtX source for this document: Click \xlink{exstd.htx}{here} to see the source file for this suite of documents. Click \xlink{http://www.cs.oberlin.edu/htx/}{here} to see the HtX home page. \sect{0}{Section hierarchy} % \sect{n} and \sect*{n} are used to start new chapters, sections, etc. \sect{1}{What does * mean in sect* etc.?} We use {\tt \backslash sect} for a short section where we do not need the navigation aids to appear both at the top and at the bottom of the chapter. {\tt \backslash sect*} is for longer chapters. \sect{1}{Another section} This is the deepest we go with separate files. \sect{2}{A further level down} Since \verb/\flatsect{2}/ appears in the preamble, this level (and deeper) does not appear in a new file. \sect*{2}{Another level 2 section} Still the same file. Using \verb/\sect*/ causes the navigation map to appear at the bottom of the file. \sect{0}{The End} That's all, folks. % ---references--- \refstart \refentry{Baase} Baase, S. {\it Computer Algorithms}, Reading: Addison-Wesley, 1993. \refentry{Cormen} Cormen, T. H., et al. {\it Introduction to Algorithms}, Cambridge: MIT Press, 1990. \refend \end{document}