Re: [xep-support] Order of unique footnotes

From: Alexei Gagarinov <>
Date: Tue Jun 17 2008 - 20:43:33 PDT

Hi Krister,

> You can see on page two in the PDF that the footnotes are in the order they
> appear in the content file.

This is the exact behavior prescribed by XSL-FO Specification and the
only reasonable way of placing footnotes in general.

A "strange" order of footnote descriptions is any other one, imo.

> My customer want the footnote to be in number order instead.

One of the solutions is to try to convince your customer that the
observed behavior is natural. :)

Another solution is to reorder footnotes (I mean footnote bodies) on
XSLT level.

The main idea is the following:
1) Sort the footnote bodies from each page in the desired order and
place these "fake" footnotes (i.e. footnotes bodies without anchors) on
the very beginning of each page.
2) The actual footnotes should contain only anchors (fo:inline).

The problem with this approach is that one doesn't know how footnotes
are split across page boundaries before formatting (due to the nature of
XSL-FO technology).

But the above idea along with the RenderX extension for unique footnotes
provide the desired result:
Each footnote in the document (optimization: in a page-sequence) have
its own anchor with the empty body and the sorted list of "fake" bodies
including its own body.
The bodies should carry the correct @id attribute, of course.
All "superfluous" bodies will be merged with each other during
formatting and you will see the unique footnotes only.
The sorted list of "fake" bodies (of the current and all subsequent -
according to the document order - footnotes) on each footnote makes it
unimportant where a page breaks.

I attached the modified XSL file with the described approach.
The XSLT code is not optimized and not elegant, but it works. :)

Best regards,
   Alexei Gagarinov


(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service

Received on Tue Jun 17 21:43:32 2008

This archive was generated by hypermail 2.1.8 : Tue Jun 17 2008 - 21:43:33 PDT