X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fbook_snippets.py;h=b7c3ddf0d67d369acfec84b3db605a54860b4db9;hb=f3dc89c03003344c3794ce823d3b8339602a669a;hp=a1b1328c575b4be2af6afe92c07d09183b9b1870;hpb=60fc32ec59fd97456218332612b87b821968da84;p=lilypond.git 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 ()