keep-together help

75 views
Skip to first unread message

John Piechowski

unread,
Feb 19, 2021, 1:31:35 PM2/19/21
to DITA-OT Users
I'm working on an issue that it seems like keep-together should be able to help.

I'm using DITA 3.5.4. 

The content is a steps/step/substeps/substep structure. See the image for Step 12. It is rendering on the page and then dropping to the next page before rendering the last two lines before starting the substeps. I don't have keep-with next/previous set on any of the items.

My preference is that all of 12. drop to the next page. If I set a page break on step 12 (which I prefer not to do for obvious reasons anyway), it pushed 12 to the next page but then does a column break at "malesuada" to the second column anyway.

I have tried different combinations of keep-together, keep-together.within-column, and keep-together.within-page. I tried forcing it with Always, setting priorities from 1-9, and as shown set it to auto. 

Auto is basically the same as nothing.

I also tried keep-together.within-page on the <step> with a value of 1. It caused only the 6 lines on a single page, then a blank page, then the rest of the substeps on the following page.

My goal is to have the <cmd> drop down the the next page instead of be left on the previous page. But the CMD is rendered in the overall fo:block for the step, so keep-together always tries to force all of it (cmd, step, and all substeps) onto a single page, which doesn't work.

Can anyone help me understand how to accomplish this?


<fo:list-item keep-together="auto" padding-after="4pt" provisional-distance-between-starts="7mm" vertical-align="middle">
<fo:list-item-label end-indent="label-end()" text-align="left" vertical-align="middle">
<fo:block>12.</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ex nulla, volutpat ac sodales ornare, molestie in leo. Etiam gravida ipsum ac ligula varius, eget euismod ex pretium. Aenean tempor semper sapien, in tempus nibh tristique eget. Ut et lectus ac massa semper feugiat. Curabitur arcu turpis, bibendum et laoreet at, venenatis vel neque. Suspendisse pretium nisi et eros tincidunt malesuada. Interdum et malesuada fames ac ante ipsum primis in faucibus.
<fo:list-block space-before.optimum="6pt">
<fo:list-item keep-together.within-page="auto" padding-after="4pt" provisional-distance-between-starts="7mm" vertical-align="middle">
<fo:list-item-label end-indent="label-end()" text-align="left" vertical-align="middle">
<fo:block>a.</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
            Vivamus pretium lorem ac urna vehicula  (A Figure <fo:basic-link internal-destination="unique_9_Connect_42_iw_relayboard_location_20kW">10</fo:basic-link>).
<fo:block>
<fo:block-container xmlns:graph="http://ns.adobe.com/Graphs/1.0/" xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/" xmlns:svg="http://www.w3.org/2000/svg" xmlns:x="http://ns.adobe.com/Extensibility/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink" margin="6pt 0pt 6pt 0pt" margin-left="0pt">
<fo:block border="0.5pt solid black" keep-together="always">
<fo:block font-size="12pt" font-style="italic" font-weight="bold" margin-left="2pt" margin-right="2pt" margin-top="2pt" text-align="left">10</fo:block>
<fo:block id="unique_9_Connect_42_iw_relayboard_location_20kW" margin-bottom="2pt" margin-left="2pt" margin-right="2pt" text-align="center">
<fo:block>
<fo:external-graphic content-height="100%" content-width="scale-to-fit" scaling="uniform" src="images/location.svg" text-align="center" width="100%"/>
</fo:block>
</fo:block>
</fo:block>
</fo:block-container>
</fo:block>
</fo:block>
</fo:list-item-body>
</fo:list-item>

TOPIC Snipper
    <step>
        <cmd>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ex nulla, volutpat ac sodales ornare, molestie in leo. Etiam gravida ipsum ac ligula varius, eget euismod ex pretium. Aenean tempor semper sapien, in tempus nibh tristique eget. Ut et lectus ac massa semper feugiat. Curabitur arcu turpis, bibendum et laoreet at, venenatis vel neque. Suspendisse pretium nisi et eros tincidunt malesuada. Interdum et malesuada fames ac ante ipsum primis in faucibus.</cmd>
        <substeps id="substeps_1">
          <substep>
            <cmd>Vivamus pretium lorem ac urna vehicula  (A Figure <xref href="topic.dita#task.dita_10845ce2-7990-4db8-b735-9bb9e70d0bb7/iw_location" scope="local"></xref>).</cmd>
            <info>
              <fig id="iw_location">
                <title> Efficitur dolor volutpat. </title>
                <image align="center" placement="break" conkeyref="Image-Warehouse/iw_location" id="image_42">
                </image>
              </fig>
            </info>
          </substep>

2021_02_19_12_03_13_80102275USCN.pdf_Adobe_Acrobat_Reader_DC_32_bit_.png

Toshihiko Makita

unread,
Feb 20, 2021, 8:36:33 AM2/20/21
to DITA-OT Users

Hi John 

It is very surprising for me to look your XSL-FO that may be generated via DITA-OT PDF2 customization. As you want to control keep conditions with 'cmd' element, you should generate <fo:inline> for 'cmd' element because it is the specialization of inline 'phase' element.

3.10.2.10 <cmd>

http://docs.oasis-open.org/dita/dita/v1.3/errata02/os/complete/part3-all-inclusive/langRef/technicalContent/cmd.html#cmd

However your stylesheet seems to generate no FO elements for 'cmd' element.

If you generate <fo:inline> for 'cmd', your can apply any keep conditions to it based XSL 1.1 spcification.

6.6.7 fo:inline

https://www.w3.org/TR/xsl11/#fo_inline

  • 7.20.3 keep-together
  • 7.20.4 keep-with-next
  • 7.20.5 keep-with-previous

Above three properties are applicable for controlling keep conditions.

Also I've noticed following PDF2 stylesheet generates <fo:block> for 'cmd' but also generates fo:block from corresponding  'steps/step'. This is stylesheet design mistake.

https://github.com/dita-ot/dita-ot/blob/develop/src/main/plugins/org.dita.pdf2/xsl/fo/task-elements.xsl line 103 to 120.

https://github.com/dita-ot/dita-ot/blob/develop/src/main/plugins/org.dita.pdf2/xsl/fo/task-elements.xsl line 249 to 270.

In your stylesheet, you may customize above PDF2 in wrong way.  If you add generating fo:inline for 'cmd' and apply keep condition (probably keep-together.within-column), it will solve your problem.

For your reference take a look at my PDF5-ML implementation.

https://github.com/AntennaHouse/pdf5-ml/blob/master/com.antennahouse.pdf5.ml/xsl/dita2fo_taskelements.xsl line 360 to 367 and line 175 to 210 in 'processStep' template.

Hope this helps your understanding.

Regards,

-- 
/*-------------------------------------------------------------------------------------
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 http://www.antenna.co.jp/
 http://www.antennahouse.com/
 --------------------------------------------------------------------------------------*/   

2021年2月20日土曜日 3:31:35 UTC+9 John Piechowski:

John Piechowski

unread,
Feb 22, 2021, 8:48:15 AM2/22/21
to DITA-OT Users
Thank you Toshihiko. This solved my problem.

Best Regards,
John

Reply all
Reply to author
Forward
0 new messages