lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFC: LaTeX-like \label


From: Nicolas Sceaux
Subject: RFC: LaTeX-like \label
Date: Sat, 19 May 2007 11:18:49 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

Hi,

I'd like to implement the following feature:

At some place in a book, a bookmark is placed, and that page is refered
to in a markup. For instance:

\score { ... } \label "piece1"
\score { ... }
\markup { Piece 1 (page \ref-page #"piece1") is played again. }

The label is better not set in the score definition (for instance the
\header block), so that we can refer to a page where there are only
markups.

That would be a first step towards a "table of contents" feature.

My idea is the following:

 - the labels are Page_markers using some dedicated new slot;

 - in Paper_book::get_system_specs, when such a Page_marker is
   encoutered, the label property of the previous system_spec object is
   set;

 - when the page breaking function computes the page breaks, it builds a
   {label -> page-number} table.

The \ref-page markup command uses this table to look up the page number
from a label -- which is possible only if the table is built before the
stencil is computed.

My question is: when are top-level markups stencils computed? is this
before the page breaking function computes the page breaks (to know
precisely the markup extents), or later, the page breaking function
using extent estimations also for markups?  If they are computed before
the page breaks are known, which sounds more likely, then I'm not sure
how to solve this issue.

Also, I don't know where to store that table, which have to be accessed
by a markup command.

nicolas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]