[XeTeX] XETEX and Lilypond

Fr. Michael Gilmary FrMichaelGilmary at MaroniteMonks.org
Sun Feb 28 21:23:22 CET 2010

Raphael Frey wrote:
> Hello everyone,
> I’m a musician and I often have to write documents including notes.
> Since a while now I use Lilypond and LATEX for this purpose but I’d like
> to change to XETEX because of the Open Type support. (I’m a typography
> enthusiast and my preferred free font Linux Libertine has some features
> [1] that cannot be accessed by LATEX.) Unfortunately lilypond-book
> doesn’t work with files including XETEX source code. While looking for
> some tutorials or informations on the Internet I came across this short
> “tutorial” [2] in the archive of this mailing list. The technique
> described there – separating the header from the rest of the document
> (“main text”) – does’t seem to be a problem for lilypond-book – although
> the content of the header file plus the content of the “main text” file
> is identical to the single file where lilypond-book doesn’t work, what I
> don’t understand. However there’s something wrong with the PDF file
> generated by XETEX (respectively xelatex): the (virtual) box with the
> notes doesn’t stop at the right page margin (see attached files). I also
> wonder why lilypond-book works with a separate header and a “main text”
> file but not with one single file including the whole source text.
> The attached file test.tex is a simple LATEX file that works without any
> problems. The two separated files I’d like to use with XETEX are
> headers.tex and document.tex; they are nearly identical to test.tex. The
> last document, headers.pdf, shows what I get when executing:
> lilypond-book --output=out/ --pdf headers.tex
> cd out
> xelatex headers.tex

Hi Raphael:

Here's a sample of your original = document.tex with a couple changes 
(using the ifxetex package, etc --- change the fonts to suit your 
needs). Also attached is an engine you can run via TeXShop if you're on 
Mac (copy it to ~/Library/TeXShop/Engines/ and it should appear in the 
drop down box for engines ... or you can use the preliminary %!TEX 
TS-program =  Lilypond-XeLaTeX line as in the included file). Otherwise, 
just use the lilypond-book as you have learned and it will do as you need.

You might have to look into the engine file to set the path to your 


United in adoration of Jesus, 

fr. michael gilmary, mma

Most Holy Trinity Monastery
67 Dugway Road
Petersham, MA 01366-9725

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Lilypond-XeLaTeX.engine
URL: <http://tug.org/pipermail/xetex/attachments/20100228/ee06be6c/attachment.pl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: music.tex
Type: application/x-tex
Size: 1745 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20100228/ee06be6c/attachment.tex>

More information about the XeTeX mailing list