Created attachment 394585 [details] PDF output Description of problem: For some reason, the footnotes at the bottom of the page aren't being numbered in the PDF output. Version-Release number of selected component (if applicable): [root@hockey ~]# rpm -q publican publican-1.4-1.fc12.noarch [root@hockey ~]# rpm -q --verify publican [root@hockey ~]# How reproducible: Always Steps to Reproduce: 1. pushd /tmp 2. publican create --name FootnoteTest 3. cd FootnoteTest 4. Add the following text to the end of line 19 of en-US/Chapter.xml <footnote><para>Testing!</para></footnote> 5. publican build --formats=html-single,pdf --langs=en-US 6. Notice that the footnotes appear correctly in the HTML version 7. Open the PDF version and notice that the footnotes at the bottom of the page don't have a number to identify which footnote is which. 8. popd Actual results: Footnotes appear at the bottom of the PDF output without numbering Expected results: Footnotes at the bottom of the page should have numbers to identify them Additional info: I tried this with several brands (common, fedora, and my own brands) to see if it is a branding issue, but it doesn't appear to be, as I get the same output with all brands I try.
This is the default behaviour of the DocBook FO style sheet. If you'd like this changed for the common brand please discuss it on the mail list. If you'd like to change this in your own brand you could try this, untested, template in your brands pdf.xsl file. <xsl:template match="footnote"> <xsl:choose> <xsl:when test="ancestor::table or ancestor::informaltable"> <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:when> <xsl:otherwise> <fo: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> <fo:footnote-body xsl:use-attribute-sets="footnote.properties"> <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:apply-templates/> </fo:footnote-body> </fo:footnote> </xsl:otherwise> </xsl:choose> </xsl:template> The original template is in /usr/share/sgml/docbook/xsl-stylesheets-1.75.2/fo/footnote.xsl, you may need to xsl:import this in to your pdf.xsl file to satisfy dependencies. Cheers, Jeff.
(In reply to comment #1) > This is the default behaviour of the DocBook FO style sheet. If you'd like this > changed for the common brand please discuss it on the mail list. Actually, this isn't true. I took Chapter.xml from my Publican document and processed it directly with the default DocBook FO stylesheet: pushd /tmp cp FootnoteTest/en-US/Chapter.xml . xsltproc /usr/share/sgml/docbook/xsl-stylesheets/fo/docbook.xsl Chapter.xml > Chapter.fo fop -fo Chapter.fo -pdf Chapter.pdf In this case, the number *does* appear in front of the footnote body. (I'll attach this PDF as well.) > If you'd like to change this in your own brand you could try this, untested, > template in your brands pdf.xsl file. That got me closer, but there were a couple of minor issues with that template, and I was able to fix those, but then my formatting was off. I'll keep playing with this as time permits and see if I can't come up with a solution.
Created attachment 394742 [details] PDF output using stock stylesheet This is the PDF generated by the system default stylesheet, not using Publican at all.
Took a while to figure this out, it's to do with the way xsl:import handles precedence and the fact that we override the para template. Added include for default footnote.xsl to get correct precedence. $ svn diff datadir/xsl/pdf.xsl Index: datadir/xsl/pdf.xsl =================================================================== --- datadir/xsl/pdf.xsl (revision 1031) +++ datadir/xsl/pdf.xsl (working copy) @@ -33,6 +33,8 @@ <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/> <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/graphics.xsl"/> +<!-- This is required to get footnotes to format correctly due to overriding para BZ #565903 --> +<xsl:include href="http://docbook.sourceforge.net/release/xsl/current/fo/footnote.xsl"/> <xsl:include href="defaults.xsl"/>
publican-1.5-0.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/publican-1.5-0.fc12
publican-1.5-0.fc13 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/publican-1.5-0.fc13
publican-1.5-0.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/publican-1.5-0.fc11
publican-1.5-0.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
publican-1.5-0.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.
This problem has come back for me in publican-2.1-0.fc13.noarch, and someone else is reporting it in publican-1.6.2 as well. Follow my "Steps to Reproduce" above with Publican 2.1, and you'll see there is no number in front of the footnote again.
I was able to work around this bug with the following bit of xml in my brand pdf.xsl file. Based on what I encountered while developing this, I believe the problem stems from customizing the properties for footnotes. The biggest change is that I added the footnote.number in to the <xsl:otherwise> portion and I used the value-of instead of apply-templates. Otherwise it was copied from footnote.xsl Caveat: I am terrible at this and the code is fugly, feel free to help me clean it up ;-) <xsl:template match="footnote"> <xsl:choose> <xsl:when test="ancestor::table or ancestor::informaltable"> <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:when> <xsl:otherwise> <fo: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> <fo:footnote-body xsl:use-attribute-sets="footnote.properties"> <fo:block> <!-- this gets the footnote number--> <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:value-of select="." /> </fo:block> </fo:footnote-body> </fo:footnote> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="footnote" mode="table.footnote.mode"> <xsl:choose> <xsl:when test="local-name(*[1]) = 'para' or local-name(*[1]) = 'simpara'"> <fo:block xsl:use-attribute-sets="table.footnote.properties"> <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:value-of select="."/> </fo:block> </xsl:when> <xsl:when test="$exsl.node.set.available != 0"> <fo:block xsl:use-attribute-sets="table.footnote.properties"> <xsl:apply-templates select="*[1]" mode="footnote.body.number"/> <xsl:apply-templates select="*[position() > 1]"/> </fo:block> </xsl:when> <xsl:otherwise> <xsl:message> <xsl:text>Warning: footnote number may not be generated </xsl:text> <xsl:text>correctly; </xsl:text> <xsl:value-of select="local-name(*[1])"/> <xsl:text> unexpected as first child of footnote.</xsl:text> </xsl:message> <fo:block xsl:use-attribute-sets="table.footnote.properties"> <xsl:apply-templates/> </fo:block> </xsl:otherwise> </xsl:choose> </xsl:template>
This is because footnote.xsl was being imported instead of included. Switched back to include, added note to not switch to import. Fixed in build: 2.1-0%{?dist}.t3
(In reply to comment #15) > This is because footnote.xsl was being imported instead of included. > > Switched back to include, added note to not switch to import. > > Fixed in build: 2.1-0%{?dist}.t3 confirmed that using a include instead of import fixes it in a 1.6.2 brand
Confirmed fixed in 2.1.t20
publican-2.2-0.fc13 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/publican-2.2-0.fc13
publican-2.2-0.fc12 has been submitted as an update for Fedora 12. https://admin.fedoraproject.org/updates/publican-2.2-0.fc12
publican-2.2-0.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/publican-2.2-0.fc14
publican-2.2-0.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.