On Tue, Jan 8, 2013 at 5:50 PM, Cognac Natanael
<natanael.cog...@gmail.com>wrote:

> Thank you very much for your answer Olivier,
>
> There is no spaces or fancy character in my directories or files names.
>

Okay, so you don't need to use quotes around the directory names (not that
it hurts having them).

And I think I’ve tried l’option that you've mentionned, and I tried with
> the option you’ve mentionned :
> lilypond-book --include=my-lilypond-repertory/
>

Exactly. You must specify every directory with a separate "--include"
directive.


> But after some new tests, I found something that works.
>
> This si how is the directory I’m working in :
>
> lilypond/
>     config.ly
>     score.ly
>     tuneA/
>         tuneA.ly
>     tuneB/
>         tuneB.ly
>
> At the beginning and the end of tuneA.ly and tuneB.ly, I have those
> instructions :
> \include "../config.ly"
> \include "../score.ly"
>
> So in order to make lilypond-book work with those includes, I have to
> specify each directory of tune !!! (I’ve got more than twenty and it should
> grow !) and thus, it works :
> lilypond-book
> --include=/home/user/project/lilypond/tuneA/
> --include=/home/user/project/lilypond/tuneB/
> --include=/home/user/project/lilypond/tuneC/
> --include=/home/user/project/lilypond/tuneD/
> etc… for each tune, it’s really cumbersome …
>

This is the way it is currently available. You could automate part of this
effort with some shell scripting, e.g. (assuming Bash):

includespec=""
for i in  /home/user/project/lilypond/tune* ; do
  includespec="$includespec --include \"$i\""
done
lilypond-book $includespec --output=out --pdf lilybook.lytex

BEWARE: I wrote the commands above without testing since I have no access
to a Linux box at the moment.

If you had a more complexe directory structure, then you'd have to crawl
down the entire subdirectory tree; the easiest way for doing so at the *NIX
command shell is with 'find'. The first line of the 'for' statement would
then read as follows:

dirlist=`find /home/user/project/lilypond/musicfiles/ -t d`
for i in $dirlist; do

BEWARE: I wrote the commands above without testing since I have no access
to a Linux box at the moment.

I’m sure I read somewhere (I didn’t find it back) that lilypond-book will
> look recursively into the reportory pointed out with --include. But
> apparantly it’s not the case.
>

No, or maybe "not yet" :)

Any lighter solution than the one I found ?
>

It would be great if a new recursive --include command were added to
lilypond-book (e.g. --include-base). It could even internally translate
into a cascade of --include directives (e.g. via the *NIX 'find' trick
implemented in Python)

Oh yes, and before I forget: make sure you NEVER have two LilyPond files
sharing the same file name when using lilypond-book!

Thanks again for your help.
> P.S: I forgot to mention my version : 2.16.1 (and I work with archlinux).


Maybe the lilypond-book author can shed some light on this?

Best regards,

Olivier
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to