The concept of objects that float to the end of a page or chapter is well-known in the context of typesetting. Footnotes float to the end of the page, while figures may float to the end of a chapter. AS TE R provides the same functionality with rendering rules that delay audio rendering. In this section, we describe rendering rules that enable footnotes to float (in general instances of any object type) to the end of different hierarchical units in the document model.
We achieve this by first implementing a mechanism for delayed evaluation in Lisp.
delays the execution of action <action> until triggered by <trigger>. In a rendering rule that floats an object, <action> is a function object whose body specifies audio events to be executed. The delayed action is triggered by executing
This forces all actions that are waiting for <trigger> in the order in which they were delayed. The delayed evaluation provided by this mechanism is of course more widely applicable.
We now give an example of a rendering rule9 that floats instances of object footnote to the end of the containing paragraph. This rule uses delay-until.
(def-reading-rule (footnote float)
"Make footnotes float to the end of containing paragraph. "
(delay-until 'paragraph
#'(lambda()
(without-rule (footnote float)
(read-aloud footnote )))))
After rendering instances of object O, function read-aloud forces all delayed actions that are triggered by the class-name of O. Thus, to make footnotes float to the end of the containing paragraph, all the user need do is to activate the above rendering rule. A rule that floats all figures10 to the end of a chapter is:
(def-reading-rule (figure float)
"Make figures float to the end of containing chapter. "
(delay-until 'chapter
#'(lambda()
(without-rule (figure float)
(read-aloud figure)))))
where Lisp macro (without-rule (<o> <r>) <b>) executes statements <b> with rule <r> for object type <o> deactivated.
The ability to delay the renderings of objects provides several interesting applications. The first of these is rendering the text of footnotes at the end of a paragraph or section, rather than where the footnote marker occurs in the running text. Such a rule is useful when rendering documents having several footnotes.
Note that footnotes float to the end of the logical unit of text in which they occur, rather than to the end of a physical unit like a page. Page breaks are completely irrelevant in the context of audio formatted output, since they are merely a consequence of the constraints placed by the physical page.
The general ability to float any object in the document model is a more powerful feature than is present in standard typesetting systems, which typically allow only certain objects to be floated. In AS TE R, given object types O1 and O2 where instances of O2 occur as sub-objects of instances of O1, we can write a rendering rule that delays the rendering of all instances of O2 until the enclosing instance of O1 has been completely rendered. Thus, instances of O2 float to the end of the enclosing instance of O1.