Re: [xep-support] Marginalia as a DocBook customisation

From: Bob Stayton (bobs@sagehill.net)
Date: Wed May 05 2004 - 13:27:47 PDT

  • Next message: G. Ken Holman: "[xep-support] Birmingham UK added to Hong Kong and Bremen for XSL Training [XML-Dev]"

    I used something that was a little closer to XEP's example, which included a
    block-container:

        <fo:float float="start"
                  start-indent="{$title.margin.left}"
                  clear="both">
          <fo:block-container width="-{$title.margin.left}">
              <fo:block
                    font-weight="normal"
                    font-size="7pt"
                    line-height="8pt"
                    start-indent="0pt"
                    end-indent="1pc">
                <xsl:apply-templates/>
              </fo:block>
          </fo:block-container>
        </fo:float>

    It tested this in both XEP and Antenna House, and it works for both. I was
    thinking that it might become a feature of the DocBook stylesheets, which is
    why I wanted it to work with all processors (although FOP does not support
    side floats yet).

    I had tried something like Jirka's example, but in Antenna House the content
    did not wrap, it just stayed on one line and intruded into the body area. I
    think the difference is that XEP supports width on fo:block, even though
    that property is not in the spec for fo:block. Is that an XEP extension?

    Bob Stayton
    Sagehill Enterprises
    DocBook Consulting
    bobs@sagehill.net

    ----- Original Message -----
    From: "Jirka Kosek" <jirka@kosek.cz>
    To: <xep-support@renderx.com>
    Sent: Wednesday, May 05, 2004 12:43 AM
    Subject: Re: [xep-support] Marginalia as a DocBook customisation

    Paul A. Hoadley wrote:

    > Has anyone written (or seen) a DocBook customisation to produce
    > marginalia using side floats?
    >
    > http://xep.xattic.com/xep/testsuite/usecasestest.html#marginalia
    >
    > I'm thinking of something like <note role="margin">...</note>. I'll
    > have a look at it if no one has done it.

    I was prototyping this some time ago, see attachement. I'm not sure if
    it still works with the latests stylesheets, but you can give it a try.
    Content of <remark> elements are formatted as marginalia, but you can
    change this very easily.

    Jirka

    -- 
    ------------------------------------------------------------------
       Jirka Kosek     e-mail: jirka@kosek.cz     http://www.kosek.cz
    ------------------------------------------------------------------
       Profesionální ¹kolení a poradenství v oblasti technologií XML.
             Úvod do XML 3.5.            DocBook 18.-19.5.
             XSLT 24.-26.5.              XML pro vývojáøe 7.-8.6.
    ------------------------------------------------------------------
    ----------------------------------------------------------------------------
    ----
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:fo="http://www.w3.org/1999/XSL/Format"
                    version="1.0">
    <!-- Element remark se zobrazuje jako marginálie -->
    <xsl:import
    href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
    <!-- Úpravy parametrů -->
    <!-- Velikost papíru -->
    <xsl:param name="paper.type" select="'A4'"/>
    <!-- XSLT procesor může používat rozšíření pro callouts apod. -->
    <xsl:param name="use.extensions" select="1"/>
    <!-- Rozšíření specifická pro daný FO procesor -->
    <!-- <xsl:param name="passivetex.extensions" select="1"/> -->
    <xsl:param name="xep.extensions" select="1"/>
    <!-- Velikost písma textu -->
    <xsl:param name="body.font.master">11</xsl:param>
    <!-- Velikost okrajů -->
    <xsl:param name="page.margin.inner" select="'8pc'"/>
    <xsl:param name="page.margin.outer" select="'8pc'"/>
    <!-- Číslování sekcí a kapitol -->
    <xsl:param name="section.autolabel" select="1"/>
    <xsl:param name="section.label.includes.component.label" select="1"/>
    <xsl:param name="chapter.autolabel" select="1"/>
    <xsl:param name="appendix.autolabel" select="1"/>
    <xsl:param name="part.autolabel" select="1"/>
    <xsl:param name="preface.autolabel" select="0"/>
    <!-- Nechceme obrázek -->
    <xsl:param name="draft.watermark.image" select="''"/>
    <!-- Nadpisy jsou zarovnány s textem, jak je zvykem v evropské
    typografii -->
    <xsl:param name="title.margin.left" select="'-5pc'"/>
    <xsl:param name="show.comments.as.marginalias" select="1"/>
    <xsl:template match="comment|remark">
      <xsl:if test="$show.comments != 0">
        <xsl:choose>
          <xsl:when test="$show.comments.as.marginalias = 1">
            <fo:float float="start">
              <fo:block width="4pc" text-align="end" font-family="Helvetica"
    font-size="8pt" font-weight="bold" margin-left="{$title.margin.left}">
                <xsl:call-template name="inline.charseq"/>
              </fo:block>
            </fo:float>
          </xsl:when>
          <xsl:otherwise>
            <fo:block font-style="italic">
              <xsl:call-template name="inline.charseq"/>
            </fo:block>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    -------------------
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to majordomo@renderx.com from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
    


    This archive was generated by hypermail 2.1.5 : Wed May 05 2004 - 13:38:30 PDT