Text formats for PDF

General features and styles for body text in PDF

Display graphics for PDF text formats

The stylesheet p9-textformats.xsl has all features and instructions to set up styles for a range of text formats in all book components. The text formats that can be set in the stylesheet are:

XML markup to edit

Linking to websites. You add a hyperlink to a website from any text in a document using the <link> element. The text inside the <link> element does not need to be a web address—it can be a description of a web address. The attribute xlink:href defines the full web address. For example:
<link xlink:href="http://www.mywebsite.com">Text describing mywebsite</link>
Linking to other parts of a document. You specify cross-references from any text to other parts of the document using the <link> element. This is useful for hyperlinking from body text to figures, tables or specific references in a bibliography. There can be any text inside a <link> element. The attribute linkend defines the name (xml:id value) of the target (or "anchor"). For example:
<link linkend="mylink">Text for cross-reference</link>

Paragraph styles. There are four types of paragraph styles that you can specify with XML markup. You would apply the styles in the following table to individual paragraphs as a way to format or highlight individual blocks of text (single paragraphs) within body text.

XML markup Description
<emphasis role="highlight"> Highlights individual words (stylesheet features p9-550 to p9-570)
<para condition="compactpara"> Formats a paragraph with smaller line height, space before and space after (settings are at stylesheet features p9-105 to p9-135)
<para role="shade"> Produces a paragraph with background shading only (stylesheet features p9-590 to p9-635)
<para role="shadebord"> Produces a paragraph with both background shading and borders (any combinations of top, bottom, left and right) (stylesheet features p9-640 to p9-705)
<para role="border"> Produces a paragraph with borders only (any combinations of top, bottom, left and right) (stylesheet features p9-710 to p9-770)
<para condition="lastpara"> Applies only the "space after" values of compact paragraphs (p9-125 to p9-135) to any paragraph (line spacing and "space before" values remain the same as for normal paragraphs). Specify this markup where a background colour is used with a paragraph (e.g. block quote, shaded paragraph); it reduces the bottom margin of the paragraph so that there is no large gap after the paragraph.
Sidebar formatting with processing instructions. To format specific aspects of individual sidebars, you can add processing instructions within XML markup. The options for formatting are:
  • float type (specify whether a sidebar appears at the left margin or right margin on a page)—put this example processing instruction immediately inside a <sidebar> element: <?dbfo float-type="left"?> or <?dbfo float-type="right"?>
  • width of sidebar (specify the width of a sidebar in any units of measurement)—put this example processing instruction immediately inside a <sidebar> element: <?dbfo sidebar-width="8cm"?>.

Text punctuation and formatting with processing instructions. There are several options to add processing instructions at specific points in body text to add punctuation and format paragraphs. Refer to the section on PDF processing instructions for more details.

Stylesheet settings to edit

The relevant Stylesheet Guide page to set up text formats for PDF is PDF-textformats.svg.