2008/9/22 Graham Percival <[EMAIL PROTECTED]>:
> Sorry!  I've added
> % run with
> %   lilypond -d letter spacing-a4-letter.ly
> % for letter size
> to the top of the file.
>
> This produces a warning that "no such internal option: letter", which
> I'd like to get rid of, but it works all the same.

This is rather nifty, but you're reinventing the wheel. :)

Why not use the built-in option instead, i.e., run with -dpaper-size="letter"?

\version "2.11.59"

% total page size to fit on A4 and letter
%   paper-height = 279mm
%   paper-width = 210mm
% with a minimum margin of 10mm on all sides, this means
%   vertical = 259mm
%   horizontal = 190mm

% A4: 210 x 297 mm
% USletter: 216 x  279 mm

#(define is-letter? (string=? (ly:get-option 'paper-size ) "letter"))

\paper{
  annotate-spacing = ##t

  % VERTICAL TARGET: 259 mm
  % letter: (279 - 259) /2 = 10mm
  % a4: (297 - 259) /2 = 19mm
  #(define (letter-margin-height)
    (if is-letter?
        (* 10 mm)
        (* 19 mm)))
  top-margin = #(letter-margin-height)
  bottom-margin = #(letter-margin-height)


  % HORIZONTAL TARGET: 180 mm
  % letter: (216 - 180) /2 = 13
  % A4: (210 - 180) /2 = 10
  #(define (letter-margin-width)
     (if is-letter?
         (* 13 mm)
         (* 10 mm)))
  left-margin = #(letter-margin-width)
  right-margin = #(letter-margin-width)
  line-width = #(- paper-width (+ left-margin right-margin))

}

\header {
  title="title"
  composer = "composer"
}
\score{
  { \repeat unfold 120 { c'4 c' c' c' } }
}

Regards,
Neil


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to