OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] xref, fo output.


Title: Re: [docbook-apps] xref, fo output.
Is this any help - straight out of Bob's book, p.238-249 (3rd edit.)

use something like <xref linkend="someID" xrefstyle="page_ref"/>

and put this in the customization layer (change styles to whatever you want.)

<!-- ==================================================================== -->
<!-- define named xrefstyles for appendix, chapter, figure, part, sect1,sect2, sect3 section, table (all same: "page_ref"), and for formalpara ("fp_page_ref") -->
<xsl:param name="local.l10n.xml" select="document('')" />
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
<l:l10n language="en">
<l:context name="xref-number-and-title">
<l:template name="appendix" style="page_ref" text="Appendix&#x00A0;%n&#x002C;&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p" />
<l:template name="chapter"  style="page_ref" text="Chapter&#x00A0;%n&#x002C;&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p" />
<l:template name="figure"   style="page_ref" text="Figure&#x00A0;%n&#x002C;&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p" />
<l:template name="part"     style="page_ref" text="Part&#x00A0;%n&#x002C;&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p" />
<l:template name="sect1"    style="page_ref" text="Section&#x00A0;%n&#x002C;&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p" />
<l:template name="sect2"    style="page_ref" text="Section&#x00A0;%n&#x002C;&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p" />
<l:template name="sect3"    style="page_ref" text="Section&#x00A0;%n&#x002C;&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p" />
<l:template name="sect4"    style="page_ref" text="Section&#x00A0;%n&#x002C;&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p" />
<l:template name="sect5"    style="page_ref" text="Section&#x00A0;%n&#x002C;&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p" />
<l:template name="section"  style="page_ref" text="Section&#x00A0;%n&#x002C;&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p" />
<l:template name="table"    style="page_ref" text="Table&#x00A0;%n&#x002C;&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p" />
</l:context>
<l:context name="xref">
<l:template name="formalpara" style="fp_page_ref" text="Paragraph&#x00A0;&#x201C;%t&#x201D;" />
<l:template name="olink.page.citation" text=" (page %p)"/>
<l:template name="page.citation" text=" [%p]"/>
<l:template name="page" text="(page %p)"/>
<l:template name="docname" text=" in %o"/>
<l:template name="docnamelong" text=" in the document titled %o"/>
<l:template name="pageabbrev" text="(p. %p)"/>
<l:template name="Page" text="Page %p"/>
</l:context>
</l:l10n>
</l:i18n>
<!--
Use of '%p' in fp_page_ref, - xref link to a formalpara - doesn't seem to work, backwards or forward - see test code in venn.xml
So the ref. to 'p.%p' is removed in the above template.  %t for the formalpara id works OK.&nbsp; %n is not relevant, formalpara cannot be numbered.  If and when %p works for formalpara, replace the above template by:

<l:template name="formalpara" style="fp_page_ref" text="Paragraph&#x00A0;&#x201C;%t&#x201D;&#x002C;&#x00A0;&#x0070;&#x002E;%p&#x002C;" />

To get a 'close' page ref. in a pointer to a formal para, do something like:

<xref linkend="id of formal para" xrefstyle="fp_page_ref" /> in <xref linkend="id of chapter or section containing the formal para" xrefstyle="page_ref" />

This will at least point the reader to the right chapter or section in a chapter.  sect1, sect2 etc. should also work to localize more closely - untested.
 -->



I have <xref linkend="IDValue"/>



The link is to
  <sect3 xml:id="IDValue">
            <title>Long waffle title.</title>


In PDF output this is showing as

Section 4.4.4, Long waffle title .. [8].

In my customization I have
<xsl:param name="insert.xref.page.number">yes</xsl:param>


I'd prefer either just the section number, or even
section number and page, e.g. Section 4.4.4 on Page 8

Can I customize this please?

regards


--
Dave Pawson
XSLT, XSL-FO and Docbook FAQ
http://www.dpawson.co.uk


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


-- 
Ron Catterall, Phd, DSc                         email: ron@catterall.net
Prolongacion de Hidalgo 140                             http://catterall.net/
San Felipe del Agua                                        tel: +52 951 520 1821
Oaxaca      68020  Mexico                          fax: +1 530 348 8309


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]