Jump to content

PDF bookmarks without table of contents: Difference between revisions

From LilyPond wiki
Create
 
m New category
Tags: Mobile edit Mobile web edit
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
It is a [https://gitlab.com/lilypond/lilypond/-/issues/6300 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.
It is a [https://gitlab.com/lilypond/lilypond/-/issues/6300 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.


<lilypond version="2.24.0">
<lilypond version="2.24">
#(define-markup-list-command (invisible-table-of-contents layout props) ()
#(define-markup-list-command (invisible-table-of-contents layout props) ()
   (interpret-markup-list layout props (make-table-of-contents-markup-list))
   (interpret-markup-list layout props (make-table-of-contents-markup-list))
Line 16: Line 16:


[[Category:Workaround]]
[[Category:Workaround]]
[[Category:Snippet]]

Latest revision as of 23:30, 21 November 2025

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' }