From 7ff65dbf6048f077b8ed819da576179b8acdd24a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 23 Jan 2008 02:54:14 +0000 Subject: [PATCH] scribble the slatex-wrapper docs svn: r8389 --- collects/slatex/doc.txt | 64 ------------------------------- collects/slatex/info.ss | 3 +- collects/slatex/slatex-wrap.scrbl | 62 ++++++++++++++++++++++++++++++ collects/slatex/slatex-wrapper.ss | 5 ++- 4 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 collects/slatex/doc.txt create mode 100644 collects/slatex/slatex-wrap.scrbl diff --git a/collects/slatex/doc.txt b/collects/slatex/doc.txt deleted file mode 100644 index 28580b7647..0000000000 --- a/collects/slatex/doc.txt +++ /dev/null @@ -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'. diff --git a/collects/slatex/info.ss b/collects/slatex/info.ss index ff3d70d4f9..a7f875a52c 100644 --- a/collects/slatex/info.ss +++ b/collects/slatex/info.ss @@ -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")) diff --git a/collects/slatex/slatex-wrap.scrbl b/collects/slatex/slatex-wrap.scrbl new file mode 100644 index 0000000000..af0f2e140c --- /dev/null +++ b/collects/slatex/slatex-wrap.scrbl @@ -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. diff --git a/collects/slatex/slatex-wrapper.ss b/collects/slatex/slatex-wrapper.ss index dea190a187..e3e3a21c86 100644 --- a/collects/slatex/slatex-wrapper.ss +++ b/collects/slatex/slatex-wrapper.ss @@ -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))]))))])