]> 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 591de34eea79f470d1594b8fd8cd7c627ffe2b1e..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}
@@ -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