>>>>> "Peter" == Peter Chubb <[EMAIL PROTECTED]> writes:
Peter> I have a latex file containing fragments of lilypond code. It
Peter> includes other files using
Peter> \include{file}
What's more when I fix the regular expressions to match \include
instead of \mbinclude, things still don't work, because the python
code doesn't append `.tex' like it should for \include in LaTeX.
I'm not a python programmer, but here's a patch (against the
lilypond-book in 1.6.6)
--- /usr/bin/lilypond-book Sun Nov 24 01:25:19 2002
+++ /home/peterc/bin/lilypond-book Fri Feb 7 19:43:23 2003
@@ -160,6 +160,13 @@
include_path = [os.getcwd()]
+suffixes = [
+ '',
+ '.tex',
+ '.latex'
+]
+
+
# g_ is for global (?)
g_extra_opts = ''
g_here_dir = os.getcwd ()
@@ -542,8 +549,8 @@
},
'latex': {
- 'input': r'(?m)^[^%\n]*?(?P<match>\\mbinput{?([^}\t \n}]*))',
- 'include': r'(?m)^[^%\n]*?(?P<match>\\mbinclude{(?P<filename>[^}]+)})',
+ 'input': r'(?m)^[^%\n]*?(?P<match>\\input *"(?P<filename>[^"]+)")',
+ 'include': r'(?m)^[^%\n]*?(?P<match>\\include{(?P<filename>[^}]+)})',
'option-sep' : ',\s*',
'header': r"\n*\\documentclass\s*(\[.*?\])?",
'preamble-end': r'(?P<code>\\begin\s*{document})',
@@ -846,13 +853,17 @@
f = None
nm = ''
for a in include_path:
- try:
- nm = os.path.join (a, name)
- f = open (nm)
- __main__.read_files.append (nm)
+ for b in suffixes:
+ try:
+ nm = os.path.join (a, name + b)
+ print 'opening ' + nm + '\n'
+ f = open (nm)
+ __main__.read_files.append (nm)
+ break
+ except IOError:
+ pass
+ if f:
break
- except IOError:
- pass
if f:
sys.stderr.write ("Reading `%s'\n" % nm)
return (f.read (), nm)
_______________________________________________
Bug-lilypond mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-lilypond