[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Including procedures in regular toc
Just a quick note for others who might try something similar: New elements added to the toc are not automatically included in the bookmarks of PDF/Fo output. For this, you have to customize or create a template specific for your FO>PDF engine. For XEP, I created the template below (I think for FOP it would be very similar). (The xmlns:rx="http://www.renderx.com/XSL/Extensions" namespace was also needed in the customization layer.) Regards, Robert <!-- Copied and modified the following template from fo/xep.xsl: <xsl:template match="set|book|part|reference|preface|chapter|appendix|article |glossary|bibliography|index|setindex |refentry|refsynopsisdiv |refsect1|refsect2|refsect3|refsection |sect1|sect2|sect3|sect4|sect5|section" mode="xep.outline">--> <xsl:template match="procedure[title]" mode="xep.outline"> <!-- To match only for procedures --> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="bookmark-label"> <xsl:apply-templates select="." mode="toc"/> <!-- Changed mode to avoid the Procedure prefix--> </xsl:variable> <xsl:if test="$bookmark-label != ''"> <rx:bookmark internal-destination="{$id}"> <rx:bookmark-label> <xsl:value-of select="normalize-space($bookmark-label)"/> </rx:bookmark-label> </rx:bookmark> </xsl:if> <xsl:variable name="toc.params"> <xsl:call-template name="find.path.params"> <xsl:with-param name="table" select="normalize-space($generate.toc)"/> </xsl:call-template> </xsl:variable> </xsl:template> Robert Fekete wrote: > Nevermind, it's working, just another customization was messing it up. > > Robert Fekete wrote: > >> Hi, In my docs I have a lot of sections that are just wrappers for >> procedures, and now I am trying to have docbook include the procedures >> in the normal table of contents, that is, listed as sections. >> >> I have followed Bob's book at http://www.sagehill.net/docbookxsl/ >> TOCcontrol.html#AddElemsToc , but I can't get it work. So far I have: >> - Addded the "procedure toc" line to <xsl:param name="generate.toc"> >> - customized the <xsl:template match="preface|chapter|appendix| >> article" mode="toc"> >> template and added <xsl:variable name="nodes" select="section|sect1| >> procedure[title]"/> >> - customized the <xsl:template match="section" mode="toc"> template >> and added <xsl:if test="$toc.section.depth > $depth >> and $toc.max.depth > $depth.from.context >> and (section or procedure)"> <!-- Added procedure to >> the list --> and <xsl:apply-templates >> select="section|procedure[title]|qandaset >> [$qanda.in.toc != 0]" mode="toc"> <!-- Added procedure to the list --> >> - created a template for procedures in toc: >> <xsl:template match="procedure" mode="toc"> >> <xsl:call-template name="toc.line"/> >> </xsl:template> >> >> - I have also tried to add the |$toc-context/procedure line to >> <xsl:variable name="nodes" in <xsl:template name="division.toc">, but >> that did not help either. >> >> Any suggestions about what I am doing wrong is appreciated. >> >> Regards, >> Robert Fekete >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org >> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org >> >> > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]