lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding 3-column section to score


From: Olivier Biot
Subject: Re: Adding 3-column section to score
Date: Sun, 18 Nov 2012 23:22:46 +0100

On Sun, Nov 18, 2012 at 2:34 AM, Thomas Morley <address@hidden> wrote:
2012/11/17 Olivier Biot <address@hidden>:
> Is there a more elegant and less verbose way than the following approach to
> add a 3-column section for documenting editorial changes to scores?
>
> %% BEGIN
> \version "2.16.0"
>
> % LSR snippet: http://lsr.dsi.unimi.it/LSR/Snippet?id=464
> #(define-markup-command (columns layout props args) (markup-list?)
[...]

Hi Olivier,

I do like this \columns-command and from my point of view it
_is_elegant and _not_ verbose.

Hi Thomas,

Thanks again for your reply! What I mean, is that centering the section headers is done differently (and actually, incorrectly, since the section words have a different length) than arranging the 3 text columns.

I fixed the heading centering by writing this:

%% BEGIN snippet 1
\markup {
  \rounded-box
  \center-column {
    % Notes section header:
    \huge \bold \columns {
      \column {
        \fill-line { \hspace #.1 Bemerkungen \hspace #.1 }
      }
      \column {
        \italic { \fill-line { \hspace #.1 Remarques \hspace #.1 } }
      }
      \column {
        \fill-line { \hspace #.1 Notes \hspace #.1 }
      }
    }

    % Notes section header:
    % (as in initial message)

    % Music annotation:
    % (as in initial message)
  }
}
%% END snippet 1

So it is apparently rather difficult to center a text word in a column where the column width has been fixed (in this case, to 1/3 of the text width). I need to write the following construct if I want my text centered:

%% BEGIN snippet 2
\column {
  \fill-line { \hspace #.1 Bemerkungen \hspace #.1 }
}
%% END snippet 2
 
I'd recommend to store more stuff in variables.

That will require a better understanding of the LilyPond / Guile tandem, as I'm still used to think in a more traditional way, i.e. in terms of "is there some repetitive task I'm using which could benefit from a method call instead of writing the same code over and over", but I still lack the proper Scheme coding skills as well as a better understanding of how the LilyPond / Guile tandem works.  How would you write a method that takes e.g. a string literal as input (Bemerkungen) and produces the LilyPond code to center the text in a column (see snippet 2)? Or should I think in terms of centering a markup instead of a string literal (e.g. \italic { Remarques }?

If you prefer a version without \columns you may want to use this:
[...]
\markup
   \override #'(box-padding . 1)
   \rounded-box \center-column {
        \fill-line { \txt¹ \txt² \txt³ }
        \vspace #0.1
        \mus
}

This brings me to actually another problem I'm bumping into: I still have difficulties understanding the way \vspace works. Right now it looks like it's inhereited from TeX (rubber space). Sometimes I want to put a well-defined nonelastic vertical spacing, but \vspace does not allow this (try typing \vspace 1\cm). Besides, I see no difference in my output between \vspace #1 or \vspace #.01.

Finally, it would be great if the \columns macro could provide a way to specify padding between columns as well as vertical padding between "rows", similar to the way "\override #'(box-padding . 1)" works for \box.

Best regards,

Olivier

reply via email to

[Prev in Thread] Current Thread [Next in Thread]