#lilypond_binary = 'valgrind --suppressions=/home/hanwen/usr/src/guile-1.6.supp --num-callers=10 /home/hanwen/usr/src/lilypond/lily/out/lilypond'
-lilypond_binary = os.path.join ('@bindir@', 'lilypond')
+lilypond_binary = os.path.join ('@bindir@', 'lilypond-bin')
# only use installed binary when we're installed too.
if '@bindir@' == ('@' + 'bindir@') or not os.path.exists (lilypond_binary):
- lilypond_binary = 'lilypond'
+ lilypond_binary = 'lilypond-bin'
cmd = "latex '\\nonstopmode \input %s'" % fname
# Ugh. (La)TeX writes progress and error messages on stdout
# Redirect to stderr
- cmd += ' 1>/dev/stderr'
+ cmd = '(( %s >&2 ) >&- )' % cmd
status = ly.system (cmd, ignore_error = 1)
signal = 0xf & status
exit_status = status >> 8
'latex': {
- 'output-lilypond-fragment' : r'''\begin[eps,singleline,%s]{lilypond}
- \context Staff <
+ 'output-lilypond-fragment' : r'''\begin[singleline,%s]{lilypond}
\context Voice{
%s
}
- >
\end{lilypond}''',
'output-filename' : r'''\verb+%s+:\\
%% %s
'output-default-post': "\\def\postLilyPondExample{}\n",
'output-default-pre': "\\def\preLilyPondExample{}\n",
'usepackage-graphics': '\\usepackage{graphics}\n',
- 'output-eps': '\\noindent\\parbox{\\lilypondepswidth{%(fn)s.eps}}{\includegraphics{%(fn)s}}',
'output-noinline': r'''
%% generated: %(fn)s.eps
''',
# why do we have distinction between @mbinclude and @include?
'texi': {
- 'include': '(?m)^[^%\n]*?(?P<match>@mbinclude[ \n\t]+(?P<filename>[^\t \n]*))',
+ 'include': '(?m)^[^%\n]*?(?P<match>@mbinclude\s+(?P<filename>\S*))',
'input': no_match,
'header': no_match,
'preamble-end': no_match,
if not m:
error ("Latex documents must start with a \documentclass command")
if m.group (1):
- options = re.split (',[\n \t]*', m.group (1)[1:-1])
+ options = re.split (r',\s*', m.group (1)[1:-1])
else:
options = []
if 'twocolumn' in options:
options = []
(content, nm) = find_file (m.group ('filename'))
options.append ("filename=%s" % nm)
-
+ (path, base) = os.path.split (nm)
+
+ if path not in include_path:
+ include_path.append (path)
return [('lilypond', content, options)]
taken_file_names[basename] = 0
else:
taken_file_names[basename] = taken_file_names[basename] + 1
- basename = basename + "-%i" % taken_file_names[basename]
+ basename = basename + "-t%i" % taken_file_names[basename]
update_file (file_body, os.path.join (g_outdir, basename) + '.ly')
needed_filetypes = ['tex']
if 'noinline' in opts:
s = 'output-noinline'
elif format == 'latex':
- if 'eps' in opts:
- s = 'output-eps'
+ if 'quote' in opts:
+ s = 'output-latex-quoted'
else:
- if 'quote' in opts:
- s = 'output-latex-quoted'
- else:
- s = 'output-latex-noquote'
+ s = 'output-latex-noquote'
elif format == 'texi':
if 'quote' in opts:
s = 'output-texi-quoted'
cmd = r"latex '\nonstopmode \input %s'" % file
# Ugh. (La)TeX writes progress and error messages on stdout
# Redirect to stderr
- cmd += ' 1>/dev/stderr'
+ cmd = '(( %s >&2 ) >&- )' % cmd
+
ly.system (cmd)
ly.system ("dvips -E -o %s.eps %s" % (file, file))
map (to_eps, eps)