2

I'd like to create a pdf base don a dita/xml map where one of the topics is formatted in a newspaper style two-column output.

I've found the attribute to use in my layout-masters-attr style sheet: <xsl:attribute name="column-count">2</xsl:attribute>

This creates an two-column output for the whole document. So i've added an @outputclass argument to the region body attribute-set. This doen't give me the correct result. Does anybody know how to create a two-column output for a single topic in a ditamap?

My style sheet definition:

<xsl:attribute-set name="region-body" use-attribute-sets="region-body.odd"/>            
<xsl:attribute-set name="region-body.odd">
<xsl:attribute name="margin-top">
<xsl:value-of select="$body-margin"/>
</xsl:attribute>
<xsl:attribute name="margin-bottom">
<xsl:value-of select="$body-margin"/>
</xsl:attribute>
<xsl:attribute name="{if ($writing-mode = 'lr') then 'margin-left' else 'margin-right'}">
<xsl:value-of select="$page-margin-inside"/>
</xsl:attribute>
<xsl:attribute name="{if ($writing-mode = 'lr') then 'margin-right' else 'margin-left'}">
<xsl:value-of select="$page-margin-outside"/>
</xsl:attribute>
<xsl:attribute name="column-count">
<xsl:choose>
<xsl:when test="@outputclass = 'twocol'">2</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:attribute-set>

My topic definition:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_hbq_pxv_yy">
<title>test</title>
<prolog/>
<body outputclass="twocol">

2 Answers2

0

The problem is that the page-sequence has to have the correct column-count attribute on it and the way the PDF2 plugin works, this is set for specific areas of a document, TOC, Index, Body, etc. You can't just tu

To achieve what you want, you can just take the content of a topic and put it into a 2-column table. While not the best solution, it's the best you can get with the current implementation.

JulioV
  • 516
  • 2
  • 3
0

If you have the opportunity to use Antenna House Formatter for PDF generation, you can easily generate two column layout by specifying fo:block-container/column-count="2".

column-count / CSS (-ah-)column-count

http://www.antenna.co.jp/AHF/help/v64e/ahf-ext.html#columns

The stylesheet is so simple as follows:

<xsl:template match="*[contains(@class,' topic/body ')][string(@outputclass) eq 'twocol']" priority="2">
    <fo:block-container column-count="2">
        <xsl:next-match/>
    </fo:block-container>
</xsl:template>
Toshihiko Makita
  • 1,294
  • 1
  • 8
  • 15