]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-book: Fix printfilename option in latex output.
authorJulien Rioux <jrioux@physics.utoronto.ca>
Sun, 22 Jan 2012 15:17:03 +0000 (10:17 -0500)
committerJulien Rioux <jrioux@physics.utoronto.ca>
Mon, 23 Jan 2012 19:42:54 +0000 (14:42 -0500)
Add a linebreak so that the latex output corresponds with
texinfo output. Also, protect against backslashes in path
on windows.

python/book_latex.py

index be7c4e18830c2b10a014c6f61e0a635c10ea7865..f2aa5e36cf6106e2c427fe30465bf9c1d446be6f 100644 (file)
@@ -132,7 +132,8 @@ Latex_output = {
 \fi
 }''',
 
-    PRINTFILENAME: '''\\texttt{%(filename)s}
+    PRINTFILENAME: r'''\texttt{%(filename)s}
+\linebreak
 ''',
 
     QUOTE: r'''\begin{quote}
@@ -298,7 +299,10 @@ class BookLatexOutputFormat (BookBase.BookOutputFormat):
         str = ''
         rep = snippet.get_replacements ();
         rep['base'] = basename.replace ('\\', '/')
-        str += self.output_print_filename (basename, snippet)
+        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