]> git.donarmstrong.com Git - lilypond.git/commitdiff
TCA pats
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 17 Jul 2002 13:18:59 +0000 (13:18 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 17 Jul 2002 13:18:59 +0000 (13:18 +0000)
Documentation/user/lilypond-book.itely
VERSION
input/test/ancient-font.ly
scripts/lilypond-book.py

index 6e732b9f416710b61dfbdf4c482c51d15a6654c5..4b01fb20ade20f4eddb1b70b7e181026163d3ac4 100644 (file)
@@ -111,11 +111,17 @@ or
 \lilypond@{ YOUR LILYPOND CODE @}
 @end example
 
-You can use whatever commands you like in the document preamble.
-Lilypond-book will send it to La@TeX{} to find out how wide the text is
-and adjust the linewidth variable in the paper definition of you music
-according to that. Lilypond-book also know about the @code{\onecolumn}
-and @code{\twocolumn} commands.
+You can use whatever commands you like in the document preamble,
+that is the part of the document before @code{\begin@{document@}}.
+@command{lilypond-book} will send it to La@TeX{} to find out how wide
+the text is and adjust the linewidth variable in the paper definition of
+you music according to that.
+
+After @code{\begin@{document@}} you must be a little more careful
+when you use commands that change the width of the text and how
+many columns there are. @command{lilypond-book} know about the
+@code{\onecolumn} and @code{\twocolumn} commands and the @code{multicols}
+environment from the multicol package.
 
 The music will be surrounded by @code{\preLilypondExample} and
 @code{\postLilypondExample}. The variables are 
diff --git a/VERSION b/VERSION
index 60212ec9f0a7c4138eddb9c1ebb1f9f8fefebb26..2e13323a11857090880ccd319e5e7f9033c82e0b 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
 PATCH_LEVEL=68
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=tca2
 
 # Use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 1ca2f408cbca905023877d9e26daa3b584138070..74ed5af99f63e296a66682caa6d135488a885061 100644 (file)
@@ -133,7 +133,7 @@ lowerVoice =  \context Staff = lowerNotes <
        \property Staff.KeySignature \set #'font-family = #'ancient
        \property Staff.KeySignature \override #'style = #'mensural
        \property Staff.Accidental \set #'font-family = #'ancient
-       \property Staff.Accidental \override #'style = #'mensural
+       \property Staff.Accidentalg \override #'style = #'mensural
        \property Staff.Custos \set #'font-family = #'ancient
        \property Staff.Custos \override #'style = #'mensural
        \property Staff.Custos \override #'neutral-position = #3
index eebf3ff3f4da20c5345b5918b52911294155297d..a922177558a1588a2dd56732a739929c2a77149f 100644 (file)
@@ -163,6 +163,7 @@ class LatexPaper:
        def __init__(self):
                self.m_document_preamble = []
                self.m_num_cols = 1
+               self.m_multicols = 1
        def find_latex_dims(self):
                if g_outdir:
                        fname = os.path.join(g_outdir, "lily-tmp.tex")
@@ -200,10 +201,14 @@ class LatexPaper:
                except:
                        pass
        def get_linewidth(self):
-               if self.m_num_cols == 2:
-                       return (self.m_textwidth-self.m_columnsep)/2
+               if self.m_num_cols == 1:
+                       w = self.m_textwidth
                else:
-                       return self.m_textwidth
+                       w = (self.m_textwidth - self.m_columnsep)/2
+               if self.m_multicols > 1:
+                       return (w - self.m_columnsep*(self.m_multicols-1)) \
+                          / self.m_multicols
+               return w
 
 
 class HtmlPaper:
@@ -444,6 +449,7 @@ re_dict = {
                  'multiline-comment': r"(?sm)\s*(?!@c\s+)(?P<code><!--\s.*?!-->)\s",
                  'singleline-comment': no_match,
                  'numcols': no_match,
+                 'multicols': no_match,
                 },
        
        'latex': {'input': r'(?m)^[^%\n]*?(?P<match>\\mbinput{?([^}\t \n}]*))',
@@ -463,6 +469,7 @@ re_dict = {
                  'multiline-comment': no_match,
                  'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>^%.*$\n+))",
                  'numcols': r"(?P<code>\\(?P<num>one|two)column)",
+                 'multicols': r"(?P<code>\\(?P<be>begin|end){multicols}({(?P<num>\d+)?})?)",
                  },
 
 
@@ -485,6 +492,7 @@ re_dict = {
                 'multiline-comment': r"(?sm)^\s*(?!@c\s+)(?P<code>@ignore\s.*?@end ignore)\s",
                 'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>@c.*$\n+))",
                 'numcols': no_match,
+                'multicols': no_match,
                 }
        }
 
@@ -807,7 +815,16 @@ def do_columns(m):
                return [('numcols', m.group('code'), 1)]
        if m.group('num') == 'two':
                return [('numcols', m.group('code'), 2)]
-       
+
+def do_multicols(m):
+       if __main__.format != 'latex':
+               return []
+       if m.group('be') == 'begin':
+               return [('multicols', m.group('code'), int(m.group('num')))]
+       else:
+               return [('multicols', m.group('code'), 1)]
+       return []
+
 def chop_chunks(chunks, re_name, func, use_match=0):
        newchunks = []
        for c in chunks:
@@ -975,6 +992,8 @@ def process_lilypond_blocks(chunks):#ugh rename
                        c = schedule_lilypond_block (c)
                elif c[0] == 'numcols':
                        paperguru.m_num_cols = c[2]
+               elif c[0] == 'multicols':
+                       paperguru.m_multicols = c[2]
                newchunks.append (c)
        return newchunks
 
@@ -1284,6 +1303,7 @@ def do_file(input_filename):
        chunks = chop_chunks(chunks, 'singleline-comment', do_ignore, 1)
        chunks = chop_chunks(chunks, 'preamble-end', do_preamble_end)
        chunks = chop_chunks(chunks, 'numcols', do_columns)
+       chunks = chop_chunks(chunks, 'multicols', do_multicols)
        #print "-" * 50
        #for c in chunks: print "c:", c;
        #sys.exit()