                           INSTALLATION 

This file covers installation on UNIX machines, including Linux.
For DOS/Windows 95, see the file INSTALL.DOS.

                           QUICK INSTALL

Edit the configuration area at the beginning of the file, then (running as
root) `make install' will install everything.

The first time you install, do not define the parameter PKFONTS. The
other parameters which must be specified when you edit the Makefile:

MFDIR is the path to the Metafont sources, and TFMDIR is the path to the .tfm
files. See above under SEARCH PATHS for tips on how to determine these
directories. 

On most machines, MANDIR is /usr/man/man1 and BINDIR is /usr/local/bin. The
parameter TEXHASH is MakeTeXls-R for the Web2C Unix distribution, texhash for
TETEX and can be left blank for NTEX.

For a reinstall, find out where MakeTeXPK has cached the files go*.*pk. They
may be in several different directories. Define PKFONTS as a list of paths to
these fonts.

                        MANUAL INSTALL (Unix)

If the QUICK INSTALL using the Makefile fails:

See INSTALLATION DETAILS for further information. Briefly, here is
the procedure on UNIX machines. You may automate this process to
some extent by using the Makefile (see MAKE INSTALL below).

Assuming you have TeX and perl already installed:

1. Download and extract the tar file sgf2tex-3.0.tar.gz. This will
create a directory called sgf2tex-3.0. Change to that directory.

2. Running as root, copy the *.mf files into your metafont search
path. (See SEARCH PATHS, below.) Make sure they are publicly readable.

3. Copy the *.tfm files into your TeX metric file (tfm) search path.
Make sure they are publically readable. Consult SEARCH PATHS for
more details.

4. (Optional) Copy gooemacs.tex and gotcmacs.tex into your TeX input
search path. If you omit this step, you may alternatively keep a copy
of this short file in your working directory whenever you are using
sgf2tex.

5. If your TeX distribution is TeTeX, run texhash. If you have the
web2c distribution, run MakeTeXls-R. Other distributions such as
NTEX do not require this step.

6. Type `make' at the command line to build the utility sgfsplit.

7. Copy sgf2tex and sgfsplit into /usr/local/bin with public read
and execute permissions. If /usr/bin/perl is not the path to perl,
then edit line 1 of /usr/local/bin/sgf2tex.

8. Copy the man pages, sgf2tex.1 and sgfsplit.1 into the appropriate
directory, with public read permissions. On many systems, this 
directory is /usr/man/man1.

9. Type `tex manual' at the command line to build manual.dvi.

10. The first time you print or preview the manual, MakeTeXPK will
generate and cache the various fonts in .gf and .pk format. This
may take a while. The second time you print or preview, these
fonts will be already built, and this time consuming process will
not repeat.

                    INSTALLATION DETAILS (Unix)

On a UNIX TeX distribution, which will typically use Karl Berry's 
kpathsea library, the following instructions should work. Download
the file sgf2tex-3.0.tar.gz and extract the sources with

   $ tar xzvf sgf2tex-3.0.tar.gz

if you have gnu tar, or

   $ gunzip sgf2tex-3.0.tar.gz ; tar xvf sgf2tex-3.0.tar

otherwise. Here $ represents your UNIX command prompt. It may be different on
your system.

This will build a subdirectory of your current directory called sgf2tex-3.0.
Change to that directory. Then $ tex manual should build manual.dvi. In order
to print or preview it, you need to install the Metafont sources (.mf) and
metric (.tfm) files into your TeX source tree, as we will explain. You must
have superuser privileges to do this installation, so log on as root.

You need to find where, on your system, Metafont source files (with the .mf
suffix) are kept. This is the default path for the MFINPUTS environment 
variable, and should be listed on the mf(1) man page. On the other hand we've
seen wrong directories listed on man pages, so in the next section, we will
give some pointers for finding the Metafont search path.

Next, you will need to know the TeX search path for .tfm files. (Again,
consult the following section if you have trouble obtaining this information.)
Copy the .tfm files to a directory in the search path for .tfm files. Make
sure the read permissions are public.

You want TeX to be able to find the file gooemacs.tex. So you need
a copy of this file in a directory in the tex search path. You may copy
this file into the default TeX search path. Alternatively, you may specify a
search path using the TEXINPUTS environment variable, or you may simply keep a
copy of this file in whatever directory you choose to work.

IMPORTANT: Some TeX distributions have a utility for updating a search path
database. This utility may be called texhash (in the teTeX distribution) or
MakeTeXls-R (in the Web2c distribution). If you have this utility, you must
run it. The NTEX distribution has no such utility, so if you are using NTEX
this step may be omitted.

The final step in installation is to copy sgf2tex into /usr/local/bin with
public read and execute permissions. You may also build the utility sgfsplit,
for which see below under Variations, by typing make at the command line. This
utility may also be copied into /usr/local/bin.

Type {\tt tex manual} to build the file {\tt manual.dvi}. Then preview or
print it. The first time you do, MakeTeXPK should invoke Metafont to build 
{\tt .gf} and {\tt .pk} font files. The second time you print or preview the
document, these files will already exist, so Metafont will not be invoked the
second time.

                          SEARCH PATHS (Unix)

In the TeX installation as described above, you need to know where Metafont
source files and TeX .tfm files are kept on your system.  In case you have
trouble obtaining this information, here are some pointers. We begin with the
search path for Metafont source files, which have the suffix .mf.

FIRST METHOD. Read the man page for mf(1). The default value of MFINPUTS is
the search path for these fonts. This information should be on the man
page. On the other hand, it is possible that the information on the man page
may be missing or wrong. So we give two other methods of finding the Metafont
search path.

SECOND METHOD. Apply strings to the Metafont binary:

  $ which mf 
  usr/local/bin/mf               (Tells us where to look for metafont)
  $ strings /usr/local/bin/mf

Scan this output for MFINPUTS. The line following this keyword will be
the default search path for Metafont. According to the kpathsea
conventions, // stands for ``all subdirectories.'' Thus the search path

.:/usr/local/share/texmf/metafont//:{/usr/local/share/texmf/fonts,/var/tex/fonts}//source//

consists of the current directory, all subdirectories of 
/usr/local/share/texmf/metafont, and all subdirectories of 
/usr/local/share/texmf/fonts or /var/tex/fonts containing a
subdirectory called source.

THIRD METHOD: The command

    find / -print 2>/dev/null|grep "\.mf\$"

will return a list of files with the suffix .mf on your system. 
Most of these will be subdirectories of some top directory. Typically
\metafont, or more precisely the program MakeTeXPK which invokes
\metafont, will be able to find .mf files which are contained in any
subdirectory of this, or (as we saw above---see `SECOND METHOD'')
depending on the kpathsea search path, the search may be restricted
to subdirectories of some fixed top directory whose path names contain
an intermediate directory with a name such as source or src. 

Next repeat this process with the .tfm files. Just as with the Metafont
sources, you can learn the search path for these by reading the man page
for xdvi(1), or by scanning the output of 
strings /usr/local/bin/xdvi or /usr/local/bin/dvips for 
TFMFONTS, or by studying the output of:

   find / -print 2>/dev/null|grep "\.tfm\$"

EXAMPLE: On a system running the web2c distribution, we find
that .mf files are kept in subdirectories of
/usr/local/share/texmf/fonts/source/. The actual default value of MFINPUTS,
found by scanning the output of strings /usr/local/bin/mf is

.:/usr/local/share/texmf/metafont//:{/usr/local/share/texmf/fonts,/var/tex/fonts}//source//

(This could be in different on another machine.) We copy the .mf files to

         /usr/local/share/texmf/fonts/source/public/misc/ 

which seems a good directory in this search path. We copy the .tfm files to:

        /usr/local/share/texmf/fonts/tfm/public/misc/

After this, we run MakeTeXls-R.

                        GETTING PERL AND TEX

Perl and TeX are both widely available, and will be found already
installed on many or most UNIX systems. 

If you don't have it, you can get Perl from
http://language.perl.com/info/software.html.
	
You can get TeX in the TeTeX or Web2c distributions from
http://www.tug.org/tetex/ or ftp://ftp.tug.org/tex/web2c/
The NTEX distribution may be found at
http://web.mathematik.uni-stuttgart.de/ntex/WWW/. 


