[racket] Scribble to latex

From: Mark Millikan (markmillikan at gmail.com)
Date: Fri Jun 8 16:30:34 EDT 2012

Two work arounds:

1. Launch DrRacket from a terminal with  <open /path/to/DrRacket.app>

2. Run <raco scribble --pdf /path/to/your-scribble-source.scrbl>


This fragment from racket/collects/redex/private/dot.rkt succinctly
describes the problem and a hard-coded
solution to the root problem:

;; these paths are explicitly checked (when find-executable-path
;; fails) because starting drracket from the finder (or the dock)
;; under mac os x generally does not get the path right.
(define dot-paths

(define dot.exe (if (eq? (system-type) 'windows) "dot.exe" "dot"))
(define neato.exe (if (eq? (system-type) 'windows) "neato.exe" "neato"))

(define (find-dot [neato? #f])
    [(and (find-executable-path dot.exe)
          (find-executable-path neato.exe))
     (if neato?
         (find-executable-path neato.exe)
         (find-executable-path dot.exe))]
     (ormap (λ (x) (and (file-exists? (build-path x dot.exe))
                        (file-exists? (build-path x neato.exe))
                        (build-path x (if neato? neato.exe dot.exe))))


To see the problem download:


Using the applescript editor

1. save it as a gui app

2. open it from the finder or dock
   and open it in a terminal shell using the open command

3, compare the PATH envvar in the two cases


On Wed, Jun 6, 2012 at 3:40 PM, David Janke <david at thejamesriver.com> wrote:

> You can always try including the relative path. Something like:
> (find-executable-path "pdflatex" "../../../sw/bin")
> Doesn't OS X have a .profile? Maybe try defining the path there instead of
> in .bashrc?
> On Wed, Jun 6, 2012 at 2:40 PM, Viera Proulx <vkp at ccs.neu.edu> wrote:
>> I am starting to play with scribble and have tried to generate a pdf
>> document from the scribble source. The conversion to html worked fine.
>> When I hit the Scribble to PDF button I got:
>> Welcome to DrRacket, version 5.2.1 [3m].
>> Language: scribble/manual; memory limit: 128 MB.
>> scribble: loading xref
>> scribble: rendering
>> . .
>> ../../../../../../../Applications/Racket/collects/scribble/private/run-pdflatex.rkt:7:0:
>> run-pdflatex: could not find a `pdflatex' executable
>> >
>> So I looked for run-pdflatex.rkt and opened that and ran it -
>> successfully. I am working on a Mac OS 1.6.8 - so I wondered whether
>> pdflatex exists on it. Running in the Terminal, I tried:
>>  vkp$ which pdflatex
>> /sw/bin/pdflatex
>>  vkp$ which man
>> /usr/bin/man
>> so, the command is there. I checked my .bashrc and /sw/bin is in the PATH:
>> PATH=/bin:/usr/bin:/usr/vkp/bin:/usr/local/bin:/sw/bin:/Applications/Racket/bin:/usr/bin/ant/bin:/Applications/android-sdk-mac_86/tools:$PATH
>> Then I tried in the Interactions for the run-pdflatex.rkt
>> Welcome to DrRacket, version 5.2.1 [3m].
>> Language: scheme/base; memory limit: 128 MB.
>> > (find-executable-path "pdflatex")
>> #f
>> > (find-executable-path "man")
>> #<path:/usr/bin/man>
>> >
>> So - I have no idea why the path to pdflatex is not found. Any help is
>> appreciated.
>> -- Viera
>> ____________________
>>  Racket Users list:
>>  http://lists.racket-lang.org/users
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120608/a3279298/attachment-0001.html>

Posted on the users mailing list.