lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: same pages in a4 and letter


From: Neil Puttock
Subject: Re: same pages in a4 and letter
Date: Mon, 22 Sep 2008 22:49:00 +0100

2008/9/22 Graham Percival <address@hidden>:
> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]