diff options
author | Julien Rioux <jrioux@physics.utoronto.ca> | 2012-01-22 10:17:03 -0500 |
---|---|---|
committer | Julien Rioux <jrioux@physics.utoronto.ca> | 2012-01-23 14:42:54 -0500 |
commit | 3df53397e259a474f2ba8daec711ca9795a2d59d (patch) | |
tree | 3c84b42603b22dcf72fa35b66c7f892f96f86c39 /python/book_latex.py | |
parent | 9630731c95c8e1c64dc3588d8b37edce83dc9fa0 (diff) |
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.
Diffstat (limited to 'python/book_latex.py')
-rw-r--r-- | python/book_latex.py | 8 |
1 files 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 |