j.asal wrote:
Hi,
I want to write a music theory book with LyX. For musical examples I would
like to use Lilypond, but there seems to be no support for including and
displaying Lilypond snippets (apart from importing whole Lilypond files). I
know that one could use lilypond-book to postprocess files with embedded
lilypond code, but then you don't have any preview and you can't use LyX to
'compile' the latex file. Any ideas/suggestions?
I created what little support there is for lilypond in LyX. Mostly
because it was easy and interesting to do. It'd be interesting to know
more about what kind of lilypond support that actually is useful.
Currently, LyX can use lilypond files that takes up a page or less. This
because LyX runs the file through the lilypond software for you, obtains
a pdf or postscript file, and includes that as a graphical object.
This lets you typeset pieces of music that is less than a page each, and
get them into the LyX document. Maybe it is also possible to create
small examples such as a single chord and include it in the middle of a
line of text. I haven't actually tried that, but it ought to work.
The way to do this:
1. Create a LyX document and a lilypond file
2. In LyX: "Insert->File->External Material"
3. In the external material dialog, change "template" to LilyPond",
and insert the correct filename.
Your music should now appear when you print the LyX file or export a PDF
file.
Please let me know if there are problems with this.
Supporting lilypond-book would need a different approach, because the
processing is different.
Helge Hafting