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 insteadAttached 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
\NeedsTeXFormat{LaTeX2e} \ProvidesPackage{lilypondbook} \RequirePackage{verbatim} \newenvironment{lilypond}{% \medskip \hrule \medskip \noindent \textit{LilyPond example, to be processed with lilypond-book:} \verbatim } { \endverbatim \hrule \medskip }
lilypondbook-test.pdf
Description: Adobe PDF document
\documentclass{article} \usepackage{lilypondbook} \begin{document} \section*{LilyPond code, compilable through ordinary \LaTeX} This is a normal paragraph which is followed by a music example. If I compile the document with \LaTeX, I get: \begin{lilypond} music = \relative e'' { e16 gis fis e dis cis | %1 h4 r8 | %2 e16 gis fis e dis cis | %3 h4 r8 | %4 } \end{lilypond} To get the music example I have to process this via \texttt{lilypond-book}. \end{document}
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user