How to force a page break after each first level topic
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 68
- Joined: Tue Jun 09, 2015 6:26 pm
- Location: Canada
How to force a page break after each first level topic
Post by BogdanM777 »
Hi guys,
I was wondering if there is a solution to inserting a page break after each level 1 topics.
I found an older reply to this issue at:
topic3261.html
However the file mentioned there is not to be found in DITA OT anymore.
Is there any other file where I have to do a similar change to get a page break after each level 1 topics?
Thank you
I was wondering if there is a solution to inserting a page break after each level 1 topics.
I found an older reply to this issue at:
topic3261.html
However the file mentioned there is not to be found in DITA OT anymore.
Is there any other file where I have to do a similar change to get a page break after each level 1 topics?
Thank you
-
- Posts: 222
- Joined: Tue Jul 01, 2014 11:48 am
Re: How to force a page break after each first level topic
Post by bogdan_cercelaru »
Hello,
The following procedure explains how to customize the PDF output by setting up a customization directory.
Regards,
Bogdan
The following procedure explains how to customize the PDF output by setting up a customization directory.
- Copy the entire directory: DITA_OT_DIR\plugins\org.dita.pdf2\Customization to another location (for instance, C:\Customization).
- Rename C:\Customization\catalog.xml.orig to: C:\Customization\catalog.xml.
- Open the catalog.xml in Oxygen XML Editor and uncomment this line:
So now it looks like this:
Code: Select all
<!--uri name="cfg:fo/attrs/custom.xsl" uri="fo/attrs/custom.xsl"/-->
Code: Select all
<uri name="cfg:fo/attrs/custom.xsl" uri="fo/attrs/custom.xsl"/>
- Rename the file: C:\Customization\fo\attrs\custom.xsl.orig to: C:\Customization\fo\attrs\custom.xsl
- Open the custom.xsl file in Oxygen XML Editor and add the "attribute-set" that you want to customize(in your case: "topic.topic.title"). Now, custom.xsl has the following content:
Code: Select all
<xsl:attribute-set name="topic.topic.title">
<xsl:attribute name="break-before">page</xsl:attribute>
</xsl:attribute-set> - Edit the DITA Map to PDF transformation scenario and in the Parameters tab, set the customization.dir parameter to C:\Customization.
Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 68
- Joined: Tue Jun 09, 2015 6:26 pm
- Location: Canada
Re: How to force a page break after each first level topic
Post by BogdanM777 »
Thank you so much Bogdan.
I will try it right away and let you know how it goes, OK?
I will try it right away and let you know how it goes, OK?
-
- Posts: 68
- Joined: Tue Jun 09, 2015 6:26 pm
- Location: Canada
Re: How to force a page break after each first level topic
Post by BogdanM777 »
Hi Bogdan,
I did what you suggested, and it worked nicely, however now I have an empty page after each chapter.
Is there a possibility to remove that please?
Thank you
I did what you suggested, and it worked nicely, however now I have an empty page after each chapter.
Is there a possibility to remove that please?
Thank you
-
- Posts: 68
- Joined: Tue Jun 09, 2015 6:26 pm
- Location: Canada
Re: How to force a page break after each first level topic
Post by BogdanM777 »
I forgot to say that now also all the entries of the Glossary are each on a new page, and this is a little bit annoying.
I have the glossary as a chapter with the reference to the glossary.ditamap
Thank you
I have the glossary as a chapter with the reference to the glossary.ditamap
Thank you
-
- Posts: 222
- Joined: Tue Jul 01, 2014 11:48 am
Re: How to force a page break after each first level topic
Post by bogdan_cercelaru »
Hello,
I'm afraid I don't have a solution for this. If you add a page break this way, it also adds the page for glossary since it is also considered a first level topic.
I would recommend to also register and ask this on the DITA users group discussion list:
https://groups.yahoo.com/neo/groups/dita-users/info
or the DITA-OT users group:
https://groups.google.com/forum/#!forum/dita-ot-users
Regards,
Bogdan
I'm afraid I don't have a solution for this. If you add a page break this way, it also adds the page for glossary since it is also considered a first level topic.
I would recommend to also register and ask this on the DITA users group discussion list:
https://groups.yahoo.com/neo/groups/dita-users/info
or the DITA-OT users group:
https://groups.google.com/forum/#!forum/dita-ot-users
Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 90
- Joined: Tue Mar 31, 2015 10:43 pm
Re: How to force a page break after each first level topic
Hello,
This customization works, but it only breaks topics that are nested two topics deep.
<xsl:attribute-set name="topic.topic.title">
<xsl:attribute name="break-before">page</xsl:attribute>
</xsl:attribute-set>
Is there a way to tell it to break before every topic?
Example:
Topic 1
Topic 2
Topic 3
Topic 4
Topic 5
....
I want every topic to start on a new page, and break after the previous page.
This customization works, but it only breaks topics that are nested two topics deep.
<xsl:attribute-set name="topic.topic.title">
<xsl:attribute name="break-before">page</xsl:attribute>
</xsl:attribute-set>
Is there a way to tell it to break before every topic?
Example:
Topic 1
Topic 2
Topic 3
Topic 4
Topic 5
....
I want every topic to start on a new page, and break after the previous page.
-
- Posts: 9437
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to force a page break after each first level topic
Hi,
In the XSLT stylesheet:
DITA-OT/plugins/org.dita.pdf2/cfg/fo/attrs/commons-attr.xsl
are all the attribute sets used to output a topic's title like "topic.title" (for first level topics), "topic.topic.title" for second level topics, "topic.topic.topic.title" for third level topics.
So one option would be for you to override in your customization as many such nested topic title attribute set names as possible and add the break-before attribute.
Another possibility would be to look in the XSLT:
DITA-OT/plugins/org.dita.pdf2/xsl/fo/commons.xsl
at the template which processes a topic's title:
override it entirely in your customization and add that page break attribute on the fo:block element.
Regards,
Radu
In the XSLT stylesheet:
DITA-OT/plugins/org.dita.pdf2/cfg/fo/attrs/commons-attr.xsl
are all the attribute sets used to output a topic's title like "topic.title" (for first level topics), "topic.topic.title" for second level topics, "topic.topic.topic.title" for third level topics.
So one option would be for you to override in your customization as many such nested topic title attribute set names as possible and add the break-before attribute.
Another possibility would be to look in the XSLT:
DITA-OT/plugins/org.dita.pdf2/xsl/fo/commons.xsl
at the template which processes a topic's title:
Code: Select all
<xsl:template match="*" mode="processTopicTitle">
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 22
- Joined: Tue May 17, 2016 4:58 pm
Re: How to force a page break after each first level topic
Hi when I use this procedure in Oxygen v18 I get the following exception:bogdan_cercelaru wrote:Hello,
The following procedure explains how to customize the PDF output by setting up a customization directory.You can find more information regarding PDF customization in our user-guide: Customizing DITA Transformations / DITA to PDF Output Customization / Creating a Customization Directory for PDF Output
- Copy the entire directory: DITA_OT_DIR\plugins\org.dita.pdf2\Customization to another location (for instance, C:\Customization).
- Rename C:\Customization\catalog.xml.orig to: C:\Customization\catalog.xml.
- Open the catalog.xml in Oxygen XML Editor and uncomment this line:
So now it looks like this:Code: Select all
<!--uri name="cfg:fo/attrs/custom.xsl" uri="fo/attrs/custom.xsl"/-->
Code: Select all
<uri name="cfg:fo/attrs/custom.xsl" uri="fo/attrs/custom.xsl"/>
- Rename the file: C:\Customization\fo\attrs\custom.xsl.orig to: C:\Customization\fo\attrs\custom.xsl
- Open the custom.xsl file in Oxygen XML Editor and add the "attribute-set" that you want to customize(in your case: "topic.topic.title"). Now, custom.xsl has the following content:
Code: Select all
<xsl:attribute-set name="topic.topic.title">
<xsl:attribute name="break-before">page</xsl:attribute>
</xsl:attribute-set>- Edit the DITA Map to PDF transformation scenario and in the Parameters tab, set the customization.dir parameter to C:\Customization.
Regards,
Bogdan
Code: Select all
C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\build.xml:41: The following error occurred while executing this line:
C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\plugins\org.dita.base\build_preprocess.xml:226: java.lang.NullPointerException
Hi I've found out the problem you need to add the pagebreak at the top level topic.title
Code: Select all
<xsl:attribute-set name="topic.title" use-attribute-sets="common.title">
<xsl:attribute name="break-before">page</xsl:attribute>
</xsl:attribute-set>
Last edited by Edwin on Wed May 25, 2016 11:46 am, edited 1 time in total.
-
- Posts: 9437
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to force a page break after each first level topic
Hi,
Could you double check that the received error is related to your customization?
For example if you publish without your customization folder, does the publishing work?
You seem to be using DITA Open Toolkit 2.x for publishing. In the Oxygen Preferences->DITA page you can configure the default used DITA Open Toolkit. For Oxygen 17.1 and older the used DITA OT was 1.8 so possibly this problem you encountered is a bug in DITA Open Toolkit 2.x. Could you paste in a code block the entire output received from the DITA OT ANT console? Or attach that to an email if you prefer...
Regards,
Radu
Could you double check that the received error is related to your customization?
For example if you publish without your customization folder, does the publishing work?
You seem to be using DITA Open Toolkit 2.x for publishing. In the Oxygen Preferences->DITA page you can configure the default used DITA Open Toolkit. For Oxygen 17.1 and older the used DITA OT was 1.8 so possibly this problem you encountered is a bug in DITA Open Toolkit 2.x. Could you paste in a code block the entire output received from the DITA OT ANT console? Or attach that to an email if you prefer...
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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