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

Post here questions and problems related to editing and publishing DITA content.
dpksaini89
Posts: 66
Joined: Thu Feb 08, 2018 2:44 pm

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

Post 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
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dpksaini89
Posts: 66
Joined: Thu Feb 08, 2018 2:44 pm

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

Post 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.
dpksaini89
Posts: 66
Joined: Thu Feb 08, 2018 2:44 pm

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

Post by dpksaini89 »

Image
thedantanner
Posts: 42
Joined: Thu Oct 27, 2016 11:13 pm

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

Post 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
dpksaini89
Posts: 66
Joined: Thu Feb 08, 2018 2:44 pm

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

Post by dpksaini89 »

Can it be implemented for topics also?
How to accomplish it in topics.
thedantanner
Posts: 42
Joined: Thu Oct 27, 2016 11:13 pm

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

Post 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.)
dpksaini89
Posts: 66
Joined: Thu Feb 08, 2018 2:44 pm

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

Post 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
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply