From b7a5c3651df01f124a6b29eb7e3021ad33826509 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 18 Aug 2002 15:33:59 +0000 Subject: [PATCH] * lily/parser.yy (script_abbreviation): accept -_ script. * ly/script-init.ly (dashUnderscore): add NOTE-_ == portato (dash and dot) * scripts/lilypond-book.py (re_dict): add spaces after command sequences (LatexPaper.find_latex_dims): run latex in nonstopmode --- Documentation/user/refman.itely | 10 +++++--- NEWS | 45 +++++++++++++++++---------------- input/test/header-ifelse.ly | 12 +++++++++ scripts/lilypond-book.py | 27 +++++++++++++++----- 4 files changed, 62 insertions(+), 32 deletions(-) create mode 100644 input/test/header-ifelse.ly diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 2befc77fcf..8232b65d2d 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1779,6 +1779,7 @@ articulation. They are demonstrated here. c''4-|_"c-|" s4 c''4->_"c->" s4 c''4-^_"c-\\^{ }" s4 + c''4-__"c-\_" s4 } } @end lilypond @@ -1800,7 +1801,8 @@ using @code{^} and @code{_}. @cindex staccatissimo @cindex fermata @cindex stopped -@cindex staccato +@cindex staccato +@cindex portato @cindex tenuto @cindex upbow @cindex downbow @@ -1829,7 +1831,8 @@ using @code{^} and @code{_}. \property Score.LyricText \override #'font-shape = #'upright \context Staff \notes { c''-\accent c''-\marcato c''-\staccatissimo c''^\fermata - c''-\stopped c''-\staccato c''-\tenuto c''-\upbow + c''-\stopped c''-\staccato c''-\tenuto c''-\portato + c''-\upbow c''-\downbow c''^\lheel c''-\rheel c''^\ltoe c''-\rtoe c''-\turn c''-\open c''-\flageolet c''-\reverseturn c''-\trill c''-\prall c''-\mordent @@ -1839,7 +1842,8 @@ using @code{^} and @code{_}. } \context Lyrics \lyrics { accent__ marcato__ staccatissimo__ fermata - stopped__ staccato__ tenuto__ upbow + stopped__ staccato__ tenuto__ portato + upbow downbow__ lheel__ rheel__ ltoe rtoe__ turn__ open__ flageolet reverseturn__ trill__ prall__ mordent diff --git a/NEWS b/NEWS index 63cec29d6d..3666b32e1d 100644 --- a/NEWS +++ b/NEWS @@ -1,39 +1,40 @@ -New features in 1.5 +New features in 1.6 since 1.4 -* Development hosted at savannah.gnu.org - -* Tablature support. - -* Many speedups, many slowdowns. - -* More extensibility. - -* Figured bass support. +* Support for figured bass and tablature. * Completely rewritten beam formatting: provides much better output now. -* Completely rewritten grace note support. +* Completely revised and improved music font. -* Improved accidental handling and formatting. +* Completely rewritten MIDI import support. + +* Completely rewritten grace note support. Practically speaking this means +that grace notes can be slurred to normal normal notes. -* Better spacing: both globally and locally. It includes subtle +* Improved accidental handling and formatting: styles for producing +cautionaries may vary, and complex collisions between accidentals of a +chord are handled much better. + +* Better spacing: both globally and locally. This includes subtle details like optical stem spacing. -* More ancient notation support: mensural ligatures, ambitus (pitch -range) of voices, more shapes, etc. +* More support for ancient notation: mensural ligatures, ambitus +(pitch range) of voices, more shapes, etc. -* Piano notation: bracket pedals, directed arpeggios, arpeggio -brackets. +* More support for piano notation: bracket pedals, directed arpeggios, +arpeggio brackets. -* Some music entry optimizations. +* Easier music polyphonic music entry. -* Font completely revised and improved. +* More extensibility, many speedups and bugfixes -* Completely rewritten MIDI import support. +* The manual has been thoroughly revised. -* Manual thoroughly revised. +* Development is now hosted at http://savannah.gnu.org, and sources +can be downloaded through anonymous CVS. -* Many bugfixes. +* Support for windows: LilyPond is part of the cygwin distribution, +which comes with a user-friendly installer. diff --git a/input/test/header-ifelse.ly b/input/test/header-ifelse.ly new file mode 100644 index 0000000000..831e9d829a --- /dev/null +++ b/input/test/header-ifelse.ly @@ -0,0 +1,12 @@ +% #(define pieceTagLine "Copyright 2002 (C) Mutopia") + +#(if (not (defined? 'pieceTagLine)) + (define pieceTagLine (string-append "Jeremie " (numbers->string (ly-version)) " was here"))) + + +pieceTagLine = #pieceTagLine +\header { + tagline = \pieceTagLine + texidoc = "High level functionality can be accomplished with GUILE. Semantics aren't nice though." + } +\score { \notes { c4 }} diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 807e7db733..a2d6dd846a 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -88,7 +88,7 @@ def progress (s): program_version = '@TOPLEVEL_VERSION@' if program_version == '@' + 'TOPLEVEL_VERSION' + '@': - program_version = '1.5.53' + program_version = '1.6.0' # if set, LILYPONDPREFIX must take prevalence # if datadir is not set, we're doing a build and LILYPONDPREFIX @@ -164,6 +164,7 @@ class LatexPaper: 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") @@ -173,6 +174,7 @@ class LatexPaper: f = open(fname, "w") except IOError: error ("Error creating temporary file '%s'" % fname) + for s in self.m_document_preamble: f.write(s) f.write(r""" @@ -185,7 +187,11 @@ class LatexPaper: """) f.close() re_dim = re.compile(r"\\(\w+)\s+(\d+\.\d+)") - p = os.popen("latex %s" % fname) + + cmd = "latex '\\nonstopmode \input %s'" % fname + if verbose_p: + sys.stderr.write ("Invoking `%s' as pipe" % cmd) + p = os.popen(cmd) ln = p.readline() while ln: ln = string.strip(ln) @@ -464,20 +470,20 @@ re_dict = { 'include': r'(?m)^[^%\n]*?(?P\\mbinclude{(?P[^}]+)})', 'option-sep' : ',\s*', 'header': r"\n*\\documentclass\s*(\[.*?\])?", - 'preamble-end': r'(?P\\begin{document})', - 'verbatim': r"(?s)(?P\\begin{verbatim}.*?\\end{verbatim})", + 'preamble-end': r'(?P\\begin\s*{document})', + 'verbatim': r"(?s)(?P\\begin\s*{verbatim}.*?\\end{verbatim})", 'verb': r"(?P\\verb(?P.).*?(?P=del))", 'lilypond-file': r'(?m)^[^%\n]*?(?P\\lilypondfile\s*(\[(?P.*?)\])?\s*\{(?P.+)})', 'lilypond' : r'(?m)^[^%\n]*?(?P\\lilypond\s*(\[(?P.*?)\])?\s*{(?P.*?)})', 'lilypond-block': r"(?sm)^[^%\n]*?(?P\\begin\s*(\[(?P.*?)\])?\s*{lilypond}(?P.*?)\\end{lilypond})", 'def-post-re': r"\\def\\postLilypondExample", 'def-pre-re': r"\\def\\preLilypondExample", - 'usepackage-graphics': r"\usepackage{graphics}", + 'usepackage-graphics': r"\usepackage\s*{graphics}", 'intertext': r',?\s*intertext=\".*?\"', 'multiline-comment': no_match, 'singleline-comment': r"(?m)^.*?(?P(?P^%.*$\n+))", 'numcols': r"(?P\\(?Pone|two)column)", - 'multicols': r"(?P\\(?Pbegin|end){multicols}({(?P\d+)?})?)", + 'multicols': r"(?P\\(?Pbegin|end)\s*{multicols}({(?P\d+)?})?)", }, @@ -554,7 +560,7 @@ def bounding_box_dimensions(fname): return (0,0) def error (str): - sys.stderr.write (str + "\n Exiting ... \n\n") + sys.stderr.write ("\n\n" + str + "\nExiting ... \n\n") raise 'Exiting.' @@ -667,6 +673,7 @@ def scan_latex_preamble(chunks): paperguru.m_num_cols = 2 break + # Then we add everythin before \begin{document} to # paperguru.m_document_preamble so that we can later write this header # to a temporary file in find_latex_dims() to find textwidth. @@ -676,6 +683,10 @@ def scan_latex_preamble(chunks): continue paperguru.m_document_preamble.append(chunks[idx][1]) idx = idx + 1 + + if len(chunks) == idx: + error ("Didn't find end of preamble (\\begin{document})") + paperguru.find_latex_dims() def scan_texi_preamble (chunks): @@ -899,6 +910,8 @@ def read_doc_file (filename): # because we don't want to include files that are mentioned # inside a verbatim environment chunks = chop_chunks(chunks, 'verbatim', make_verbatim) + + chunks = chop_chunks(chunks, 'verb', make_verb) chunks = chop_chunks(chunks, 'multiline-comment', do_ignore) #ugh fix input -- 2.39.5