Page 1 of 1

Adding columns for certain DITA elements (PDF layout)

Posted: Mon May 13, 2024 12:44 pm
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)

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

Posted: Mon May 13, 2024 2:39 pm
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

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

Posted: Mon May 13, 2024 7:28 pm
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;
}
...