lilypond-user
[Top][All Lists]
Advanced

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

Re: vcenter help


From: Mats Bengtsson
Subject: Re: vcenter help
Date: Sun, 17 Aug 2008 20:38:43 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20061113 Debian/1.7.8-1sarge8

A practically relevant example of the use of \hcenter (to be renamed
to something else), should rather contain a single markup.
Within scores, markups are in principle always used for graphical
objects, that do the horizontal alignment themselves, for the full
markup.
However, for markups at the top level of a file, the alignment point
of the markup is placed relative to the left margin of the page, so
this is a possibility to actually show what happens (unless
lilypond-book plays some tricks within the documentation.

So, instead of the current examples, where you may get confused
by the use of column, I would rather propose the following example
to illustrate the possibilities for horizontal alignment of a single
markup.
\version "2.11.50"
\markup{ Default alignment is left. }
\markup{ \left-align Left. }
\markup{ \hcenter Center}
\markup{ \right-align Right}

and make sure to make the point that these commands set the
alignment point of the full markup. You also needs a number of
bells and whistles to explain why these commands don't have
any effect, when used in a TextScript or RehearsalMark or
most other situations.

One final detail that I didn't fully understand until just now, is
how the horizontal alignment point is used when a number of
markups are combined on a single line.
Let's start with the following example
\version "2.11.50"
\markup{\concat \left-align{ AAA BB C }}
\markup{\concat \hcenter{ AAA BB C }}
\markup{\concat \right-align{ AAA BB C }}
First of all, note that the alignment commands are applied to all
three markups because of the curly braces, so for example
\right-align { AAA BB C } is equivalent to
{\right-align {AAA } \right-align {BB } \right-align {C }}
Then, if you look carefully at the resulting output, you will
realize that it's the right end of first markup that's aligned
with the alignment point of the second one, and similarly
the right end of the second markup that's aligned with the
alignment point of the third markup.

The same idea applies to
\version "2.11.50"
\markup{\left-align{ AAA BB C }}
\markup{\hcenter{ AAA BB C }}
\markup{\right-align{ AAA BB C }}
The difference is that here a space (word-space wide) is added
to the right of each markup before it's aligned with the alignment
point of the next one.

  /Mats



James E. Bailey wrote:


Am 15.08.2008 um 19:36 schrieb Neil Puttock:

2008/8/15 James E. Bailey <address@hidden>:

Thanks, I think I've got a hang of it, (I was actually looking for
\hcenter), but now I have another question. Is there any situation where
\center-align and \hcenter are exclusive? Aside from \hcenter needing
\column, I couldn't find any difference.


They're completely unrelated; \hcenter doesn't `need' column, it's
used to align an object to its centre *relative* to another object.


Ah, okay, that makes sense.

The example for \hcenter in B.8.2 uses \column as a convenience to
show the alignment relative to the arrow.

When I try it without the column, they aren't centered (assuming I wanted to superimpose to markup objects on top of each other).



\markup {
\hcenter \column {
  { "One line of text." }
  { "Another line of text." }
}
}


This doesn't work, since \hcenter comes before \column; it has no
reference point to work with. If you swap them round, this behaves
just like \center-align.

Yes, I knew that, I just switched them as I was typing it.

And I think I've figured it out. \center-align aligns all object along the center axis. \hcenter aligns an objects center axis to the left axis of the reference point.
\markup {
  \column {
    one
    \hcenter
    two
    three
  }
}

Can I suggest this (or something similar) be the example for B.8.2? It expresses very clearly, using terms from a previous example exactly how \hcenter differs from \center-align.



_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user



--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





reply via email to

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