From 06f15d45164ec38c546444927300f6fb77cd6b60 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Mon, 28 Feb 2011 09:03:34 +0000 Subject: [PATCH] lilypond-book: add [pagesize=xyz] option. This will be *extremely* useful when writing Notation 4 Spacing issues. --- python/book_snippets.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/book_snippets.py b/python/book_snippets.py index a1b1328c57..b7c3ddf0d6 100644 --- a/python/book_snippets.py +++ b/python/book_snippets.py @@ -53,6 +53,7 @@ NOTIME = 'notime' OUTPUT = 'output' OUTPUTIMAGE = 'outputimage' PAPER = 'paper' +PAPERSIZE = 'papersize' PREAMBLE = 'preamble' PRINTFILENAME = 'printfilename' QUOTE = 'quote' @@ -112,6 +113,7 @@ snippet_options = { ## PAPER: { + PAPERSIZE: r'''#(set-paper-size "%(papersize)s")''', INDENT: r'''indent = %(indent)s''', LINE_WIDTH: r'''line-width = %(line-width)s''', QUOTE: r'''line-width = %(line-width)s - 2.0 * %(exampleindent)s''', @@ -553,6 +555,12 @@ left-margin-default right-margin-default)" elif relative > 0: relative_quotes += "'" * relative + # put paper-size first, if it exists + for i,elem in enumerate(compose_dict[PAPER]): + if elem.startswith("#(set-paper-size"): + compose_dict[PAPER].insert(0, compose_dict[PAPER].pop(i)) + break + paper_string = '\n '.join (compose_dict[PAPER]) % override layout_string = '\n '.join (compose_dict[LAYOUT]) % override notes_string = '\n '.join (compose_dict[NOTES]) % vars () -- 2.39.5