On 19/04/2015 09:33, [email protected] wrote:
I'm trying to make a title/cover page within LilyPond.  I'm aware of the 
possibility of workarounds:

lilypond-book/LaTeX; Strikes me as a bit ham-fisted, not sure if I would run 
into trouble as I've seen the warning about \pageBreak not playing well with 
lilypond-book

Create separate title/cover page in LaTeX and assemble the PDFs; seems a bit 
kludgy, though should work just fine.  Failing any more integrated approach I 
would probably do this.

I tried to find a LilyPond-only solution but have yet to succeed.  What I would 
like is to have a fairly simple page; composer, title, and instrument.  All 
centered, in a column, all in a fairly large font with the title being quite 
large.  It would be very nice if these items could be taken from those relative 
fields in the overall \header{} block.

Does such a solution already exist?  If not, isn't this something that should 
be available?

Here's one way of doing it, along with a ToC:


\version "2.19.18"

date = #(strftime "%d/%m/%Y" (localtime (current-time)))

\paper {
  #(define (print-positive-page-number layout props arg)
     (if (> (chain-assoc-get 'page:page-number props -1) 0)
         (create-page-number-stencil layout props arg)
         empty-stencil))
  
  #(define (not-last-page layout props arg)
     (if (and (chain-assoc-get 'page:is-bookpart-last-page props #f)
              (chain-assoc-get 'page:is-last-bookpart props #f))
         empty-stencil
         (interpret-markup layout props arg)))
  
  print-all-headers = ##f
  first-page-number = -1
  tocItemMarkup = \tocItemWithDotsMarkup
  oddHeaderMarkup = \markup \fill-line { " " }
  evenHeaderMarkup = \oddHeaderMarkup
  oddFooterMarkup = \markup \fill-line { \column { \fontsize #-1
    \on-the-fly #not-first-page \on-the-fly #not-last-page 
    \on-the-fly #print-positive-page-number \fromproperty #'page:page-number-string
    \on-the-fly #last-page \fromproperty #'header:tagline
  } }
  evenFooterMarkup = \oddFooterMarkup
}

\header {
  title = \markup {
    \lower #50 \left-align \center-column { 
      \fontsize #4 \bold "Overall Title"
    }
  }
  subtitle = \markup {
    \lower #5 \left-align \center-column { 
      \fontsize #2 \bold "Overall Subtitle"
    }
  }
  subsubtitle = \markup {
    \lower #4 \left-align \center-column { 
      \fontsize #1 \bold "Overall Subsubtitle"
    }
  }
  tagline = \markup {
    \fontsize #-3.5 {
      \override #'(box-padding . 1.0) \override #'(baseline-skip . 2.7) \box \center-column {
        \line {
          Engraved on \date using \with-url #"http://lilypond.org/";
          \line {
            LilyPond \simple #(lilypond-version) (http://lilypond.org/)
          }
        }
      }
    }
  }
}

\pageBreak

\markuplist \table-of-contents
\markup \null

\bookpart {
  \paper {
    print-page-number = ##t
  }
  \header { 
    title = \markup { \fromproperty #'toc:number " Piece One" } % overrides overall title
    subtitle = ##f % prevent overall subtitle from appearing
    subsubtitle = ##f % prevent overall subsubtitle from appearing
    composer = "Composer One"
  } 
  \tocItem \markup { 1. Piece One }
  \relative c' { c1 }
}

\bookpart {
  \paper {
    print-page-number = ##t
  }
  \header { 
    title = \markup { \fromproperty #'toc:number " Piece Two" } % overrides overall title
    subtitle = ##f % prevent overall subtitle from appearing
    subsubtitle = ##f % prevent overall subsubtitle from appearing
    composer = "Composer Two"
  }
  \tocItem \markup { 2. Piece Two }
  \relative c' { c1 }
}

\bookpart {
  \paper {
    print-page-number = ##t
  }
  \header {
    title = \markup { \fromproperty #'toc:number " Piece Three" } % overrides overall title
    subtitle = ##f % prevent overall subtitle from appearing
    subsubtitle = ##f % prevent overall subsubtitle from appearing
    composer = "Composer Three"
  }
  \tocItem \markup { 3. Piece Three }
  \relative c' { c1 }
}
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to