Home > Articles

XSL-FO Floats and Footnotes

XSL-FO (XSL-Formatting Objects) enables enterprise applications to publish graphic-arts quality printed and electronic documents from any XML data store. In this sample chapter, the author of "Definitive XSL-FO," explains how to use Floats and Footnotes, which are used to render distinctive information that is supplemental to the information found in the main text.
This chapter is from the book

This chapter is from the book

Floats and footnotes are used to render distinctive information that is supplemental to the information found in the flow, making it easy for the reader to find it because of its predetermined location on the page. These constructs are defined “in line” of the flow of information being paginated, but are rendered “out of line” of the flow of information being paginated. Such information is considered auxiliary enough not to disturb the flow itself for the reader, so that the reader can choose to examine a float or footnote at leisure without interrupting the reading of the flow in which it is referenced.

These constructs are dynamically rendered on the page where detected by the formatter in the flow, or perhaps on the immediately following page should it not fit where referenced. They can only be defined in the flow filling the body region of a page, though not in an absolutely positioned area, and are stacked in a different reference area than the main reference area. Floats are moved to either the before, start, or end edges within the body region (not in the perimeter regions). Footnotes are two-part constructs: the footnote citation that is rendered inline in the flow and the footnote body is rendered at the after edge within the body region. An after float is accomplished using a footnote without a footnote citation, but can only be used when not using footnotes since this kind of after float cannot be distinguished from other footnotes on the same page.

Note that the labeling of footnotes is up to the transformation process producing the XSL-FO instance and cannot be generated by the formatter. A feature that is commonly requested but unavailable in XSL-FO 1.0 is numbering the footnotes on a per-page basis. Since the transformation process is unaware of where the page breaks are, yet is responsible for the labeling of the footnote references, this feature cannot yet be realized.

There are no endnote layout constructs in XSL-FO. An endnote is a two-part footnote-like construct with a citation and a definition, but all endnote definitions are collected at the end of a page sequence (e.g. chapter) rather than at the bottom of pages. To render endnotes, it would be the responsibility of transformation to cite the endnotes inline in the flow of the scope and then collect and render endnotes at the end of the scope. You could then choose to render the citations as part of the flow on the body, or use empty citations to take advantage of the XSL-FO footnote construct to sink the collection of endnotes to the bottom of the last page.

Judicious use of floats can keep the main flow of information continuous without unseemly breaks at the bottom of pages. The formatter moves the floating object to the perimeter and flows subsequent information in the main flow without interruption, as if the flow had not been present. If the construct is too large to fit on the page, it can be rendered on the next page and the subsequent information continues on the previous page in a seamless fashion.

There are many candidate uses of floating constructs. You can use float to float images to the side of a page, e.g. to present sidebar portions of content, or to format lists where the item bodies are indented relative to the corresponding item label's formatted length. It can also be used to implement a multi-line drop initial cap in a paragraph. You can use footnote to sink content to the bottom of a page, e.g. for traditional footnotes, acronym expansions, glossary definitions, or images floating to the bottom of a page (using an empty inline construct).

The name of the construct shouldn't prejudice how the construct is used. Consider the need to format a disclaimer at the bottom of the last page of a document. You can flow the disclaimer in the body of a footnote with an empty citation in an empty block at the end of the document. The disclaimer isn't a footnote, yet you'll get the desired effect of the out-of-line placement.

Every page's body region has two sub-regions that are rendered only if necessary. Before floats and footnotes are stacked in the body region with other block level constructs, but the reader needs some separation rendered to distinguish content belonging in a float or footnote from the content belonging in the body. The body region is separated into the before-float reference area, main reference area, and footnote reference area portions, as shown in Figure 8-1.

08fig01.gifFigure 8-1. Conditional areas and sub-regions

The act of defining these visual separators does not affect their rendering, as they are only rendered on a page if the floated information is being rendered on the page. Static content defines the rendering of a separator. When needed, the static content associated with xsl-before-float-separator is rendered inside and at the end of the before-float reference area. When needed, the static content associated with xsl-footnote-separator is rendered inside and at the start of the footnote reference area.

Static content for these sub-regions should always be defined as a contingency if floats and footnotes are being used, for the chance that a given page may have such a construct.

Remember from Figure 4-2 the incursion of the perimeter regions into the body: all reference areas shown above are within the body region's margins and not part of the perimeters.

Included in this chapter. This chapter includes discussion of the following XSL-FO objects:

  • float (6.10.2):

    • is the content to be rendered towards either the before, start, or end edges of the body region regardless of where in the region the content is defined,

  • footnote (6.10.3):

    • is the content to be rendered partly in the flow and partly towards the after edge of the body region regardless of where in the region the content is defined,

  • footnote-body (6.10.4):

    • is the portion of footnote content rendered towards the after edge of the body region.

8.1 Floats

8.1.1 Float definition

Using the float object, you can position out-of-line information at the before, start, or end sides of a page.

  • The before floats are flowed in the before-float reference area (see Figure 8-1).

  • A float creates a dimensionless anchor area in the area tree.

  • The anchor is tied to the information that precedes the float in the flow.

  • Out-if-line information is placed relative to the anchor —

    • typically at the top or sides of the page in which the anchor is flowed.

  • The content of the float is always a set of block-level constructs.

Information can be defined at the block level or at the inline level of the flow.

  • The anchor is treated as a block if defined at the block level.

  • The anchor is typically treated as an inline construct if defined at the inline level.

    • It is treated as a block object if the line area created by the inline constructs consists only of anchors.

  • It must be defined in the body region of the page.

  • It must be defined as a descendant of a relatively positioned block.

    • Absolutely positioned areas cannot have float descendants.

  • It cannot have any float, footnote, or marker descendants.

The blocks of the float definition are positioned in the area tree accordingly.

  • The before floats are stacked in the before-float reference area.

  • The side floats are stacked in a side-float reference area.

    • This is a child of the specifying block's ancestral span reference area.

  • Float content that does not float is flowed as normal content.

    • This may be the result of a faulty definition or placement.

    • A float is an area that is not normally flowed and cannot be defined within any other area that is not normally flowed (e.g. another float, a footnote, a perimeter region, an absolutely positioned block container, etc.).

  • Float lengths cannot be preset and are always derived from the content of the float.

The block areas that float have no border or padding.

  • Padding, border, and content rectangles are coincident.

Side floats do not overlap and are typically placed beside each other.

  • They make a further incursion into the inline-progression dimension of the block.

  • They can be forced to not be placed beside each other by using the clear property.

    • Different values control which floats are clear of other floats.

8.1.2 The float object

Purpose

  • This is the content to be rendered towards either the before, start, or end edges of the body region regardless of where in the region the content is defined.

Content

  • (6.10.2) (%block;)+,

  • child object:

    • %block; (6.2; 69).

Optional properties

  • clear (7.18.1; 368),

  • float (7.18.2; 376).

8.1.3 The interaction of blocks and floats

The clear property is used to prevent two side floats from being beside each other or a block-level object from being beside a float.

  • It is not documented as a property within the individual block-level object descriptions.

    • It applies to all such constructs as documented in the property definition.

  • The default is for side floats to continue intruding into the main reference area.

    • Use clear to start a side float back at the edge, clear of any previous float.

  • The default is for the lines of a block to contour around the accumulation of side floats.

    • Use clear to start a block back at the edge, clear of any previous float.

  • Those constructs with the clear value clear the float they would otherwise be beside.

Consider three situations in Figure 8-2 that illustrate the use of clear on each of floats and blocks;

  • the numbers reflect the order in which the constructs are flowed;

  • the thick-lined blocks with “F-” prefixes are floats;

  • the thin-lined blocks with “B-” prefixes are blocks.

08fig02.gifFigure 8-2. The clearing of slide floats by new constructs

Of note in the diagram:

  • the left-most page fragment shows the default situation where side floats intrude and blocks flow around floats;

    • the second float (“F-3”) is to the right of the first float (“F-1”);

    • the second block (“B-4”) wraps around both floats;

  • the center page fragment shows the second float being clear of the first float;

    • the second block (“B-4”) starts abutted to the first block (“B-2”);

  • the right-most page fragment shows the second block being clear of all floats;

    • the second float (“F-3”) is to the right of the first float (“F-1”);

    • the second block (“B-4”) is clear of both floats.

The intrusion-displace property indicates the strategy of locating the start (or end) edges and indents of the lines of the block being intruded upon.

  • Note that displacing the edge of a block necessarily displaces all lines in that block.

Consider three situations in Figure 8-3 that illustrate the use of intrusion-displace on a block with both text-indent and start-indent.

  • indent” respects text-indent and start-indent;

  • block” respects text-indent but limits all lines by the width of the float;

  • line” ignores text-indent if occupied by the float, and respects start-indent.

08fig03.gifFigure 8-3. The behavior of lines in a block next to a float

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020