-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to define left-margin #23
Comments
I'm not sure I understand very well, but I've no objection ! |
OK, I see now that it's not that simple and that I need some help from the lilypond-user list, but I can fake an example. By default LaTeX aligns an image with the left margin of the surrounding text. When suppressing parindent this looks like this: However, I would prefer giving users the possibility (because I would usually do it like this) not to align the border of the image but the first barline and have the system bracket (or whatever brackets are used, maybe even short instrument names) protrude in the left margin like this: For this we have to know (set) the exact width of the left margin of the score and offset the position in the LaTeX file accordingly. Unfortunately the cropped layout always crops the left margin, so we can't easily retrieve the necessary information (because the actual value dependes on the actual staff organization (a PianoStaff brace over three staves is wider than over two etc.). I'll have to see if there's a way to make LilyPond produce a usable score for this use case. |
A clearer description of the problem in the attached PDF. I think this problem is already touched in the code by defaulting the line width to the text's line width minus 10 pt. But as the elements to the left are of arbitrary width this is not a real solution. |
Having asked on lilypond-user I found an answer myself. The solution consists of a number of steps, and I would like to give it a try myself:
|
Deals with #23 I'm trying to pass a 'margin' value into the lilypond_fragment_header function, as a first step towards implementing proper alignment of full-width scores. However, using this code the `left_margin` argument reaching `lilypond_header_fragment` is not 50 or another value given as option but `true`.
Deals with #23 This is a first step towards implementing proper alignment with protrusion. Actually I would prefer being able to pass the margin with arbitrary units (instead of assuming points). This would also make it possible to calculate a paper width from line-width plus margin, so the score is guaranteed not to be cut off on any side.
Deals with #23 This commit includes several changes but I couldn't separate them while staging. * add function compile_lilypond_fragment separate compilation from the generation of the header * simplify generation of systems - it is sufficient to set the option 'backend to 'eps in the ly_code - this makes the handling of the command line option and passing the parameter around obsolete * retrieve the horizontal space that has effectively been cropped - determine the proper amount of protrusion in the left margin (so far it is only stored in the global variable PROTRUDE - NOTE: @jperon this value is read from the file <output>.eps, therefore I had to change the lilypond options to -dno-delete-intermediate-files. Is that OK?
With a defined
left-margin
option in the lilypond-score it will be possible to explicitly align the first barline to the text margin, which is something I'd greatly prefer.Any value set here should be added to line-width. So a left margin of 0.5cm should add 0.5cm to the line width.
The text was updated successfully, but these errors were encountered: