Hi
Many thanks to you all for your help. I thought you might like to know that
I found Simon's solution the best one.
Perhaps my minimal example was a little too pared down. In reality, I use
headers and footers on my music as well. So my minimal example begins:

Jean Abou's suggestion

\version "2.24.0"
\language "english"

\header {    title = "Praeludium" }

myScore = \score { \relative { c'4 d e f g }}

\markup ""
\pageBreak
\myScore

puts the header on the first page and the music on the second page.

With Simon's trick I can use a variable to push the header after the
initial page break thus:

\version "2.24.0"
\language "english"
hdr = \header {    title = "Praeludium" }
myScore = \score { \relative { c'4 d e f g }}
\bookpart { \markup \null }
\bookpart { \hdr  \myScore }

I guess my concept of how \pageBreak should work was gleaned from having to
use Microsoft Word. There you get a page break wherever you ask for one,
even if it makes no sense. (Followed by space above the first paragaph on
the page which is execrable. Don't get me started … )

On Mon, 12 Jun 2023 at 10:46, Valentin Petzel <valen...@petzel.at> wrote:

> Hello Silvain,
>
> it might help to understand that \pageBreak is not an instruction to
> insert a
> pageBreak. Think of \noPageBreak: This is a token that prevents a
> pageBreak to
> happen at the given place. Similarly \pageBreak is a token that enforces a
> pageBreak to happen at the given place (in other words the token must not
> happen within one page).
>
> Now, if you have
>
> [ page1 ]
> \pageBreak
> [ page2 ]
>
> and [page1] and [page2] are already two different pages the \pageBreak
> will not
> do anything, as there already is a pageBreak. This is similar to how
> adding
> \break at a line break will not cause an empty line. I’d suggest you do
>
> \pageBreak
> \markup\null
> \pageBreak
>
> The first \pageBreak will ensure that a new page is started, the second
> guarantees that the follwing content starts on a new page. All in all this
> will create an empty page, no matter where you insert it. You can even do
> a
> function for this:
>
> emptyPage =
> #(define-scheme-function () ()
>    (collect-music-aux add-score #{ \pageBreak #})
>    (add-text (markup #:null))
>    (collect-music-aux add-score #{ \pageBreak #}))
>
> \emptyPage
> \markup "a"
> \emptyPage
> \markup "b"
>
> Cheers,
> Valentin
>
> Am Montag, 12. Juni 2023, 08:28:36 CEST schrieb Silvain Dupertuis:
> > I tried this trick, which seems to work :
> >
> > \markup " "
> > \pageBreak
> >
> > produces a blank page
> >
> > It seems that there must be something on the page for \pageBreak to
> produce
> > a page.
> >
> > Of course, there is also possibilities to add blank pages to a PDF
> document.
> > Le 11.06.23 à 15:41, Paul McKay a écrit :
> > > \version "2.24.0"
> > > \language "en"
> > > myScore = \score { \relative { c'4 d e f g }}
> > > \pageBreak
> > > \myScore
>
>

Reply via email to