PDF bookmarks without table of contents

Revision as of 23:30, 21 November 2025 by Lemzwerg (talk | contribs) (New category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

It is a known issue that there is no built-in way to obtain an outline in the PDF metadata without also printing a table of contents. This snippet provides a workaround.

\version "2.24"

#(define-markup-list-command (invisible-table-of-contents layout props) ()
   (interpret-markup-list layout props (make-table-of-contents-markup-list))
   (list empty-stencil))

\markuplist \invisible-table-of-contents

\tocItem \markup "Piece 1"
{ c' }

\tocItem \markup "Piece 2"
{ d' }