Jump to content

Table of contents: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m New category
Tags: Mobile edit Mobile web edit
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
A table of contents is included using <code>\markuplist \table-of-contents</code>. The TOC items are added with the <code>\tocItem</code> command.
A table of contents is included using <code>\markuplist \table-of-contents</code>. The TOC items are added with the <code>\tocItem</code> command.


<lilypond version="2.24.0">
<lilypond version="2.24">
#(set-default-paper-size "a6")
#(set-default-paper-size "a6")


Line 26: Line 26:
[[Category:Paper and layout]]
[[Category:Paper and layout]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]

Latest revision as of 23:37, 21 November 2025

A table of contents is included using \markuplist \table-of-contents. The TOC items are added with the \tocItem command.

\version "2.24"

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

\book {
  \markuplist \table-of-contents
  \pageBreak
  \tocItem \markup { The first score }
  \score {
    {
      c'1 \pageBreak
      \mark \default \tocItem \markup { Mark A }
      d'1
    }
  }
  \pageBreak
  \tocItem \markup { The second score }
  \score {
    { e'1 }
    \header { piece = "Second score" }
  }
}