keep with


Aaron Mehl
 

Hi all,
Is there a way within Dita to force an image to stay with the previous or next steps in a task?
I googled and saw ways to do this with xslt, but I was wondering if there is an attribute within Dita, or can I achieve the same thing with css.
I am using Oxygen.
Thanks,
Aaron


Nicholas Mucks
 

Hi Aaron,
You’ll probably want an outputclass. We do something similar with tables in PDF. The outputclass will also become a class attribute value in the CSS if you’re relying on the HTML5 plugin as your base for customizations.

For example, if a writer sets outputclass=keep-together on their table then we add keep-together.within-page to the table in the XSL-FO attributes. (It’s just a choose statement in the attribute declaration.) This then forces the table to render within one PDF page.


Take care,
- Nick

Sent from mobile

On Feb 6, 2021, at 9:58 PM, Aaron Mehl via groups.io <mehlzaidy770@...> wrote:


Hi all,
Is there a way within Dita to force an image to stay with the previous or next steps in a task?
I googled and saw ways to do this with xslt, but I was wondering if there is an attribute within Dita, or can I achieve the same thing with css.
I am using Oxygen.
Thanks,
Aaron


Radu Coravu
 

Hi,

There are various properties in the CSS which control the page breaks if you are using CSS to produce PDF:

https://www.oxygenxml.com/doc/versions/23.0/ug-editor/topics/dcpp_page_breaking.html#dcpp_how_to_avoid_page_breaks_in_lists_and_tables

and combined with that Nick said, with the possibility to use a custom outputclass attribute either on the image or on its parent step you may be able to achieve what you want.

Regards,

Radu

On 2/7/21 18:15, Nicholas Mucks via groups.io wrote:
Hi Aaron,
You’ll probably want an outputclass. We do something similar with tables in PDF. The outputclass will also become a class attribute value in the CSS if you’re relying on the HTML5 plugin as your base for customizations.

For example, if a writer sets outputclass=keep-together on their table then we add keep-together.within-page to the table in the XSL-FO attributes. (It’s just a choose statement in the attribute declaration.) This then forces the table to render within one PDF page.


Take care,
- Nick

Sent from mobile

On Feb 6, 2021, at 9:58 PM, Aaron Mehl via groups.io <mehlzaidy770@...> wrote:


Hi all,
Is there a way within Dita to force an image to stay with the previous or next steps in a task?
I googled and saw ways to do this with xslt, but I was wondering if there is an attribute within Dita, or can I achieve the same thing with css.
I am using Oxygen.
Thanks,
Aaron
-- 
Radu Coravu
Oxygen XML Editor


despopoulos_chriss
 

Hi Radu...  Since we have your attention on this...  With CSS to PDF, can you avoid page breaks in a table row, but still allow the table itself to span pages?

Thanks                 cud


Chris Papademetrious
 

Hi Aaron,

If you are using the HTML5/CSS PDF transformation in Oxygen, it's pretty easy. Here is how we give authors manual control over pagination:

Making pagination controls accessible to DITA writers

You don't need to create a separate attribute for this (outputclass works fine), but I felt that doing so made it a bit more writer-friendly.

And we also do some automatic pagination handling for the writers. For example, we keep <p> introductions ending in ":" or "," with the following content, but you could easily extend this to images following procedure steps and so on (which is a good idea, actually!). Here's how we do that:

Automatically keeping introduction paragraphs with their content

We even have a Schematron check (mentioned in the preceding link's discussion) that tells writers when they've used a manual @paginate attribute in a scenario where it's automatically applied, which helps them dynamically learn the contexts in which it will be handled for them.


Hi Chris,

We use this setting to keep table rows from being split across pages:

@media print {
  *[class~='topic/row'] { page-break-inside: avoid; }
}

I put it in @media print to be pedantically correct.  :)