Using LaTeX on the Amiga
++++++++++++++++++++++++

Jörgen Grahn 1994-09-05

Introduction
++++++++++++

LaTeX is an application mostly used by people involved
in computer science or mathematics at the universities to create
nice-lookng printed documents in a simple way.
Many people feel that using LaTeX is a better way
to create documents than using a word processor
or a desktop publishing program. The option to use LaTeX on
your Amiga has existed for a long time. It doesn't even have to cost
anything. There are problems though:

o	the packages are often difficult to install even for
	experienced Amiga users
o	the documentation is more often than not in German (!)
o	the documentation is poor
o	it's hard to know what utilities are needed; several different
	ones actually do the same thing
o	different versions of the same utilities are floating around -
	it's hard to know if you use the most recent or not

I've worked my way through a part of this jungle, and I though my
experiences could help others.

PLEASE NOTE that I'm not in any way a LaTeX wizard. I'm just a
guy who cleared his way through the software jungle up to the
point that I could get from source text to a printed LaTeX
document. I thought it would be a nice thing if I could spare
a few people some trouble.

Any of this information may be dead wrong or obsolete, especially
since there are new versions of the language out (see below).


What is LaTeX?
++++++++++++++

Back in the seventies, the famous computer scientist Don Knuth created
the language TeX, mainly for typesetting mathematical formulas. He made
TeX expandable for the user; anyone could expand TeX with his own macros
The basic set of functions that Knuth implemented was called Plain TeX.

In 1985, Leslie Lamport created LaTeX, a set of TeX macros
which made writig documents much easier. You write your text with your
favourite text editor as usual, but insert special commands like
\em for emphasizing a piece of text (by turning on italic) or
\chapter{} for creating a new chapter title. There are even commands
for drawing simple pictures. Then you run your text through LaTeX,
which arranges the text according to its own rules, numbers chapters and
pages, creates a table of contents etc. It puts all this in a file in
a special format. This file can then be viewed or printed with some
of the utilities that come with LaTeX.

Good things about LaTeX
+++++++++++++++++++++++

o	LaTeX enforces a certain style on every document. All documents made
	with LaTeX will have the same typeface, the same way of numbering sections
	and so on. LaTeX provides a few basic styles for different purposes:
	books, articles, letters and technical reports.

o	Unlike the popular WYSIWYG desktop publishing programs, LaTeX keeps
	your mind on what's important: the text and not its visual appearance.
	You can format your text in the strangest ways; as long as you
	spell correctly, LaTeX will make it look nice in the end.

o	LaTeX doesn't want files in a special format like word processors do;
	you can use your favourite text editor and other useful tools to
	create the text file.

o	LaTeX source can be moved between machines, for example between your
	Amiga and the university's UNIX system. The output will always look
	the same.

o	LaTeX and its support utilities can (more or less) automatically do
	things like create bibliographies, tables of contents,
	cross references and glossaries.

o	LaTeX doesn't have to cost money.

o	LaTeX creates much more professional output than most word processors,
	especially when it comes to mathematics.

Bad things about LaTeX
++++++++++++++++++++++

o	The command language is very hairy and complicated at times.

o	You can't see the completed document until you have compiled the source
	text and started the printing or viewing program.

o	LaTeX doesn't know much about foreign languages. It doesn't use the
	full Amiga Latin-1 character set, so you can't directly use for
	example Scandinavian characters with umlauts. It doesn't hyphenate
	words with such 'special' characters well.

	Additional utilities and new versions of LaTeX may help.

o	It is hard to install all utilities correctly.

o	It is largely unknown in the 'real' world, where
	most people use *argh* WordPerfect for word processing.

What do I need?
+++++++++++++++

o	Some basic knowledge about using the Amiga, especially the shell
	and a text editor. If you found this document, you probably have that
	knowledge.

o	You don't _need_ a fast processor to use LaTeX, but you will need
	a hard disk with a few megabytes free and at least two or three
	megabytes of RAM to make it work painlessly.

o	Some way of getting LaTeX and its associated  utilities. Not all of it
	is in Fred Fish's library, or even on Aminet. Full Internet access
	by FTP is probably the best.

o	A book about how to program in LaTeX. The documentation doesn't cover
	the language it itself (though it often is an excellent example).

How does it work?
+++++++++++++++++

You use a text editor to create the source file and name it foo.tex.  Then
you issue the command 'latex foo.tex' (or 'virtex.lplain.fmt foo.tex' if
you haven't renamed the proper files (more on that later).  The TeX program
(latex) reads the big bunch of precompiled latex commands from 'latex.fmt'
and a few more from the TeX:inputs/latex/ directory.  It also reads .tfm files
from TeX:fonts. These files contain information on the size of each character in
each font, so that hyphenation and stuff can be done.
From all this information and the source file, LaTeX creates the file foo.dvi.
It contains all the information needed to print the document, except for
the exact shape of each character in the fonts. Then you tell a program
(showdvi, for example) to display foo.dvi. It reads the file and tries to
find the fonts that foo.dvi wants in TeX:pk/. It needs the font in a
bitmap format, so it should be just the right size to fit nicely on the screen.
If the display program can't find the proper size of a font, it calls a special
ARexx script which in turn calls MetaFont, which generates the bitmap from
some of its MetaFont source files. Then you look at the output,
decide if you like it, and if you do, call another program which prints the
file on your printer.

Software you may need
+++++++++++++++++++++

	TeX
		TeX is the most impotant part. If usually comes with
		the LaTeX macros and the needed .TFM font metric files.
		There are three implementations: the one in the freeware (?) PasTeX
		package by G Hessman , a freeware version named just 'TeX' by D Crooke,
		and the rather expensive one in Tom Rokicki's rather expensive AmigaTeX
		package. They work much the same, but are installed in different ways.
		Crooke's version needs the hated ixemul.library, since it is
		a straightforward port from UNIX, but is otherwise OK.

	Dvi2tty
		Dvi2tty, originally by S Lindahl, is the simplest way to look at
		the .dvi output of LaTeX. It prints the document (almost) properly
		formatted on a standard console window. You won't see the different
		fonts and styles, but on the other hand you can catch its output and
		load it into a DTP program for further use. Dvi2tty needs no
		files except the .dvi file.

	DVI
		DVI is made by a bunch of Germans and has no English documentation.
		It is made to view and print .dvi files. Sadly, it doesn't use
		normal Amiga printer drivers. so it doesn't work with all printers,
		but most of them. It uses the font bitmap files ('PK-files'), so if
		you don't have them (and all fonts for all output resolutions
		take megabytes of memory!) you must get MetaFont so it can
		generate them. The best is to let DVI call MetaFont to generate
		a font on the hard disk if it doesn't exist.

	MetaFont
		Knuth's own package for generating good-loocking fonts.
		Comes with the source files for the Computer Modern Font Family,
		which is the set of fonts that LaTeX normally uses.

	DVILW
		Comes with DVI and is a program for converting .DVI to the
		PostScript format, used by many PostScript printers. This way you
		can generate a postscript file, take it to someone's printer and
		print it there. I don't know how this works; if the printer needs
		some special files, postscript fonts or whatever.

	Post
		Post is a program to interpret PostScript files and print them on a
		non-postscript printer or on the screen.

	F2L
		Foreign2LateX is a program that converts non-US characters
		(å,ö,ä) to LaTeX commands so you can use them in your LaTeX
		source files. Not needed if you have 'amiga.tex' from the
		PasTeX package.

	BibTeX
		Helps manage a bibliography database, from which LaTeX automatically
		can create good-looking bibliographies. Not even a German
		documentation, and I haven't been able to make it work yet.

	GloTeX
		Helps creating glossaries.

	There are other programs to do most of these things, but these are
	the ones I have used. There are programs for most of these things
	in the PasTeX package.

	There are also several support macro packages. Macros for using German
	rather than English comes with PasTeX.

Page sizes
++++++++++

If you're in Europe and use DIN A4 paper size (being 1/8 of a 1m2 paper
with dimensions given by h/v = v/2h if my memory serves me right) most
likely you find that the printout of a dvi file doesn't cover the
whole paper. That's because US standard papers are smaller. Use
a macro package named 'a4' to make it look better. 

How I've organized my stuff
+++++++++++++++++++++++++++

	I presently use Crooke's TeX 3.1415 port for generating the text,
	Sherer's port of MetaFont 2.71 to generate the fonts and DVI 3.62
	to view and print them on my Star SJ48 printer (excellent ink-jet
	printer, although Canon sells the same printer with a more common
	command language for less money).

To install like I did
+++++++++++++++++++++

Crooke's TeX:
Get TeX3141UserKit.lha from Aminet. Dearchive it (using the 'LhA' program
for example)
to your hard disk and make an assign TeX: in your 'S:User-startup'
to this directory. You don't have to create the environment variables
'TEXINPUTS' et cetera mentioned in the README; the default values will do.
Then you will have to edit the TeX:config/texmemory.config file.
Mine looks like:
	set memmax 150000
	set bufsize 500
	set stacksize 200
	set maxopenin 6
	set fontmax 75
	set fontmemsize 20000
	set maxstrings 6000
	set poolsize 64000
	set savesize 500
	set triesize 8000
	set dvibufsize 100
	set memtop 30000
	set trieopsize 500
You can delete the files Tex:inputs/standard; they are the plain TeX macros
and you will use LaTeX.
The stack value will probably have to be larger than usual, say 30000 or so.
Next, you'll have to generate the precompiled bunch of macros from the
files in Tex:inputs/latex. Initex exists just to do this.
Start Initex. It will ask for commands. Write:
	\lefthyphenmin=2
	\righthyphenmin=3
	\input lplain
	\dump
and it will create a 500K file 'lplain.fmt' in the current directory.
Delete Initex - you won't need it any more. Rename 'virtex' to 'latex'
and move 'lplain.fmt' to Tex:formats/latex.fmt. Now you only need
to call 'latex file.tex' and it will find latex.fmt automatically.

Now you can create .dvi files from your source file, but you can't use
it for anything except feeding it to dvi2tty - yet.

MetaFont:
No package comes with the the ready-made .pk font files, since they are
so large. You can buy some of them on lots of disks from G Hessmann.
If you don't want to do that, you have to install MetaFont.
I use MetaFontV2.71.lha from Aminet - I think.

Extract the archive like you did with TeX and assign MF: to it.
You can delete mf:inputs/tes, as well as IniMF - the plain.base is
pregenerated. NOTE: Unless you have an Amiga with a 020 processor
and a FPU, you should use the No020 version of VirMF. This isn't documented.
If you use the wrong version, it will GURU every time.

You don't have to change the configuration files, but you have to
set the environment variable MFINPUTS - the default place for
font source files. Do this (once) with:
echo >ENVARC:MFINPUTS ",,MF:inputs,MF:inputs/cm"
echo >ENV:MFINPUTS ",,MF:inputs,MF:inputs/cm"

MetaFont is complicated to use. Luckily, you don't need to call it yourself.
Metafont doesn't only generate the bitmaps for each character,
but also generates the .TFM files. They are already included with
Crooke's TeX and PasTeX though.

DVI:
DVI is a modern program in contrast to the others, who use strange assigns and
configuration scripts. It has an installation script for use with Commodore's
Installer program. If you have Workbench 3.0, you have Installer on the Install
disk; if not, you have to get it from Aminet or possibly the Fish disks.
After that, installing is easy, except that the installation scrips is in German
*sigh*. It installs a few files into the TEX: drawer and an ARexx script
MakePKFont.rexx somewhere else: in REXX:. DVI calls that script when it needs a new
font. Metafont calls get more and more rare as fonts gather on the hard disk.

The script didn't work for me; it created fonts 25 times larger than
the one I wanted! Changing 'OneZeroZero' to 'previewer' in the script solved
the problem for me - somehow.

I got it now - the modes refered to in this MakePKFont.rexx (same as in
MF:config/modes) aren't in the MetaFont plain.base file; thus,
MetaFont uses one of its built-in modes. You must change these
names to those in MF:inputs/drucker.mf instead.

I changed 'OneZeroZero' (100dpi) to 'previewer' and
'necHQ' (360dpi) to 'nechigh'. If you use other resolutions
you must look in MF:inputs/drucker.mf and select one that matches
your printer - provided your MetaFont was generated using drucker.mf,
like mine was.

BTW, I think 'drucker' is German for printer...

Sources of Information
++++++++++++++++++++++

The best book about LaTeX is the creator's own book:
LaTeX - A Document Preparation System
Leslie Lamport
Addison-Wesley
1986
ISBN 0-201-15790-X

There's a new (1994) edition of this book too, covering
also the newer LaTeX2e standard.

There's a Usenet newsgroup about TeX and LaTeX:
comp.text.tex

Third, you can recieve infomation sheets with Frequently
Asked Questions (FAQs) through email, by sending a message
with no subject line and only the text
SENDME FAQ
from fileserv@shsu.edu. Note that you will get quite
large email in return: hundreds of Kb, I believe.

New LaTeX versions
++++++++++++++++++

I found out yesterday about the work in making a standardized
enhanced LaTeX - LaTeX2e. This is a replacement macro package
(the same TeX engine is used) with lots of new features.
At the same time it's rather compatible with old LaTeX 2.9.

It is supposed to have better support for foreign languages,
better font support, a few new styles and environments and
so on.

PasTeX
++++++

I never used the PasTeX system, but it seems rather good -
provided you know a bit German. You can find it by
anonymous FTP to ftp.uni-passau.de and probably other places
too. PasTeX 1.3 comes on five disks, compressed with the rather
rare Zoom program. You need Zoom to decompress the disks. It can
be found for example on Aminet. On uni-passau there are also a lot
of LaTeX utilities.

PasTeX's five disks contain LaTeX, utilities for viewing and
printing the files, a good installation script, some new
LaTeX macros (for example the German document styles and
the amiga.tex file that allows you to use all Amiga characters
in your files) and a few more utlities for handling fonts.
What _isn't_ there is the fonts - either get MetaFont and
let the utilities call it when they need fonts, or buy
font disks from the PasTeX authors.

There will soon be an official V1.4 release of PasTeX. So far,
Hessman has only released some of the 1.4Beta executables,
not the macros.

Partial list of software
++++++++++++++++++++++++

Lastly, I made a list of the software I found so far, together
with its version, author and use. Many utilities exist on the net
in different versions in different packages, as you can see.

AmigaDVIps547.lha
	dvips		5.47		Rokicki/Hessmann		dvi->ps
	afm2tfm		5.36		Rockicki
	CallMF		0.84		Bokaemper/Hessmann
		MakeTeXfont		0.84
		...
TeX3141UserKit.lha
	TeX		3.141		Knuth/Crooke			src->dvi

ShowDVI.lha
	ShowDVI		0.99		Imagine Software		dvi->txt
	DVItty		1.00		Imagine Software		dvi->txt
(This has nothing to do with PasTeX's ShowDVI)

dvi2tty.lha
	dvi2tty		5.0		Lindahl/Mol/Dalton		dvi->txt
	disdvi				Lindahl/Mol/Dalton		dvi->?

dvi362.lha
	DVI		3.62		Eichenseher/Wilhelms/Zahn	dvi->scr | raw
	DVILW		3.62		Eichenseher/Wilhelms/Zahn	dvi->ps
	MakePKFont.rexx	1.02		Zahn

glotex30.lha
	glotex				Steppler

MetaFontV2.71.lha
	MetaFont	2.71		Knuth/Scherer
	GFtoDVI		3.0
	GFtoPK		2.3
	GFType		3.0
	MFT		2
	PKtoGF		1.0
	PKType		2.3
	CallMF		1.0		Bokaemper/Hessmann
		MakeTeXFont		1.01

PasTeX14beta5.lha
	TeX		3.1415		Knuth/Hessmann
	DVIprint	1.36		Hessmann
	flib		1.10		Hessmann
	lsfont		1.0		Hessmann
	ShowDVI		1.36		Hessmann
	SpecialHost	1.18		Hessmann

PasTeXSpecialHost.lha
	SpecialHost	0.80		Hessmann

PasTeX_dviprint.lha
	DVIprint	1.19beta	Hessmann

PasTeX_flib110.lha
	flib		1.10		Hessmann

PasTeX_styles.lha
	german.sty	2.3		Partl

PasTeX 1.3
	TeX		3.14		Knuth/Hessmann
	DVIprint	1.17		Hessmann
	flib				Hessmann
	ShowDVI		1.17		Hessmann
	SpecialHost	0.95		Hessmann
	
	amiga.tex	910709		Barthel/Hessmann
	german.sty	2.3e		Partl
	CallMF		0.90		Bokaemper/Hessmann
			MakeTeXfont	0.90

- - -

I hope this answered some of your questions and made it
easier to begin using LaTeX on your Amiga.

	Jörgen
