]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/book_latex.py
Issue 2513: Build: add -fno-tree-vrp to CXXFLAGS for gcc 4.7.0
[lilypond.git] / python / book_latex.py
index 398d88c42c229b728edf9e81866934bf075758c4..f2aa5e36cf6106e2c427fe30465bf9c1d446be6f 100644 (file)
@@ -125,14 +125,15 @@ Latex_output = {
   \expandafter\preLilyPondExample
 \fi
 \def\lilypondbook{}%%
-\input %(base)s-systems.tex
+\input{%(base)s-systems.tex}
 \ifx\postLilyPondExample \undefined
 \else
   \expandafter\postLilyPondExample
 \fi
 }''',
 
-    PRINTFILENAME: '''\\texttt{%(filename)s}
+    PRINTFILENAME: r'''\texttt{%(filename)s}
+\linebreak
 ''',
 
     QUOTE: r'''\begin{quote}
@@ -189,7 +190,7 @@ def get_latex_textwidth (source, global_options):
     cmd = '%s %s' % (global_options.latex_program, tmpfile);
     ly.debug_output ("Executing: %s\n" % cmd);
     run_env = os.environ.copy()
-    run_env['LC_ALL:'] = 'C'
+    run_env['LC_ALL'] = 'C'
 
     ### unknown why this is necessary
     universal_newlines = True
@@ -297,8 +298,11 @@ class BookLatexOutputFormat (BookBase.BookOutputFormat):
     def snippet_output (self, basename, snippet):
         str = ''
         rep = snippet.get_replacements ();
-        rep['base'] = basename
-        str += self.output_print_filename (basename, snippet)
+        rep['base'] = basename.replace ('\\', '/')
+        rep['filename'] = os.path.basename (snippet.filename).replace ('\\', '/')
+        rep['ext'] = snippet.ext
+        if PRINTFILENAME in snippet.option_dict:
+            str += self.output[PRINTFILENAME] % rep
         if VERBATIM in snippet.option_dict:
             rep['verb'] = snippet.verb_ly ()
             str += self.output[VERBATIM] % rep