%% Generated by lilypond-book.py
%% Options: [alt=[image of music],printfilename,indent=0\mm,texidoc,line-width=160\mm]
\include "lilypond-book-preamble.ly"


% ****************************************************************
% Start cut-&-pastable-section
% ****************************************************************



\paper {
  #(define dump-extents #t)
  
  indent = 0\mm
  line-width = 160\mm
  force-assignment = #""
  line-width = #(- line-width (* mm  3.000000))
}

\layout {
  
}



% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "/main/src/gub/target/linux-x86/src/lilypond-git.sv.gnu.org--lilypond.git-stable-2.12/input/regression/bookparts.ly"
\sourcefileline 0
\version "2.12.0"

\header {
  texidoc = "A book can be split into several parts with different paper settings,
using @code{\\bookpart}.

Fonts are loaded into the top-level paper.
Page labels are also collected into the top-level paper."
}

#(set-default-paper-size "a6")

#(define-markup-command (roman-page-number layout props) ()
  (let ((page-number (chain-assoc-get 'page:page-number props)))
    (interpret-markup layout props (format #f "~@r" page-number))))

\book {
  \tocItem \markup "First part"
  \header { title = "Book with several parts" }
  \markup { First part }
  \markup { with default paper settings. }

  \bookpart {
    \paper {
      left-margin = 20\mm
      right-margin = 20\mm
      line-width = 65\mm
      evenHeaderMarkup = \markup \fill-line { \roman-page-number "SECOND PART" \null }
      oddHeaderMarkup = \markup \fill-line { \null "SECOND PART" \roman-page-number }
    }
    \tocItem \markup "Second part"
    \markup \justify { Second part, with different margins and page header. }
    { c' }
  }

  \tocItem \markup "Third part"
  \markup { Third part }
  \markuplines \table-of-contents
}



% ****************************************************************
% end ly snippet
% ****************************************************************
