lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Making LilyPond (2.12.1) and TeXShop (2.18) working together (USER'S GUI


From: Elmar Koch
Subject: Making LilyPond (2.12.1) and TeXShop (2.18) working together (USER'S GUIDE for Mac)
Date: Wed, 21 Jan 2009 15:35:57 +0100
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

To write musicological documents it is necessary to combine text and
music. If you are using TeXShop you need a little script called "Engine"
to do this. I have written two for use with dvips and pdflatex as stated
in the LilyPond documentation:
http://lilypond.org/doc/v2.12/Documentation/user/lilypond-program-big-page#Invoking-lilypond_002dbook

Open the files LaTeX-LilyPond-dvips.engine and
LaTeX-LilyPond-pdflatex.engine with an editor and edit the line

set path = ($path
/Applications/LILYPONDPATH/LilyPond.app/Contents/Resources/bin/)

so that LILYPONDPATH points to your LilyPond.app inside your
Applications folder. Save and close.

Move both files to the directory /TeXShop/Engines which can be found in
your personal Library folder.
Open Terminal.app and type the following lines, ending each one by
pressing ENTER:

cd ~/Library/TeXShop/Engines
chmod +x LaTeX-LilyPond-dvips.engine LaTeX-LilyPond-pdflatex.engine

Open TeXShop.app and write your document or you can use the following
sample if you remove the line
"\lilypondfile[quote,noindent]{screech-boink.ly}":
http://lilypond.org/doc/v2.12/Documentation/user/lilypond-program-big-page#An-example-of-a-musicological-document

The engine you want to use must be chosen from the drop-down list
(default is LaTeX) or by typing as first line (!)
%!TEX TS-program = LaTeX-LilyPond-dvips
or
%!TEX TS-program = LaTeX-LilyPond-pdflatex
depending on the engine you want to use.


If you are using OS-X 10.4 or earlier you might get an error message
concerning python.

Install the latest python relase:
http://www.python.org/ftp/python/2.6.1/python-2.6.1-macosx2008-12-06.dmg
(should install in /usr/local/bin)

open LilyPond.app/Contents/Resources/bin/convert-ly and
LilyPond.app/Contents/Resources/bin/lilypond-book with an editor (might
require admin privileges)

Change the first line - which will set the correct path - into:
#!/usr/local/bin/python

Save, exit and try again!
You will probably get some error messages about corrupted files which
can be ignored.

The whole problem is known to the developers and the solution is also
described here:
http://lilypond.org/doc/v2.12/Documentation/user/lilypond-program/Setup-for-MacOS-X#Setup-for-MacOS-X

Have fun!

Elmar Koch (with special thanks to Kieren MacMillan for his contribution)
#!/bin/tcsh
# Set the path to lilypond-book
set path = ($path 
/Applications/LILYPONDPATH/LilyPond.app/Contents/Resources/bin/)
# Create directory "filename-out" to write the needed files
mkdir -p "$1:r"-out/
# Write LilyPond code to directory "filename-out" in pdflatex computable format 
by evoking lilypond-book
if ({ lilypond-book --output="$1:r"-out --pdf "$1" }) then
# Change to directory "filename-out"
cd "$1:r"-out
        # Write .pdf file
        if ({ pdflatex "$1" }) then
        # Move .pdf to parent directory (overwrites older file) and remove 
directory "filename-out"
        mv "$1:r".pdf ..
        cd ..
        rm -Rf "$1:r"-out
        endif
endif
# For Use with LilyPond 2.12.1, TeXShop 2.18 and TeXLive 2008
# Elmar Koch 2009 address@hidden
#!/bin/tcsh
# Set the path to lilypond-book
set path = ($path 
/Applications/LILYPONDPATH/LilyPond.app/Contents/Resources/bin/)
# Create directory "filename-out" to write the needed files
mkdir -p "$1:r"-out/
# Write LilyPond code to directory "filename-out" in latex computable format by 
evoking lilypond-book
if ({ lilypond-book --output="$1:r"-out --format=latex "$1:r" }) then
# Change to directory "filename-out"
cd "$1:r"-out
        # Write .dvi file
        if ({ latex "$1:r" }) then
                # Write .ps file
                if ({ dvips -Ppdf "$1:r" }) then
                        # Write .pdf file
                        if ({ ps2pdf "$1:r".ps }) then
                                # Move .pdf to parent directory (overwrites 
older file) and remove directory "filename-out"
                                mv "$1:r".pdf ..
                                cd ..
                                rm -Rf "$1:r"-out
                        endif
                endif
        endif
endif
# For Use with LilyPond 2.12.1 and TeXShop 2.18
# Elmar Koch 2009 address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]