Re: `set-global-staff-size` fails within `\book`

2023-12-12 Thread Werner LEMBERG


> IMHO the documentation is wrong. Everything's in the name.
> set-global-staff-size sets the *global* staff size. Per-\book is not
> global.

Thanks to all who answered.  I've submitted an MR to improve the
documentation.

  https://gitlab.com/lilypond/lilypond/-/merge_requests/2200


Werner



Re: `set-global-staff-size` fails within `\book`

2023-12-12 Thread Mark Knoop
At 10:36 on 12 Dec 2023, Werner LEMBERG wrote:
>>> Consider this snippet.
>>>
>>> ```
>>> \book {
>>>   #(set-global-staff-size 20)
>>>   { c' }
>>> }
>>>
>>> \book {
>>>   #(set-global-staff-size 10)
>>>   { c' }
>>> }
>>> ```

> I played a bit more with this, and I've found that
> `set-global-staff-size` affects the *next* book block, which is, well,
> unexpected.

> ```
> \book {
>   \markup "30"
>   #(set-global-staff-size 30)
>   { c' }
> }

> \book {
>   \markup "10"
>   #(set-global-staff-size 10)
>   { c' }
> }

> \book {
>   \markup "10"
>   #(set-global-staff-size 10)
>   { c' }
> }
> ```
I've always just used it at top-level - this works as expected.

```
#(set-global-staff-size 30)
\book {
  \markup "30"
  { c' }
}

#(set-global-staff-size 10)
\book {
  \markup "10"
  { c' }
}

#(set-global-staff-size 20)
\book {
  \markup "20"
  { c' }
}
```

--
Mark Knoop



Re: `set-global-staff-size` fails within `\book`

2023-12-12 Thread Jean Abou Samra
> What is wrong?  The documentation or LilyPond's behaviour?


IMHO the documentation is wrong. Everything's in the name. set-global-staff-size
sets the *global* staff size. Per-\book is not global.



signature.asc
Description: This is a digitally signed message part


Re: `set-global-staff-size` fails within `\book`

2023-12-12 Thread Werner LEMBERG
>> Consider this snippet.
>> 
>> ```
>> \book {
>>   #(set-global-staff-size 20)
>>   { c' }
>> }
>> 
>> \book {
>>   #(set-global-staff-size 10)
>>   { c' }
>> }
>> ```

I played a bit more with this, and I've found that
`set-global-staff-size` affects the *next* book block, which is, well,
unexpected.

```
\book {
  \markup "30"
  #(set-global-staff-size 30)
  { c' }
}

\book {
  \markup "10"
  #(set-global-staff-size 10)
  { c' }
}

\book {
  \markup "10"
  #(set-global-staff-size 10)
  { c' }
}
```


Werner


Re: `set-global-staff-size` fails within `\book`

2023-12-12 Thread Werner LEMBERG


Six weeks ago I asked the following, without getting a response:

> Consider this snippet.
> 
> ```
> \book {
>   #(set-global-staff-size 20)
>   { c' }
> }
> 
> \book {
>   #(set-global-staff-size 10)
>   { c' }
> }
> ```
> 
> Section 'Setting the staff size' in the NR says
> 
>   To set the staff size globally for all scores in a file (or in a
>   \book block, to be precise), use set-global-staff-size [...]
> 
> This implies that `set-global-staff-size` is restricted to `\book`
> if used within.
> 
> However, the above example fails: In both created PDF files, the
> staff size is 20pt, which means that the second call to
> `set-global-staff-size` does nothing.
> 
> What is wrong?  The documentation or LilyPond's behaviour?

Any takers who has some insight?


Werner