Originally created by: *anonymous
Originally created by: PhilEHol...@googlemail.com
Originally owned by: reinhold...@gmail.com
Reported by GP:
The below example demonstrates that lilypond-book cannot estimate
the line width correctly; music runs off the right-hand side of
the page.
Also note that this bug has NOTHING to do with the documentation.
It's a perfectly reasonable file. Compile with:
lilypond-book --pdf linelength.tely
texi2pdf linelength.texi
\input texinfo @c -*- coding: utf-8; mode: texinfo; -*-
@setfilename LineTest
@settitle PhilTest
@afourpaper
Test Lorem ipsum dolor sit amet, consectetur adipisicing elit.
@lilypond[relative=2]
\repeat unfold 100 { c4 }
@end lilypond
Test Lorem ipsum dolor sit amet, consectetur adipisicing elit.
@lilypond[relative=2]
\set Staff.instrumentName = "Violincello"
\repeat unfold 100 { c4 }
@end lilypond
Test Lorem ipsum dolor sit amet, consectetur adipisicing elit.
@bye
\input texinfo @c -*- coding: utf-8; mode: texinfo; -*-
@setfilename LineTest
@settitle PhilTest
@afourpaper
Test Lorem ipsum dolor sit amet, consectetur adipisicing elit.
@lilypond[relative=2]
\repeat unfold 60 { c4 }
@end lilypond
Test Lorem ipsum dolor sit amet, consectetur adipisicing elit.
@lilypond[relative=2]
\set Staff.instrumentName = "Violincello"
\repeat unfold 60 { c4 }
@end lilypond
Test Lorem ipsum dolor sit amet, consectetur adipisicing elit.
@bye
Originally posted by: PhilEHol...@googlemail.com
It appears that this occurs because -book does not take note of the fact that included snippets are indented from the left of the page - it allows them the full width of the page, and the indentation therefore pushes the snippet to the right. This behaviour is exacerbated by LilyPond furniture (e.g. instrument names) which aren't counted as part of the line width - see Issue 766.
texi2pdf signals where text/pictures go into the right margin by putting a black bar down the side - this can be turned off, but probably shouldn't be.
-book can be made to improve this behaviour by using the [quote] option - the question is - why is this not the default? Why would -book ever want to ignore the indents?
Related
Issues: #766
Originally posted by: percival.music.ca@gmail.com
The first @lilypond has no bar numbers nor instrument names. [quote] is also a red herring.
lilypond-book produces images which overflow the allowable space by latex. That should not happen. What's the size of the mbox (or hbox) allocated to the eps image that lilypond-book is going to create? What's the size of the bbox of the eps image that lilypond produces? These are not the same thing, and they *should* be (or at least, the size of the bbox eps should be less than the mbox in latex).
Either:
1) we have hard-coded constants for this width, and those constants are wrong,
or
2) we don't get correct information from latex about the width,
or
3) we get correct info from latex, but don't use that information correctly
These problems exist whether or not we use [quote]. They are exacerbated by having an instrument name, but since it's even broken without an instrument name, that's also a red herring.
ETA: 1 hour if you know latex+eps, python, and maybe scheme as well. 10 hours if you don't.
Originally posted by: bealings...@googlemail.com
[quote] is not a red herring. It implements the situation that is needed - i.e. lilypond output that doesn't flow off the right of the page.
I didn't say that this bug doesn't exist - merely pointed out a way either to work around it, or to use as a source to solving it.
Originally posted by: reinhold...@gmail.com
It's case 3)
Lilypond-book has proper width detection, but for some reason there is code to clear the auto-detected width (from latex) or the default with (from texinfo) in most cases. I don't see any reason why it should be cleared at all. After all, ragged and quote will MODIFY the current line-width, so they still depend on a sensitive default value to start with...
Here's a patch that should fix the width of the snippets:
http://codereview.appspot.com/4888046/
However, we still have a problem with instrument names, because lilypond does not include them for the line-width calculation, so the second snippet will still be way too wide... I don't see any chance to fix this...
Labels: Patch-new
Owner: reinhold...@gmail.com
Status: Started
Originally posted by: percival.music.ca@gmail.com
Thank you so much, Reinhold!
According to git blame, those lines came from
d4a36739
but that doesn't really help; that was the big "Factor out the formatting from lilypond-book into separate classes" patch from 2010-05-11. I don't know if that helps in tracking down why we were doing it, though; that part probably just came from the original code.
Originally posted by: percival.music.ca@gmail.com
(No comment was entered for this change.)
Blocking: 1691
Originally posted by: PhilEHol...@googlemail.com
I've tested this exhaustively. I've manually updated the book-snippets.py in my build tree, and run it against my test file, prior and post this update. Both outputs are attached. As you see, without the [quote] option, this does inded get rid of the black bars/overfull hbox. Not quite sure why, since these are quite wide compared to the snippets with [quote] but that's because I don't understand the working of -book, latex, etc. However, there's no effect on the lines compiled with [quote], which continue to have bars and overfull hbox warnings. However, if you make the change I'm suggesting (indeed, 2.05 only needs changing to 2.02) you get the 3rd result - with no bars at all. See the 3rd PDF. I've run the test file with multipliers of 1.95, 1.96, 1.97, 1.98, 1.99, 2.00, 2.01, 2.02 and 2.03. 1.95 to 1.98 give the same result in terms of the point size of the overfull hbox - 2.0635 to 4 decimal digits. 1.99 to 2.01 give the same result (1.05977), different from 1.96. 2.02 is zero, and hence no black bars. It seems beyond obvious that Reinhold has fixed one bug, and the [quote] bug is down to a rounding error. Please, please, please can we stop pointless arguing about angels on the head of a pin, and make a simple change that fixes a lot of horrible output in our documentation - make the multiplier of indent just bigger than 2. If this is not agreed, I'll give up and move on to other more valued work - other work than Lilypond.
Originally posted by: percival.music.ca@gmail.com
I will put this patch on a countdown later tonight.
I will cancel any new GOP proposals for the next two weeks. I am returning to the UK next week; flying away from Vancouver on the 24th, and arriving at 13:40 on the 25th (assuming that I catch my flight from Heathrow to Glasgow). I will probably sleep for 5-6 hours (jetlag), and be at university at approximately 00:01 on the 26th.
If Reinhold (or anybody else) has not figured out what the problem is with [quote], I will absolutely give this my highest priority.
Could you please wait a week? This is my last chance to see friends and family for the next few months.
Originally posted by: percival.music.ca@gmail.com
To avoid misunderstandings: when I wrote "this patch" in comment 8, I was referring to Reinhold's patch which fixes the music-off-side-of-page for no [options].
Originally posted by: percival.music.ca@gmail.com
The patch does not break compiling. I am not able to easily test whether the generated html+pdf look good until I return to Glasgow.
Labels: -Patch-new Patch-review
Originally posted by: percival.music.ca@gmail.com
(No comment was entered for this change.)
Labels: -Maintainability Type-Maintainability
Originally posted by: percival.music.ca@gmail.com
Issue 1638 has been merged into this issue.
Related
Issues: #1638
Originally posted by: PhilEHol...@googlemail.com
For the record - it's been marked as not a duplicate of Issue 1638.
Related
Issues: #1638
Originally posted by: reinhold...@gmail.com
Pushed as [r93d4e8aa80360c95696e065b9fd4744f269f4ea8]
Labels: fixed_2_15_9
Status: Fixed
Originally posted by: brownian.box@gmail.com
I believe "fixed_2_15_9" is wrong.
Originally posted by: reinhold...@gmail.com
Ah, sorry, I missed that Graham has released 2.15.9 meanwhile...
Labels: -fixed_2_15_9 fixed_2_15_10
Originally posted by: PhilEHol...@googlemail.com
(No comment was entered for this change.)
Status: Verified
Originally posted by: PhilEHol...@googlemail.com
(No comment was entered for this change.)
Blocking: lilypond:1691
Originally posted by: victotro...@gmail.com
What's the status of this issue? I'm still seeing this behaviour with 2.16.2.
I have a score that normally makes the first line shorter to accomodate instrument names. Under lilybook all staves have the same music width, and the instrument names into the left margin. With large names, the music run into the right side of the page.
Originally posted by: PhilEHol...@googlemail.com
This specific bug has been fixed, as the status says. However, Issue 766 has not, and is what's causing your problem. Unfortunately, you will need to adjust the linewidth manually to take account of intrument names, or use shorter instrument names,
Related
Issues: #766
.