[OS X TeX] TeXShop and Lilypond
Themis Matsoukas
matsoukas at psu.edu
Sun Apr 22 16:33:57 EDT 2007
David,
Change the first line of your engine to
#!/bin/tcsh -f
(notice the exclamation mark that's missing from your file). Also
change the path to lilypond as David Watson suggested (set
LILYPONDFOLDER = /Users/michaelm/Desktop ). Better yet, move lilypond
to /Applications and change the engine accordingly - this will create
a more standard environment. Moreover, if you need to run latex/
lilypond on different computers, just copy the engine without the
need to edit new paths.
Thanks to those who helped with this thread!
Themis
On Apr 21, 2007, at 10:24 PM, Michael Millett wrote:
> Here is the contents of the Engine file:
>
> #/bin/tcsh -f
> # Updated on 2006/10/17 - Thanks to Marc Schonbrun!
> #
> ##########################
> # HOW TO USE THIS FILE: #
> ##########################
> #
> # 0) Set the variable LILYPONDFOLDER below to the absolute path
> # of the folder containing the Lilypond application.
> # For example, if you have put the Lilypond app in a folder
> # called Music inside the Applications folder, the path
> # is /Applications/Music and the line below must read
> #
> # set LILYPONDFOLDER = /Applications/Music
> #
> # If Lilypond is installed in the Applications folder,
> # then just skip this step.
> #
> set LILYPONDFOLDER = /Desktop
> set path = ($path $LILYPONDFOLDER/LilyPond.app/Contents/Resources/
> bin/)
>
> #
> # 1) Rename this file by dropping the .txt suffix
> # and put it into your Library/TeXShop/Engines folder.
> #
> # 2) Run the Terminal application (which you find in the Utilities
> folder)
> # and, in the Terminal window, type:
> #
> # cd ~/Library/TeXShop/Engines
> #
> # then, press the Enter key and type:
> #
> # chmod +x Lilypond-LaTeX.engine
> #
> # and press Enter again. The above command makes this script
> executable.
> #
> # 3) Switch to TeXShop, open a LaTeX file with Lilypond code,
> # choose the Lilypond-LaTeX engine and typeset!
> #
> #######
> # HINT
> #######
> #
> # Write:
> #
> # %!TEX TS-program = Lilypond-LaTeX
> #
> # at the very beginning of your document: this will let TeXShop
> # automatically switch to the right engine!
> #
> #######
> # NOTE about including pictures with \includegraphics:
> #######
> #
> # you may want to include the following in the preamble of your
> # source file:
> #
> # \usepackage{graphicx}
> # \graphicspath{{../}}
> #
> # since the generated LaTeX file is put into a subdirectory
> # of the current directory.
> #
> # In general, if your directory structure is as follows
> #
> # MyLilyPondDocs/
> # MyLilyPondDocs/lilybook.lytex
> # MyLilyPondDocs/MyPictures/
> # MyLilyPondDocs/MyPictures/pic1.eps
> # ...
> # MyLilyPondDocs/MyPictures/picn.eps
> #
> # the preamble of lilybook.lytex should contain:
> #
> # \graphicspath{{../MyPictures/}}
> #
> # The trailing slash "/" is required!
> #
>
> # Create directory to put all temporary stuff
> mkdir -p "$1:r"-out/
> # Copy local style files, if any, where latex will be able to find
> them
> cp *.sty "$1:r"-out
> if ({ lilypond-book --output="$1:r"-out --psfonts "$1" }) then
> cd "$1:r"-out
> if ({ latex "$1" }) then
> if ({ dvips -o -Ppdf -R0 -h "$1:r".psfonts "$1:r".dvi }) then
> if ({ ps2pdf "$1:r".ps }) then
> mv "$1:r".pdf ..
> endif
> endif
> endif
> endif
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
More information about the MacOSX-TeX
mailing list