Next in thread → Next in month →

Re: [docbook-apps] Customizing xrefstyle globally

From
Bob Stayton <>
Date
2004-05-20T04:16:58+00:00
ID
044901c43e21$ee529950$6501a8c0@toshiro
Thread
Re: [docbook-apps] Customizing xrefstyle globally
As you realized, using xrefstyle is good for ad hoc changes to individual
xrefs, but it would be tedious to use as a global change of style for all
references.

The default style for xref rendering comes from the gentext templates, which
are in common/en.xml for English language documents. In your case, you only
want to change how the page citation is rendered.  Fortunately, there is a
single gentext template that handles that for all xrefs.  It is the template
whose name is 'page.citation' in the 'xref' context in en.xml:

<l:template name="page.citation" text=" [%p]"/>

If you put a new version of that gentext template  in your customization,
then you will get it as the new default style for page numbers.

Bob Stayton
Sagehill Enterprises
DocBook Consulting



----- Original Message ----- 
From: "John W. Shipman" <>
To: "docbook-apps mailing list" <>
Cc: "John Shipman" <>
Sent: Wednesday, May 19, 2004 8:08 PM
Subject: [docbook-apps] Customizing xrefstyle globally


> I've just finished carefully reading the chapter in Stayton's
> book on `Cross-references,' but there's one thing I can't figure
> out how to do.
>
> When in my FO customization layer I set insert.xref.page.number
> to 1, I get the default style of page number cross-references,
> namely, the page number in square brackets, e.g., "[12]".
>
> What I'd prefer is that such page numbers occur in the
> xrefstyle="select: title pageabbrev" style, e.g., "(p. 12)".
>
> Since I'm using the 1.65.1 stylesheets but the DTD is only
> DocBook 4.2, I could achieve this by adding this attribute to
> every <xref> element:
>
>     <xref role='select: title pageabbrev'/>
>
> However, I'd prefer to have this style of page number reference
> be the default in my customization layer, so I don't have to add
> this attribute in a zillion places.
>
> I spent some time grepping around the stylesheets, but I couldn't
> figure out where the templates connect with the gentext templates
> for "pageabbrev".
>
> Any suggestions?
>
> Best regards,
> John Shipman (), Applications Specialist, NM Tech Computer
Center,
> Speare 128, Socorro, NM 87801, (505) 835-5950, http://www.nmt.edu/~john
>   ``Let's go outside and commiserate with nature.''  --Dave Farber
>
>
> To unsubscribe from this list, send a post to
, or visit
http://www.oasis-open.org/mlmanage/.
>
>
>
Next in thread → Next in month →