|
From: | Urs Liska |
Subject: | Re: Crop only top and bottom |
Date: | Tue, 16 Jan 2018 15:24:48 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
Am 16.01.2018 um 13:26 schrieb Urs
Liska:
OK, I think I have found something. But still I would be glad if LilyPond could do that on its own. I have a two-system score: %%%%% \paper{ left-margin = 50\pt % see below why I use \pt here line-width = 17\cm indent = 0 } \new PianoStaff \with { instrumentName = "Vl." } << \new Staff { \tempo Allegro c''2 ( c'''-. ) \break c'1 } \new Staff { \clef bass c2 c,\sustainOn c1 } >> %%%%% I compile it using the EPS backend, producing the series of cropped systems: lilypond --pdf -dbackend=eps my-file.ly This gives me (among others) the files my-file.eps. From this I can extract the dimensions of the two systems: %%BoundingBox: 27 -200 539 0 (is the third line of the file) (Parameters are bottom left (X/Y) and top right (X/Y), in points. There are also .eps files for each system, but they differ only by the second parameter, which refers to the height. What this tells me is that 27 points have been cropped from the left, that is: the 50 point margin defined in the \paper block has been reduced by 27 points. That means the "protrusion" of brace plus instrument name is 50 - 27 = 23 points. And voilà: when I do \hspace*{-23bp}\includegraphics{my-file-1.pdf} The alignment is correct. (bp (big points) is LaTeX's unit for "points"). Interestingly that left cropping is the same for all systems, obviously referring to the widest system. To achieve my goal I have to - for every score, but not for every system -
So in the end I don't have to post-process the output but can
actually retrieve the necessary information from the EPS. Urs
|
[Prev in Thread] | Current Thread | [Next in Thread] |