% TeX lives on ATARI 1040 !!
%This is TeX, C Version 2.9 (preloaded format=LPLAIN 88.4.9)  
%**&lplain texst
%(.\texst.tex
%LaTeX Version 2.09 <26 Feb 1988>
%(\tex\inputs\article.sty
%Document Style 'article'. Released 23 September 1985
%(\tex\inputs\art10.sty)
% This file can be processed with LATEX
%
% David DERMOTT
%
\documentstyle{article}
\begin{document}

\begin{center}
\LARGE
  \TeX\ (C version) on ATARI ST
\end{center}
\section{General Info}
   TeX-to-C is part of the UNIX distribution of \TeX . It translates
the PASCAL source of \TeX\ to standard C. This makes it easier to port
to systems which lack good PASCAL compilers. With a good C compiler
it should be possible to port to almost any system with enough memory.
I did this port on the ST using MEGAMAX C which had many bugs that
had to be worked around. Hopefully with a better compiler like MWC it
would port much easier.

 Note that the program is only part of the Tex package.  You need FONT
METRIC files (TFM), style files etc.  to have a working Tex system. 
\TeX\ is copyrighted by Donald Knuth to prevent faulty programs calling
themselves \TeX.  In order to be called \TeX\ the program must pass the
TRIP test supplied with stadand distribution.  This port now passes
TRIP.  The UNIX \TeX\ distribution is Public Domain software. 

   You also need a output device and driver to make \TeX\ worthwhile.
Access to a Laser printer with lots of memory is preferable. It is
possible to print fair quality output on on dot matrix printer at
240 pixels/inch ( Epson compatibles). There is a public domain driver
program to do this but it would be extremely slow ( 10 minutes/page).
There is a nice public domain previewer DVIST which allows you to 
view the ouput on the screen before transferring to your favourite
mainframe and laser printer.

 
\section{Hardware etc.}
   The main problem is that \TeX uses lots of RAM memory and disk space. 
The executable file TEX.TTP takes about 200 k , PLAIN.FMT is about 120k
and LPLAIN.FMT is about 250k and the FONT METRICS (TFM) are about 70k .  The
program uses almost 1 meg of RAM so there is no room for a RAM disk.  A
few extra megs of RAM would be ideal so everything could go on a RAM
disk.  A hard disk is the next best.  It is possible to use on a single
floppy drive, swapping disks,but it is slow. 


 To use LATEX use command {\bf TEX \&LPLAIN filename}.
This reads file LPLAIN.FMT (LATEX macro library).

 Times for Latexing a 5 page document are:
\begin{description}
\item[HARD DISK-] 25 seconds to load TEX.TTP and LPLAIN, 1:15 total
\item[FLOPPY DISK-] 2:23 to load TEX.TTP and LPLAIN, 3:46 total
    (swapping disk)
\item[VAX 750- ] 0:52 CPU time. VAX lightly loaded at time.
\end{description}

\section{building new macro libraries}
   A special version of TeX called INITEX is used to compile macro
libraries and dump them in format (FMT) files. PLAIN.FMT and LPLAIN.FMT
are the format files for plain TEX and LATEX.
  For example to build a new version of LATEX you need LPLAIN.TEX,
LATEX.TEX, LFONTS.TEX, HYPHEN.TEX , the string pool file TEX.POOL, plus
all the TFM files called by LFONTS.  Just run INITEX LPLAIN.  LPLAIN
calls all the other files.  If all the right files are there it will
dump out LPLAIN.FMT. There is also a version called SLITEX (SPLAIN)
for generating slides or posters

\section{Files etc.}
\subsection{Input files}
  \TeX\ looks for files via paths which are defined by environment variables.
If the variables are not set, default values are used. Note that usually
the current directory (.) is searched first.
The  values can be reset by a CLI shell which supports environment
variables. Note directory separator is `;'. I had trouble including ;
in the setenv command of GULAM. The variables are:
\begin{description}
\item[TEXFORMATS] default .;/TEX --   FMT files here
\item[TEXINPUTS] default .;/TEX/INPUTS -- user input files and style files
\item[TEXFONTS] default .;/TEX/TFM -- font metric files (TFM)
\item[TEXPOOL] default .;/TEX  --  file TEX.POOL here  used only by INITEX
\end{description}
   TeX doesn't like backslashes in file names so they are entered as `/'
(as in UNIX) and translated. If you put a / as first character of filename
or : as second character the program doesn't look at the environment
variable TEXINPUTS, it uses the exact name you entered.eg.
\begin{verbatim}
  TEX /mydir/test
    or
  TEX d:test
\end{verbatim}
   Note that the .TEX extension is optional for input file names.

\subsection{Output files}
  The main output is a DVI (Device Independant) binary file. This file
can be printed on any device for which there is a device driver and fonts.
This can be a screen previewer, dot matrix printer. laser printer,
or very high resolution phototypsetting machine. Note on VMS (VAX) DVI
files must be in 512 byte fixed record files; the last record padded
with hex DF. VMS Kermit has an option for transferring files of this type.
In this ST port I padded the last record with DF so that it doesn't have to be
done by an external program. 
\subsection{Files on a single floppy drive}
   It is possible to run even LATEX on a single Floppy system.  
\begin{itemize}
\item  On disk 1 put TEX.TTP, PLAIN.FMT(for plain TeX) or
LPLAIN.FMT (for LATEX)

\item On disk 2 put your source files , Latex style files and the TFM files.

\item Insert disk 1 in drive

\item Give command `TEX \&LPLAIN myfile'. Program will take about 2 min to load
LPLAIN.FMT file. Since it can't find myfile.tex it will ask you to enter
another file name.

\item Put disk 2 in drive and enter `myfile' Hopefully the program will
find all the files it needs on this disk .  The DVI file will be saved
on disk 2. 
 \end{itemize}

\section {Example of Equations}
  Printing math equations is where \TeX\ really shines. Here is an
example.
\subsection{Hartley Transform}

The equations for discrete Hartley transform and its inverse are:
\Large
\begin{equation}
H(f) = \frac{1}{N}\sum_{t=0}^{N-1} F(t)cas(2\pi ft/N)
\end{equation}
and
\begin{equation}
X(t) =  \sum_{f=0}^{N-1} H(f)cas(2\pi ft/N)
\end{equation}
\normalsize
where $ cas(2\pi ft) = \cos(2\pi ft) + \sin(2\pi ft)$. These are similar to
those for the discrete Fourier Transform.

\end{document}
     
