Re: horizontally aligning columns in \fill-line

2008-05-21 Thread Joe Neeman
On Mon, May 19, 2008 at 1:30 AM, Reinhold Kainhofer <[EMAIL PROTECTED]>
wrote:

> PS: I had to insert \noPageBreak at every possible point, because without
> them, lilypond would always decide it wants to start the real score on an
> even-numbered page and stretch the lyrics to three pages, even if that
> means
> that one page contains just one or two lines (e.g. only the headline)!!! I
> have no idea how to get around this problem, either...


Are you using the page-turn-breaking function? The default algorithm has no
concept of odd and even pages. Turning off ragged-last-bottom can help if
lilypond is too eager to badly-space the last page (I probably need to
rethink the way that ragged-bottom and ragged-last-bottom affect the scores
of different page-breaking configurations). If you can't solve it, please
send me the input file and I'll try to see how the algorithm can be
improved.

Joe
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: horizontally aligning columns in \fill-line

2008-05-19 Thread Reinhold Kainhofer
Am Montag, 19. Mai 2008 schrieb Nicolas Sceaux:
> Le 19 mai 08 à 18:05, Reinhold Kainhofer a écrit :
> > The problem with that approach is that it will really leave no space
> > between
> > subsequent markups, so there will not be any pixel space between the
> > headline / title and between each of the columns...
> > Instead, there will be several lines of space at the bottom of the
> > page :-(
>
> You need to use a command that adds space around the
> subsequent lines of text, such as \column-lines.
>
> \markuplines \column-lines {
>\line { titi }
>\line { toto }
>\line { tutu }
> }

Unfortunately, my problems remain, because this does not work after a line 
with multiple columns, as the attached file shows. Plus, before the columns 
there is way too much space...
Or am I doing something wrong in the code?

Cheers,
Reinhold

-- 
--
Reinhold Kainhofer, Vienna University of Technology, Austria
email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
\version "2.11.46"

 Distribute line width evenly to all columns:
 Solution by Nicolas Sceaux
#(define-markup-command (columns layout props args) (markup-list?)
   (let ((line-width (/ (chain-assoc-get 'line-width props
 (ly:output-def-lookup layout 'line-width))
(max (length args) 1
 (interpret-markup layout props
   (make-line-markup (map (lambda (line)
(markup #:pad-to-box `(0 . ,line-width) '(0 . 0)
  #:override `(line-width . ,line-width)
  line))
   args)

\markuplines { \column-lines {
  \line {\bold {Text der Messe / Text of the Mass}}

  \line {\bold "Kyrie eleison" }
  \column-lines {\columns{
\column { "line 1"  "line 2" "line 3" }
\column { "line 1"  "line 2" "line 3" }
\column { "line 1"  "line 2" "line 3" }
  }}

  \line {\bold "Gloria in excelsis Deo" }
  \column-lines {\columns{
\column { "line 1"  "line 2" "line 3" }
\column { "line 1"  "line 2" "line 3" }
\column { "line 1"  "line 2" "line 3" }
  }}

  \line {\bold "Credo in unum Deum" }
  \column-lines {\columns{
\column { "line 1"  "line 2" "line 3" }
\column { "line 1"  "line 2" "line 3" }
\column { "line 1"  "line 2" "line 3" }
  }}
}}

markuplines_spacing.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: horizontally aligning columns in \fill-line

2008-05-19 Thread Reinhold Kainhofer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am Montag, 19. Mai 2008 schrieben Sie:
> 2008/5/19 Reinhold Kainhofer <[EMAIL PROTECTED]>:
> > Cool, I just submitted your solution to the LSR.
>
> Looks cool indeed, though it doesn't seem to work with 2.10 :(

Huh? It works just fine in 2.10 (with the version on lsr!), because I saw even 
the nice preview on LSR:
http://lsr.dsi.unimi.it/LSR/Item?id=464

It's only that the server is quite shaky currently (most of the time it would 
return empty pages for any snipped today).

Cheers, 
Reinhold

- -- 
- --
Reinhold Kainhofer, Vienna University of Technology, Austria
email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIMd7ITqjEwhXvPN0RAlJeAKDI2ZUzh345VnbLN5iUKzbmCb+3DQCeMg6T
KnCMarsPbXzL0vReEbv8fSo=
=6vfT
-END PGP SIGNATURE-


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: horizontally aligning columns in \fill-line

2008-05-19 Thread Nicolas Sceaux


Le 19 mai 08 à 18:05, Reinhold Kainhofer a écrit :



PS2: Is there any way to set something like ragged-bottom=##t only
for the
current page? It would suffice to have some \vfill construct, which
simply
takes up all the remaining space on the page. This would do away
with the
need to insert lots of \markup\null to prevent really ugly
stretching of text
paragraphs...


Use a top-level \markuplines, this will set the padding and spacing  
to 0

for the consecutive markups inside it, thus make them stick one to
another.


The problem with that approach is that it will really leave no space  
between

subsequent markups, so there will not be any pixel space between the
headline / title and between each of the columns...
Instead, there will be several lines of space at the bottom of the  
page :-(


You need to use a command that adds space around the
subsequent lines of text, such as \column-lines.

\markuplines \column-lines {
  \line { titi }
  \line { toto }
  \line { tutu }
}



___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: horizontally aligning columns in \fill-line

2008-05-19 Thread Valentin Villenave
2008/5/19 Reinhold Kainhofer <[EMAIL PROTECTED]>:

> Cool, I just submitted your solution to the LSR.

Looks cool indeed, though it doesn't seem to work with 2.10 :(

Approved and tagged as version-specific anyway.

> The problem with that approach is that it will really leave no space between
> subsequent markups, so there will not be any pixel space between the
> headline / title and between each of the columns...
> Instead, there will be several lines of space at the bottom of the page :-(

Would this be a convenient time for me to raise the following suggestion again?
http://lists.gnu.org/archive/html/lilypond-devel/2008-04/msg00320.html

However, I understand looking for a better way to use the existing
implementation its much more sensible than asking for new code.

Cheers,
Valentin


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: horizontally aligning columns in \fill-line

2008-05-19 Thread Reinhold Kainhofer
Am Sonntag, 18. Mai 2008 schrieben Sie:
> Le 18 mai 08 à 17:30, Reinhold Kainhofer a écrit :
> > I want
> > the columns of all six text blocks to line up nicely. Currently, each
> > \fill-line is layed out by itself, so the German and English
> > translations are not properly aligned at all.
>
> You may work on something like that. Note that it won't work well
> if the text is too large.

Cool, I just submitted your solution to the LSR.


> > PS: I had to insert \noPageBreak at every possible point, because
> > without
> > them, lilypond would always decide it wants to start the real score
> > on an
> > even-numbered page and stretch the lyrics to three pages, even if
> > that means
> > that one page contains just one or two lines (e.g. only the
> > headline)!!! I
> > have no idea how to get around this problem, either...
>
> You may change the page breaker:
> to avoid page breaks when there is still room to print text at the
> bottom of a page. But then the page and line breaking of the pieces
> won't be as fine as with optimal-breaking.

Which is definitely not what I want. I've had some cases where minimal 
breaking looks really ugly, and since that score will have ~50 pages and is 
supposed to be printed, that's not an option for me.

AFAICT, the page breaker can only be changed globally, right?

> > PS2: Is there any way to set something like ragged-bottom=##t only
> > for the
> > current page? It would suffice to have some \vfill construct, which
> > simply
> > takes up all the remaining space on the page. This would do away
> > with the
> > need to insert lots of \markup\null to prevent really ugly
> > stretching of text
> > paragraphs...
>
> Use a top-level \markuplines, this will set the padding and spacing to 0
> for the consecutive markups inside it, thus make them stick one to
> another.

The problem with that approach is that it will really leave no space between 
subsequent markups, so there will not be any pixel space between the 
headline / title and between each of the columns...
Instead, there will be several lines of space at the bottom of the page :-(

Cheers,
Reinhold


-- 
--
Reinhold Kainhofer, Vienna University of Technology, Austria
email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: horizontally aligning columns in \fill-line

2008-05-18 Thread Karl Hammar
Reinhold:
> In one of my scores, I'm writing two pages with the lyrics of a mass, 
> together 
> with the corresponding German/English translations. I'm using 
> \fill-line { 
>   \column{"Latin text"...} 
>   \column{"German text"...}
>   \column{"English text"...}
> }
> to generate the three columns. However, since the mass has 6 pieces, I want 
> the columns of all six text blocks to line up nicely. Currently, each 
> \fill-line is layed out by itself, so the German and English translations are 
> not properly aligned at all.

What happens if you make a column per page and language:

\markup {
\markup {\fill-line {
  \column {
\bold "Kyrie eleison"
""
"Kyrie eleison," 
"Christe eleison," 
"Kyrie eleison."
""
\bold "Gloria in excelsis Deo"
""
\italic "Gloria in excelsis Deo"
"Et in terra pax"
...
"Et vitam venturi saeculi."
"Amen."
  }
  \column {
""
""
"Herr, erbarme dich," 
"Herr, erbarme dich," 
"Christus, erbarme dich," 
"Herr, erbarme dich!"
""
""
""
\italic "Ehre sei Gott in der Höhe"
"und Friede auf Erden"
...
"Und an das Leben der kommenden Welt."
"Amen"
  }
  \column {
""
""
"Lord, have mercy," 
"Christ, have mercy," 
"Lord, have mercy."
...
"And in the life of the world to come."
"Amen."
  }
}
\pageBreak
...

> Attached is the lilypond code and the output, where one can easily see what I 
> want (look at the English translation of Kyrie and Gloria...) The PDF is too 
> large to attach, so I uploaded it to our server:
> http://www.fam.tuwien.ac.at/~reinhold/temp/Test_Messe_Lyrics.pdf

Interesting.

I did something similar, but in latex at http://aspodata.se/noter/latin/
and latin vs. swedish.

Regards,
/Karl





___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: horizontally aligning columns in \fill-line

2008-05-18 Thread Nicolas Sceaux


Le 18 mai 08 à 17:30, Reinhold Kainhofer a écrit :

In one of my scores, I'm writing two pages with the lyrics of a  
mass, together

with the corresponding German/English translations. I'm using
\fill-line {
 \column{"Latin text"...}
 \column{"German text"...}
 \column{"English text"...}
}
to generate the three columns. However, since the mass has 6 pieces,  
I want

the columns of all six text blocks to line up nicely. Currently, each
\fill-line is layed out by itself, so the German and English  
translations are

not properly aligned at all.


You may work on something like that. Note that it won't work well
if the text is too large.

#(define-markup-command (columns layout props args) (markup-list?)
  (let ((line-width (/ (chain-assoc-get 'line-width props
(ly:output-def-lookup layout 'line-width))
   (max (length args) 1
(interpret-markup layout props
  (make-line-markup (map (lambda (line)
   (markup #:pad-to-box `(0 . ,line- 
width) '(0 . 0)

 #:override `(line-width . ,line-width)
 line))
  args)

\markup \columns {
  \column {
"Kyrie eleison,"
"Christe eleison,"
"Kyrie eleison."
  }
  \column {
"Herr, erbarme dich,"
"Christus, erbarme dich,"
"Herr, erbarme dich!"
  }
  \column {
"Lord, have mercy,"
"Christ, have mercy,"
"Lord, have mercy."
  }
}


PS: I had to insert \noPageBreak at every possible point, because  
without
them, lilypond would always decide it wants to start the real score  
on an
even-numbered page and stretch the lyrics to three pages, even if  
that means
that one page contains just one or two lines (e.g. only the  
headline)!!! I

have no idea how to get around this problem, either...


You may change the page breaker:

\paper {
  #(define page-breaking ly:minimal-breaking)
}

to avoid page breaks when there is still room to print text at the
bottom of a page. But then the page and line breaking of the pieces
won't be as fine as with optimal-breaking.

PS2: Is there any way to set something like ragged-bottom=##t only  
for the
current page? It would suffice to have some \vfill construct, which  
simply
takes up all the remaining space on the page. This would do away  
with the
need to insert lots of \markup\null to prevent really ugly  
stretching of text

paragraphs...


Use a top-level \markuplines, this will set the padding and spacing to 0
for the consecutive markups inside it, thus make them stick one to  
another.


Nicolas



___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user