Is there a way that I can assign a value to a variable in the lilypond command line, then make that variable available to my lilypond code? Using the -e option?
I maintain my songs in separate scores then I compile them to PDF, when I'm assembling my final "book" I use ghost writer to concatenate the PDF's (some of the PDF's might be Word documents, lilypond, web page conversions to PDF, whatever) into the final book. So when I'm compiling my lilypond PDF I'd like to be able to pass into my template a variable that contains the appropriate starting page number and also another variable that might contain different heading text. Reading the manual it seems like I should be able to do this, but so far no luck and I could not find an example. Ideally here is what I'd like the command line to do: lilypond -e '(myStartingPage = 24)' -e '(myHeading = "Example 3")' mySong.ly Then in my code I would be free to use the variables called "myStartingPage" and "myHeading" in any way I want. Basically I want to input variables through the command line for things that are totally dependant on usage rather than on something permanent where I would want to re-edit the source code. "Purpose based" compiling for lack of a better word. Would a better alternative be to use the "--include" option and put all my job-specific variables into a file called "job.ly" in separate folders by job, then simply change the search path depending upon what job I'm running to pull in a different "set" of variables? This way if I'm compiling for the purpose of inclusion in a book as opposed to stand-alone I can have 2 different "job.ly" files in separate folders? Where job.ly is unconditionally \include at the top of my template? Now that I think of it, this might be cleaner to just run with a different --include path. Can this be done? Would this technique be better for language localization of my scores also, by defining my language-sensitive content in a separate "bylanguage.ly" file and using "--include" to point at the Spanish path as opposed to the English path? Can someone please give me some opinions on best practice for implementing job-specific runs of a single lily file? I apologize if this is already in the manual and I missed it. -- View this message in context: http://www.nabble.com/Command-line-option--e--tf2253549.html#a6250374 Sent from the Gnu - Lilypond - User forum at Nabble.com. _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user