Running headers and footers

Features for formatting the content of running headers and footers

Display graphics for running headers and footers

To specify what text appears in running headers and footers, you need to specify features in the stylesheet p2-headersfooters.xsl. This stylesheet lets you set up:
Text in headers and footers. There are several options to automatically add text from XML markup into headers and footers. Text is automatically generated from the XML markup or stylesheet coding for one or more of:

You can set up in the stylesheet p2-headersfooters.xsl whether text or graphics appears in headers or footers, and whether in the left, centre or right side of the headers and footers.

Styles for the text. The typeface, font size, weight, style, colour and alignment can be set separately for the book title, part title, chapter title, section title and page numbers.

There are further options in the stylesheet to additionally display the prefix and label number for part and chapter titles, and a prefix for page numbers.

For part titles, the options at stylesheet feature p2-35 are: main title (e.g. "Overall concepts of this topic"), prefix and label number with title (e.g. "Part 1 Overall concepts of this topic"), or an abbreviated title if you have <titleabbrev> in the XML markup (e.g. "Overall concepts").

For chapter titles, the options at stylesheet feature p2-70 are: main title (e.g. "Introduction to the book"), prefix and label number with title (e.g. "Chapter 1 Introduction to the book"), or an abbreviated title if you have <titleabbrev> in the XML markup (e.g. "Introduction").

For page numbers, you can type in the stylesheet at feature p2-135 any text to use as a prefix (e.g. "Page").

Proportional widths of cells. The space in running headers and footers is represented as an "invisible table" divided into a single row of three columns: left, centre and right. Specify the proportional widths of these three columns at stylesheet feature p2-310 (for headers) or p2-915 (for footers) using integer numbers separated by a single space. The following diagram demonstrates two layouts for content in running headers/footers using different proportional widths.

Examples of setting values for proportional widths of running headers and footers. The first number is the proportional width of the left column, the second number is the width of the centre column and the third number is the width of the right column.

Note: Set the proportional column widths for running headers and footers as you want them to appear on recto pages. The stylesheets will automatically produce a "mirror image" of the columns for verso pages as shown in the following diagram.

Example of how stylesheets automatically generate the layout of running headers and footers on verso pages, based on proportional settings for recto pages.

Separator rule lines. You can display separator rule lines below running headers or above running footers. There are options to selectively display rule lines for different book components (e.g. the first page of chapters, blank pages). You can also set the width, colour and pattern style of rule lines separately for running headers and footers.

Background colours. There are stylesheet features to optionally display solid background colours separately for all running headers (p2-225) and footers (p2-830). Also, you can set up border styles, margin and padding values for headers and footers.

Background images. An alternative to using background colours is to use images or graphics, which is useful for branding. There are options to specify large graphics that span across the width of headers and footers, or to insert small graphics into the left, centre or right columns. The stylesheet lets you specify any supported image type (i.e. an image format that your XML editor and typesetting software supports) in any running headers or footers throughout book components.
Note: When you specify a background image in running headers or footers, it is positioned in the space for a running header or footer at the centre of the image. For example, if you are using a large image as the background image, then the centre of the image will appear at the centre of the running header or footer.

XML markup to edit

Titles. The text contained within <title> elements is used in running headers and footers. You have the option to insert a shortened title by adding a <titleabbrev> element immediately after <title> elements for part and chapter titles.

Stylesheet settings to edit

The relevant Stylesheet Guide page to set up running headers and footers is headerfooter.svg.