docbook-apps

  • 1.  Changing line spacing in variablelists

    Posted 08-17-2016 17:49
      |   view attached
    Dear friends,



    I want to remove all line spacing for list items in the PDF output of a
    Docbook 4.5 document, using Saxon6.5.5 and Apache FOP. I've been able to do
    this successfully, except for one line in variablelists. The spacing
    between the term and listitem in a variablelist remains. I have made a
    number of attempts in my custom stylesheet, but no luck.



    For example, one part of my source document looks like this:



    <varlistentry>

    <term><parameter moreinfo="none">modbus</parameter></term>

    <listitem>

    <para>The modbus instance pointer. Always enter <literal></literal>

    moreinfo="none">modbus for this

    parameter</para>

    </listitem>

    </varlistentry>

    <varlistentry>

    <term><parameter moreinfo="none">slaveid</parameter></term>

    <listitem>

    <para>The slave ID for this point. An entry of zero (<literal></literal>

    moreinfo="none">0) will use the default slave

    ID for the Modbus connection.</para>

    </listitem>

    </varlistentry>

    ...



    My custom stylesheet currently contains this:



    <xsl:attribute-set name="list.item.spacing">

    <xsl:attribute name="space-before.optimum">0em</xsl:attribute>

    <xsl:attribute name="space-before.minimum">0em</xsl:attribute>

    <xsl:attribute name="space-before.maximum">0em</xsl:attribute>

    <xsl:attribute name="space-after.optimum">0em</xsl:attribute>

    <xsl:attribute name="space-after.minimum">0em</xsl:attribute>

    <xsl:attribute name="space-after.maximum">0em</xsl:attribute>

    </xsl:attribute-set>



    <xsl:attribute-set name="list.block.spacing">

    <xsl:attribute name="padding-top">0em</xsl:attribute>

    <xsl:attribute name="padding-bottom">0em</xsl:attribute>

    <xsl:attribute name="space-before.optimum">0em</xsl:attribute>

    <xsl:attribute name="space-before.minimum">0em</xsl:attribute>

    <xsl:attribute name="space-before.maximum">0em</xsl:attribute>

    <xsl:attribute name="space-after.optimum">0em</xsl:attribute>

    <xsl:attribute name="space-after.minimum">0em</xsl:attribute>

    <xsl:attribute name="space-after.maximum">0em</xsl:attribute>

    </xsl:attribute-set>



    <xsl:template match="d:varlistentry" mode="vl.as.blocks">

    <xsl:variable name="id">

    <xsl:call-template name="object.id"></xsl:call-template>

    </xsl:variable>



    <fo:block id="{$id}"></fo:block>
    xsl:use-attribute-sets="variablelist.term.properties

    list.item.spacing"

    keep-together.within-column="always"

    keep-with-next.within-column="always"

    space-after.minimum="0pt"

    space-after.maximum="0pt"

    space-after.optimum="0pt"

    space-after.precedence="3"

    padding-top="0pt"

    padding-bottom="0pt"

    >

    <xsl:apply-templates select="d:term"></xsl:apply-templates>





    <fo:block></fo:block>

    space-before.minimum="0pt"

    space-before.maximum="0pt"

    space-before.optimum="0pt"

    space-before.precedence="3"

    padding-top="0pt"

    padding-bottom="0pt"

    >

    <xsl:attribute></xsl:attribute>
    name="margin-{$direction.align.start}">0.25in

    <xsl:apply-templates select="d:listitem"></xsl:apply-templates>



    </xsl:template>



    My output is in the attached screenshot, VariableListSpacing.jpg. As you
    can see, all of the line spacing is removed, except for the area between the
    term and the listitem. Can anyone help with this?



    Best regards,



    Bob






    <http: cogent.ca/="">

    Bob McIlvride Communications Manager

    Cogent Real-Time Systems Inc., a Skkynet company

    T 1 905 702 7851 ext 103

    <http: cogent.ca/=""> cogent.ca




    </http:></http:>


  • 2.  Re: [docbook-apps] Changing line spacing in variablelists

    Posted 08-17-2016 19:11
    Hi Bob,
    The extra space is coming from the <para> element embedded in the
    listitem. The para element generates a block with its own spacing coming
    from the "para.properties" attribute-set. I was able to remove the
    extra space by customizing para.properties as follows to make it
    conditional:

    <xsl:attribute-set name="para.properties">
    <xsl:attribute name="space-before.maximum">
    <xsl:choose>
    <xsl:when test="ancestor::varlistentry">0pt</xsl:when>
    <xsl:otherwise>1.2em</xsl:otherwise>
    </xsl:choose>
    </xsl:attribute>
    <xsl:attribute name="space-before.optimum">
    <xsl:choose>
    <xsl:when test="ancestor::varlistentry">0pt</xsl:when>
    <xsl:otherwise>1.0em</xsl:otherwise>
    </xsl:choose>
    </xsl:attribute>
    <xsl:attribute name="space-before.minimum">
    <xsl:choose>
    <xsl:when test="ancestor::varlistentry">0pt</xsl:when>
    <xsl:otherwise>.8em</xsl:otherwise>
    </xsl:choose>
    </xsl:attribute>

    </xsl:attribute-set>

    Note that this applies to all paras in varlistentry, so if you have two
    paras in a listitem, there will be no space between them as well.


    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    On 8/17/2016 10:49 AM, Bob McIlvride wrote:
    > Dear friends,
    >
    >
    >
    > I want to remove all line spacing for list items in the PDF output of a
    > Docbook 4.5 document, using Saxon6.5.5 and Apache FOP. I've been able
    > to do this successfully, except for one line in variablelists. The
    > spacing between the term and listitem in a variablelist remains. I have
    > made a number of attempts in my custom stylesheet, but no luck.
    >
    >
    >
    > For example, one part of my source document looks like this:
    >
    >
    >
    > <varlistentry>
    >
    > <term><parameter moreinfo="none">modbus</parameter></term>
    >
    > <listitem>
    >
    > <para>The modbus instance pointer. Always enter <literal
    >
    > moreinfo="none">modbus</literal> for this
    >
    > parameter</para>
    >
    > </listitem>
    >
    > </varlistentry>
    >
    > <varlistentry>
    >
    > <term><parameter moreinfo="none">slaveid</parameter></term>
    >
    > <listitem>
    >
    > <para>The slave ID for this point. An entry of zero (<literal
    >
    > moreinfo="none">0</literal>) will use the default slave
    >
    > ID for the Modbus connection.</para>
    >
    > </listitem>
    >
    > </varlistentry>
    >
    > ...
    >
    >
    >
    > My custom stylesheet currently contains this:
    >
    >
    >
    > <xsl:attribute-set name="list.item.spacing">
    >
    > <xsl:attribute name="space-before.optimum">0em</xsl:attribute>
    >
    > <xsl:attribute name="space-before.minimum">0em</xsl:attribute>
    >
    > <xsl:attribute name="space-before.maximum">0em</xsl:attribute>
    >
    > <xsl:attribute name="space-after.optimum">0em</xsl:attribute>
    >
    > <xsl:attribute name="space-after.minimum">0em</xsl:attribute>
    >
    > <xsl:attribute name="space-after.maximum">0em</xsl:attribute>
    >
    > </xsl:attribute-set>
    >
    >
    >
    > <xsl:attribute-set name="list.block.spacing">
    >
    > <xsl:attribute name="padding-top">0em</xsl:attribute>
    >
    > <xsl:attribute name="padding-bottom">0em</xsl:attribute>
    >
    > <xsl:attribute name="space-before.optimum">0em</xsl:attribute>
    >
    > <xsl:attribute name="space-before.minimum">0em</xsl:attribute>
    >
    > <xsl:attribute name="space-before.maximum">0em</xsl:attribute>
    >
    > <xsl:attribute name="space-after.optimum">0em</xsl:attribute>
    >
    > <xsl:attribute name="space-after.minimum">0em</xsl:attribute>
    >
    > <xsl:attribute name="space-after.maximum">0em</xsl:attribute>
    >
    > </xsl:attribute-set>
    >
    >
    >
    > <xsl:template match="d:varlistentry" mode="vl.as.blocks">
    >
    > <xsl:variable name="id">
    >
    > <xsl:call-template name="object.id"/>
    >
    > </xsl:variable>
    >
    >
    >
    > <fo:block id="{$id}"
    > xsl:use-attribute-sets="variablelist.term.properties
    >
    > list.item.spacing"
    >
    > keep-together.within-column="always"
    >
    > keep-with-next.within-column="always"
    >
    > space-after.minimum="0pt"
    >
    > space-after.maximum="0pt"
    >
    > space-after.optimum="0pt"
    >
    > space-after.precedence="3"
    >
    > padding-top="0pt"
    >
    > padding-bottom="0pt"
    >
    > >
    >
    > <xsl:apply-templates select="d:term"/>
    >
    > </fo:block>
    >
    >
    >
    > <fo:block
    >
    > space-before.minimum="0pt"
    >
    > space-before.maximum="0pt"
    >
    > space-before.optimum="0pt"
    >
    > space-before.precedence="3"
    >
    > padding-top="0pt"
    >
    > padding-bottom="0pt"
    >
    > >
    >
    > <xsl:attribute
    > name="margin-{$direction.align.start}">0.25in</xsl:attribute>
    >
    > <xsl:apply-templates select="d:listitem"/>
    >
    > </fo:block>
    >
    > </xsl:template>
    >
    >
    >
    > My output is in the attached screenshot, VariableListSpacing.jpg. As
    > you can see, all of the line spacing is removed, except for the area
    > between the term and the listitem. Can anyone help with this?
    >
    >
    >
    > Best regards,
    >
    >
    >
    > Bob
    >
    >
    >
    >
    >
    > COGENT <http://cogent.ca/>
    >
    >
    >
    > *Bob McIlvride ** Communications Manager*
    >
    > Cogent Real-Time Systems Inc., a Skkynet company
    >
    > T 1 905 702 7851 ext 103
    >
    > cogent.ca <http://cogent.ca/>
    >
    >
    >
    >
    >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >



  • 3.  RE: [docbook-apps] Changing line spacing in variablelists

    Posted 08-17-2016 19:29
    Hi Bob,

    That did it. Very helpful! Thank you.

    Best regards,

    Bob


    Bob McIlvride Communications Manager
    Cogent Real-Time Systems Inc., a Skkynet company
    T 1 905 702 7851 ext 103
    cogent.ca