[Top][All Lists]

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

Re: The LilyPond Report: a new weekly opinion column about Lily's world

From: Karl Hammar
Subject: Re: The LilyPond Report: a new weekly opinion column about Lily's world
Date: Mon, 7 Apr 2008 23:52:45 +0200 (CEST)

> A new issue of the "LilyPond Report" is out:

Qouting from above link:
L> This week, Karl Hammar shared with us a rather unusual set of macros
L> that somehow replace lilypond-book with some gcc makefiles.

Hmm, I don't see them as unusual, I see it more like that I bend
lilypond-book to the way I am used to when developing program and using

It boils down to

. using makefiles
. having something that finds out dependencies, like gcc -M
. not preprocessing my latex files by lilypond-book

I found out it was not really convenient preprocessing my latex files
when using bibtex,makeindex and friends. So I tried using
\includegraphics{lily-<horrible_number>-1.eps}, but I could not guess
what number lilypond would use so I looked into the whole process.

>From what I understand, lilypond-book do

a, run latex on the file.lytex to find out linewidth
 (I've had some problems with this when lilypond-book couldn't find
 latex, even though I could)

b, for every \lilypond* create an .ly file, say
 containing roughly:

  scheme code to make the output file cropped (without "margins")
  a \paper section with the line length found out above
  the rest of your lilypond code

c, run lilypond on (and the other lily-xxx files) to


d, it also makes an to remember which lily-xxx file is
 related to what \lilypond* directive

 #(define version-seen? #t)
 #(ly:add-file-name-alist '(
 ("" . "all.lytex:128 (")
 ("" . "all.lytex:152 (")
 ("" . "all.lytex:171 (")
 ("" . "all.lytex:181 (")
 ("" . "all.lytex:187 (")
 ("" . "all.lytex:200 (")
 ("" . "all.lytex:233 (")

e, since every lily-xxx-xx.eps file is without fonts to save space,
 lilypond-book reads all lily-xxx.eps files (which includes the needed
 fonts) and creates an file.psfonts with the grand total fonts needed to
 be used by dvips to include them in the end result


I replaced step a, with an \include which has an paper block whith the
right linewidth, like \include "" or \include "".
For small snippets, I could either set it in the .ly or using e.g.

Step b, is also solved by an \include, in current lilypond it is
\include "".

Step c, is 
 lilypond --ps -b eps            # for 2.10
 lilypond --ps -dbackend=eps     # for 2.11

Step d, is not needed any longer.

step e, is with a shrinked lilypond-book, ending with

 def main ():
         files = sys.argv[2:]
         file = sys.argv[1]
         fontextract.extract_fonts (file,files)

 if __name__ == '__main__':
         main ()


reply via email to

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