******************************************************************** -->
<xsl:template name="formal.object">
+ <xsl:param name="placement" select="'before'"/>
+
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<fo:block id="{$id}"
xsl:use-attribute-sets="formal.object.properties">
- <xsl:call-template name="formal.object.heading"/>
+ <xsl:if test="$placement = 'before'">
+ <xsl:call-template name="formal.object.heading"/>
+ </xsl:if>
<xsl:apply-templates/>
+ <xsl:if test="$placement != 'before'">
+ <xsl:call-template name="formal.object.heading"/>
+ </xsl:if>
</fo:block>
</xsl:template>
</xsl:template>
<xsl:template name="semiformal.object">
+ <xsl:param name="placement" select="'before'"/>
<xsl:choose>
<xsl:when test="./title">
- <xsl:call-template name="formal.object"/>
+ <xsl:call-template name="formal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ </xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="informal.object"/>
</xsl:template>
<xsl:template match="figure">
+ <xsl:variable name="param.placement"
+ select="substring-after(normalize-space($formal.title.placement),
+ concat(local-name(.), ' '))"/>
+
+ <xsl:variable name="placement">
+ <xsl:choose>
+ <xsl:when test="contains($param.placement, ' ')">
+ <xsl:value-of select="substring-before($param.placement, ' ')"/>
+ </xsl:when>
+ <xsl:when test="$param.placement = ''">before</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$param.placement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<!-- FIXME: is this too careless? -->
<xsl:choose>
<xsl:when test=".//imagedata[@align][1]">
<fo:block text-align="{.//imagedata[@align][1]/@align}">
- <xsl:call-template name="formal.object"/>
+ <xsl:call-template name="formal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ </xsl:call-template>
</fo:block>
</xsl:when>
<xsl:otherwise>
- <xsl:call-template name="formal.object"/>
+ <xsl:call-template name="formal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ </xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="example">
- <xsl:call-template name="formal.object"/>
+ <xsl:variable name="param.placement"
+ select="substring-after(normalize-space($formal.title.placement),
+ concat(local-name(.), ' '))"/>
+
+ <xsl:variable name="placement">
+ <xsl:choose>
+ <xsl:when test="contains($param.placement, ' ')">
+ <xsl:value-of select="substring-before($param.placement, ' ')"/>
+ </xsl:when>
+ <xsl:when test="$param.placement = ''">before</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$param.placement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:call-template name="formal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ </xsl:call-template>
</xsl:template>
<xsl:template name="table.frame">
<xsl:call-template name="object.id"/>
</xsl:variable>
+ <xsl:variable name="param.placement"
+ select="substring-after(normalize-space($formal.title.placement),
+ concat(local-name(.), ' '))"/>
+
+ <xsl:variable name="placement">
+ <xsl:choose>
+ <xsl:when test="contains($param.placement, ' ')">
+ <xsl:value-of select="substring-before($param.placement, ' ')"/>
+ </xsl:when>
+ <xsl:when test="$param.placement = ''">before</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$param.placement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<xsl:variable name="prop-columns"
select=".//colspec[contains(@colwidth, '*')]"/>
<xsl:variable name="table.content">
- <fo:table-and-caption id="{$id}"
- xsl:use-attribute-sets="formal.object.properties"
- keep-together.within-column="1">
- <fo:table-caption>
- <fo:block xsl:use-attribute-sets="formal.title.properties">
- <xsl:apply-templates select="." mode="object.title.markup"/>
- </fo:block>
- </fo:table-caption>
+ <fo:block id="{$id}"
+ xsl:use-attribute-sets="formal.object.properties"
+ keep-together.within-column="1">
+
+ <xsl:if test="$placement = 'before'">
+ <xsl:call-template name="formal.object.heading"/>
+ </xsl:if>
+
<fo:table>
<xsl:call-template name="table.frame"/>
<xsl:if test="count($prop-columns) != 0">
</xsl:if>
<xsl:apply-templates select="tgroup"/>
</fo:table>
- </fo:table-and-caption>
+
+ <xsl:if test="$placement != 'before'">
+ <xsl:call-template name="formal.object.heading"/>
+ </xsl:if>
+ </fo:block>
</xsl:variable>
<xsl:variable name="footnotes">
<xsl:if test=".//footnote">
- <fo:block>
+ <fo:block font-family="{$body.font.family}"
+ font-size="{$footnote.font.size}"
+ keep-together.within-column="1"
+ keep-with-previous="always">
<xsl:apply-templates select=".//footnote" mode="table.footnote.mode"/>
</fo:block>
</xsl:if>
</xsl:template>
<xsl:template match="equation">
- <xsl:call-template name="semiformal.object"/>
+ <xsl:variable name="param.placement"
+ select="substring-after(normalize-space($formal.title.placement),
+ concat(local-name(.), ' '))"/>
+
+ <xsl:variable name="placement">
+ <xsl:choose>
+ <xsl:when test="contains($param.placement, ' ')">
+ <xsl:value-of select="substring-before($param.placement, ' ')"/>
+ </xsl:when>
+ <xsl:when test="$param.placement = ''">before</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$param.placement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:call-template name="semiformal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ </xsl:call-template>
</xsl:template>
<xsl:template match="figure/title"></xsl:template>
<xsl:variable name="footnotes">
<xsl:if test=".//footnote">
<fo:block font-family="{$body.font.family}"
- font-size="{$footnote.font.size}">
+ font-size="{$footnote.font.size}"
+ keep-together.within-column="1"
+ keep-with-previous="always">
<xsl:apply-templates select=".//footnote" mode="table.footnote.mode"/>
</fo:block>
</xsl:if>
<!-- ==================================================================== -->
<xsl:template match="procedure">
- <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
- <xsl:variable name="title" select="title"/>
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id"/>
+ </xsl:variable>
+
+ <xsl:variable name="param.placement"
+ select="substring-after(normalize-space($formal.title.placement),
+ concat(local-name(.), ' '))"/>
+
+ <xsl:variable name="placement">
+ <xsl:choose>
+ <xsl:when test="contains($param.placement, ' ')">
+ <xsl:value-of select="substring-before($param.placement, ' ')"/>
+ </xsl:when>
+ <xsl:when test="$param.placement = ''">before</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$param.placement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<xsl:variable name="preamble"
select="*[not(self::step or self::title)]"/>
<xsl:variable name="steps" select="step"/>
<fo:block id="{$id}" xsl:use-attribute-sets="list.block.spacing">
- <xsl:if test="./title">
- <fo:block font-weight="bold">
- <xsl:apply-templates select="./title" mode="procedure.title.mode"/>
- </fo:block>
+ <xsl:if test="./title and $placement = 'before'">
+ <xsl:choose>
+ <xsl:when test="$formal.procedures != 0">
+ <xsl:call-template name="formal.object.heading"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:block font-weight="bold">
+ <xsl:apply-templates select="./title" mode="procedure.title.mode"/>
+ </fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:if>
<xsl:apply-templates select="$preamble"/>
provisional-label-separation="0.2em">
<xsl:apply-templates select="$steps"/>
</fo:list-block>
+
+ <xsl:if test="./title and $placement != 'before'">
+ <xsl:choose>
+ <xsl:when test="$formal.procedures != 0">
+ <xsl:call-template name="formal.object.heading"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:block font-weight="bold">
+ <xsl:apply-templates select="./title" mode="procedure.title.mode"/>
+ </fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
</fo:block>
</xsl:template>
<!ENTITY fop.extensions SYSTEM "../params/fop.extensions.xml">
<!ENTITY formal.object.properties SYSTEM "../params/formal.object.properties.xml">
<!ENTITY formal.procedures SYSTEM "../params/formal.procedures.xml">
+<!ENTITY formal.title.placement SYSTEM "../params/formal.title.placement.xml">
<!ENTITY formal.title.properties SYSTEM "../params/formal.title.properties.xml">
<!ENTITY funcsynopsis.decoration SYSTEM "../params/funcsynopsis.decoration.xml">
<!ENTITY funcsynopsis.style SYSTEM "../params/funcsynopsis.style.xml">
<reference><title>Miscellaneous</title>
&graphic.default.extension;
&formal.procedures;
+&formal.title.placement;
&runinhead.default.title.end.punct;
&runinhead.title.end.punct;
&show.comments;
<src:fragref linkend="fop.extensions.frag"/>
<src:fragref linkend="formal.object.properties.frag"/>
<src:fragref linkend="formal.procedures.frag"/>
+<src:fragref linkend="formal.title.placement.frag"/>
<src:fragref linkend="formal.title.properties.frag"/>
<src:fragref linkend="funcsynopsis.decoration.frag"/>
<src:fragref linkend="funcsynopsis.style.frag"/>
******************************************************************** -->
<xsl:template name="formal.object">
+ <xsl:param name="placement" select="'before'"/>
+
<div class="{name(.)}">
- <xsl:call-template name="formal.object.heading"/>
- <xsl:apply-templates/>
+ <xsl:call-template name="anchor"/>
+ <xsl:choose>
+ <xsl:when test="$placement = 'before'">
+ <xsl:call-template name="formal.object.heading"/>
+ <xsl:apply-templates/>
+ <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
+ <xsl:apply-templates/>
+ <xsl:call-template name="formal.object.heading"/>
+ </xsl:otherwise>
+ </xsl:choose>
</div>
</xsl:template>
<xsl:template name="formal.object.heading">
- <p>
- <xsl:call-template name="anchor"/>
+ <p class="title">
<b>
<xsl:apply-templates select="." mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:template>
<xsl:template name="semiformal.object">
+ <xsl:param name="placement" select="'before'"/>
<xsl:choose>
<xsl:when test="title">
- <xsl:call-template name="formal.object"/>
+ <xsl:call-template name="formal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ </xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="informal.object"/>
</xsl:template>
<xsl:template match="figure|table|example">
- <xsl:call-template name="formal.object"/>
+ <xsl:variable name="param.placement"
+ select="substring-after(normalize-space($formal.title.placement),
+ concat(local-name(.), ' '))"/>
+
+ <xsl:variable name="placement">
+ <xsl:choose>
+ <xsl:when test="contains($param.placement, ' ')">
+ <xsl:value-of select="substring-before($param.placement, ' ')"/>
+ </xsl:when>
+ <xsl:when test="$param.placement = ''">before</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$param.placement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:call-template name="formal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ </xsl:call-template>
</xsl:template>
<xsl:template match="equation">
- <xsl:call-template name="semiformal.object"/>
+ <xsl:variable name="param.placement"
+ select="substring-after(normalize-space($formal.title.placement),
+ concat(local-name(.), ' '))"/>
+
+ <xsl:variable name="placement">
+ <xsl:choose>
+ <xsl:when test="contains($param.placement, ' ')">
+ <xsl:value-of select="substring-before($param.placement, ' ')"/>
+ </xsl:when>
+ <xsl:when test="$param.placement = ''">before</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$param.placement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:call-template name="semiformal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ </xsl:call-template>
</xsl:template>
<xsl:template match="figure/title"></xsl:template>
</xsl:template>
<xsl:template match="itemizedlist/title">
- <p><b><xsl:apply-templates/></b></p>
+ <p class="title"><b><xsl:apply-templates/></b></p>
</xsl:template>
<xsl:template match="itemizedlist/listitem">
</xsl:template>
<xsl:template match="orderedlist/title">
- <p><b><xsl:apply-templates/></b></p>
+ <p class="title"><b><xsl:apply-templates/></b></p>
</xsl:template>
<xsl:template match="orderedlist/listitem">
</xsl:template>
<xsl:template match="variablelist/title">
- <p><b><xsl:apply-templates/></b></p>
+ <p class="title"><b><xsl:apply-templates/></b></p>
</xsl:template>
<xsl:template match="listitem" mode="xref">
<!-- ==================================================================== -->
<xsl:template match="procedure">
+ <xsl:variable name="param.placement"
+ select="substring-after(normalize-space($formal.title.placement),
+ concat(local-name(.), ' '))"/>
+
+ <xsl:variable name="placement">
+ <xsl:choose>
+ <xsl:when test="contains($param.placement, ' ')">
+ <xsl:value-of select="substring-before($param.placement, ' ')"/>
+ </xsl:when>
+ <xsl:when test="$param.placement = ''">before</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$param.placement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="preamble"
+ select="*[not(self::step or self::title)]"/>
+
<div class="{name(.)}">
<xsl:call-template name="anchor"/>
- <xsl:if test="title or $formal.procedures != 0">
- <xsl:call-template name="formal.object.heading"/>
+
+ <xsl:if test="title and $placement = 'before'">
+ <xsl:choose>
+ <xsl:when test="$formal.procedures != 0">
+ <xsl:call-template name="formal.object.heading"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="title"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:if>
- <xsl:apply-templates select="*[local-name()!='step']"/>
+
+ <xsl:apply-templates select="$preamble"/>
<xsl:choose>
<xsl:when test="count(step) = 1">
</ol>
</xsl:otherwise>
</xsl:choose>
+
+ <xsl:if test="title and $placement != 'before'">
+ <xsl:choose>
+ <xsl:when test="$formal.procedures != 0">
+ <xsl:call-template name="formal.object.heading"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="title"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
</div>
</xsl:template>
<xsl:template match="procedure/title">
+ <p class="title">
+ <b>
+ <xsl:apply-templates/>
+ </b>
+ </p>
</xsl:template>
<xsl:template match="title" mode="procedure.title.mode">
- <p>
+ <p class="title">
<b>
<xsl:apply-templates/>
</b>
<!ENTITY emphasis.propagates.style SYSTEM "../params/emphasis.propagates.style.xml">
<!ENTITY firstterm.only.link SYSTEM "../params/firstterm.only.link.xml">
<!ENTITY formal.procedures SYSTEM "../params/formal.procedures.xml">
+<!ENTITY formal.title.placement SYSTEM "../params/formal.title.placement.xml">
<!ENTITY funcsynopsis.decoration SYSTEM "../params/funcsynopsis.decoration.xml">
<!ENTITY funcsynopsis.style SYSTEM "../params/funcsynopsis.style.xml">
<!ENTITY function.parens SYSTEM "../params/function.parens.xml">
<reference><title>Miscellaneous</title>
&graphic.default.extension;
&formal.procedures;
+&formal.title.placement;
&runinhead.default.title.end.punct;
&runinhead.title.end.punct;
&show.comments;
<src:fragref linkend="emphasis.propagates.style.frag"/>
<src:fragref linkend="firstterm.only.link.frag"/>
<src:fragref linkend="formal.procedures.frag"/>
+<src:fragref linkend="formal.title.placement.frag"/>
<src:fragref linkend="funcsynopsis.decoration.frag"/>
<src:fragref linkend="funcsynopsis.style.frag"/>
<src:fragref linkend="function.parens.frag"/>
--- /dev/null
+<refentry id="formal.title.placement">
+<refmeta>
+<refentrytitle>formal.title.placement</refentrytitle>
+<refmiscinfo role="type"></refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>formal.title.placement</refname>
+<refpurpose></refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='formal.title.placement.frag'>
+<xsl:param name="formal.title.placement">
+figure before
+example before
+equation before
+table before
+procedure before
+</xsl:param>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>Specifies where formal object titles should occur. For each formal object
+type (<sgmltag>figure</sgmltag>,
+<sgmltag>example</sgmltag>,
+<sgmltag>equation</sgmltag>,
+<sgmltag>table</sgmltag>, and <sgmltag>procedure</sgmltag>)
+you can specify either the keyword
+<quote><literal>before</literal></quote> or
+<quote><literal>after</literal></quote>.</para>
+
+</refsect1>
+</refentry>