From 7343fa0420aefbc1f55c516a01d3879bd1474451 Mon Sep 17 00:00:00 2001
From: Werner Lemberg <wl@gnu.org>
Date: Sun, 20 Sep 2009 11:33:05 +0200
Subject: [PATCH] [lilypond-book]: Minor documentation clarification.

---
 Documentation/application/lilypond-book.itely | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/Documentation/application/lilypond-book.itely b/Documentation/application/lilypond-book.itely
index defc539e03..fa22f2e72e 100644
--- a/Documentation/application/lilypond-book.itely
+++ b/Documentation/application/lilypond-book.itely
@@ -320,14 +320,20 @@ is trivial.
 
 If a greater number of systems is requested, a @TeX{} conditional must
 be used before the @code{\endinput}.  In this example, replace @q{2} by
-the number of systems you want in the output,
+the number of systems you want in the output.
 
 @example
 \def\betweenLilyPondSystem#1@{
-    \ifnum##1<2\else\endinput\fi
+    \ifnum##1<2\else\expandafter\endinput\fi
 @}
 @end example
 
+@noindent
+(Since @code{\endinput} immediately stops the processing of the current
+input file we need @code{\expandafter} to delay the call of @code{\endinput}
+after executing @code{\fi} so that the @code{\if}-@code{\fi} clause is
+balanced.)
+
 Remember that the definition of @code{\betweenLilyPondSystem} is
 effective until @TeX{} quits the current group (such as the @LaTeX{}
 environment) or is overridden by another definition (which is, in
@@ -345,7 +351,8 @@ This may be simplified by defining a @TeX{} macro
 
 @example
 \def\onlyFirstNSystems#1@{
-    \def\betweenLilyPondSystem##1@{\ifnum##1<#1\else\endinput\fi@}
+    \def\betweenLilyPondSystem##1@{%
+      \ifnum##1<#1\else\expandafter\endinput\fi@}
 @}
 @end example
 
-- 
2.39.5