This section contains information about how to handle pages that have multiple columns.
First, you need to identify which of the pages need to be changed. Pages are already defined for the cover page, table of contents, chapter content, and others. The complete list is here: Default Page Definitions.
Next, add the column-count and column-gap properties to
that page. For example:
@page chapter{
column-count:2;
column-gap:1in;
}
If you need some of the elements to expand on all the columns, use the
column-span:all CSS property. The next snippet makes the chapter titles
span both columns:
*[class ~= "topic/topic"][is-chapter] > *[class ~= "topic/title"] {
column-span:all;
}
column-count and column-gap properties into account if
they are set on @page rules, not on elements from the content.If you need to have a different column layout for just one topic, you can use the following technique:
outputclass on the topic root
element.<topic outputclass="two_columns" ...page property for the matching
element.*[class ~= "two_columns"],
*[outputclass ~= "two_columns"]{
page: two_column_page !important;
}class attribute for the HTML
transformation, or outputclass for the direct transformation, or leave
them both if you are not sure.chapter page. You must use !important because the
built-in rules are more specific and you need to override the page
property.@page two_column_page {
column-count: 2;
}Note that the topic will be separated from other sibling topics with different page layouts by page breaks.
If you need to start each topic on a new column, you can use the following technique:
<map>
<title>Map</title>
<topicref href="first.dita">
<topicref href="second.dita"/>
</topicref>
<topichead navtitle="Topichead">
<topicref href="second.dita"/>
</topichead>
</map>@page {
column-count: 2;
}
*[class ~= "topic/topic"] *[class ~= "topic/topic"] > *[class ~= "topic/title"] {
-oxy-column-break-before: always;
}
*[class ~= "topic/title"] + *[class ~= "topic/topic"] > *[class ~= "topic/title"] {
-oxy-column-break-before: auto;
}Each topic will be displayed on a new column except for topics that only have a title and no content.