}
>
\end{mudela}""",
- 'output-mudela':r"""\begin%s{mudela}
+ 'output-mudela':r"""\begin[%s]{mudela}
%s
\end{mudela}""",
'output-verbatim': r"""\begin{verbatim}%s\end{verbatim}""",
'mudela-file': '@mudelafile(\[[^\\]]+\])?{([^}]+)}',
'mudela' : '@mudela(\[.*?\])?{(.*?)}',
'mudela-block': r"""(?s)@mudela(\[.*?\])?(.*?)@end mudela""",
- 'interesting-cs': r"""[\\@](node|mudelagraphic)""",
+ 'interesting-cs': r"""[\\@](chapter|section)""",
'comma-sep' : ', *',
}
}
# urg: breaks on \include of full score
# Use nofly option if you want to \include full score.
- if not 'nofly' in opts and not re.search ('\\\\score', body):
- opts.append ('fly')
+ if 'nofly' not in opts and not re.search ('\\\\score', body):
+ opts.append ('fragment')
- if 'fragment' in opts or 'singleline' in opts:
+ if 'fragment' in opts and 'nosingleline' not in opts:
+ opts.append ('singleline')
+
+ if 'singleline' in opts:
l = -1.0;
else:
l = latex_linewidths[cols][paper][latex_size]
- if 'fly' in opts:
+ if 'relative' in opts:
+ body = '\\relative c { %s }' % body
+
+
+ if 'fragment' in opts:
body = r"""\score {
- \notes\relative c {
- %s
- }
+ \notes { %s }
\paper { }
}""" % body
opts = uniq (opts)
optstring = string.join (opts, ' ')
optstring = re.sub ('\n', ' ', optstring)
-
+
body = r"""
%% Generated by mudela-book.py; options are %s
\include "paper%d.ly"
str = f.read (-1)
opts = match.group (1)
if opts:
- opts = re.split (',[ \n\t]*', opts[1:-1])
+ opts = opts[1:-1]
+ opts = re.split (',[ \n\t]*', opts)
else:
opts = []
opts .append ('nofly')
str_opts = string.join (opts, ',')
- if str_opts: str_opts = '[' + str_opts + ']'
-
str = ("%% copied from file `%s'\n" % full_path) + str
return get_output ('output-mudela') % (str_opts, str)
def find_mudela_chunks (str):
"""Find mudela blocks, while watching for verbatim. Returns
- (STR,MUDS) with \mudelagraphic substituted for the blocks in STR,
+ (STR,MUDS) with substituted for the blocks in STR,
and the blocks themselves MUDS"""
chunks = []
pass
elif g == 'chapter':
(chapter, section, count) = (chapter + 1, 0, 0)
- elif g == 'section' or g == 'node':
+ elif g == 'section':
(section, count) = (section + 1, 0)