Previous Next Contents

2. A Short Tour

Suppose you would like to write a letter to a colleague. Let's go through the steps of writing, previewing and then printing the letter. You may want to actually type along at your computer. Don't worry at this point if you don't quite understand the details of SGML syntax.

There are just two prerequisites to understanding this tour: you need to know how to use a text editor such as textedit, emacs or vi, and you need some basic knowledge about working with a Unix command shell, such as ksh or csh. (footnote: It is also assumed that your PATH environment variable has been set so as to include the directory containing the programs described in Chapter .)

Now, just start your favorite editor and type after me:

<!doctype qwertz system>
<letter>

<from> Dr. Alexander Hertzberg
<address> 
Institute for Insanely Great Software &nl
Research Center for Stuff Not Yet Discovered &nl
Former Capital City, Germany

<to> Prof. Wanda Wonderful
<address> 
Dept. of Eccentrics &nl
Universal University &nl
Sandy Ego, California, U.S.A.

<opening> Dear Wanda,
<p>
Have you heard about that insanely great SGML
to LaTeX translator developed by those guys at the
GMD?  They've done it again!  It does everything
and more.  I'll never go back to using a (phooey!)
WYSIWYG editor like <tt/brand name deleted/
again.

<closing> Yours truly,

</letter>

To preview the document, there are several possibilities, depending on what you have available. First of all, save your file as phooey.sgml and shift the focus of your attention to some Unix shell. Then, if you have a PostScript previewer, such as ghostview(footnote: Ghostview is part of the Gnu system from the Free Software Foundation.), try:

format phooey | qtex > phooey.ps; ghostview phooey.ps

If you are using Open Look, you may have the pageview PostScript previewer:

format phooey | qtex | pageview

In either case, if you (and I) haven't made any typing errors, your letter should soon appear on your screen.

If you do not not have a PostScript previewer, you may also be able to preview the document using a dvi previewer, such as xdvi:

format phooey | qtex -d > phooey.dvi;  xdvi phooey

However, xdvi is not effective if PostScript fonts have been used, as is the case at our site, where letters are formatted so as to appear to have been printed on our institute's letterhead stationery.

To view the letter on an ordinary ASCII terminal, try this:

format -T nroff | nroff -ms | more

Now, to print the letter, formatted using LaTeX, just type:

 
format phooey | qtex | lpr

Another common type of document is a journal article. Appendix A contains the SGML source of a short "article". It is only a few pages long, but contains examples of most of the elements necessary, including sections and subsections, headers, footnotes, various kinds of emphasis, lists, mathematical formulas, tables, figures and a bibliography.

Perhaps this short tutorial, together with the extended example in Appendix A, are sufficient for using this reference manual to write qwertz documents. But you well may want to read one or more of [Barron89], [Bryan88], [Warmer89], each of which contains an introduction to SGML.

References


Previous Next Contents