docbook-apps

  • 1.  Left-aligning section titles with body text

    Posted 10-17-2013 21:45
    Hello all,

    The text body of my PDF document is indented.
    The section titles are auto-numbered (auto-labeled).

    Because there are several section levels, section labels vary w.r.t.
    length (the character count) and font. This makes that the distance from
    the left margin where the text part of a section title begins, is
    variable also.

    By tweaking the size of the body-indent, I can left-align the body text
    to the beginning of the section title of one specific section level. But
    this makes it almost by definition not aligned for another section level.

    Is there a way to accomplish that the text part of section titles always
    left-aligns with the body text, regardless the section level (i.e.
    regardless font or character length of the label)?

    Thanks in advance for any directions,

    Erik Leunissen.



  • 2.  Re: [docbook-apps] Left-aligning section titles with body text

    Posted 10-17-2013 22:11
    Yes, it is described in this section of my book:

    http://www.sagehill.net/docbookxsl/SideBySide.html

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    --------------------------------------------------
    From: "Erik Leunissen" <e.leunissen@hccnet.nl>
    Sent: Thursday, October 17, 2013 2:44 PM
    To: <docbook-apps@lists.oasis-open.org>
    Subject: [docbook-apps] Left-aligning section titles with body text

    > Hello all,
    >
    > The text body of my PDF document is indented.
    > The section titles are auto-numbered (auto-labeled).
    >
    > Because there are several section levels, section labels vary w.r.t.
    > length (the character count) and font. This makes that the distance from
    > the left margin where the text part of a section title begins, is
    > variable also.
    >
    > By tweaking the size of the body-indent, I can left-align the body text
    > to the beginning of the section title of one specific section level. But
    > this makes it almost by definition not aligned for another section level.
    >
    > Is there a way to accomplish that the text part of section titles always
    > left-aligns with the body text, regardless the section level (i.e.
    > regardless font or character length of the label)?
    >
    > Thanks in advance for any directions,
    >
    > Erik Leunissen.
    >
    > ---------------------------------------------------------------------
    > 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] Left-aligning section titles with body text

    Posted 10-18-2013 16:37
    On 18/10/13 00:10, Bob Stayton wrote:
    > Yes, it is described in this section of my book:
    >
    > http://www.sagehill.net/docbookxsl/SideBySide.html
    >

    Well blimey!

    I've got your book since several years now, and I missed this completely.

    It must be that I never realized what "side-by-side" means.

    Thanks,

    I'm off, reading ...

    Erik Leunissen.




  • 4.  Re: [docbook-apps] Left-aligning section titles with body text

    Posted 10-18-2013 17:18
    If you can come up with a better name than "side-by-side", let me know. I
    didn't know what to call it. 8^)

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    --------------------------------------------------
    From: "Erik Leunissen" <e.leunissen@hccnet.nl>
    Sent: Friday, October 18, 2013 9:37 AM
    To: <docbook-apps@lists.oasis-open.org>
    Subject: Re: [docbook-apps] Left-aligning section titles with body text

    > On 18/10/13 00:10, Bob Stayton wrote:
    >> Yes, it is described in this section of my book:
    >>
    >> http://www.sagehill.net/docbookxsl/SideBySide.html
    >>
    >
    > Well blimey!
    >
    > I've got your book since several years now, and I missed this completely.
    >
    > It must be that I never realized what "side-by-side" means.
    >
    > Thanks,
    >
    > I'm off, reading ...
    >
    > Erik Leunissen.
    >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    >



  • 5.  Re: [docbook-apps] Left-aligning section titles with body text

    Posted 10-18-2013 18:46
    On 18/10/13 19:18, Bob Stayton wrote:
    > If you can come up with a better name than "side-by-side", let me know.
    > I didn't know what to call it. 8^)
    >

    Well, now that you challenge me, and I come to think of it closely:

    1. I don't believe that there is anything wrong with "side by side".

    2. I think my missing this has to do with failing to see the relation
    with "alignment" or "left-alignment" or more in general "spatial
    lay-out". In any case, the word "formatting" seems a too unspecific word
    for me. (I understand "formatting" to include also colors and sizes of
    fonts, borders, ... maybe I'm wrong).

    Now you know what confused me. But how to express it best, that's
    another matter. Maybe something like:

    "Side by side aligned lay-out"

    I'm letting you consider this and maybe come up with something better,
    or just leave it as it is. Because after all, I'm not a native English
    speaker (and stating that my native language is Dutch, though not
    "double Dutch", isn't really adding to my status in this regard).

    Best regards,

    Erik Leunissen




  • 6.  Template for side-by-side lay-out adjusted for bridgeheads [was: Left-aligning section titles with body text]

    Posted 10-18-2013 21:20
    On 18/10/13 00:10, Bob Stayton wrote:
    > Yes, it is described in this section of my book:
    >
    > http://www.sagehill.net/docbookxsl/SideBySide.html
    >

    I've adjusted that template to account for bridgeheads rendered as a
    certain section level. For anyone to use at own risk.

    Regards,

    Erik Leunissen
    --
    <xsl:template name="section.heading">
    <xsl:param name="level" select="1"/>
    <xsl:param name="marker" select="1"/>
    <xsl:param name="title"/>
    <xsl:param name="marker.title"/>

    <xsl:variable name="title.block">
    <xsl:choose>
    <xsl:when test="self::d:bridgehead">
    <xsl:value-of select="$title"/>
    </xsl:when>
    <xsl:otherwise>
    <fo:list-block start-indent="0mm"
    provisional-distance-between-starts="{$body.start.indent}"
    provisional-label-separation="5mm">
    <fo:list-item>
    <fo:list-item-label end-indent="label-end()"
    text-align="start">
    <fo:block>
    <xsl:apply-templates select="parent::*"
    mode="label.markup"/>
    </fo:block>
    </fo:list-item-label>
    <fo:list-item-body start-indent="body-start()"
    text-align="start">
    <fo:block>
    <xsl:apply-templates select="parent::*"
    mode="title.markup"/>
    </fo:block>
    </fo:list-item-body>
    </fo:list-item>
    </fo:list-block>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>

    <fo:block xsl:use-attribute-sets="section.title.properties">
    <xsl:if test="$marker != 0">
    <fo:marker marker-class-name="section.head.marker">
    <xsl:copy-of select="$marker.title"/>
    </fo:marker>
    </xsl:if>

    <xsl:choose>
    <xsl:when test="$level=1">
    <fo:block xsl:use-attribute-sets="section.title.level1.properties">
    <xsl:copy-of select="$title.block"/>
    </fo:block>
    </xsl:when>
    <xsl:when test="$level=2">
    <fo:block xsl:use-attribute-sets="section.title.level2.properties">
    <xsl:copy-of select="$title.block"/>
    </fo:block>
    </xsl:when>
    <xsl:when test="$level=5">
    <fo:block xsl:use-attribute-sets="section.title.level5.properties">
    <xsl:copy-of select="$title.block"/>
    </fo:block>
    </xsl:when>

    </xsl:choose>
    </fo:block>
    </xsl:template>

    -- end of message --