X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fbook_latex.py;h=f2aa5e36cf6106e2c427fe30465bf9c1d446be6f;hb=refs%2Fremotes%2Forigin%2Fmaster;hp=398d88c42c229b728edf9e81866934bf075758c4;hpb=ab8dfc6e8f3de3cefc8fab09a4993acaec460720;p=lilypond.git diff --git a/python/book_latex.py b/python/book_latex.py index 398d88c42c..f2aa5e36cf 100644 --- a/python/book_latex.py +++ b/python/book_latex.py @@ -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} @@ -189,7 +190,7 @@ def get_latex_textwidth (source, global_options): cmd = '%s %s' % (global_options.latex_program, tmpfile); ly.debug_output ("Executing: %s\n" % cmd); run_env = os.environ.copy() - run_env['LC_ALL:'] = 'C' + run_env['LC_ALL'] = 'C' ### unknown why this is necessary universal_newlines = True @@ -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