scribble the slatex-wrapper docs

svn: r8389
This commit is contained in:
Matthew Flatt 2008-01-23 02:54:14 +00:00
parent 816daac9a4
commit 7ff65dbf60
4 changed files with 67 additions and 67 deletions

View File

@ -1,64 +0,0 @@
_SLaTeX_
========
The use SLaTeX as a standalone program, either drag your .tex file onto
SLaTeX (on the macintosh or windows), or type "slatex file" at the command
prompt (under windows or X).
Under the macintosh, SLaTeX will attempt to run OzTeX. If you do not have
OzTeX installed, or use another version of LaTeX, this will fail and you
can run your own version manually.
To use SLaTeX in a program, require _slatex-wrapper.ss_:
(require (lib "slatex-wrapper.ss" "slatex"))
The file slatex-wrapper.ss defines three procedures:
> (slatex filename)
This procedure accepts a string naming a file and runs slatex and latex on
the file. It calls `filename->latex-filename' on `filename'.
> (slatex/no-latex filename)
This procedure slatex's the file named by filename, without calling
latex. That is, it only processes the .tex file to produce the .Z files.
It calls filename->latex-filename on `filename'.
> (latex filename)
This procedure `latex's the file named by filename. It calls
filename->latex-filename on `filename'.
> (filename->latex-filename filename)
This procedure accepts a filename and, if that file exists, it returns
it. If the filename appended with the suffix `.tex' exists, that filename
is returned. Otherwise, error is called.
NOTE: in order to run slatex, your TEXINPUTS environment variable
must contain a reference to the directory in which the most recent
version of slatex.sty lives. That file resides by default in
plt/collects/slatex.
_PDF-SLaTeX_
============
In addition to the slatex tools, this collection contains a parallel
set of PDF-SLaTeX tools, which are identical except that they call
pdf-latex rather than latex. In particular, there is now a launcher
called (PDF-SLaTeX/pdf-slatex), and the file slatex-wrapper.ss now
defines pdf-slatex and pdf-latex.
> (pdf-slatex filename)
This procedure `slatex's the file named by filename and
produces PDF output instead of ps output. It calls
filename->latex-filename on `filename'.
> (pdf-latex filename)
This procedure `latex's the file named by filename and
produces PDF output instead of ps output. It calls
filename->latex-filename on `filename'.

View File

@ -1,8 +1,9 @@
(module info setup/infotab
(define doc.txt "doc.txt")
(define name "SLaTeX")
(define scribblings '(("slatex-wrap.scrbl")))
;(define tools (list (list "slatex-lang.ss")))
;(define tool-names (list "SLaTeX Language"))

View File

@ -0,0 +1,62 @@
#lang scribble/doc
@(require scribble/manual
(for-label scheme/base
slatex/slatex-wrapper))
@(define latex @exec{latex})
@(define pdflatex @exec{pdf-latex})
@(define slatex @exec{slatex})
@title{SLaTeX Wrapper}
@defmodule[slatex/slatex-wrapper]
To use SLaTeX as a standalone program, either drag your
@filepath{.tex} file onto SLaTeX (under Windows or MacOS X), or type
@exec{slatex file} in a command shell.
In addition to the SLaTeX tools, this collection contains a parallel
set of PDF-SLaTeX tools, which are identical except that they
call @pdflatex rather than @|latex|. In particular, there is now a
launcher called (PDF-SLaTeX/pdf-slatex).
@deftogether[(
@defproc[(slatex (filename string?)) boolean?]
@defproc[(pdf-slatex (filename string?)) boolean?])]{
Accepts a string naming a file and runs @slatex and @latex on the
file. It calls @scheme[filename->latex-filename] on @scheme[filename].
@scheme[pdf-slatex] is like @scheme[slatex] except that it calls
@pdflatex rather than @latex, and produces PDF output instead of PS
output.}
@defproc[(slatex/no-latex (filename string?)) void?]{
Runs @slatex on the file named by @scheme[filename], without calling
@|latex|. That is, it only processes the @filepath{.tex} file to
produce the @filepath{.Z} files. It calls
@scheme[filename->latex-filename] on @scheme[filename].}
@deftogether[(
@defproc[(latex (filename string?)) boolean?]
@defproc[(pdf-latex (filename string?)) boolean?])]{
Runs @latex on the file named by @scheme[filename]. It calls
@scheme[filename->latex-filename] on @scheme[filename].
@scheme[pdf-latex] is like @scheme[latex] except that it calls
@pdflatex rather than @latex, and produces PDF output instead of PS
output.}
@defproc[(filename->latex-filename (filename string?)) string?]{
Accepts a filename and, if that file exists, it returns it. If the
filename appended with the suffix @filepath{.tex} exists, that
filename is returned. Otherwise, an exception is raised.}
@emph{NOTE:} in order to run @slatex, your @envvar{TEXINPUTS}
environment variable must contain a reference to the directory in
which the most recent version of @filepath{slatex.sty} lives. That
file resides by default in the @filepath{slatex} collection of the
main installation.

View File

@ -5,7 +5,8 @@
(lib "sendevent.ss")
"slatex.ss")
(provide slatex latex pdf-slatex pdf-latex slatex/no-latex)
(provide slatex latex pdf-slatex pdf-latex slatex/no-latex
filename->latex-filename)
(define (add-suffix p s)
(path->string
@ -70,7 +71,7 @@
(send-event "OTEX" "aevt" "odoc" (vector 'file file))
#t]
[(windows) (exec-latex (add-suffix command-name #".exe") file)]
[(unix macosx) ;; is this also okay for beos?
[(unix macosx)
(exec-latex command-name file)]
[else
(error 'latex "do not know how to run ~s on ~s" command-name (system-type))]))))])