This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] footnote as endnote in pdf
- From: "Bob Stayton" <bobs at sagehill dot net>
- To: "David Warnock" <david at sundayta dot com>, <docbook-apps at lists dot oasis-open dot org>
- Date: Wed, 22 Sep 2004 01:14:49 -0700
- Subject: Re: [docbook-apps] footnote as endnote in pdf
- References: <414F8F96.8050003@sundayta.com>
There is no stylesheet parameter that converts footnotes to endnotes, but it
can be done with a customization. Take a look at the template with
match="footnote" in fo/footnote.xsl, for example. You can customize that to
generate endnotes.
First copy the template to your customization layer and remove the
fo:footnote elements, because they generate bottom-of-page footnotes. Leave
just the part that generates the footnote number, inside an fo:inline:
<xsl:template match="footnote">
<fo:inline>
<xsl:call-template name="format.footnote.mark">
<xsl:with-param name="mark">
<xsl:apply-templates select="." mode="footnote.number"/>
</xsl:with-param>
</xsl:call-template>
</fo:inline>
</xsl:template>
The copy the same template to your customization layer and add
mode="endnote". Edit this version to format the number and block of text
inside an fo:block:
<xsl:template match="footnote" mode="endnote">
<fo:block font-family="{$body.fontset}"
font-size="{$footnote.font.size}"
font-weight="normal"
font-style="normal"
text-align="{$alignment}"
margin-left="0pc">
<xsl:call-template name="format.footnote.mark">
<xsl:with-param name="mark">
<xsl:apply-templates select="." mode="footnote.number"/>
</xsl:with-param>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
Then you can generate the list of end notes by having a template like this:
<xsl:template name="make.endnotes">
<xsl:apply-templates select="//footnote" mode="endnote"/>
</xsl:template>
The only remaining item is figuring out how to call this template at the
appropriate place. I don't know how you want to present your end notes in
PDF output. Perhaps in an appendix, or some other container. Or use a
processing instruction that triggers a template that generates its own
page-sequence for the endnotes.
You may also want to make the footnote number a hotlink, or maybe make them
go both ways, by generating different ids for each end, and using
fo:basic-link around the footnote numbers.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
----- Original Message -----
From: "David Warnock" <david@sundayta.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Monday, September 20, 2004 7:19 PM
Subject: [docbook-apps] footnote as endnote in pdf
> Hi,
>
> For my theology course assignments I have to present references as
> endnotes rather than footnotes. They come out that way when I prepare
> html. However in both chunked html and pdf (via fop) they come out at
> the bottom of the page (which of course is expected for footnotes).
>
> Can I via the xsl customizations present footnotes at the end of the
> document (ie as endnotes) when using print and chunked html?
>
> Thanks
>
> Dave
> --
> David Warnock: Sundayta Ltd. http://www.sundayta.com
>
>
>