lilypond-user
[Top][All Lists]
Advanced

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

lilypondbook package useful?


From: Urs Liska
Subject: lilypondbook package useful?
Date: Wed, 16 Jan 2013 11:20:30 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

Hi list,

I'm just starting my first try with lilypond-book.
I see that I have to enter the code in my latex document, process this document with lilypond-book and then compile the resulting file to get my final pdf document.

But do I see correctly that I can't compile my original file with latex anymore (because of the undefined environment/command)?
I find this inacceptable, because I want to be able to compile my original document at any time during its development.

If I didn't miss something, I will try to use the following workaround:
  • Write a .sty file containing latex definitions corresponding to the command recognized by lilypond-book.
  • When latex compiles the file it will then print the source code and a comment instead

Attached you'll find a first sketch for the 'lilypond' environment (.sty file, test .tex file and pdf).

Am I on the right track with this approach?
Or is there something wrong with it?
Or did I miss something, and there is already a solution?

If you think that's a good idea I will complete it and suggest it as an enhancement to be distributed together with lilypond-book.

And if it works, I would think about giving them an optional parameter where one can store the path to the file (resulting of a run of lilypond-book), so latex can display either the code or this image if present.
And if that works too I'd suggest to update lilypond-book as to insert this additional parameter by itself, so latex would automatically use the generated image.

And if I understand all this correctly (but chances are quite high I don't), I would say that this approach could make the intermediate (i.e. processed) .tex file obsolete (at least for latex).
Please be patient if I'm completely off the track, but it may also be I'm not ...
Wouldn't the following work:

  • lilypond-book processes the original latex file as usual,
    but writes an additional parameter (the path to the generated image) _into the original file_ (instead of creating a new file).
  • A latex package contains environments/commands corresponding to those understood by lilypond-book
  • If that additional parameter is present, it includes the image file,
  • otherwise it prints the source code verbatim.

????

As lilypond-book is written in Python I might even contribute to that myself.

Thanks for any opinions
Urs

Attachment: lilypondbook.sty
Description: Text Data

Attachment: lilypondbook-test.pdf
Description: Adobe PDF document

Attachment: lilypondbook-test.tex
Description: Text Data


reply via email to

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