+ return footnotes;
+}
+
+vsize
+Page_layout_problem::get_footnote_count (SCM lines)
+{
+ vector<Grob *> notes = get_footnote_grobs (lines);
+ return notes.size ();
+}
+
+SCM
+Page_layout_problem::get_footnotes_from_lines (SCM lines)
+{
+ if (!scm_is_pair (lines))
+ return SCM_EOL;
+
+ bool footnotes_added;
+ if (Grob *g = Grob::unsmob (scm_car (lines)))
+ footnotes_added = !scm_is_null (g->get_property ("footnote-stencil"));
+ else if (Prob *p = Prob::unsmob (scm_car (lines)))
+ footnotes_added = !scm_is_null (p->get_property ("footnote-stencil"));
+ else
+ {
+ programming_error ("Systems on a page must be a prob or grob.");
+ return SCM_EOL;
+ }
+ if (!footnotes_added)
+ {
+ programming_error ("Footnotes must be added to lines before they are retrieved.");
+ return SCM_EOL;
+ }
+
+ SCM out = SCM_EOL;
+ for (SCM s = lines; scm_is_pair (s); s = scm_cdr (s))
+ {
+ if (Grob *g = Grob::unsmob (scm_car (s)))
+ out = scm_cons (g->get_property ("footnote-stencil"), out);
+ else if (Prob *p = Prob::unsmob (scm_car (s)))
+ out = scm_cons (p->get_property ("footnote-stencil"), out);
+ else
+ programming_error ("Systems on a page must be a prob or grob.");
+ }
+
+ return scm_reverse_x (out, SCM_EOL);