Adding columns for certain DITA elements (PDF layout)

Post here questions and problems related to editing and publishing DITA content.
oxygen-user
Posts: 6
Joined: Wed Jan 24, 2024 4:36 pm

Adding columns for certain DITA elements (PDF layout)

Post by oxygen-user »

Hi,
I need to produce a PDF file
  • body content has three columns
  • page title and subtitle [shortdesc] don't have columns
So I added an outputclass in the DITA file:

Code: Select all

<concept>
<shortdesc>test</shortdesc>
<conbody outputclass="three-columns">
   <p>text</p>
</conbody>
</concept>
Then I added the following CSS selectors:

Code: Select all

*[class ~= "three-columns"],
.three-columns,
*[outputclass ~= "three-columns"]{ 
  column-count:3 !important;
  column-gap: normal; 
}

.body {
    display: block !important;
    column-count: 3 !important;
    column-gap: normal;
}
This has no result on the output PDF. (The *merged.html file has three columns but the column-count is also applied on the title and the subtitle/shortdesc.)
Could you help me with that? (Or do I need the paged solution, then add the title and subtitle as ::before elements?)

Kind regards

Related links:
https://www.oxygenxml.com/doc/versions/ ... xc_4xy_3fb (works but I do not want to apply the columns to the whole page
post13040.html#p13040 (did not work but I assume it's also only for the page)
julien_lacour
Posts: 545
Joined: Wed Oct 16, 2019 3:47 pm

Re: Adding columns for certain DITA elements (PDF layout)

Post by julien_lacour »

Hello,

Currently Oxygen PDF Chemistry does not support multiple column display at element level.
As explained in the user guide, the column-count property should be set at page level.
Then you can set column-span:all on the topics title and short description.

However, I added your vote to the feature request on our tracking system and I will post again here when the status will change.

Regards,
Julien
oxygen-user
Posts: 6
Joined: Wed Jan 24, 2024 4:36 pm

Re: Adding columns for certain DITA elements (PDF layout)

Post by oxygen-user »

Hi
Excellent, that works as expected.
Thanks for the information and for keeping me posted.

On some occasions, the columns on the last page were not evenly distributed. (In essence, the first column contained all the contents, the other columns nothing.)
So I declared various pages (for different outputclass values), similar to your instructions from https://www.oxygenxml.com/doc/versions/ ... xc_4xy_3fb


Code: Select all

/* Declare pages */
*[class ~= "one-fifth-page"],
*[outputclass ~= "one-fifth-page"]{ 
  page: one-fifth-page !important; 
}

...

/* Add columns to pages */
:root {
  --column-gap: 5mm;
}

@page one-fifth-page {
  column-count: 3;
  column-gap: var(--column-gap);
}

...

/* Declare padding for last page */
@page one-fifth-page:last {
  padding-bottom:21.4cm !important;
}
...
Post Reply