Layout-driven generated text
Generated text than depends on result of formatting: page numbers in
headers and footers; chapter titles in headers or footers;
line-numbering; cross references with page/line numbers; per-page
numbering of footnotes
Specification of generated text is in two parts: specification of a
value in terms of a number of primitives; specification of function to
turn that value into a flow object sequence. This allows arbitrary
formatting of generated text without requiring implementation to
deliver values at a point in processing when they are unknown.
Primitives to count areas in various ways: with respect to header or
footer area; with respect to area containing the generated flow
object; with respect to area containing flow object with particular ID
(typically corresponding to element with particular ID).
When a flow object is constructed, a number of named reference values
can be associated with it. Reference values can be inherited.
Within a header or footer (and similar contexts), there are primitives
to access in various ways the reference values associated with flow
objects that produced areas that header or footer apply to.
For example, a security-level reference value could be associated with
each flow object. Then within a header specification, a primitive
could be used to return a list of all distinct security-levels on the
page. Then the formatting procedure could turn this list into the
appropriate flow object sequence, for example, printing a border in a
color corresponding to the highest security level.