From: Julien Rioux Date: Sun, 22 Jan 2012 15:17:03 +0000 (-0500) Subject: lilypond-book: Fix printfilename option in latex output. X-Git-Tag: release/2.15.27-1~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3df53397e259a474f2ba8daec711ca9795a2d59d;p=lilypond.git lilypond-book: Fix printfilename option in latex output. Add a linebreak so that the latex output corresponds with texinfo output. Also, protect against backslashes in path on windows. --- diff --git a/python/book_latex.py b/python/book_latex.py index be7c4e1883..f2aa5e36cf 100644 --- a/python/book_latex.py +++ b/python/book_latex.py @@ -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