lilypond-user
[Top][All Lists]
Advanced

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

Re: Inserting a "Preface" into Table of Contents


From: Thomas Morley
Subject: Re: Inserting a "Preface" into Table of Contents
Date: Fri, 14 Jun 2013 00:27:44 +0200

2013/6/13  <address@hidden>:
>
>   Howdy!
>
>               I have a Table of Contents. The TOC is the first file and
> has the
> first page number. All the rest of the pieces are correctly inserted into
> the TOC. I have a Preface that appears before the TOC, has a roman numeral
> like page numbering and is inserted as a pdf after compilation. I want the
> Preface to
>  appear in the TOC with its page number. How can I manually insert the  entry
> for  the Preface into the TOC??
>
>           thanx - steve
>
>
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user

Hi steve,

try:

\version "2.17.20"

tocInsert =
#(define-music-function (parser location text) (markup?)
   (add-toc-item! 'tocInsertMarkup text))

\paper {
  tocInsertMarkup = \markup
            \line { \fromproperty #'toc:text  }
}

\book {
  \markuplist \table-of-contents
  \tocInsert \markup \fill-line { "Preface-one" "I" }
  \tocInsert \markup \fill-line { "Text-two" "I" }


  \tocItem Allegro
  \markup \null

  \pageBreak

  \tocInsert \markup \fill-line { "Text-three" "II" }
  \tocItem Largo
  \markup \null
}


HTH,
  Harm



reply via email to

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