
(module pdf-slatex-launcher mzscheme
  (require "slatex-wrapper.ss")

  (define argv (current-command-line-arguments))
  
  (case (system-type)
    [(macos)
     
     ;; set up drag and drop
     (error 'slatex "pdf-slatex not supported under Mac OS Classic")]
    [(windows unix macosx)
     (when (equal? (vector) argv)
       (fprintf (current-error-port) "pdf-slatex: expected a file on the command line\n")
       (exit 1))
     (let ([result
            (parameterize ([error-escape-handler exit])
              (pdf-slatex (vector-ref argv 0)))])
       (if result
           (exit)
           (exit 1)))]))



(module pdf-slatex-launcher mzscheme
  (require "slatex-wrapper.ss")

  (define argv (current-command-line-arguments))
  
  (case (system-type)
    [(macos)
     
     ;; set up drag and drop
     (error 'slatex "pdf-slatex not supported under Mac OS Classic")]
    [(windows unix macosx)
     (when (equal? (vector) argv)
       (fprintf (current-error-port) "pdf-slatex: expected a file on the command line\n")
       (exit 1))
     (let* ([filename
             (command-line
              #:program "slatex"
              #:once-each
              [("-n" "--no-latex") "Just preprocess, don't run LaTeX"
                                   (no-latex #t)]
              #:args (filename)
              filename)]
            [result
             (parameterize ([error-escape-handler exit])
               (if (no-latex)
                   (slatex/no-latex filename)
                   (pdf-slatex filename)))])
       (if result
           (exit)
           (exit 1)))]))


Fix pdf-slatex to recognize the '-n' option (and to fail appropriately on unknown options).
Fix pdf-slatex to recognize the '-n' option (and to fail appropriately on
unknown options).

svn: r11086
