Forcing page breaks and list breaks in PDF output...
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 58
- Joined: Fri Sep 12, 2008 12:12 am
Forcing page breaks and list breaks in PDF output...
So, I have two questions in one here, both relating to how to allow for breaks or white space between entries. First of all, I would like to be able to arbitrarily force a page break between topics so that they appear at the top of the next page (regardless of their position in the topic hierarchy). Can any kind of tag be used for that, or specific editing to be made the ditamap, rather than editing the xsls that transform the document into a PDF?
Second, and lastly, if I want to have breaks or spaces (the equivalent of shift+enter in Microsoft Word) between items in a sequentially numbered bulleted list is there a way to accommodate that in the WYSIWYG editor (none that I can see) or will it require editing an xsl that controls the formatting of ordered lists? If that does require editing an xsl file, which one is the relevant *.xsl and would you be able to propose a pertinent change to enable it to do that? I would really appreciate any help anyone can give on this.
Thanks,
Josh
Second, and lastly, if I want to have breaks or spaces (the equivalent of shift+enter in Microsoft Word) between items in a sequentially numbered bulleted list is there a way to accommodate that in the WYSIWYG editor (none that I can see) or will it require editing an xsl that controls the formatting of ordered lists? If that does require editing an xsl file, which one is the relevant *.xsl and would you be able to propose a pertinent change to enable it to do that? I would really appreciate any help anyone can give on this.
Thanks,
Josh
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: Forcing page breaks and list breaks in PDF output...
Hello Josh,
Controlling the page breaks in DITA OT is possible only by changing the XSL parameters from the file: ${oxygen_install_dir}/frameworks/dita/DITA-OT/xsl/xslfo/dita2fo-params.xsl. There is no equivalant DITA markup for this.
For instance to add a page break before the title of a level 3 topic you should add the break-brefore=page attribute:
To change the spacing between the list items, you should change the template:
from the file:${oxygen_install_dir}/frameworks/dita/DITA-OT/xsl/xslfo/dita2fo-lists.xsl.
For more advanced DITA-OT related questions, I recommend the discussion list:
dita-users@yahoogroups.com.
Many regards,
Dan
Controlling the page breaks in DITA OT is possible only by changing the XSL parameters from the file: ${oxygen_install_dir}/frameworks/dita/DITA-OT/xsl/xslfo/dita2fo-params.xsl. There is no equivalant DITA markup for this.
For instance to add a page break before the title of a level 3 topic you should add the break-brefore=page attribute:
Code: Select all
<xsl:attribute-set name="topictitle3" >
<xsl:attribute name="break-before">page</xsl:attribute>
..
Code: Select all
<xsl:template match="*[contains(@class,' topic/ol ')]/*[contains(@class,' topic/li ')]">
For more advanced DITA-OT related questions, I recommend the discussion list:
dita-users@yahoogroups.com.
Many regards,
Dan
-
- Posts: 58
- Joined: Fri Sep 12, 2008 12:12 am
Re: Forcing page breaks and list breaks in PDF output...
Thank you Dan. Quite helpful. Now lets say, just to humor me, that I wanted to be more picky and somehow tag individual (arbitrarily picked) topics with some attribute (whether in the ditamap or in the topic itself - like tagging the title). Would it be possible in the dita2fo-params.xsl file to use a <xsl:choose> <xsl:when> </xsl:when> </xsl:choose> section to filter out a given attribute when I want to break the topic? Is there even a possible attribute that can be used to "tag" item like that, or will that not work? I admit I'm still learning the ropes of DITA and I'm not terribly good at xslfo, so any advice you can give to me would more likely than not be helpful.
And lastly, for the bulleted lists, now that I know how/where to edit them what is the best method for adding a "newline" space? Looking on some other forums I saw two suggestions: adding an extra fo block with a breaking character, <fo:block> </fo:block> -or- adding a setting to the block <fo:block white-space-collapse="false"> so that it won't ignore white space. The   character seems to work alright although it produces staggered (literally) results based on where I place it, some bullets it seems to skip and no space is made, while the one right after it and a few following do, and then it happens again. As for the white-space-collapse="false" it doesn't seem to work at all. Any suggestions?
Thanks,
~Josh
And lastly, for the bulleted lists, now that I know how/where to edit them what is the best method for adding a "newline" space? Looking on some other forums I saw two suggestions: adding an extra fo block with a breaking character, <fo:block> </fo:block> -or- adding a setting to the block <fo:block white-space-collapse="false"> so that it won't ignore white space. The   character seems to work alright although it produces staggered (literally) results based on where I place it, some bullets it seems to skip and no space is made, while the one right after it and a few following do, and then it happens again. As for the white-space-collapse="false" it doesn't seem to work at all. Any suggestions?
Thanks,
~Josh
-
- Posts: 58
- Joined: Fri Sep 12, 2008 12:12 am
Re: Forcing page breaks and list breaks in PDF output...
I actually just solved the line space problem by using the line space character, but I had to put it in two places to counteract the staggered results. I don't fully understand the reason they needed to be placed like they did but here is a sample of the code (asterisks next to the added lines):
I initially tried placing them near the bottom of "list-item-label" and "list-item-body" but that gave strange results, and a single <fo:block> </fo:block> at the top of "list-item-label" and "list-item-body" would offset the text up or down from the numbering. So I figured if one section set it off in the upward direction and the other section set it in the downward direction that doing both would counteract one another while still adding the space needed. It worked. Hope that can help someone who ever runs across the same problem.
~Josh
Code: Select all
<fo:list-item>
<fo:list-item-label end-indent="label-end()" text-align="end">
*******<fo:block> </fo:block>*******
<fo:block > <!-- linefeed-treatment="ignore"-->
<xsl:choose>
<xsl:when test="($list-level mod 2) = 1">
<!-- arabic -->
<!--xsl:number format="1." /-->
<xsl:value-of select="position()"/>.
</xsl:when>
<xsl:otherwise>
<!-- alphabetic -->
<xsl:number format="a." />
</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<!--xsl:attribute name="start-indent"><xsl:value-of select="$basic-start-indent"/> + <xsl:value-of select="$extra-list-indent"/></xsl:attribute-->
*******<fo:block> </fo:block>*******
<fo:block>
<xsl:apply-templates />
</fo:block>
</fo:list-item-body>
</fo:list-item>
~Josh
Return to “General XML Questions”
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