I am working on a music-book using LilyPond with different languages (here English and German). I created a minimal working example (MWE) referring to a snippet that can be found here in the LilyPond Documentary. This is what I made:

\version "2.20.0"

\paper { indent = #0 }

#(define-markup-command (toc-line layout props label text)
  (symbol? markup?)
  (interpret-markup layout props
   (markup #:fill-line (text #:page-ref label "8" "?"))))

\label #'Inh
\markup {
  \column {
    \large \fill-line { \null \bold "Inhaltsverzeichnis" \null }
    \toc-line #'Inh "Inhaltsverzeichnis"
    \toc-line #'ersterTeil "Erster Teil"
    \toc-line #'zweiterTeil "Zweiter Teil"
    \toc-line #'dritterTeil "Dritter Teil"
    \toc-line #'vierterTeil "Vierter Teil"
    \toc-line #'fünfterTeil "Fünfter Teil"
    \toc-line #'sechsterTeil "Sechster Teil"

\markup {  \vspace #1 }

%Table of Contens
\label #'toc
\markup {
  \column {
    \large \fill-line { \null \bold \italic "Table Of Contents" \null }
    \toc-line #'toc "Table Of Contents"
    \toc-line #'firstPart "First Part"
    \toc-line #'secondPart "Second Part"
    \toc-line #'thirdPart "Third Part"
    \toc-line #'fourthPart "Fourth Part"
    \toc-line #'fifthPart "Fifth Part"
    \toc-line #'sixthPart "Sixth Part"

\markup {  \vspace #1 }

\label #'ersterTeil
\label #'firstPart
\score { \relative c' { c4 d e f g1 } \header { piece = "Erster Teil - First Part"}}

\label #'zweiterTeil
\label #'secondPart
\score { \relative c' { d4 f g d c1 }\header { piece = "Zweiter Teil -  Second Part"}}

\label #'dritterTeil
\label #'thirdPart
\score { \relative c' { e4 f g e c1 }\header { piece = "Dritter Teil - Third Part"}}

\label #'vierterTeil
\label #'fourthPart
\score { \relative c' { c8( d e f) c( d e d c1) }\header { piece = "Vierter Teil - Fourth Part"}}

\label #'fünfterTeil
\label #'fifthPart
\score { \relative c' { f8 g f g e4 d c1 }\header { piece = "Sechster Teil - Sixth Part"}}

\label #'sechsterTeil
\label #'sixthPart
\score { \relative c' { c4( g' f d c1) }\header { piece = "Siebter Teil -  Seventh Part"}}


LilyPond - Table of Contents

For some reasons I would like to apply a different approach, that can be found in the appropriate section of the LilyPond Documentory for "Table of Contents", basically suggesting the preconfigured commands \table-of-contents and \tocItem in a way like this:

\markuplist \table-of-contents

\tocItem \markup "Erste Partitur"
\score {
    c'4  % ...
    \tocItem \markup "Ein bestimmter Punkt innerhalb der ersten Partitur"
    d'4  % ...

\tocItem \markup "zweite Partitur"
\score {
    e'4 % ...

Does anyone know how I can use this approach with a similar outcome as in my example, getting two tables with two different languages?

The Project can be found here on GitHub.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.