\def\windows{{\em Windows}}
\def\wintex{{\em Win\TeX}}
\def\dviwin{{\em DVIwin}}
\def\windowtex{{\em Windows}\TeX}
\def\fortex{\leavevmode\lower.5ex\hbox{4}\kern-.1667em\TeX}
\def\fordos{{\sc 4Dos}}
\def\emtex{{em\TeX}}
\def\astex{A\raise.3ex\hbox{\sc s}\kern-.1em\TeX}
\def\filenaam#1{{\tt\lowercase{#1}}}
\def\envpar#1{{\small\tt\uppercase{#1}}}
\def\sel#1{{\sc #1}}
\def\bs{$\backslash$}

\title{Some notes about MS-Windows and \TeX}

\author[Wietse Dol]{Wietse Dol\\ Landbouw-Economisch Instituut (LEI-DLO)\\ P.O.Box
29703\\ 2502 LS Den Haag\\ The Netherlands\\email: {\tt W.Dol@LEI.Agro.nl}}
\begin{article}

{\sl [Editor's note: I am grateful to
Wietse Dol and Gerard van Nes (editor) for permission to reprint this
article from MAPS 93.2, the journal of the Nederlandstalige \TeX\
Gebruikersgroep.]}

\section{Introduction}
I am a real DOS (\fordos) addict\footnote{I am not a \windows\ specialist
so do not be offended when I do stupid and clumsy things. This note is
intended to inform people and stimulate them to write more about \TeX\ 
and \windows.} and in principle do not like to work under
\windows. I really detest the many mouse clicks one needs to get simple things
done. Things that are done with one or two really simple \fordos\ commands
(e.g.\ file moving) need many mouse movements. Perhaps I am an old fashioned
guy not realizing that the world is changing\ldots

There are two application that make it worth while using \windows. The
first one is the multitasking environment of \windows. Of course there
are ordinary DOS programs (e.g.\ Quarterdeck Desqview) that do the same
but a nice graphical environment with icons makes \windows\ a really
user-friendly multitasking environment. The second and most convincing
advantage of \windows\ is its graphical interface. There are many
excellent graphical packages (e.g.\ Coreldraw) that allow you the
create, manipulate, convert and print all kind of graphics. So when
talking graphics one really should work with \windows.

People who work with \TeX\ are all people who like to create texts of the
highest quality. The greatest disadvantage (others would say advantage) of
\TeX\ is that it is not WYSIWYG (what you see is what you get). After the
compilation of a \TeX\ document we all want to use some kind of graphical
interface to view (see) the results. So we are talking graphics.
We also would like some kind of multitasking, even better a straight
compilation and viewing of our \TeX\ code while we are typing the text. This
all should be possible with \windows\ldots

An operating system quite similar to \windows\ for a PC is OS/2 (sorry,
but OS/2 is much better than \windows). For OS/2 there are several
excellent \TeX\ programs and utilities. For example \emtex\ 
(absolutely free of charge!) and \astex\ (see MAPS 93.1 page 41).
These programs all have the multitasking and excellent graphical
display as mentioned above. People who really like to use some kind of
\TeX\ for \windows\ will find out that there is no such thing yet.
There is a commercial package Scientific word which claims to be a
\TeX\ \`a la WYSIWYG (see MAPS 92.2 page 147). It really looks
promising but is not a real and complete \TeX\ system for \windows.

After reading this introduction the question arises `what should we
use under \windows?'. The next sections will discuss some \windows\ 
and \TeX\ topics and hopes you to inform how one could set up a
\windowtex\ system.

\section{em\TeX\ and Windows}

When looking at \TeX\ PC packages there is one that is state of the
art: \emtex. It is a pity that E.~Mattes `only' developed a MS-DOS and
an OS/2 version. \emtex\ is free of charge and is to my knowledge the
best \TeX\ PC package there is. It offers for the novice and advanced
\TeX\ user everything one wants. The only drawback to the system is
that E.~Mattes did not develop a user-friendly \TeX\ shell. This is
nowadays no real disadvantage because there are many good shells.

Our first attempt for a \windowtex\ should be a DOS-window running
\emtex.  Many people who have tried got really disappointed. When
running the 386 version of \emtex\ under \windows\ we get the error
message `DPMI not supported.' We can use the slower 8088 and 80186
versions of \emtex\ but we want more$\ldots$ The error message `DPMI
not supported' is the result of E.~Mattes own DOS-extender. Running
\TeX\ needs a lot of memory or disk swapping. When you have a 386 PC or
higher with a lot of memory (the manuals suggest 3Mb) the DOS-extender
will claim all available memory and use this instead of the slow
disk swapping. The DOS-extender will also use the fast 32-bit
processor optimally and gain a lot of speed. The second advantage of
the 386 version of \emtex\ is that it uses the memory settings of the
BiG-\TeX\ and BiG-\LaTeX\ versions. This means that you can compile
large documents with many references and labels.

There is nowadays a solution to the DOS-extender problem. Perhaps not
the perfect solution but it works and I think in the near future will
become idiot proof. Mattes wrote a program (\filenaam{EMXBIND -X})
that deletes his own EMX DOS-extender from the \filenaam{tex386.exe}
and adds a small program (\filenaam{EMXL}) to \filenaam{tex386.exe}.
Now \filenaam{tex386.exe} will by default look for Mattes own
DOS-extender (\filenaam{EMX.exe}) on the DOS-path or will look in the
environment variable \envpar{EMX} what DOS-extender to use. There are
two possible memory-extenders you can use
\begin{enumerate}
\item The DOS-extender \filenaam{EMX.exe} (version 0.8f),
                             i.e.\ E.~Mattes own DOS-extender.
      This will only work under DOS and not under \windows. To use this
      DOS-extender set the environment variable \envpar{EMX} to\par
      \envpar{set EMX=c:\bs emtex\bs compiler\bs emx.exe}
\item The DPMI-extender \filenaam{RSX.exe} (version  alpha 0.51)
                                       written by R.~Schnitker. This
      will only work under \windows\ and not under DOS. To use this
      DOS-extender set the environment variable \envpar{EMX} to\par
      \envpar{set EMX=c:\bs emtex\bs compiler\bs RSX.exe}
\end{enumerate}

So, simply by updating your \filenaam{tex386.exe} and adding two
memory-extenders to your \emtex\ system you now can use \emtex\ under DOS as
well as under \windows. The DPMI-extender is still in a testing phase (an
alpha release), so there could be some bugs. Indeed some bugs are already
documented and will be solved in the near future. I have noticed that after
running \emtex\ under \windows\ my log file as well as my dvi file and several
others became read-only. No serious problem because with a simple DOS
statement these files are no longer read-only (i.e. \filenaam{attrib -r *.dvi
*.log}). A simple batch file solves these inconveniences. All the testing I
did under \windows\ did not result in crashes or strange error massages. The
error messages that appeared were all the result of the known bug that some
files appear to be read-only after \filenaam{RSX} has opened them. All these
errors are easily corrected.

The conclusion of this section is that people who want a \TeX\ for \windows,
should consider upgrading/installing the \emtex\ system.

\section{Win\TeX version 1.0}
\wintex\ is a text editor for \windows\ specialy written for the use with \TeX\
and \LaTeX. It is written by S.~Morin and helps you with all the difficulties
of writing documents in \LaTeX. \wintex\ is shareware and only costs \$25.
Not only the `normal' editing facilities are supported but also some `tool
bars' and `dialog boxes'.

There are three \TeX\ tool bars, i.e.\ a Text-bar, a Math-bar and a \LaTeX\
commands-bar. With the Text-bar you can easily and graphically select
fontsize, font type and all kinds of accentuation. The Math-bar graphically
displays all \LaTeX\ symbols and helps you selecting the correct statements
for all math symbols. With the \LaTeX\ commands-bar one can select from a list
of all \LaTeX\ commands. \wintex\ also has some dialog boxes. There are dialog
boxes for the mathematical array, the eqnarray environment, the tabular
environment and the \LaTeX\ preamble. With dialog boxes the making of the
above structures becomes easy.

When you open a new document, \wintex\ gives you access to dialog boxes that
will help you to build the preamble and the style options. With the main
dialog box you choose the document style and associated options.
Clicking on Page style, Math style or Floating bodies style buttons will open
environment specific dialog boxes. Once selected, the options are inserted in
the newly opened document.

I could not read many of my own \LaTeX\ documents and I really missed the
powerful macro possibilities as for instance with Qedit (or TSE). My general
conclusion is that the tool-bars and the dialog-boxes makes it really simple to
type documents but that there need a lot to be done before \wintex\ is a real
text editor and \TeX\ tool.

\section{DVIwin version 2.7}

The DVIwin driver is written by H.~Sendoukas and lets you preview and print
DVI files under MS-Windows 3.1. Its main advantages are: speed, compatibility
with any raster device with a \windows\ driver, and graphics capability. All
screen and printer handling is done through \windows, so it should work on any
printer supported by the system. You can insert arbitrary graphics files
produced by most \windows\ applications, or other standard graphics files (eg.
TIFF, PCX, etc.) provided that you have the appropriate graphics filter. The
\emtex\ specials and the PostScript specials to include graphics, however, are
not supported.

\dviwin\ is easy to install and also reads fonts from \emtex\ fontlibrary
files (\filenaam{.fli} files in the directory \filenaam{c:\bs emtex\bs
texfonts}). The font-substitution looks much like the one used by \emtex.
There only difference is that \dviwin\ does not allow wildcard characters
(e.g.\verb+ cm*  150 -> cm*  300+ is not allowed).

I really like \dviwin\ because every time you switch to \dviwin,
it checks if the dvi-file that is currently displayed is updated. If
updated it will load the new dvi-file and position at the same position
(page) as the old dvi-file. This makes it really simple to perform the
edit-compile-view cycle.

My general conclusion is that \dviwin\ is an excellent dvi-viewer and printer
for \windows. I think it will be only a question of time before all \emtex\
possibilities that are not available yet in \dviwin\ (e.g. automatic
font generation, specials) can be used with \dviwin.

\section{A \TeX\ for Windows system}
In this section I will explain what I have installed under \windows\ and how I
use \windows\ to produce \TeX\ documents.

First I updated the \emtex\ \filenaam{tex386.exe} and added the two
memory-extenders. These programs will be available on the 27 high density
diskettes the NTG will distribute as the complete \TeX\ distribution for the
PC. I will also try to get them on all the CTAN servers.

The \TeX\ shell I use is \fortex. This user friendly menu system can be used
to perform all (novice and advance) \TeX ing. \fortex\ version 3.00 (promised
to be released in november 1993) will be updated so that it can run every
thing in a DOS-window when running \windows. The only thing one has to do is
to open a new program group, i.e.\ select in the Program Manger the
\sel{File} and then \sel{New} and \sel{Program group} and type the new group
name (e.g. TeX). After this you can install \fortex\ as a new \sel{Program
item} and use \filenaam{c:\bs emtex\bs btm\bs 4tex.pif} as the \sel{Command
line} and use \filenaam{c:\bs emtex\bs btm\bs 4tex.ico} as the icon.

Of course I have installed \wintex, \dviwin\ and some other \TeX\ \windows\
utilities (e.g.\ \filenaam{dvips}, \filenaam{Ghostscript} and
\filenaam{Gnuplot} for \windows) as Program items in the same Program group.
Now I have a complete \TeX\ system for \windows.

One thing to remember when installing \dviwin\ is that the number of files in
the \filenaam{config.sys} should be at least 50 (due to font loading). Also
one needs to copy the \filenaam{*.dll} files from the directory where one
installs \wintex\ (e.g.\ \filenaam{c:\bs emtex\bs win\bs{}}) to the window
system directory (e.g.\ \filenaam{c:\bs windows\bs system\bs{}}). The
font substitution file \filenaam{dviwin.sub} we need to adjust to our own
(extra) fonts and then copy it to our font directory ( \filenaam{c:\bs
emtex\bs texfonts\bs{}}). After installing \dviwin\ one has to start the
program and adjust some \sel{Option} settings. First we change the resolution
to 300 dpi and then change the \sel{Option} \sel{Font directory} to
\filenaam{c:\bs emtex\bs btm\bs texfonts \bs \$rdpi;c:\bs texfiles\bs fonts\bs
\$rdpi}. Now we are ready for action$\ldots$

\dviwin\ also has two nice utilities. The program \filenaam{clipmeta.exe} can
be used to take a metafile or a bitmap file from the system clipboard and save
it to a disk metafile. E.g.\ you can use \filenaam{gnuplot} to make nice plots
and then paste then to the clipboard and convert this with
\filenaam{clipmeta.exe} to a metafile. The program \filenaam{wbr.exe} is a
text file browser under \windows. It is for instance used in combination with
\dviwin\ to display the log files.

When I use \TeX\ I first start a \fortex\ session and at the same time a
\dviwin\ session. I use the menu of \fortex\ for all \TeX ing and switch to
\dviwin\ whenever I want to view and print the document. \fortex\ has much to
offer what is not yet available under windows (e.g.\ automatic fontgeneration
and many other utilities).

The general conclusion is that in the world of \windows\ much is on the move.
It will only be a matter of time and there will be a perfect \TeX\ system for
\windows. Especially the inclusion of all kinds of graphics and the
mulitasking (even better real time display while typing) will be possible
under \windows. Perhaps all this will not be possible under DOS 7.0.


\end{article}
