A patch for ly2dvi.

Fixes a couple of things:

Tagline only appears on the last page and doesn't clobber the footer
(which I use for copyright stuff).

Added a new header field - latexoptions, contents of which go in the
documentclass options. 

Added support for twosided output.

To use it, just put twoside in the latexoptions header field.

I have also adjusted the \geometry{headsep} to make space for the even
numbers and reduced the default twosideshift (which I always think is
too big).

Hope people find it useful.

Mark


--- ./ly2dvi    Wed Apr  4 08:43:42 2001
+++ ./ly2dvi    Fri Apr  6 13:34:19 2001
@@ -62,6 +62,7 @@
        'language' : [],
        'latexheaders' : [],
        'latexpackages' :  ['geometry'],
+       'latexoptions' : [],
        'papersize' : [],
        'pagenumber' : [1],
        'textheight' : [], 
@@ -387,16 +388,19 @@
        s = ""
        s = s + '% generation tag\n'
 
-       paper = ''
+       options = ''
 
        if extra['papersize']:
                try:
-                       paper = '[%s]' % ly_paper_to_latexpaper[extra['papersize'][0]]
+                       options = '%s' % ly_paper_to_latexpaper[extra['papersize'][0]]
                except:
                        warning (_ ("invalid value: %s") % `extra['papersize'][0]`)
                        pass
+
+       if extra['latexoptions']:
+               options = options + ',' + extra['latexoptions'][-1]
        
-       s = s + '\\documentclass%s{article}\n' % paper
+       s = s + '\\documentclass[%s]{article}\n' % options
 
        if extra['language']:
                s = s + r'\usepackage[%s]{babel}\n' % extra['language'][-1]
@@ -422,17 +426,23 @@
                linewidth = 597
        else:
                linewidth = extra['linewidth'][0]
-       s = s + '\geometry{width=%spt%s,headheight=2mm,headsep=0pt,footskip=2mm,%s}\n' 
% (linewidth, textheight, orientation)
+       s = s + 
+'\geometry{width=%spt%s,headheight=2mm,headsep=12pt,footskip=2mm,%s}\n' % (linewidth, 
+textheight, orientation)
 
+       if extra['latexoptions']:
+               s = s + '\geometry{twosideshift=4mm}\n'
+               
        s = s + r'''
 \usepackage[latin1]{inputenc}
 \input{titledefs}
 \makeatletter
 \renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\thefooter}}%
+\renewcommand{\@evenfoot}{\parbox{\textwidth}{\mbox{}\thefooter}}%
 '''
        
        if extra['pagenumber'] and extra['pagenumber'][-1] and extra['pagenumber'][-1] 
!= 'no':
                s = s + r'''
+\renewcommand{\@evenhead}{\parbox{\textwidth}%
+    {\mbox{}\textbf{\thepage}\hfill\small\theheader}}
 \renewcommand{\@oddhead}{\parbox{\textwidth}%
     {\mbox{}\small\theheader\hfill\textbf{\thepage}}}
 '''
@@ -449,9 +459,11 @@
                first = 0
 
        s = s + r'''
-\makeatletter
-\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\makelilypondtagline}}%
-\makeatother
+% I don't see why we want to clobber the footer here
+\vfill\hfill\parbox{\textwidth}{\mbox{}\makelilypondtagline}
+%\makeatletter
+%\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\makelilypondtagline}}%
+%\makeatother
 '''
        s = s + '\\end{document}'
 


_______________________________________________
Gnu-music-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/gnu-music-discuss

Reply via email to