bug-lilypond
[Top][All Lists]
Advanced

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

Patch for more paper sizes in lilypond


From: Mats Bengtsson
Subject: Patch for more paper sizes in lilypond
Date: Fri, 19 Sep 2003 13:03:47 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

We had recently a question about support for legal and ledger
paper sizes, see my answer earlier today on lilypond-user.
I have patched the lilypond script to include that support but
send it here as a patch instead of submitting it directly to CVS
to make sure you agree on it.

One complication, as mentioned in the earlier mail today is that
dvips thinks of 'ledger' paper as having landscape orientation.
This means that the script would have to check extra for the
ledger papersize and the extra flag -tlandscape to dvips to
compensate for the default. I prefer to replace 'ledger' with
'tabloid' wich is the same paper size but with portrait orientation.
See also http://www.metric.fsworld.co.uk/si_paper.htm for further
support of this choice. Consequently, we should rename the old
ledger-init.ly to tabloid-init.ly. (I didn't manage to include
the addition and removal of files in the patch from cvs diff,
so you don't see it in the attachment.)

Another minor complication was that the geometry package doesn't
know about tabloid/ledger papers. This means that we have to use
papersize={width,height} instead of a option like 'legalpaper'.
Since such an option cannot be issued to \documentclass, I had
to move the paper size option to the \geometry command.

Comments?



--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
        Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================
? patch
Index: ChangeLog
===================================================================
RCS file: /cvsroot/lilypond/lilypond/ChangeLog,v
retrieving revision 1.1366
diff -p -u -r1.1366 ChangeLog
--- ChangeLog   19 Sep 2003 07:38:51 -0000      1.1366
+++ ChangeLog   19 Sep 2003 10:59:58 -0000
@@ -1,3 +1,8 @@
+2003-09-19  Mats Bengtsson  <address@hidden>
+
+       * scripts/lilypond.py: add support for 'legal' and 'tabloid' paper
+       sizes. Remove support for 'ledger'(=tabloid+landscape).
+
 2003-09-19  Heikki Junes  <address@hidden>
 
        * buildscripts/lilypond.words.py: add drum names as note names to
Index: scripts/lilypond.py
===================================================================
RCS file: /cvsroot/lilypond/lilypond/scripts/lilypond.py,v
retrieving revision 1.5
diff -p -u -r1.5 lilypond.py
--- scripts/lilypond.py 9 Sep 2003 23:02:11 -0000       1.5
+++ scripts/lilypond.py 19 Sep 2003 10:59:58 -0000
@@ -379,6 +379,8 @@ ly_paper_to_latexpaper =  {
        'a4' : 'a4paper',
        'a5' : 'a5paper',
        'a6' : 'a6paper',
+       'legal' : 'legalpaper', 
+       'tabloid' : 'papersize={11in,17in}', 
 }
 
 #TODO: should set textheight (enlarge) depending on papersize. 
@@ -390,13 +392,6 @@ def global_latex_preamble (extra):
        options = ''
 
 
-       if extra['papersize']:
-               try:
-                       options = ly_paper_to_latexpaper[extra['papersize'][0]]
-               except KeyError:
-                       ly.warning (_ ("invalid value: `%s'") % 
`extra['papersize'][0]`)
-                       pass
-
        if extra['latexoptions']:
                options = options + ',' + extra['latexoptions'][-1]
 
@@ -415,6 +410,15 @@ def global_latex_preamble (extra):
 
        unit = extra['unit'][-1]
 
+
+       papersize = ''
+       if extra['papersize']:
+               try:
+                       papersize = 
ly_paper_to_latexpaper[extra['papersize'][0]] + ','
+               except KeyError:
+                       ly.warning (_ ("invalid value: `%s'") % 
`extra['papersize'][0]`)
+                       pass
+
        textheight = ''
        if extra['textheight']:
                textheight = ',textheight=%f%s' % (extra['textheight'][0], unit)
@@ -430,7 +434,7 @@ def global_latex_preamble (extra):
                linewidth = '597pt'
        else:
                linewidth = '%d%s' % (maxlw, unit)
-       s = s + '\geometry{width=%s%s,headheight=2mm,footskip=2mm,%s}\n' % 
(linewidth, textheight, orientation)
+       s = s + '\geometry{%swidth=%s%s,headheight=2mm,footskip=2mm,%s}\n' % 
(papersize, linewidth, textheight, orientation)
 
 
        if 'twoside' in  extra['latexoptions'] :

reply via email to

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