Page 1 of 1

Unable to generate 2-column PDF output in DITA Book

Posted: Mon May 04, 2026 6:21 pm
by Timbot2000
Hello everyone, first-time poster here.
I have created a document as a multi-topic book in DITA, and everything otherwise displays the way I would like it, however, There is one section, namely "Abstract" that I want displayed in 2-column view. However all attempts to do so have failed (including outputclass, topicgroup, etc..
The current code of the Abstract topic is as follows:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="abstract" outputclass="two-columns">
    <title outputclass="two-columns">(57) Abstract</title>
    <body outputclass="two-columns">
        <p> This invention ... is not restricted.</p>
        <p><image placement="inline" href="media/image3.png" id="image_y3q_5rx_cjc">
                <alt>Enxploded view of nail gun</alt>
            </image></p>
    </body>
</topic>
Where the corresponding code in the combined HTML5 is

Code: Select all

</article><article xmlns:nd="http://www.oxygenxml.com/css2fo/named-destinations" class="- topic/topic topic nested0 two-columns two-column" aria-labelledby="ariaid-title4" break-before="true" is-chapter="true" id="unique_4" topicrefclass="- map/topicref " outputclass="two-columns two-column" nd:nd-id="abstract" oid="abstract" specializations="@props/deliveryTarget">
    <h1 class="- topic/title title topictitle1 two-columns" outputclass="two-columns" id="ariaid-title4"><span class="- topic/ph topic/title-wrapper ph title-wrapper">(57) Abstract</span></h1>
    <div class="- topic/body body two-columns" outputclass="two-columns">
        <p class="- topic/p p"> This invention ... is not restricted.</p>
        <p class="- topic/p p"><img xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot" class="- topic/image image" dita-ot:image-width="483" dita-ot:image-height="351" href="file:/home/tim/Insync/timbot2000@gmail.com/OneDrive/Portfolio/media/image3.png" id="unique_4_Connect_42_image_y3q_5rx_cjc" nd:nd-id="image_y3q_5rx_cjc" placement="inline" src="file:/home/tim/Insync/timbot2000@gmail.com/OneDrive/Portfolio/media/image3.png" alt="Enxploded view of nail gun"/></p>
and the current CSS settings are:

Code: Select all

/* Target abstract by its oid attribute */
article[oid="abstract"] {
    column-count: 2 !important;
    column-gap: 2em !important;
    column-fill: balance !important;
}

/* Make the title span both columns */
article[oid="abstract"] h1.title {
    column-span: all !important;
    -moz-column-span: all !important;
    -webkit-column-span: all !important;
}

/* Prevent paragraphs from breaking across columns */
article[oid="abstract"] p {
    break-inside: avoid-column !important;
    page-break-inside: avoid !important;
}

/* Target the body only within the article where oid is 'abstract' */
article[oid="abstract"] *[class ~= "topic/body"][class ~= "two-columns"] {
    column-count: 2;
    column-gap: 10mm;
}
Yest PDF Chemistry still stubbornly refuses to make this section 2-column. Can anybody help?

Re: Unable to generate 2-column PDF output in DITA Book

Posted: Tue May 05, 2026 9:41 am
by julien_lacour
Hello,

Oxygen PDF Chemistry doesn't support column display at element level.
Instead you need to define it at page level for your "abstract" topic. You will find here the detailed customization.

Regards,
Julien