]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/lilypond-latex.py
*** empty log message ***
[lilypond.git] / scripts / lilypond-latex.py
index faec0d33f99f54ab3b9f8e685fc24c45749de4fa..069b5452a30460be00e1cac7d02ebe7956b360b7 100644 (file)
@@ -82,7 +82,7 @@ global _;_=ly._
 global re;re = ly.re
 
 # lilylib globals
-program_name = 'lilypond'
+program_name = os.path.split (sys.argv[0])[1]
 program_version = '@TOPLEVEL_VERSION@'
 # input without \book, use classic latex definitions
 classic_p = 0
@@ -118,9 +118,9 @@ option_definitions = [
        #junkme?
        ('', '', 'no-lily', _ ("don't run LilyPond")),
        #junkme? 
-       ('', 'm', 'no-paper', _ ("produce MIDI output only")),
+       ('', 'm', 'no-layout', _ ("produce MIDI output only")),
        
-       (_ ("FILE"), 'o', 'output', _ ("write output to FILE")),
+       (_ ("FILE"), 'o', 'output', _ ("write output to FILE (suffix will be added)")),
        (_ ('RES'), '', 'preview-resolution',
         _ ("set the resolution of the preview to RES")),
        ('', 'p', 'pdf', _ ("generate PDF output")),
@@ -157,6 +157,7 @@ lilypond_binary = os.path.join ('@bindir@', 'lilypond')
 if '@bindir@' == ('@' + 'bindir@') or not os.path.exists (lilypond_binary):
        lilypond_binary = 'lilypond'
 
+lilypond_binary += ' --format=tex ' 
 
 ## Init to empty; values here take precedence over values in the file
 extra_init = {
@@ -173,7 +174,7 @@ extra_init = {
 header_fields = extra_init.keys ()
 
 include_path = ['.']
-paper_p = 1
+layout_p = 1
 
 output_name = ''
 
@@ -216,11 +217,11 @@ def run_lilypond (files, dep_prefix):
        ## UGHr
        if pseudo_filter_p:
                opts += ' --output=lelie'
-       if paper_p:
+       if layout_p:
                opts += ' ' + string.join (map (lambda x : '--header=' + x,
                                                header_fields))
        else:
-               opts = opts + ' --no-paper'
+               opts = opts + ' --no-layout'
        if safe_mode_p:
                opts = opts + ' --safe-mode'
 
@@ -272,7 +273,7 @@ def analyse_lilypond_output (filename, extra):
        # search only the first 10k
        s = s[:10240]
        for x in header_fields:
-               m = re.search (r'\\def\\lilypondpaper%s{([^}]*)}' % x, s)
+               m = re.search (r'\\def\\lilypondlayout%s{([^}]*)}' % x, s)
                if m:
                        set_setting (extra, x, m.group (1))
 
@@ -617,9 +618,9 @@ for opt in options:
                        targets.append ('PNG')
        elif o == '--preview-resolution':
                preview_resolution = string.atoi (a)
-       elif o == '--no-paper' or o == '-m':
+       elif o == '--no-layout' or o == '-m':
                targets = ['MIDI'] 
-               paper_p = 0
+               layout_p = 0
        elif o == '--output' or o == '-o':
                output_name = a
        elif o == '--safe-mode' or o == '-s':