]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/music-functions.scm: Make phrasing slurs follow voice direction
authorErik Sandberg <mandolaerik@gmail.com>
Tue, 6 Dec 2005 11:25:30 +0000 (11:25 +0000)
committerErik Sandberg <mandolaerik@gmail.com>
Tue, 6 Dec 2005 11:25:30 +0000 (11:25 +0000)
        * scripts/lilypond-book.py: Introduce option
        --preserve-line-breaks, for usage with srcltx

ChangeLog
scm/music-functions.scm
scripts/lilypond-book.py

index e68c39c3933f06fa148ec39dfdcfb1057c017627..3c508926f60be8273a79881f4f4d10fbdf03f019 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-06 Erik Sandberg  <mandolaerik@gmail.com>
+
+       * scm/music-functions.scm: Make phrasing slurs follow voice direction
+
+       * scripts/lilypond-book.py: Introduce option
+        --preserve-line-breaks, for usage with srcltx
+
 2005-12-06  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * scm/output-lib.scm (print-circled-text-callback): draw circle
index ce4af76c064d378045ce7d305589a00ec5bd74d3..36c4b84877c43c7daa6bfb133baa6915a7ccdc5c 100644 (file)
@@ -285,7 +285,7 @@ i.e.  this is not an override"
              'grob-property gprop))
 
 (define direction-polyphonic-grobs
-  '(Stem Tie Rest Slur Script TextScript Dots DotColumn Fingering))
+  '(Stem Tie Rest Slur PhrasingSlur Script TextScript Dots DotColumn Fingering))
 
 (define-safe-public (make-voice-props-set n)
   (make-sequential-music
index a9346b830a42e97ddc317f41914c7d8203899106..7f8a8f4fb4106f983a1a89285a0a6f752e9c27fb 100644 (file)
@@ -99,8 +99,11 @@ option_definitions = [
        (_ ("COMMAND"), 'P', 'process',
          _ ("process ly_files using COMMAND FILE...")),
        ('', '', 'psfonts',
-        _ ('''extract all PostScript fonts into INPUT.psfonts for LaTeX
-        must use this with dvips -h INPUT.psfonts''')),
+         _ ('''extract all PostScript fonts into INPUT.psfonts for LaTeX
+         must use this with dvips -h INPUT.psfonts''')),
+       ('', '', 'keep-line-breaks',
+         _ ('''do not alter the number of newline characters in output
+         .tex files. Useful when the LaTeX package srcltx is used''')),
        ('', 'V', 'verbose',
          _ ("be verbose")),
        ('', 'v', 'version',
@@ -117,6 +120,7 @@ if '@bindir@' == ('@' + 'bindir@') or not os.path.exists (lilypond_binary):
        lilypond_binary = 'lilypond'
 
 psfonts_p = 0
+srcltx_p = 0
 use_hash_p = 1
 format = 0
 output_name = ''
@@ -471,7 +475,7 @@ output = {
 
        ##
        LATEX: {
-               OUTPUT: r'''{%%
+               OUTPUT: r'''{
 \parindent 0pt
 \catcode`\@=12
 \ifx\preLilyPondExample \undefined
@@ -479,7 +483,7 @@ output = {
 \else
   \preLilyPondExample
 \fi
-\def\lilypondbook{}%%
+\def\lilypondbook{}
 \input %(base)s-systems.tex
 \ifx\postLilyPondExample \undefined
   \relax
@@ -491,15 +495,11 @@ output = {
                PRINTFILENAME: '''\\texttt{%(filename)s}
        ''',
 
-               QUOTE: r'''\begin{quotation}
-%(str)s
-\end{quotation}
-''',
+               QUOTE: r'''\begin{quotation}%(str)s
+\end{quotation}''',
 
                VERBATIM: r'''\noindent
-\begin{verbatim}
-%(verb)s\end{verbatim}
-''',
+\begin{verbatim}%(verb)s\end{verbatim}''',
 
                FILTER: r'''\begin{lilypond}[%(options)s]
 %(code)s
@@ -1080,7 +1080,9 @@ class Lilypond_snippet (Snippet):
                        if VERBATIM in self.option_dict:
                                verb = self.substring ('code')
                                str += (output[LATEX][VERBATIM] % vars ())
-
+                       elif srcltx_p:
+                               breaks = self.substring ('code').count ("\n")
+                               str += "".ljust (breaks, "\n").replace("\n","%\n")
                str += (output[LATEX][OUTPUT] % vars ())
                if QUOTE in self.option_dict:
                        str = output[LATEX][QUOTE] % vars ()
@@ -1568,7 +1570,7 @@ def do_file (input_filename):
                raise Compile_error
 
 def do_options ():
-       global format, output_name, psfonts_p
+       global format, output_name, psfonts_p, srcltx_p
        global filter_cmd, process_cmd, verbose_p
 
        (sh, long) = ly.getopt_args (option_definitions)
@@ -1614,6 +1616,10 @@ def do_options ():
                        verbose_p = 1
                elif o == '--psfonts':
                        psfonts_p = 1 
+               elif o == '--keep-line-breaks':
+                       srcltx_p = 1 
+                       for s in (OUTPUT, QUOTE, VERBATIM):
+                               output[LATEX][s] = output[LATEX][s].replace("\n"," ")
                elif o == '--warranty' or o == '-w':
                        if 1 or status:
                                ly.warranty ()