From 3df53397e259a474f2ba8daec711ca9795a2d59d Mon Sep 17 00:00:00 2001 From: Julien Rioux Date: Sun, 22 Jan 2012 10:17:03 -0500 Subject: [PATCH] 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. --- python/book_latex.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.39.5