\title{A brief guide to \TeX\ assistants}
\author[Sebastian Rahtz]{Sebastian Rahtz\\ArchaeoInformatica\\York}
\begin{article}

\def\PicR#1#2#3{%
 \begin{figure*}
 \centerline{\rotatebox{-90}{\epsfig{figure=#1.ps,#3}}}
 \caption{#2}\label{#1}
 \end{figure*}
}
\def\Pic#1#2{%
 \begin{figure*}
 \centerline{\epsfig{figure=#1.ps,height=.4\textheight}}
 \caption{#2}\label{#1}
 \end{figure*}
}

This paper offers a `back to basics' overview of the various types of
software which are of assistance to the \TeX nical writer on a
personal computer (this includes Unix machines, but excludes, for
instance, VMS or VM/CMS systems). It is based on a presentation to the
October \ukt\ meeting, and I am grateful to the other speakers, and
our chairman Allan Reese, for insights and news. I would also like to
refer readers to the Dutch \TeX\ Group's journal {\em MAPS}, whose
issue 93.2 contains a variety of useful papers on \TeX\ interfaces
(two of which are reproduced elsewhere in this issue of \BV.)

Every \TeX\ user knows that the traditional command-line way of
working (the `edit ; compile; \verb|{|preview, print\verb|}|' cycle)
is far from ideal, and many people want some help.
We may define eight different ways in which the environment we
interact with can be improved:
\begin{enumerate}
\item Integrated environments (e.g.\ \TeX tures\ on Mac), where
  everything is tightly-coupled, and designed from the ground up to
  work together;
\item Integrating shells (e.g.\ \TeX shell), where a set of different
  programs are controlled by a single interface, which does its best
  to protect the user from their idiosyncrasies and errors;
\item Loosely-coupled packages (e.g.\ Windows, Desqview setups), where
  a multi-tasking environment is used to combine together various
  programs to provide a useful working environment;
\item \TeX-aware editors (e.g.\ Gnuemacs AUC\TeX\ package), which
  simplify the input of complex markup, and check syntax;
\item \TeX\ super-scripts, including Makefile generators (e.g.\
  `texit'); these take away the need to remember complicated program
  switches, and remembering which files are up to date, by
  understanding the rules about the different types of \TeX-related files;
\item Super-previewers (e.g.\ xtex), which allow us to make greater
  use of the previewer to inspect and interact with our document.
\item Hypertext source convertors (e.g.\ latex2html), which make the
  tedium of writing generic markup with \LaTeX\ more worthwhile by
  giving it a life beyond the printed page;
\item Friendly \TeX\ programming; when we {\em do} interact with
  \TeX's enigmatic `*' prompt, we want macros to help us, not hinder
  us. This is discussed by Jonathan Fine elsewhere in this \BV.
\end{enumerate}

Since most computer users seem to belong in distinct
`camps', based on machines and operating systems, it seems appropriate
to examine what is on offer in each area.

\section{Windows, OS/2, and NT}
For a fully-fledged Windows \TeX, we have to look to the commercial
companies: Turbo\TeX, from Kinch Computer Co, offers a full \TeX,
previewer, and drivers with a moderately-well integrated Windows
interface, although (critically) it lacks a real integrated editor.
The `traditional' PC supplier of \TeX, PC\TeX, has also recently
released a Windows setup, although it (like Turbo\TeX) fails to take
advantage of builtin fonts properly. Y\&Y sell a high-quality Windows
previewer and PostScript driver, linked with a public domain \TeX\ and
commercial programmer's editor, which work together well in a
loosely-coupled way, and offer genuine integration with the Windows
font systems (although the previewer has trouble using PK fonts).
{\em Scientific Word} (described elsewhere in this \BV) takes a
different direction by offering a WYSIWYG writers interface
(particularly for maths) which saves files in \LaTeX\ format and does
final formatting for printing with Turbo\TeX.  None of these products,
however, offer the same degree of integration and instant previewing as
Textures on a Mac, and we still await the `real' Windows \TeX.

The more impoverished writer who wants to build her own Windows \TeX\ 
setup has a not altogether easy time.\footnote{Wietse Dol discusses
  this more fully elsewhere in this \BV.} There is an excellent
previewer, Hippocrates Sendoukas' {\em Dviwin} (now at version 2.81,
but {\em still} lacking support for virtual fonts, and nowhere near
using the Windows system fonts), and the excellent em\TeX\ ports of
the basic \TeX\ programs run in DOS windows (with some shenanigans
necessary to change extended memory managers), but integration is left
to the user. The powerful editor Microemacs has an adequate Windows
port, extensible to allow \TeX\ jobs (compiling, previewing, printing
--- see Figure \ref{mea}) and context-sensitive help to be selected
from menus, but it does not provide much protection for the user from
the essentially unsatisfactory nature of Windows DOS boxes and
multi-tasking. The alternative, running a DOS \TeX\ shell in a DOS box
under Windows, probably gives a better result (see Wietse Dol's article).
But the convenience of access to Windows printer drivers (such as fax
boards --- see Figure \ref{dwina}) is a pointer to why this
possibility should not be ignored.
\PicR{mea}{Microemacs \TeX\ menus}{height=.4\textheight}
\PicR{dwina}{Dviwin accessing Windows printer driver}{height=.4\textheight}

Those converting to NT will, of course, have access to all the
Windows tools, and the Unix `web2c' \TeX\ has been ported, but there
do not yet appear to be any interfaces which make serious use of
NT's abilities.

OS/2 users are well served by the basic em\TeX\ kit, which has a
proper Presentation Manager previewer, and by various shells (e.g.\ 
{\em PM\TeX} which make life easy. Given the good multi-tasking,
Windows compatibility, and the availability of compilers to port most
Unix tools (such as {\em Gnuemacs}, {\em make} etc), the OS/2 \TeX ie
has the best of almost all worlds.

\section{DOS}
The hard-pressed DOS user (or lover --- there are a few) has a
plethora of tools to make up for the inadequacies of the command line.
The most mature of the `shell' programs, which run \TeX, previewer,
printer, editor etc for you sequentially when you select menu items
from a character-based screen, is probably 
J\"urgen Schlegelmilch's \TeX shell (see Phons Bloemen's article below). A
typical screen is shown in Figure \ref{tsb}. Other offerings include 
Thomas Esken's \TeX surface, Johannes Martin's \TeX pert, 
Ulrich Jahnz's Eddi4\TeX, the editors Redit and ET (see Reese's article
above) and Petr Olsak's menu builder `mnu'. All of
these have some or all of  the following characteristics:
\begin{itemize}
\item a model of the original Turbo Pascal --- character screens
  with pull-down menu bars;
\item protection from the horrors of DOS environment variables
  controlling programs from four different authors ({\em after} you
  have got the shell properly configured);
\item \TeX\ and other programs activated by `shelling out' to DOS,
  (an intrinsically `uncool' procedure), with parsing of error messages;
\item heavy use of customizable environments (see Figure \ref{eb}),
  which can confuse the novice to screaming point;
\item limited editors which can be difficult to use with
  `industrial strength' documents;
\item access to online \TeX\ context-sensitive help.
\end{itemize}
This is not to deny the great usefulness of parts of all of the DOS
\TeX\ shells, but their parts are greater than their sum. The
dedicated DOS \TeX\ user will find them extremely useful, but perhaps they
can be summed up by saying that they will not convert many Microsoft
Word users. 

\PicR{tsb}{\TeX shell, after running \TeX\ and finding an error}{width=.3\textheight}
\PicR{eb}{Eddi4\TeX\ customization}{width=.3\textheight}

A recent initiative by Dutch \TeX\ users has resulted in 4\TeX\ (see
the article by Wietse Dol), a \TeX\ shell accompanied by a packaging
of almost all the good public domain \TeX\ goodies. This is
undoubtedly the system which is getting most support and development.
The even more powerful As\TeX\ setup of Michel Lavaud (described in
\TUB\ 14.3, 238--44) unfortunately depends on commercial software for
its implementation, but those interested in a wider perspective on
{\em managing} their \TeX\ document library should examine this closely.

Those who want the approach of Scientific Word (WYSIWYG maths
composition) in plain DOS can try the public domain ET by John
Collins, or the commercial {\em Leo} from ABK Software.

\section{Macintosh systems}
The Macintosh user does not need convincing about GUIs or integration;
for hard cash, she can buy what is probably the fastest (given the
processor), slickest \TeX\ around, Textures. A port of the Unix \TeX\
is available (CMac\TeX), and a half-way house, the shareware Oz\TeX,
which offers integration between a good compiler, previewer and
printer driver, but not quite the smooth transition of Textures, or the use
of system fonts. What is lacking on a Mac is a WYSIWYG interface to
mathematical writing such as that offered by Scientific Word.

\section{Unix, etc}
The Unix \TeX\ user has a rich variety of tools to play with; like
everything else in Unix, they are dangerously powerful, and require
dedication to obtain true mastery. They start with simple things
like the {\em csh} or {\em bash} history  mechanisms, which let you recall
previous commands by name:
\begin{verbatim}
$ history
  171  lutex fine2
  172  dvips fine2
  175  latex interfac
  176  lpq
  180  dvips fine2 -o fine2.ps
  182  cp fine2.ps /user
$ !lat
$ !dv
\end{verbatim}

Another universal Unix tool is `make' which manages the relationship
between different stages of a document's `compilation' from various
sources, and keeps things up to date. A large book, with dozens of
input files, hundreds of graphics inclusions from different programs,
a bibliography managed with \BibTeX, and an index, is likely to need
such a tool to keep the author sane. There are various tools to help
you write `make' files, and to do similar jobs to `make':
\begin{description}
\item[imaketex] Just write an {\em imake} file and you just type
  `make'; as in `just write'\ldots
\item[texit] A Perl script which makes educated guesses about the
  state of your \TeX\ file and helps you decide what to do next;
\item[latexmk] Given a \LaTeX\ file this tries to work out what to do,
  like a `makefile'; but does not understand multiple-level dependencies;
\item[latex\_make] A set of rules for real `make', which understand a
  wide range of common \TeX\ jobs; but tailoring is not for the
  beginner. Sample `make' rules are shown in Figure \ref{make}.
\end{description}
If you are already a Unix programmer, these are well worth
investigating.

\begin{figure*}
\footnotesize
\begin{verbatim}
# ensure that the bbl file gets regenerated if the bib file is changed
%.bbl : $(BIBFILES)
        @# if there is no aux file, skip this, it will get done later
        -@if [ -r $*.aux ] ;\
        then $(BIBTEX) $* ; \
             fi
# create a dvi file from a tex file
% %.dvi: %.tex
        $(LATEX) $*
        -@egrep -c 'Citation .* undefined.' $*.log && ($(BIBTEX) $*;$(LATEX) $*)
        -@grep 'Rerun to get cross-references right' $*.log && $(LATEX) $*
# create postscript file of a dvi file
%.ps: %.dvi
        echo dvips -D $(PRINT_RES) -p $(PAGE_F) -l $(PAGE_T) -o $@ $*
        dvips -D $(PRINT_RES) -p $(PAGE_F) -l $(PAGE_T) -o $@ $*

\end{verbatim}
\caption{An example of `make' rules for a \TeX\ file}\label{make}
\end{figure*}
There do not appear to be any obvious public domain \TeX\ shells for
the X Window system; the `doc' editor does provide help in writing
\LaTeX, with limited immediate formatting, but it still leaves you
to run \TeX. The Berkeley Vor\TeX\ program to produce an interactive
\TeX\ ended some years ago without a real success (although various
results have now been released for general use; they are available in
CTAN). 

The queen of Unix software is Gnuemacs; as well as being an {\em
extremely} sophisticated editor, it provides hooks to run jobs
synchronously or asynchronously from within the editor, and parse the
output.  The latest X Window version allows for user-defined menu
bars, and multiple windows, which allows the Unix user access to as
sophisticated a setup as almost everything except Textures. The actual
editing can be enhanced with powerful Lisp routines to check syntax
provide structure skeletons, edit in outline mode etc; the
best-supported and enhanced package is Kresten Krab Thorup and Per
Abrahamsen's AUC\TeX. If you can learn to be happy with Gnuemacs, this
has almost limitless possibilities. An example screen is given in
Figure \ref{auctex}.

\Pic{auctex}{Gnuemacs and AUC\TeX}

\section{Conclusions}
If you have to choose a \TeX\ environment, how do you start evaluating
the offerings? I would suggest that base your choice on the following
criteria:
\begin{itemize}
\item The editor; this is where you spend most of the time;
\item On-line help; \LaTeX\ is unmemorable;
\item Integration with windowing systems; doing just \TeX\ is dull;
\item {\em Lack} of special features; compatibility with other \TeX\
  setups is important;
\item Integration with the `style' of the environment (ie use of Adobe
  Type Manager).
\end{itemize}
For the five possible environments you might consider choosing:
\begin{itemize}
\item AUC\TeX: if you use the X Window system and {\em gnuemacs},
  there is no other way to live;
\item \TeX shell: if you like plain DOS, this is well-designed and
  easily customized;
\item Dviwindo: it really is a Windows application, and understands
  PostScript fonts;
\item \TeX tures: it works; it has semi-instant previewing; it
   integrates its fonts with the rest of the Mac;
\item OS/2 and emTeX: a very good command-line \TeX, a Presentation
  Manager previewer, and integration with a reliable operating system.
\end{itemize}

{\sl [Note: all the public domain or shareware software referred to in
  this article can be found in the CTAN archives. The commercial
  vendors all advertise in \TUB.]}
\end{article}
\endinput
%-----------------
\slidechapter{X Window}
\item[xlatex]
