diff --git a/collects/slatex/slatex-wrap.scrbl b/collects/slatex/slatex-wrap.scrbl index af0f2e140c..2de0dd5d1b 100644 --- a/collects/slatex/slatex-wrap.scrbl +++ b/collects/slatex/slatex-wrap.scrbl @@ -15,6 +15,13 @@ 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. +@emph{NOTE:} If you compile your @filepath{.tex} file without using +@exec{slatex} (i.e., by using @exec{slatex -n} and then using @exec{latex} +directly), then 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. + 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 @@ -54,9 +61,3 @@ output.} 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.rkt b/collects/slatex/slatex-wrapper.rkt index 2d4f206a31..46df116ff7 100644 --- a/collects/slatex/slatex-wrapper.rkt +++ b/collects/slatex/slatex-wrapper.rkt @@ -4,7 +4,10 @@ scheme/contract mzlib/process mzlib/sendevent + scheme/runtime-path "slatex.ss") + + (define-runtime-path here ".") (provide/contract [slatex (string? . -> . boolean?)] @@ -90,6 +93,10 @@ (lambda (latex-fun) (lambda (filename) (slatex/no-latex filename) + (putenv "TEXINPUTS" + (format "~a:~a" + (path->string here) + (or (getenv "TEXINPUTS") ""))) (latex-fun filename)))]) (values (meta-slatex latex)