What elements control page breaks in DITA content?

In DITA content, page breaks are controlled by specific elements to ensure proper layout and readability in both print and digital formats.

Page breaks in DITA content are crucial for organizing and formatting content, especially when the content will be published in print or other paginated formats. DITA provides several elements and mechanisms to control page breaks:

<topicbreak> Element:

Definition: The <topicbreak> element is used to specify where a page break should occur within a DITA topic.

Purpose: It ensures that content is organized into distinct pages when the topic is published.

Example: The <topicbreak> element can be used to specify that a new page should start before a new section of content begins within a topic. For example:


       <p>This is the first section of content.</p>
            <topicbreak />
            <p>This is the second section of content, which starts on a new page.</p>
    

Conditional Processing Attributes:

Definition: Conditional processing attributes such as @outputclass, @props, and @audience can be used to control where page breaks should occur based on specific conditions.

Purpose: This allows for the creation of different versions of content with varying page breaks to cater to different audiences or outputs.

Example: Conditional control of page breaks can be used to create separate printed and online versions of a document. For example, the @outputclass attribute can be employed to specify that a page break should occur only when generating a PDF output:


       <p>Content before the page break.</p>
            <p conkeyref="break_condition">This content appears on a new page in PDF output.</p>           
    

Styling and CSS:

Definition: The use of Cascading Style Sheets (CSS) can also control page breaks. CSS styles can define page break properties, such as page break-before and page break-after, to influence the page layout.

Purpose: CSS styles help maintain consistent formatting across various outputs, including printed documents.

Example: In the CSS stylesheet, specific styles for page breaks can be defined. For example, CSS can be used to add page breaks before certain elements:


        .page-break-before {
            page-break-before: always;
        }
    

In the DITA content, this style can be applied as needed:


         <p class="page-break-before">This content starts on a new page.</p>
    

These elements and mechanisms allow for precise control over page breaks in DITA content, ensuring that the content is formatted appropriately for different publishing formats, including print and digital outputs.