From: Werner Lemberg Date: Thu, 1 Jan 2009 18:56:35 +0000 (+0100) Subject: lilypond-book: Improve LaTeX wrapper. X-Git-Tag: release/2.12.2-1~32^2~17^2~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=229244c14ea3a7dae98c2bd5511106c75e729613;p=lilypond.git lilypond-book: Improve LaTeX wrapper. Using `\expandafter' ensures that the if-clause is finished before executing the \{pre,post}LilyPondExample hooks. This allows usage of other TeX conditionals within those two macros without getting warnings (or even hard to find errors in case of more complex macros). --- diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 2564aea75f..a0ee6fb0ad 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -719,27 +719,27 @@ output = { OUTPUT: r'''{%% \parindent 0pt \ifx\preLilyPondExample \undefined - \relax \else - \preLilyPondExample + \expandafter\preLilyPondExample \fi \def\lilypondbook{}%% \input %(base)s-systems.tex \ifx\postLilyPondExample \undefined - \relax \else - \postLilyPondExample + \expandafter\postLilyPondExample \fi }''', PRINTFILENAME: '''\\texttt{%(filename)s} ''', - QUOTE: r'''\begin{quotation}%(str)s + QUOTE: r'''\begin{quotation} +%(str)s \end{quotation}''', VERBATIM: r'''\noindent -\begin{verbatim}%(verb)s\end{verbatim}''', +\begin{verbatim}%(verb)s\end{verbatim} +''', VERSION: program_version,