Menu

#4649 NR: show how a custom tocItemMarkup can be used in \paper block

Verified
Documentation
2015-11-26
2015-10-29
No

http://www.lilypond.org/doc/v2.19/Documentation/notation/table-of-contents

At the bottom of the page there is this part:

"""
Dots can be added to fill the line between an item and its page number:

\header { tagline = ##f }
\paper {
tocItemMarkup = \tocItemWithDotsMarkup
}
"""

which is useful, but I think that it would be better to show how a custom tocItemMarkup can use that function. IIUC, the only (?) way is redefining the variable:

\paper {
tocItemMarkup = \markup { \fill-line { \fromproperty #'toc:text \fromproperty #'toc:page } }
tocItemMarkup = \tocItemWithDotsMarkup
}

This may be obvious for a programmer who knows the concept of variable, but not obvious for a musician.

Discussion

  • Federico Bruni

    Federico Bruni - 2015-10-29

    I would add also an example of \fill-with-pattern in the context of a toc, in order to show how you can customize it:

    \paper {
      tocItemMarkup = \markup { \fill-line {
        \override #'(line-width . 70)
        \fill-with-pattern #1.5 #CENTER . \fromproperty #'toc:text \fromproperty #'toc:page
        }
      }
    }
    
     
  • Trevor Daniels

    Trevor Daniels - 2015-10-31
    • status: New --> Accepted
     
  • Anonymous

    Anonymous - 2015-11-01
    • assigned_to: pkx166h
     
  • Anonymous

    Anonymous - 2015-11-01

    I have a patch done but am struggling getting git-cl to work. If I cannot get git-cl working I will upload the patch here so that we don't have others duplicating work.

     
  • David Kastrup

    David Kastrup - 2015-11-01

    The description says

    \paper {
    tocItemMarkup = \markup { \fill-line { \fromproperty #'toc:text \fromproperty #'toc:page } }
    tocItemMarkup = \tocItemWithDotsMarkup
    }
    

    But that does not make a whole lot of sense since \tocItemWithDotsMarkup does not reference the previous value of tocItemMarkup at all, so there is no point in defining it twice.

     
  • Federico Bruni

    Federico Bruni - 2015-11-02

    of course you are right, I didn't check how tocItemMarkup is defined in ly/toc-init.ly:

    tocItemWithDotsMarkup = \markup \fill-with-pattern #1 #RIGHT .
      \fromproperty #'toc:text \fromproperty #'toc:page
    

    but I would still add an example on how to customize tocItemMarkup with \fill-with-pattern

     
  • Anonymous

    Anonymous - 2015-11-02

    Doc: NR - input.itely - TOC customization

    Issue 4649

    Added more examples of how
    to customize the tocItemMarkup
    function.

    Also made minor line-length
    fixes and re-worded some
    paragraphs to accomodate
    a slight re-ordering of the
    existing examples.

    http://codereview.appspot.com/271220043

     
  • Anonymous

    Anonymous - 2015-11-02
     
  • Anonymous

    Anonymous - 2015-11-02

    more TexInfo fixes (grr!)

    http://codereview.appspot.com/271220043

     
  • Anonymous

    Anonymous - 2015-11-02

    Passes make, make check and a full make doc.

     
  • Anonymous

    Anonymous - 2015-11-02
    • Needs: -->
    • Patch: new --> review
    • Type: --> Other
     
  • Anonymous

    Anonymous - 2015-11-02

    Forgot to post this (yet another) Texinfo correction

    http://codereview.appspot.com/271220043

     
  • Anonymous

    Anonymous - 2015-11-02
    • Needs: -->
    • Patch: new --> review
    • Type: --> Other
     
  • Anonymous

    Anonymous - 2015-11-02

    Passes make, make check and a full make doc

     
  • Anonymous

    Anonymous - 2015-11-11
    • status: Accepted --> Started
     
  • Anonymous

    Anonymous - 2015-11-13

    Patch on countdown for November 16th.

     
  • Anonymous

    Anonymous - 2015-11-13
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2015-11-16
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2015-11-16

    Patch counted down - please push.

     
  • Anonymous

    Anonymous - 2015-11-16

    author James Lowe pkx166h@gmail.com
    Sun, 1 Nov 2015 14:35:11 +0000 (14:35 +0000)
    committer James Lowe pkx166h@gmail.com
    Mon, 16 Nov 2015 12:24:47 +0000 (12:24 +0000)
    commit 4d8ae12d918b0183f85c3b1dc93f65c7711104a3

     
  • Anonymous

    Anonymous - 2015-11-16
    • labels: --> Fixed_2_19_32
    • status: Started --> Fixed
    • Patch: push -->
    • Type: Other --> Documentation
     
  • Phil Holmes

    Phil Holmes - 2015-11-26
    • status: Fixed --> Verified