2

I have a large number of small scores intended for Sunday morning service leaflets. Preparing the image for insertion into the MS Word document includes removing all the vertical blank space, which is different for each piece.

I currently create custom paper sizes via #(set! paper-alist (cons ...)) but there is still quite a lot of cropping the output images.

Is there a better way?

jwvh
  • 50,871
  • 7
  • 38
  • 64

2 Answers2

1

I wrote a Bash shell script to do this: https://github.com/andrewacashner/lilypond/lilycrop.sh

In the terminal of a Unix-based system (or perhaps on Cygwin on Windows, though I haven't tested that), this script will automatically crop the PDF output by lilypond to a minimum size. It produces a separate cropped PDF file for each page of the original.

musarithmia
  • 216
  • 3
  • 9
  • Nice. Early testing looks good but the fact that it crops the width (horizontal) as well might turn out to be a deal breaker. I'll get in touch via your github after I've spent more time with it. – jwvh Aug 31 '15 at 05:31
  • I use this with LaTeX. I set the page width in Lilypond so that the images are exactly the width of the textblock (that is, the space between left and right margins) in LaTeX. Then i can import the images using \includegraphics[withd=\textwidth]{lyimage.pdf}. – musarithmia Aug 31 '15 at 13:09
0

Lilypond has no internal way to produce automatically cropped output. On linux, you can use the pdfcrop tool which is part of the texlive-extra-utils package. Does the job nicely.

andro
  • 901
  • 9
  • 20