lilypond-user
[Top][All Lists]
Advanced

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

Re: line breaking newbie question


From: Mats Bengtsson
Subject: Re: line breaking newbie question
Date: Wed, 26 Nov 2003 18:07:39 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

Actually, the raggedright parameter doesn't do what you expect.
It turns out that LilyPond uses the same line breaking as it would
if you didn't have raggedright = ##t, but instead of squeezing together
the notes to get equal length of the lines, it will use the "natural
width" of each note even though the resulting line is much too long or
too short.

As far as I know, there is no feature in LilyPond today to use natural
spacing and break the lines so that no line is longer than textwidth.
If that's what you wish, I suggest to send your wish to
address@hidden

   /Mats

Rupert wrote:
Rupert wrote:

I'm having trouble with line breaks.


[snip]


\include "english.ly"

rhStandardMajorBrokenChord=\notes { \cadenzaOn \key c\major \relative
  c' { c8-1[ e-2 g-3 c-5] e,-1[ g-2 c-4 e-5] g,-1[ c-2 e-3 g-5]
  c,2-1 g'8-5[ e-3 c-2 g-1] e'-5[ c-4 g-2 e-1] c'-5[ g-3 e-2 c-1]
  \cadenzaOff g'2-5 }}
rhStandardMajorArpeggio=\notes { \cadenzaOn \key c\major \relative c' { c8-1[ e-2 g-3] c-1[ e-2 g-3] c-5[ g-3 e-2] c-1[ g-3 e-2] \cadenzaOff c2-5 }}


\score {
  \notes {
  \time 2/4
  \context PianoStaff
<< \context Staff = up { \rhStandardMajorArpeggio
          \rhStandardMajorBrokenChord
} >>
  }
  \paper {
  raggedright = ##t
  papersize = "a4"
  linewidth = 17\cm
  }
}

\include "paper16.ly"


On Fri, Nov 21, 2003 at 04:56:01PM +0100, Mats Bengtsson wrote:

LilyPond will only consider breaking lines where you have bar lines.


Yes. Oddly though, in my example I have barlines but lilypond doesn't
break there although not doing so means the line is far too long.


If you don't want any bar lines in the output,


actually i do want barlines... I want bars of arbitrary length and I
want the barlines to be measure boundaries too (so accidentals are
dealt with properly). I'm getting the arbitrary bar lengths with
\cadenzaOn ... \cadenzaOff pairs.


you could indicate positions that are good candidates for line
breaks by inserting invisible bar lines with \bar "". If you want to
force a line break, combine it with the command \break: \bar ""
\break


Interesting, but I'd much prefer to let lilypond decide where to break
the lines.


If you don't want any bar lines in your score and want LilyPond
to be able to break the lines anywhere, you could use
\score{
 ...
 \paper{
   ...
   \translator{
     \ScoreContext
     barAlways = ##t
     defaultBarType = #""
   }
 }
}


By the way, I hope you realize that the line \include "paper16.ly"
in your example doesn't have any effect, since it comes after the
score.


Nope, I hadn't realised that :) But moving that line to the top of the
file creates a tex file that exhausts tex's memory :(

Thanks for the help,
Rupert

PS I should have mentioned before that I'm using lilypond 2.0.0




_______________________________________________
Lilypond-user mailing list
address@hidden
http://mail.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]