@menu
* Creating titles::
* Custom titles::
-* Table of contents::
+* Reference to page numbers::
@end menu
}
@end verbatim
-@node Table of contents
-@subsection Table of contents
+@node Reference to page numbers
+@subsection Reference to page numbers
A particular place of a score can be marked using the @code{\label}
command, either at top-level or inside music. This label can then be
point is placed, using the @code{\page-ref} markup command.
@verbatim
+\label #'firstScore
\score {
{
c'1
\mark A \label #'markA
c'
}
-} \label #'firstScore
+}
\markup { The first score is on page \page-ref #'firstScore "0" "?" }
\markup { Mark A is on page \page-ref #'markA "0" "?" }
-\version "2.11.25"
+\version "2.11.26"
\header {
texidoc = "Page labels may be placed inside music or at top-level,
\pageBreak
+\label #'toc
\markup \column {
\large \fill-line { \null "Table of contents" \null }
\toc-line #'toc "Table of contents"
\toc-line #'markB "Mark B"
\toc-line #'markC "Mark C"
\toc-line #'unknown "Unknown label"
-} \label #'toc
+}
\pageBreak
+\label #'firstScore
\score {
{ c'2 c'
\mark \markup { A (page \concat { \page-ref #'markA "0" "?" ) }} \label #'markA
\mark "C" \label #'markC
}
\header { piece = "First score" }
-} \label #'firstScore
\ No newline at end of file
+}
\ No newline at end of file
SCM interpret_markup_list = ly_lily_module_constant ("interpret-markup-list");
SCM header = SCM_EOL;
+ bool set_next_label = false;
+ SCM label;
for (SCM s = scm_reverse (scores_); scm_is_pair (s); s = scm_cdr (s))
{
if (ly_is_module (scm_car (s)))
}
if (scm_is_symbol (page_marker->label ()))
{
- /* set previous element label */
- if (scm_is_pair (system_specs))
- set_label (scm_car (system_specs), page_marker->label ());
+ /* The next element label is to be set */
+ set_next_label = true;
+ label = page_marker->label ();
}
}
else if (Music_output *mop = unsmob_music_output (scm_car (s)))
header = SCM_EOL;
system_specs = scm_cons (pscore->self_scm (), system_specs);
+ if (set_next_label)
+ {
+ set_label (scm_car (system_specs), label);
+ set_next_label = false;
+ }
}
else
{
system_specs = scm_cons (ps->self_scm (), system_specs);
ps->unprotect ();
+ if (set_next_label)
+ {
+ set_label (scm_car (system_specs), label);
+ set_next_label = false;
+ }
// FIXME: figure out penalty.
//set_system_penalty (ps, scores_[i].header_);
}