tweak the pdflatex finding code to work in drracket when
started from the finder original commit: 02e33983d0d6cf2da5a967077bfcb7fff95320f5
This commit is contained in:
parent
55f01d36f4
commit
cf5c1e3fae
|
@ -5,12 +5,8 @@
|
|||
(provide run-pdflatex)
|
||||
|
||||
(define (run-pdflatex file [notify void])
|
||||
(define (err fmt . args) (apply error 'run-pdflatex fmt args))
|
||||
(define cmd
|
||||
(list (or (find-executable-path "pdflatex")
|
||||
(and (eq? 'windows (system-type))
|
||||
(find-executable-path "pdflatex.exe"))
|
||||
(err "could not find a `pdflatex' executable"))
|
||||
(list (get-pdflatex-binary)
|
||||
"-interaction=batchmode"
|
||||
(format "~a" file)))
|
||||
(define logfile (path-replace-suffix file #".log"))
|
||||
|
@ -41,3 +37,26 @@
|
|||
(notify "WARNING: no \"Rerun\" found in first run of pdflatex for ~a"
|
||||
file)]))
|
||||
(path-replace-suffix file #".pdf"))
|
||||
|
||||
(define (get-pdflatex-binary)
|
||||
(define ans
|
||||
(case (system-type)
|
||||
[(macosx) (or (find-executable-path "pdflatex")
|
||||
(for/or ([macosx-candidate (in-list macosx-candidates)])
|
||||
(and (file-exists? macosx-candidate)
|
||||
macosx-candidate)))]
|
||||
[(windows) (or (find-executable-path "pdflatex")
|
||||
(find-executable-path "pdflatex.exe"))]
|
||||
[(unix) (find-executable-path "pdflatex")]))
|
||||
(unless ans
|
||||
(err "could not find a `pdflatex' executable"))
|
||||
ans)
|
||||
|
||||
(define (err fmt . args) (apply error 'run-pdflatex fmt args))
|
||||
|
||||
;; under mac os x, gui apps do not get started with
|
||||
;; a good path environment, so put likely candidates
|
||||
;; for a latex installation here so that the "scribble
|
||||
;; pdf" button is more likely to work in drracket
|
||||
(define macosx-candidates
|
||||
'("/usr/texbin/pdflatex"))
|
||||
|
|
Loading…
Reference in New Issue
Block a user