install
SLaTeX Version 2.2
(c) Dorai Sitaram, Rice University, 1991, 1994
dorai@cs.rice.edu

Subj. Installation instructions for SLaTeX

Sec. 1. Configuring SLaTeX for your system

    1. Go to the directory slatex.

    2. Edit the file config.dat as suggested in the
    comments there.

    3. Invoke your Scheme interpreter.  (If you're
    using Common Lisp, invoke the Common Lisp
    interpreter.)  Load the file config.scm into Scheme
    (or Common Lisp).  This is done by typing

      (load "config.scm")

    at the Scheme (or Common Lisp) prompt. This will
    configure SLaTeX for your Scheme dialect and
    operating system, creating an appropriate
    slatex.scm file.  (For Chez, slatex.scm is a
    compiled version.)  A bat file slatex.bat or shell
    script slatex is created for convenient invocation
    on your operating system command line.  A
    Scheme/Common Lisp file callsla.scm is also created
    to provide access to SLaTeX from Scheme/Common
    Lisp.

    4. Exit Scheme (or Common Lisp).

Sec. 2. Setting paths and modifying shell script/batch file

    1. Copy or move or link slatex.scm into a suitable
    place, e.g., your bin or lib, or the system bin or
    lib.

    2. Copy or move or link slatex.sty into a suitable
    place, e.g., somewhere in your TEXINPUTS path.  For
    installing on system, place in directory containing
    the LaTeX style files (on mine this is
    /usr/local/lib/tex/macros).

    3. Copy or move or link the shellscript slatex or
    batfile slatex.bat to a suitable place in your
    PATH, e.g., your bin or the system bin.  Note that
    slatex(.bat) sets SLaTeX.*texinputs*.  If you're
    making the same shellscript/batfile available to
    multiple users, you should change the line

      (set! SLaTeX.*texinputs* "...")

    to

      (set! SLaTeX.*texinputs* <dialect-dependent-way
                                of obtaining TEXINPUTS>)

    4. Run slatex on slatex-d.tex for documentation.
    (This also checks that slatex does indeed work on
    your machine.)  Refer to slatex-d.dvi when
    befuddled.

Sec. 3. Other ways of invoking SLaTeX

The configuration process creates shellscript/batfile
slatex(.bat) for a standard invoking mechanism for
SLaTeX.  The shellscript/batfile is created to exploit
the way your Scheme is called, e.g., matters like
whether it accepts echo'd s-expressions (e.g., Chez) ,
whether it loads command line files (e.g., SCM) , and
whether it always checks for an "init" file (e.g., MIT
C Scheme).

    1. If your Scheme doesn't fall into either of these
    categories, you may have to write your own
    shellscript/batfile or devise some other mechanism.

    2. The shellscript/batfile invokes Scheme.  If,
    however, you are already in Scheme and spend most
    of the time continuously at the Scheme prompt
    rather than the operating system prompt, you may
    avoid some of the delays inherent in the
    shellscript/batfile.

The file callsla.scm, which contains just one small
procedure named call-slatex, and which is created by
the configuration process, provides a simple calling
mechanism from Scheme/Common Lisp, as opposed to the
operating system command line.  You may use it as an
alternative to the slatex shellscript/batfile.  The
usage is as follows: load callsla.scm into
Scheme/Common Lisp

  (load "callsla.scm")

and type

  (call-slatex <tex-file>)

when you need to call SLaTeX on the (La)TeX file
<tex-file>.  This invokes the SLaTeX preprocessor on
<tex-file>.  If your Scheme has a "system" procedure
that can call the operating system command line,
call-slatex will also send your file to TeX or LaTeX.
If your Scheme does not have such a procedure,
call-slatex will simply prod you to call TeX or LaTeX
yourself.

The outline of the shellscript/batfile or callsla.scm
or of any strategy you devise for using SLaTeX should
include the following actions:

    1. Load the file slatex.scm (created by the
    configuration process) into Scheme.

    2. Set the variable SLaTeX.*texinputs* to the path
    TEXINPUTS or TEXINPUT used by TeX to look for
    \input files.

    3. Call the procedure process-main-tex-file on the
    .tex file to be processed.

    4. Call either latex or tex on the .tex file.

You may devise your own way of calling
process-main-tex-file, provided your method makes sure
that slatex.scm has been loaded, SLaTeX.*texinputs* set
appropriately _before_ the call and latex/tex is called
_after_ the call.

Note that if you prefer to stay in Scheme most of the
time, it is a good idea to pre-load the procedure
call-slatex, perhaps through an init file.  Call-slatex
is just a "one-liner" "call-by-need" hook to SLaTeX and
does not take up much resources.  (Global name clashes
between your own code and SLaTeX code won't occur
unless you use variable names starting with 'SLaTeX.')
If you made no calls to call-slatex, the bigger file
slatex.scm is not loaded at all.  If you make several
calls to call-slatex, slatex.scm is loaded only once,
at the time of the first call.
