Dots in TOC

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dots in TOC

Vaughan McAlley
Hi,

I’ve tried adding an extra line of description to the title within a TOC entry (it states the voicing of each choral movement). The last movement has a description longer than the title, so the dots don’t reach the title. I’ve tried overriding X-extents within the markup, but it doesn't seem to make any difference.

Vaughan

\version "2.19.83"

\markuplist \table-of-contents
\pageBreak

\bookpart {
  \tocItem \markup \left-column {
    "Quite long title of the first piece"
    "Short description"
  }
  \score { c'1 }
}
\pageBreak

\bookpart {
  \tocItem \markup \left-column {
    "Short title"
    % \override X-extent of this string?
    "Longer more detailed description of second piece"
  }
  \score { d'1 }
}

mySpacer = #(make-string 20 #\space)

\paper {
  tocItemMarkup = \markup \column {
    \fontsize #1.5 {
      \override #'(line-width . 120)
      \fill-with-pattern #1 #RIGHT .
      \concat { \mySpacer \fromproperty #'toc:text }
      \concat { \fromproperty #'toc:page \mySpacer }
    }
    \vspace #1.5
  }
}



TOC.png (27K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dots in TOC

Aaron Hill
On 2020-02-06 4:40 am, Vaughan McAlley wrote:

> Hi,
>
> I’ve tried adding an extra line of description to the title within a
> TOC
> entry (it states the voicing of each choral movement). The last
> movement
> has a description longer than the title, so the dots don’t reach the
> title.
> I’ve tried overriding X-extents within the markup, but it doesn't seem
> to
> make any difference.

You could use either \with-dimensions or \with-dimensions-from to adjust
the effective extents of the markup.  But likely the better option is
this:

%%%%
\version "2.19.83"

\paper {
   tocItemMarkup = \tocItemWithDotsMarkup
   tocDescriptionMarkup = \markup \italic \fromproperty #'toc:text
}

tocDescription = #(define-music-function (text) (markup?)
   (add-toc-item! 'tocDescriptionMarkup text))

\book {
   \markuplist \table-of-contents
   \tocItem "One"
   \tocDescription "Lorem ipsum"
   \tocItem "Two"
   \tocDescription "Dolor sit amet"
   \markup \null
}
%%%%

You can follow pattern this to add any number of other specialized items
with custom markup.


-- Aaron Hill