DITA to PDF Using HTML5 and CSS: Forced Page Breaks
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 53
- Joined: Sat May 22, 2021 6:04 pm
DITA to PDF Using HTML5 and CSS: Forced Page Breaks
Post by patjporter »
Hello, thank you for all the great answers on modifying my CSS files.
I have a few questions about page breaks.
Is there a way to force "keep with next". For example if I have two paragraphs I want to keep together across a page break?
Same question for tables. If I want the table to start at the top of a new page?
Finally, how do I keep a caption and a table or figure together? I have an example where the caption is on one page but the figure breaks to the next page.
Thank you!!
Pat
I have a few questions about page breaks.
Is there a way to force "keep with next". For example if I have two paragraphs I want to keep together across a page break?
Same question for tables. If I want the table to start at the top of a new page?
Finally, how do I keep a caption and a table or figure together? I have an example where the caption is on one page but the figure breaks to the next page.
Thank you!!
Pat
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: DITA to PDF Using HTML5 and CSS: Forced Page Breaks
Hello Pat,
Yes, you can fine tune the page breaking as explained here:
https://www.oxygenxml.com/doc/versions/ ... aid-title4
on the tables that need to start on a new page.
If you want to avoid page breaks in all figures, you should avoid setting an outputclass attribute, instead you should an add to your CSS customization:
Many regards,
Dan
Yes, you can fine tune the page breaking as explained here:
https://www.oxygenxml.com/doc/versions/ ... aid-title4
So I would useIf you want to force a page break for a specific topic, mark the topic (or any other element you need to control page breaking for) with an @outputclass attribute set to one of these values:
page-break-before
Use this for a page break before the marked element.
page-break-after
Use this for a page break after the marked element.
page-break-avoid
Use this to avoid page breaks inside the marked element.
For example, to force a page break before a certain topic, use:
<topic outputclass="page-break-before" ... >
Code: Select all
<table outputclass="page-break-before" ...>
If you want to avoid page breaks in all figures, you should avoid setting an outputclass attribute, instead you should an add to your CSS customization:
Code: Select all
*[class~="topic/fig"] {
page-break-inside:avoid;
}
Dan
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service