]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/lilypond-book.py
Introduce new handling for paper margin settings.
[lilypond.git] / scripts / lilypond-book.py
index 6abbe5393b7c48cc208ec970d18334dbc15e5288..29cde34202208b7699ee41ee16cd110e098e2e4a 100644 (file)
@@ -1116,6 +1116,17 @@ class LilypondSnippet (Snippet):
         if not INDENT in self.option_dict:
             self.option_dict[INDENT] = '0\\mm'
 
+        # Set a default line-width if there is none. We need this, because
+       # lilypond-book has set left-padding by default and therefore does
+       # #(define line-width (- line-width (* 3 mm)))
+       # TODO: Junk this ugly hack if the code gets rewritten to concatenate
+       # all settings before writing them in the \paper block.
+        if not LINE_WIDTH in self.option_dict:
+           if not QUOTE in self.option_dict:
+               if not LILYQUOTE in self.option_dict:
+                   self.option_dict[LINE_WIDTH] = "#(- paper-width \
+left-margin-default right-margin-default)"
+
     def compose_ly (self, code):
         if FRAGMENT in self.option_dict:
             body = FRAGMENT_LY