Page 1 of 1

How to implement keep-with-next and keep-with-previous

Posted: Fri Apr 06, 2018 8:05 am
by dpksaini89
I have tried with procedures mentioned in
https://github.com/dita-ot/dita-ot/issues/1878
and
https://www.oxygenxml.com/doc/versions/ ... ined3.html

But unable to find right instruction on how to implement keep-with-next and keep-with-previous to customize pdf output.
I am using <oXygen/> XML Editor 20.0, build 2018031511

Please direct me to right instructions page.

Thanks

Re: How to implement keep-with-next and keep-with-previous

Posted: Thu Apr 12, 2018 1:53 pm
by Radu
Hi,

Those particular instructions are only for implementing forced page breaks.
You seem to want more, maybe you could consider reading the DITA For Print book:

https://xmlpress.net/publications/dita/dita-for-print/

or join the Yahoo Groups DITA Users list, and ask there, giving more details, a small DITA sample and how you want the PDF output to look like.

Regards,
Radu

Re: How to implement keep-with-next and keep-with-previous

Posted: Fri Apr 27, 2018 9:18 am
by dpksaini89
Image

Here i wish to apply 'keep with next' feature on the task step, so that it always accompanies it's supporting illustration.

Re: How to implement keep-with-next and keep-with-previous

Posted: Fri Apr 27, 2018 3:48 pm
by dpksaini89
Image

Re: How to implement keep-with-next and keep-with-previous

Posted: Fri Apr 27, 2018 6:18 pm
by thedantanner
We have accomplished what you are trying to do by applying an attribute to the steps.step attribute set in the task-elements-attr.xml file.

Add the attribute keep-together.within-page as shown below.

Code: Select all

    <xsl:attribute-set name="steps.step" use-attribute-sets="ol.li">
<xsl:attribute name="space-after">3pt</xsl:attribute>
<xsl:attribute name="space-before">3pt</xsl:attribute>
<xsl:attribute name="keep-together.within-page">always</xsl:attribute>
Hope this helps.

d

Re: How to implement keep-with-next and keep-with-previous

Posted: Tue Jun 12, 2018 1:40 pm
by dpksaini89
Can it be implemented for topics also?
How to accomplish it in topics.

Re: How to implement keep-with-next and keep-with-previous

Posted: Tue Jun 12, 2018 5:18 pm
by thedantanner
If you use paragraphs in your topic files, you can apply the same attribute to paragraphs in the file commons-attr.xsl.

Code: Select all

  <xsl:attribute-set name="p" use-attribute-sets="common.block">
<xsl:attribute name="text-indent">0em</xsl:attribute>
<xsl:attribute name="keep-together.within-page">always</xsl:attribute>
</xsl:attribute-set>

(This attribute is also in the topic-attr.xsl file, but the commons-attr.xsl file covers all file types so I prefer to set it there.)

Re: How to implement keep-with-next and keep-with-previous

Posted: Tue Jul 10, 2018 9:43 am
by dpksaini89
I did not understood how to implement this in topics with ordered list.
Can you explain step-by-step how to do it.
Thanks

Re: How to implement keep-with-next and keep-with-previous

Posted: Tue Jul 10, 2018 9:48 am
by Radu
Hi,

This thread is about customizing PDF produced using XSL-FO.
You are currently using the new way to produce PDF using CSS. Maybe you can write a new post in which you can explain your problem, give maybe a small DITA example and tell us how you would expect the output PDF styled using CSS to look like.
Maybe you could also read this topic:

https://www.oxygenxml.com/doc/versions/ ... aking.html

which explains how the CSS "page-break-inside" property can be used to avoid page breaks inside certain elements.

Regards,
Radu