-
- 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)
-
- orientation = 'portrait'
- if extra['orientation']:
- orientation = extra['orientation'][0]
-
- # set sane geometry width (a4-width) for linewidth = -1.
- maxlw = max (extra['linewidth'] + [-1])
- if maxlw < 0:
- # who the hell is 597 ?
- linewidth = '597pt'
- else:
- linewidth = '%d%s' % (maxlw, unit)
- s = s + '\geometry{%swidth=%s%s,bottom=11mm,headsep=2mm,top=12mm,headheight=2mm,footskip=5mm,%s}\n' % (papersize, linewidth, textheight, orientation)
-
-
- if 'twoside' in extra['latexoptions'] :
- s = s + '\geometry{twosideshift=4mm}\n'
-
- s = s + r'''