[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ragged right for contents but not staff?
From: |
Matthew Collett |
Subject: |
Re: Ragged right for contents but not staff? |
Date: |
Mon, 11 Jul 2011 16:46:23 +1200 |
On 11/07/2011, at 3:47 pm, David Nalesnik wrote:
>> Now I just need to figure out how to calculate the desired width, given the
>> paper size and the staff size. (I think I know what calculation needs to be
>> done; the question is just whether my Scheme is up to automating it.)
>>
>
> This seems to do the trick:
> \version "2.14.1"
>
> \paper {
> ragged-right = ##t
> }
>
> \relative c' {
> \override Staff.StaffSymbol #'width = #(lambda (grob)
> (ly:output-def-lookup (ly:grob-layout grob) 'line-width))
> \repeat unfold 10 { c d e f }
> \bar "||"
> }
Indeed it does, thank you. And no, my Scheme would _not_ have been up to that.
I was still trying to figure out how to access the value of line-width, or
indeed any of the \paper variables: the documentation is very clear on how to
set them in the \paper block, but completely unforthcoming on how to get them
from anywhere else.
In fact, even given your solution I'm not convinced I understand how it works:
as far as I can see you have defined an anonymous function, but not actually
evaluated it ... (I've been coding on and off for 30 years in a succession of
Basic, Fortran, C, Matlab, C++, Python and even the odd spot of assembler, but
Scheme remains quite impenetrable to me).
Best wishes,
Matthew
Re: Ragged right for contents but not staff?, Wilbert Berendsen, 2011/07/11