Thank you very much for your very precise answer.

So now it works like a charm. I used your script with a few changes :

------------------
#!/bin/bash
CURRENT_DIR=$(pwd)
includespec=""
for i in  $CURRENT_DIR/lilypond/* ; do
  if [[ -d $i ]] ; then
  includespec="$includespec --include=$i/"
  fi
done
lilypond-book $includespec --output=tmp --pdf $1
------------------

Strange as it seems, the quotes around the directory names did hurt, your
script didn't work until I took them off.

But now it is perfect, and I can work with lilypond-book with my splitted
files,  the same way I was doing with lilypond.

Thank you very much for your help !

PS: I think the above script should be mentionned in the documentation,
I've spent many hours to make this works and I wouldn't have managed
without the help of the community.

2013/1/8 Olivier Biot <olivier.b...@gmail.com>

> 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