LaTeX is a great way of preparing nice-looking documents. At least as useful is its keeping track of cross-references, references and suchlike.
It has also been very stable (though evolving). That means that more than 30 years ago it was powerful and useful. And 25 years ago, if you were using MSDOS or OS/2, you could install emTeX, the implementation of LaTeX put together by Eberhard Mattes. He has long put it down and moved on, but if you’re interested in retrotech, it remains an interesting tool, or suite of tools.
Because you can get a reasonably recent Vim on FreeDOS (7.3) and some other great editors too, LaTeX is still quite viable. The biggest issue is that a lot of more modern functionality is missing — for example, anything using Lua, things like XeLaTeX, TrueType fonts, inserting PDFs and PNG files directly, and so on. You’re really limited to EPS graphics or (if you use the emTeX driver) monochrome PCX files.
BUT
Because LaTeX has been so stable, a LaTeX file that works in emTeX will work on a modern machine. That means LaTeX remains the best way of making a modern, good-looking document on DOS, one that can at some point be transferred to a modern machine for production if need be.
So here I outline a way of installing emTeX on FreeDOS
Basic install of emTeX on FreeDOS
The procedure mostly consists of unzipping archives and creating some environment variables.
I assume emTeX zips are in c:\cds\emtexzip (change to suit wherever you have put them). The zips can be found on CTAN, in systems/msdos/emtex.
FreeDOS installs unzip32.exe, I think. Any unzip that can keep the directory structure (eg pkzunip -d) is ok.
The instructions are really all already there — in the file install.eng (if English is your language — there is also an install.ger). So every so often, I have a look at it. I’ve already installed Vim using FreeDOS’s package tools. You don’t need Vim — the FreeDOS EDIT program is fine.
C:\> vim \cds\emtexzip\install.eng
So, step 1 is to unzip the archives after changing to the root directory.
C:\> c:
C:\> cd \
C:\> unzip32 \cds\emtexzip\first.zip
Add the new directory to the path in autoexec.bat and set some environment variables (note that you might well need to increase your environment space). It may be useful to add these paths and variables to your current DOS session as well, because we need to run emTeX later to generate some formats and so on, so these variables and paths need to be active for the installation to work:
path=%path%;c:\emtex\bin
set emtexdir=c:\emtex
set texconfig=%emtexdir%\data\dvips
set emtexopt=/ms:1600
tmp is already set by FreeDOS, but if not, make it:
md c:\tmp
Then add this to autoexc.bat:
set tmp=c:\tmp
Add emx/rsx; some of these files may already be on FreeDOS; I said ‘no’ to copying over any existing files. Do install this package, even if c:\emx already exists:
c:\>unzip c:\cds\emtexzip\emxrsx.zip
Add \emx\bin to your current path (to help with later install steps), and then add this to autoexec.bat :
path=%path%;c:\emx\bin
C:\>vim \emx\doc\emxrt.doc
There can be issues with emx and your DPMI driver; we’ll plough on an see if we have to come back to this.
C:\>unzip \cds\emtexzip\TEX4B.ZIP
C:\>unzip \cds\emtexzip\fontcm.zip
C:\>unzip \cds\emtexzip\l2input.zip
C:\>unzip \cds\emtexzip\latex209.zip
C:\>unzip \cds\emtexzip\fontltx.zip
Now, we set up tex, latex, whatever we want to use — this is why we need our environment variables and paths to include the emTeX information:
C:\>vim emtex\doc\english\tex.doc
C:\>cd \emtex\htexfmts\
We make some formats. I use latex2e as latex. This means I can run latex with latex2e (or latex), latex 2.09 with latex209, slitex with slitex and plain tex with either tex or htex386 (“C:…\>” bit omitted from commands not run in the root directory):
makefmt huge latex2e US -b \emtex\bin\latex2e
makefmt huge slitex US -b \emtex\bin\slitex
makefmt huge latex209 US -b \emtex\bin\latex209
makefmt huge plain US -b \emtex\bin\tex
(I then copied latex2e.bat to latex.bat.) Then we unzip some more archives.
C:\>cd \
C:\>unzip \cds\emtexzip\l2tools.zip
C:\>cd \emtex\dist\latex\packages\tools\
latex tools.ins
copy *.sty \emtex\texinput\latex2e\
copy *.tex \emtex\texinput\latex2e\
vim \emtex\dist\latex\packages\tools\readme.txt
cd \
C:\>unzip \cds\emtexzip\texware.zip
C:\>unzip \cds\emtexzip\MF4B.ZIP
C:\>unzip \cds\emtexzip\mfjob12d.zip
C:\>unzip \cds\emtexzip\fontcm.zip
C:\>unzip \cds\emtexzip\fontec.zip
C:\>unzip \cds\emtexzip\fontltx.zip
C:\>unzip \cds\emtexzip\fontemsy.zip
C:\>unzip \cds\emtexzip\fontams.zip
C:\>vim emtex\doc\english\metafont.doc
C:\>cd emtex\bmfbases\
makebas 386 plain
makebas 386 cm
C:\>cd \
C:\>vim emtex\doc\english\mfjob.doc
C:\>unzip \cds\emtexzip\mfware.zip
C:\>unzip \cds\emtexzip\DVID16H1.ZIP
C:\>unzip \cds\emtexzip\DVID16H2.ZIP
C:\>vim emtex\doc\english\metafont.doc
C:\>vim emtex\doc\english\mfjob.doc
C:\>vim emtex\doc\english\dvidrv.doc
C:\>mkdir texdocs\dvifiles
C:\>mkdir \texfonts
C:\>mkdir \texdocs\images
Put these 4 lines in autoexec.bat:
set dvidrvinput=c:\texdocs\dvifiles
set dvidrvfonts=c:\texfonts!!
set dvidrvgraph=c:\texdocs\images
set mfjobopt=/3
Then:
C:\>copy cds\emtexzip\*.fli \texfonts
C:\>unzip \cds\emtexzip\makeindx.zip
Put a line in autoexec.bat:
set indexstyle=c:\emtex\idxstyle
And then install BibTeX:
C:\>unzip \cds\emtexzip\bibtex4b.zip
C:\>vim emtex\doc\bibtex.doc
We want to find bib files that are not in the emTeX tree — they are userspace things, but we do want to search the official place if need be. I put my userspace stuff in c:\texdocs, so add to autoexec.bat:
set bibinput=c:\texdocs\bib;c:\emtex\bibtex\bib
set bstinput=c:\emtex\bibtex\bst
Then:
C:\>mkdir \texdocs\bib
C:\>unzip \cds\emtexzip\texcad.zip
texcad did not work on my machine, but you can install if you like. Remove it using emTeX’s package management tools:
C:\>emremove \emtex\remove\texcad.rem
c:\>cd \
C:\>unzip \cds\emtexzip\pictex.zip
C:\>unzip \cds\emtexzip\web.zip
Now emTeX works, but we still need some ancillaries — especially PSNFSS, which gives us PostScript fonts, and dvips which makes PostScript files for us. We can also add PS2PDF to make PDF files, which allows us to make modern output with old LaTeX (ps2pdf comes with GhostScript; old version of some of the xpdf tools are also available). Other tools to install later include ispell, word counters, drawing tools, gnuplot, all that kind of thing. Beyond the scope of this document.
FreeDOS package management can install some of these, including GhostScript; it should add the gs environment variables, but if not, more stuff for autoexec.bat:
set GS_LIB=c:\gs
set GS_FONTPATH=c:\gs\fonts
Download (it’s on CTAN) dvips583.zip and put in a temporary directory, unzip it then unzip some files that were within it from the root directory:
C:\>cd \
C:\>mkdir dvips.tmp
C:\>cd dvips.tmp
Move dvips583.zip from wherever to here and unzip it, then return to the root and unzip the zip that was inside the zip …
unzip dvips583.zip
C:\>cd \
C:\>unzip dvips.tmp\dvipsexe.zip
C:\>deltree -Y dvips.tmp
(If you like); I am using 300 DPI (that is, LJ), so I go:
C:\>cd \emtex\data\dvips
Back up the config.ps because it is for the 600 DPI LaserJet IV. Then:
C:\>copy config.ps config.lj4
C:\>copy config.lj config.ps
Because it works for 300 DPI LJ/LJII. Then, if I want ps2pdf to work, I go:
C:\>cd \gs
C:\>copy gs386.exe gs.exe.
(Or I could make an alias in autoexec.bat — FreeDOS/4DOS can do that. That is probably better, so if using 4DOS, instead add this to autoexec.bat):
alias gs="gs386.exe"
Ok, next we want to add PSNFSS — this gives us access to a bunch of PostScript fonts, like Bookman and all those kind of standard ones. There is a very good guide for doing this online — search for: “Installing the PostScript fonts in EmTeX using the PSNFSS package” and the guide will come up.
On CTAN or elsewhere (ideally, an older version), find PSNFSS.zip and unzip it in a scratch space (I am using C:\cds\psnfss). Inside that zip is lw35nfss.zip, preferably an older version; unzip that too. Note that my system has some gnu utilities, so you may see ‘cp -r’ for ‘recursive copy’. Unzipping PSNFSS.zip should provide a handful of files, so in the scratch space:
cd \cds\psnfss
latex psfonts.ins
move *.sty \emtex\texinput\latex2e\
cd fonts\tfm\
cp -r adobe \emtex\tfm\
cd \cds\psnfss
copy psnfss.map \emtex\data\dvips\
cp -r fonts\vf\adobe \texfonts\vf
vim \emtex\data\dvips\config.ps
And on line 54 I add:
p +psnfss.map
Then:
C:\>mkdir \emtex\texinput\fd
C:\>cp tex\latex\psnfss\*.fd \emtex\texinput\fd\
C:\>cp 8r.enc \emtex\data\dvips\
And another environment variable:
set textfm=C:\EMTEX\tfm!!
Now, we can find the pixel fonts for these fonts in lw35pk.zip. This archive uses a different directory naming convention from the emTeX DVI viewer, so we have some manual copying to do; for example, after we unzip it:
c:\> copy dpi300\ptmr8r.pk \texfonts\pixel.lj\300dpi
(Of course, in practice to automate this any way you like).
Now we have a pretty good LaTeX installation. Some more packages and resources would be useful.
- Using computer modern, we can just use emTeX as given, and dvips32 and v.bat (the DVI viewer) will work out of the box.
- We can use the PSNFSS fonts by following the instructions, and latex and dvips32 will work, but we won’t have pixel fonts that are needed for onscreen preview. They can be generated using gsftopk, but that is beyond the scope of this document. It is often easiest done using a Linux or Windows box, to be honest.
Now, we must add some more packages.
Just as an example!
To add packages to emTeX, use the archived TeX material at tug.org/historic. emTeX was last updated around 1999, so the ideal place to get packages to add to the installation is somewhere like ftp.math.utah.edu/pub/tex/historic/systems/texlive1998 where you can browse the repository or download the whole things as a tgz file (273 MB) (it’s not even that big a download by modern standards).
Almost everything fits with DOS’s 8.3 file name restrictions, and while important modern developments are not available, if you are happy to stick with TEX -> DVI -> PS -> PDF, there’s a lot that still works very nicely.
The historic archives contain fonts, macros and so on. Not all obey 8.3, so check before installing/adding. For example, we can add a graphics bundle of the right age.
For example, if we have the source files for array (array.ins and array.dtx) in the folder c:\array:
C:\>cd array\
latex ARRAY.ins
latex ARRAY.DTX
latex ARRAY.DTX
mkidx32 -s gind.ist array.idx
mkidx32 -s gglo.ist -o array.gls array.glo
latex ARRAY.DTX
latex ARRAY.DTX
v array
(We can view the documentation.) Then copy into the tree:
mkdir \emtex\texinput\latex2e\array
copy *.sty \emtex\texinput\latex2e\array
Let’s install a package from TeXLive3 downloaded from ftp.math.utah.edu/pub/tex/historic/systems/texlive/. I created a documentation tree parallel with the texinput tree, but you don’t have to. This file did not produce index or glossary output, so some steps are different from above.
C:\>cd \texlive3\texmf\source\latex\geometry\
latex geometry.ins
latex geometry.dtx
latex geometry.dtx
mkdir \emtex\doc\latex2e\geometry
mkdir \emtex\texinput\latex2e\geometry\
mv geometry.d* \emtex\doc\latex2e\geometry\
mv GEOMETRY.CFG \emtex\texinput\latex2e\geometry\
mv GEOMETRY.STY \emtex\texinput\latex2e\geometry\
Then we can go to the \emtex\doc\latex2e\geometry directory and make the documentation, if we want (as above for array).
FreeDOS includes Vim, which is a great editor for LaTeX. It also includes TDE, which I like.
That’s it.