Controlling Page Breaks Before/After for Part/Chapter
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 15
- Joined: Wed Jun 27, 2018 12:44 am
Controlling Page Breaks Before/After for Part/Chapter
Post by paulkhillier »
Hello Oxygen Team and Users,
I am struggling to figure out how to implement the following fir the DITA MAP PDF - Based on DITA and CSS (WYSIWYG) transform:
• Part has page break before, but not after (keep with next chapter title)
• Chapter has no page break before
I tried coding the following (among many other solutions) to override the default configuration for part/chapter, with no luck:
I unfortunately cannot post hosted images from my workplace, but here's what I'm getting vs. the desired result:
Desired
Part Title (page break before)
Chapter Title (no page break following part title)
Mapref Title (no page break following chapter title)
Actual
Part Title (page break before and after)
Chapter Title (page break before)
Mapref Title (no page break following chapter title)
I've been reviewing https://www.oxygenxml.com/doc/versions/ ... aking.html and trying different solutions with no luck. Can you suggest how to achieve this page flow?
Regards,
Paul Hillier
I am struggling to figure out how to implement the following fir the DITA MAP PDF - Based on DITA and CSS (WYSIWYG) transform:
• Part has page break before, but not after (keep with next chapter title)
• Chapter has no page break before
I tried coding the following (among many other solutions) to override the default configuration for part/chapter, with no luck:
Code: Select all
*[class~="topic/topic"] > *[class~="topic/title"] {
page-break-after: avoid;
}
*[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
page-break-before: avoid;
}
Desired
Part Title (page break before)
Chapter Title (no page break following part title)
Mapref Title (no page break following chapter title)
Actual
Part Title (page break before and after)
Chapter Title (page break before)
Mapref Title (no page break following chapter title)
I've been reviewing https://www.oxygenxml.com/doc/versions/ ... aking.html and trying different solutions with no luck. Can you suggest how to achieve this page flow?
Regards,
Paul Hillier
-
- Posts: 9439
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Controlling Page Breaks Before/After for Part/Chapter
Hi Paul,
I think you should start by trying to see the actual merged XML document on which your CSS changes are applied:
https://www.oxygenxml.com/doc/versions/ ... e_css.html
because this will give you a better idea about what to match.
All out default page break policies are defined in this CSS file: OXYGEN_INSTALL_DIR\frameworks\dita\css\print\p-page-breaks.css
As you see we also look for a certain @outputclass attribute value which could be set on certain DITA topic root elements or even on topicrefs.
Regards,
Radu
I think you should start by trying to see the actual merged XML document on which your CSS changes are applied:
https://www.oxygenxml.com/doc/versions/ ... e_css.html
because this will give you a better idea about what to match.
All out default page break policies are defined in this CSS file: OXYGEN_INSTALL_DIR\frameworks\dita\css\print\p-page-breaks.css
As you see we also look for a certain @outputclass attribute value which could be set on certain DITA topic root elements or even on topicrefs.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 15
- Joined: Wed Jun 27, 2018 12:44 am
Re: Controlling Page Breaks Before/After for Part/Chapter
Post by paulkhillier »
Hi Radu,
Thanks for pointing me to the merged.xml... would you believe I've gotten through 80% of the templating without referring to this?
Here is a snippet of the XML that I am trying to control page breaks for:
Based on this structure, I would expect the following to work, but it does not:
Also tried this:
What am I missing? Please assist Oxygen wizards!
Regards,
Paul Hillier
Thanks for pointing me to the merged.xml... would you believe I've gotten through 80% of the templating without referring to this?

Here is a snippet of the XML that I am trying to control page breaks for:
Code: Select all
<part xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot" is-chapter="true" is-part="true" class="- map/topicref bookmap/part " format="dita" navtitle="Enhancements" rev="23 January 2018" scope="local" type="confidential"><topicmeta class="- map/topicmeta "><navtitle class="- topic/navtitle " href="#d7e66">Enhancements</navtitle></topicmeta><chapter is-chapter="true" class="- map/topicref bookmap/chapter " format="dita" href="#d7e67" rev="23 January 2018" scope="local" type="confidential"><topicmeta class="- map/topicmeta "><navtitle href="#d7e67" class="- topic/navtitle ">DSC Calculations/Percent Free/Inventory</navtitle></topicmeta><topicref class="- map/topicref " format="dita" href="#unique_3" navtitle="Ten Percent Free Calculation Adjustment" rev="23 January 2018" scope="local" type="concept"><topicmeta class="- map/topicmeta " data-topic-id="PETXXXXXX_BenefitBackground"><resourceid appid="PETXXXXXX_BenefitBackground" class="- topic/resourceid " oxy-source="topic"/><navtitle href="#unique_3" class="- topic/navtitle ">Ten Percent Free Calculation Adjustment</navtitle></topicmeta><
Code: Select all
*[class~="map/topicref"] *[class~="bookmap/part"] {
page-break-after: avoid;
}
*[class~="map/topicref"] *[class~="bookmap/chapter"] {
page-break-before: avoid;
}
Code: Select all
*[class~="map/topicref"] *[class~="bookmap/part"] {
page-break-after: avoid;
}
*[class~="map/topicref"] *[class~="bookmap/chapter"][navtitle] {
page-break-before: avoid;
}
What am I missing? Please assist Oxygen wizards!
Regards,
Paul Hillier
-
- Posts: 9439
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Controlling Page Breaks Before/After for Part/Chapter
Hi Paul,
If you look in this CSS OXYGEN_INSTALL_DIR/frameworks/dita/css/print/p-chapters.css
it defines a new page sequence for each chapter:
you could probably define in your custom.css the page sequence on each part and avoid having the chapter break the sequence:
Regards,
Radu
If you look in this CSS OXYGEN_INSTALL_DIR/frameworks/dita/css/print/p-chapters.css
it defines a new page sequence for each chapter:
Code: Select all
*[class ~= "topic/topic"][is-chapter] {
/* Each chapter starts a new page sequence, so the :first selector applies to each of them. */
-oxy-page-group:start;
page: chapter;
}
Code: Select all
*[class ~= "topic/topic"][is-chapter] {
-oxy-page-group:auto;
page: auto;
}
*[class ~= "topic/topic"][is-part] {
-oxy-page-group:start;
page: chapter;
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 15
- Joined: Wed Jun 27, 2018 12:44 am
Re: Controlling Page Breaks Before/After for Part/Chapter
Post by paulkhillier »
Thank you Radu, that has the intended result.
With regards,
Paul Hillier
With regards,
Paul Hillier
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)
- ↳ 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