lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Create blank page based on page-number (if odd)


From: Yoshiaki Onishi
Subject: Create blank page based on page-number (if odd)
Date: Sat, 15 Mar 2025 09:54:38 -0400

> Hello. I'm writing a book and after my ToC I need a blank page ("this page is 
> left blank purposefully") only if this blank page would have an odd page 
> number. If it falls under an even page number it must not be printed. I've 
> looked in the manual and didn't find an answer... any help would be 
> appreciated.
> 
> %%MWE starts here
> \version "2.25.20"
> \book {
> \markup "First page with nice graphics."
> \pageBreak
> \markup "Second page with a ToC that we can't know for sure how big it will 
> be."
> \pageBreak
> \markup "Conditional page that is only printed if it's page number is odd."
> } % end of book
> %%MWE ends here

Dear Lucas,

I spent a little bit of time trying to strategize how this could be 
accomplished, and I have gathered that:

1. oddHeaderMarkup (or its footer counterpart) in the \paper column won’t be 
helpful here because you are trying to have the “blank page” notice on an odd 
page only at your command
2. Because of 1., I thought about creating define-markup-command to create a 
scheme function that:
   a. Upon placing a \label on the said (possibly odd-numbered) page in 
question,
   b. The said scheme function will use \page-ref function 
(https://lilypond.org/doc/v2.25/Documentation/notation/reference-to-page-numbers)
 and if the page number is determined odd (if (odd? (…))),
   c. You have the “blank page” message show up.
3. Place the markup with the custom function in your score.

But with my normal work as of late, time ran out before I could implement it. 
So I can’t really help much here aside from possibly suggesting above.

I know it may not be ideal, but I suppose a bit easier (but more 
labor-intensive) way is to create the TOC once the rest of the book is done, 
then manually add the “blank page” message as necessary.

Sorry I can’t be much of help here…curious what others might come up with, 
though.

Regards,
Yoshi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]