How is content layout and formatting controlled in DITA for print?
In DITA for print output, control over content layout and formatting is achieved through styles, templates, and transformation settings. Controlling content layout and formatting in DITA for print involves defining the structure and appearance of printed documents.
Content layout can be controlled by styles and CSS, templates, and transformation settings.
Styles and CSS:
Cascading Style Sheets (CSS) play a crucial role in DITA for print. Styles are defined to control various aspects of formatting, such as fonts, margins, spacing, and colors. DITA publishing tools often provide mechanisms for specifying CSS styles for print output.
Templates:
Templates are used to establish the overall structure and design of printed documents. These templates define the arrangement of content, including elements like headers, footers, page numbering, and margins. Templates can be customized to match an organization’s branding and layout requirements.
Transformation Settings:
DITA publishing tools offer transformation settings to tailor the output for print. These settings determine how content is transformed from DITA topics to the final printed document. They can include options to control pagination, cross-references, fonts, and other formatting details.
Example:
A software company wants to create a printed manual from DITA source content. They can control content layout and formatting with:
Styles and CSS:
CSS can define the appearance of the text, headings, and other elements. For example, the CSS might specify:
body {
font-family: Arial, sans-serif;
font-size: 12pt;
line-height: 1.5;
color: #333;
}
h1 {
font-size: 18pt;
color: #0066cc;
}
In this CSS, the font-family, font-size, line-height, and color properties control the appearance of body text and headings.
Templates:
Templates can specify how content is structured for print. For example, a template might define a two-column layout with a company logo in the header, page numbers in the footer, and a table of contents. The template configuration could resemble:
<page-template>
<page-header>
<top-left><image src="logo.png" width="2in" height="0.5in" /></top-left>
<top-right><current-page /> / <total-pages /></top-right>
</page-header>
<page-footer>
<bottom-center><toc toc-title="Table of Contents" /></bottom-center>
</page-footer>
<page-body>
<columns>
<column width="45%" />
<column width="5%" />
<column width="45%" />
</columns>
</page-body>
</page-template>
In this example, the template defines the page layout, with a header containing a logo and page numbers and a footer that includes a table of contents. The <columns> element defines a two-column layout for the body.
Transformation Settings:
Transformation settings might control how cross-references are resolved, whether pages are numbered, and other formatting options. Organizations can configure these settings according to their specific requirements.