bug-lilypond
[Top][All Lists]
Advanced

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

Re: landscape mode in lilypond-book doesn't calculate line length correc


From: David Kastrup
Subject: Re: landscape mode in lilypond-book doesn't calculate line length correctly
Date: Sat, 11 Aug 2012 21:57:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Laura Conrad <address@hidden> writes:

>>>>>> "Laura" == Laura Conrad <address@hidden> writes:
>
>     Laura> When run on the attached file, lilypond-book sets the line
>     Laura> length of the music to be much less than the actual width of
>     Laura> the page that latex is using (which you can see by where it
>     Laura> puts the footers.)
>
> I think I have a clue as to the source of this problem.  I did
> some investigation, since this is a blocking bug for a project with a
> tight deadline in early September.
>
> I looked at the lilypond-book python code, and it does indeed seem to be
> setting the width wider for a landscape page than for a portrait page.
> However, at some point when lilypond-book is running lilypond, I get the
> following warning:
>
> warning: systems run off the page due to improper paper settings,
> setting default values
>
> It looks like whatever code writes this warning thinks that no page
> should ever be more than about 9 inches wide.  This might be good enough
> for my purposes, although I was thinking about using smaller than 1 inch
> margins, and certainly there are some purposes for which you would
> definitely want minimal margins.
>
> So can someone who understands where that message comes from check
> whether there's some inappropriate hard coding of the maximum width of a
> page which is too small for a letter paper in landscape?

No such luck, it is in LilyPond itself that you have

  if (to_boolean (c_variable ("check-consistency")))
    {
      // Consistency checks. If values don't match, set defaults.
      if (abs (paper_width - line_width - left_margin - right_margin) > 1e-6)
        {
          line_width = line_width_default;
          left_margin = left_margin_default;
          right_margin = right_margin_default;
          warning (_ ("margins do not fit with line-width, setting default 
values"));
        }
      else if ((left_margin < 0) || (right_margin < 0))
        {
          line_width = line_width_default;
          left_margin = left_margin_default;
          right_margin = right_margin_default;
          warning (_ ("systems run off the page due to improper paper settings, 
setting default values"));
        }
    }

Have you tried setting the paper type in your lilypond-book snippets?
LilyPond-book only siphons off

    # Retrieve dimensions from LaTeX
    LATEX_INSPECTION_DOCUMENT = r'''
    \nonstopmode
    %(preamble)s
    \begin{document}
    \typeout{textwidth=\the\textwidth}
    \typeout{columnsep=\the\columnsep}
    address@hidden
    \end{document}

so it does not bother getting/setting paper info.  Fragments may use the

`papersize=STRING'
     Where STRING is a paper size defined in `scm/paper.scm' i.e.
     `a5', `quarto', `11x17' etc.

     Values not defined in `scm/paper.scm' will be ignored, a warning
     will be posted and the snippet will be printed using the default
     `a4' size.

option.  Embarrassingly, there is no way to get a4 landscape in
LilyPond-book right now, but a3 should do the trick I guess, at some
loss of performance.

Inside of LilyPond, #(set-default-paper-size "a4" 'landscape) would
work.

-- 
David Kastrup




reply via email to

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