[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fix 1816: Lilypond-book: Give images 1mm less linewidth (issue 49400
From: |
reinhold . kainhofer |
Subject: |
Re: Fix 1816: Lilypond-book: Give images 1mm less linewidth (issue 4940043) |
Date: |
Mon, 22 Aug 2011 13:50:48 +0000 |
Reviewers: lemzwerg,
http://codereview.appspot.com/4940043/diff/1/python/book_snippets.py
File python/book_snippets.py (right):
http://codereview.appspot.com/4940043/diff/1/python/book_snippets.py#newcode178
python/book_snippets.py:178: %% offset the left padding and tex2pdf
needs a bit of on each side
Will change the comment here about the additional mm of reduction (it' s
not texi2pdf, but rather lilypond that is to blame here)
Description:
Fix 1816: Lilypond-book: Give images 1mm less linewidth
lilypond creates images that are wider than allowed (~0.5-1mm too wide),
so
workaround this by removing 1mm from the linewidth.
Also remove code that makes the fragment snippet option imply
ragged-right. Since single-line snippets are now formatted
ragged-right anyway by default in lilypond, we don't need to set
this explicitly. And multi-line snippets are usually not desired
to be printed ragged-right.
Please review this at http://codereview.appspot.com/4940043/
Affected files:
M Documentation/usage/lilypond-book.itely
M python/book_snippets.py
Index: Documentation/usage/lilypond-book.itely
diff --git a/Documentation/usage/lilypond-book.itely
b/Documentation/usage/lilypond-book.itely
index
31590d91dd101a0045ca0580aebddc4bfc9edf42..2e6dfd113e5d67cf86c683f48996d426984eab8e
100644
--- a/Documentation/usage/lilypond-book.itely
+++ b/Documentation/usage/lilypond-book.itely
@@ -667,11 +667,9 @@ Set staff size to @var{ht}, which is measured in
points.
@item ragged-right
Produce ragged-right lines with natural spacing, i.e.,
address@hidden = ##t} is added to the LilyPond snippet. This is the
-default for the @address@hidden@}} command if no @code{line-width}
-option is present. It is also the default for the @code{lilypond}
-environment if the @code{fragment} option is set, and no line width is
-explicitly specified.
address@hidden = ##t} is added to the LilyPond snippet. Single-line
+snippets will always be typeset by default as ragged-right, unless
address@hidden is explicitly given.
@item noragged-right
For single-line snippets, allow the staff length to be stretched to
Index: python/book_snippets.py
diff --git a/python/book_snippets.py b/python/book_snippets.py
index
47b683471657e39c1fcf3ef764bf2e8bbaf22075..57bbd089f65f0cddc437d3f143c35cc19bee6343
100644
--- a/python/book_snippets.py
+++ b/python/book_snippets.py
@@ -175,7 +175,8 @@ PREAMBLE_LY = '''%%%% Generated by %(program_name)s
\paper {
%(paper_string)s
- line-width = #(- line-width (* mm %(padding_mm)f))
+ %% offset the left padding and tex2pdf needs a bit of on each side
+ line-width = #(- line-width (* mm %(padding_mm)f) (* mm 1))
}
\layout {
@@ -408,22 +409,6 @@ class LilypondSnippet (Snippet):
if has_relative and not self.option_dict.has_key (FRAGMENT):
self.option_dict[FRAGMENT] = None
- if not has_line_width:
- if type == 'lilypond' or FRAGMENT in self.option_dict:
- self.option_dict[RAGGED_RIGHT] = None
-
- if type == 'lilypond':
- if LINE_WIDTH in self.option_dict:
- del self.option_dict[LINE_WIDTH]
- else:
- if RAGGED_RIGHT in self.option_dict:
- if LINE_WIDTH in self.option_dict:
- del self.option_dict[LINE_WIDTH]
-
- if QUOTE in self.option_dict or type == 'lilypond':
- if LINE_WIDTH in self.option_dict:
- del self.option_dict[LINE_WIDTH]
-
if not INDENT in self.option_dict:
self.option_dict[INDENT] = '0\\mm'