]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/styleguide/docbook-xsl-1.75.2/manpages/lists.xsl
stylesheet changes.
[working/Evergreen.git] / stylesheets / styleguide / docbook-xsl-1.75.2 / manpages / lists.xsl
1 <?xml version='1.0'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                 version='1.0'>
4
5 <!-- ********************************************************************
6      $Id: lists.xsl 8347 2009-03-16 14:35:19Z mzjn $
7      ********************************************************************
8
9      This file is part of the XSL DocBook Stylesheet distribution.
10      See ../README or http://docbook.sf.net/release/xsl/current/ for
11      copyright and other information.
12
13      ******************************************************************** -->
14
15 <xsl:variable name="list-indent">
16   <xsl:choose>
17     <xsl:when test="not($man.indent.lists = 0)">
18       <xsl:value-of select="$man.indent.width"/>
19     </xsl:when>
20     <xsl:when test="not($man.indent.refsect = 0)">
21       <!-- * "zq" is the name of a register we set for -->
22       <!-- * preserving the original default indent value -->
23       <!-- * when $man.indent.refsect is non-zero; -->
24       <!-- * "u" is a roff unit specifier -->
25       <xsl:text>\n(zqu</xsl:text>
26     </xsl:when>
27     <xsl:otherwise/> <!-- * otherwise, just leave it empty -->
28   </xsl:choose>
29 </xsl:variable>
30
31 <!-- ================================================================== -->
32
33 <xsl:template match="para[ancestor::listitem or ancestor::step or ancestor::glossdef]|
34   simpara[ancestor::listitem or ancestor::step or ancestor::glossdef]|
35   remark[ancestor::listitem or ancestor::step or ancestor::glossdef]">
36   <xsl:call-template name="mixed-block"/>
37   <xsl:text>&#10;</xsl:text>
38   <xsl:if test="following-sibling::*[1][
39     self::para or
40     self::simpara or
41     self::remark
42     ]">
43     <!-- * Make sure multiple paragraphs within a list item don't -->
44     <!-- * merge together.                                        -->
45     <xsl:text>.sp&#10;</xsl:text>
46   </xsl:if>
47 </xsl:template>
48
49 <xsl:template match="bibliolist">
50   <xsl:apply-templates/>
51   <xsl:text>&#10;</xsl:text>
52 </xsl:template>
53
54 <xsl:template match="variablelist|glosslist">
55   <xsl:if test="title">
56     <xsl:text>.PP&#10;</xsl:text>
57     <xsl:call-template name="bold">
58       <xsl:with-param name="node" select="title"/>
59       <xsl:with-param name="context" select="."/>
60     </xsl:call-template>
61     <xsl:text>&#10;</xsl:text>
62   </xsl:if>
63   <xsl:apply-templates/>
64 </xsl:template>
65
66 <xsl:template match="varlistentry|glossentry">
67   <xsl:text>.PP&#10;</xsl:text> 
68   <xsl:for-each select="term|glossterm">
69     <xsl:variable name="content">
70       <xsl:apply-templates/>
71     </xsl:variable>
72     <xsl:value-of select="normalize-space($content)"/>
73     <xsl:choose>
74       <xsl:when test="position() = last()"/> <!-- do nothing -->
75       <xsl:otherwise>
76         <!-- * if we have multiple terms in the same varlistentry, generate -->
77         <!-- * a separator (", " by default) and/or an additional line -->
78         <!-- * break after each one except the last -->
79         <!-- * -->
80         <!-- * note that it is not valid to have multiple glossterms -->
81         <!-- * within a glossentry, so this logic never gets exercised -->
82         <!-- * for glossterms (every glossterm is always the last in -->
83         <!-- * its parent glossentry) -->
84         <xsl:value-of select="$variablelist.term.separator"/>
85         <xsl:if test="not($variablelist.term.break.after = '0')">
86           <xsl:text>&#10;</xsl:text>
87           <xsl:text>.br&#10;</xsl:text>
88         </xsl:if>
89       </xsl:otherwise>
90     </xsl:choose>
91   </xsl:for-each>
92   <xsl:text>&#10;</xsl:text>
93   <xsl:text>.RS</xsl:text> 
94   <xsl:if test="not($list-indent = '')">
95     <xsl:text> </xsl:text>
96     <xsl:value-of select="$list-indent"/>
97   </xsl:if>
98   <xsl:text>&#10;</xsl:text>
99   <xsl:apply-templates/>
100   <xsl:text>.RE&#10;</xsl:text>
101 </xsl:template>
102
103 <xsl:template match="varlistentry/term"/>
104 <xsl:template match="glossentry/glossterm"/>
105
106 <xsl:template match="variablelist[ancestor::listitem or ancestor::step or ancestor::glossdef]|
107   glosslist[ancestor::listitem or ancestor::step or ancestor::glossdef]">
108   <xsl:apply-templates/>
109   <xsl:if test="following-sibling::node() or
110     parent::para[following-sibling::node()] or
111     parent::simpara[following-sibling::node()] or
112     parent::remark[following-sibling::node()]">
113     <xsl:text>.sp</xsl:text> 
114     <xsl:text>&#10;</xsl:text>
115   </xsl:if>
116 </xsl:template>
117
118 <xsl:template match="varlistentry/listitem|glossentry/glossdef">
119   <xsl:apply-templates/>
120 </xsl:template>
121
122 <xsl:template match="itemizedlist/listitem">
123   <!-- * We output a real bullet here (rather than, "\(bu", -->
124   <!-- * the roff bullet) because, when we do character-map -->
125   <!-- * processing before final output, the character-map will -->
126   <!-- * handle conversion of the &#x2022; to "\(bu" for us -->
127   <xsl:text>&#10;</xsl:text>
128   <xsl:text>.sp</xsl:text>
129   <xsl:text>&#10;</xsl:text>
130   <xsl:text>.RS</xsl:text>
131   <xsl:if test="not($list-indent = '')">
132     <xsl:text> </xsl:text>
133     <xsl:value-of select="$list-indent"/>
134   </xsl:if>
135   <xsl:text>&#10;</xsl:text>
136   <!-- * if "n" then we are using "nroff", which means the output is for -->
137   <!-- * TTY; so we do some fixed-width-font hackery with \h to make a -->
138   <!-- * hanging indent (instead of using .IP, which has some -->
139   <!-- * undesirable side effects under certain circumstances) -->
140   <xsl:call-template name="roff-if-else-start"/>
141   <xsl:text>\h'-</xsl:text>
142   <xsl:choose>
143     <xsl:when test="not($list-indent = '')">
144       <xsl:text>0</xsl:text>
145       <xsl:value-of select="$list-indent"/>
146     </xsl:when>
147     <xsl:otherwise>
148       <xsl:text>\n(INu</xsl:text>
149     </xsl:otherwise>
150   </xsl:choose>
151   <xsl:text>'</xsl:text>
152   <xsl:text>&#x2022;</xsl:text>
153   <xsl:text>\h'+</xsl:text>
154   <xsl:choose>
155     <xsl:when test="not($list-indent = '')">
156       <xsl:text>0</xsl:text>
157       <xsl:value-of select="$list-indent - 1"/>
158     </xsl:when>
159     <xsl:otherwise>
160       <xsl:text>\n(INu-1</xsl:text>
161     </xsl:otherwise>
162   </xsl:choose>
163   <xsl:text>'\c&#10;</xsl:text>
164   <!-- * else, we are not using for "nroff", but instead "troff" - which -->
165   <!-- * means not for TTY, but for PS or whatever; so we’re not using a -->
166   <!-- * fixed-width font, so use a real .IP instead -->
167   <xsl:call-template name="roff-else"/>
168   <!-- * .IP generates a blank like of space, so let’s go backwards one -->
169   <!-- * line up to compensate for that -->
170   <xsl:text>.sp -1&#10;</xsl:text>
171   <xsl:text>.IP \(bu 2.3&#10;</xsl:text>
172   <!-- * The value 2.3 is the amount of indentation; we use 2.3 instead -->
173   <!-- * of 2 because when the font family is New Century Schoolbook it -->
174   <!-- * seems to require the extra space. -->
175   <xsl:call-template name="roff-if-end"/>
176   <xsl:apply-templates/>
177   <xsl:text>.RE&#10;</xsl:text>
178 </xsl:template>
179
180 <xsl:template match="orderedlist/listitem|procedure/step">
181   <xsl:text>&#10;</xsl:text>
182   <xsl:text>.sp</xsl:text>
183   <xsl:text>&#10;</xsl:text>
184   <xsl:text>.RS</xsl:text>
185   <xsl:if test="not($list-indent = '')">
186     <xsl:text> </xsl:text>
187     <xsl:value-of select="$list-indent"/>
188   </xsl:if>
189   <xsl:text>&#10;</xsl:text>
190   <!-- * if "n" then we are using "nroff", which means the output is for -->
191   <!-- * TTY; so we do some fixed-width-font hackery with \h to make a -->
192   <!-- * hanging indents (instead of using .IP, which has some -->
193   <!-- * undesirable side effects under certain circumstances) -->
194   <xsl:call-template name="roff-if-else-start"/>
195   <xsl:text>\h'-</xsl:text>
196   <xsl:choose>
197     <xsl:when test="not($list-indent = '')">
198       <xsl:text>0</xsl:text>
199       <xsl:value-of select="$list-indent"/>
200     </xsl:when>
201     <xsl:otherwise>
202       <xsl:text>\n(INu+3n</xsl:text>
203     </xsl:otherwise>
204   </xsl:choose>
205   <xsl:text>'</xsl:text>
206   <xsl:if test="count(preceding-sibling::listitem) &lt; 9">
207     <xsl:text> </xsl:text>
208   </xsl:if>
209   <xsl:number format="1."/>
210   <xsl:text>\h'+</xsl:text>
211   <xsl:choose>
212     <xsl:when test="not($list-indent = '')">
213       <xsl:text>0</xsl:text>
214       <xsl:value-of select="$list-indent - 3"/>
215     </xsl:when>
216     <xsl:otherwise>
217       <xsl:text>1n</xsl:text>
218     </xsl:otherwise>
219   </xsl:choose>
220   <xsl:text>'\c&#10;</xsl:text>
221   <!-- * else, we are not using for "nroff", but instead "troff" - which -->
222   <!-- * means not for TTY, but for PS or whatever; so we’re not using a -->
223   <!-- * fixed-width font, so use a real .IP instead -->
224   <xsl:call-template name="roff-else"/>
225   <!-- * .IP generates a blank line of space, so let’s go backwards one -->
226   <!-- * line up to compensate for that -->
227   <xsl:text>.sp -1&#10;</xsl:text>
228   <xsl:text>.IP "</xsl:text>
229   <xsl:if test="count(preceding-sibling::listitem) &lt; 9">
230     <xsl:text>  </xsl:text>
231   </xsl:if>
232   <xsl:number format="1."/>
233   <xsl:text>" 4.2&#10;</xsl:text>
234   <!-- * The value 4.2 is the amount of indentation; we use 4.2 instead -->
235   <!-- * of 4 because when the font family is Bookman it seems to require -->
236   <!-- * the extra space. -->
237   <xsl:call-template name="roff-if-end"/>
238   <xsl:apply-templates/>
239   <xsl:text>.RE&#10;</xsl:text>
240   <xsl:text>&#10;</xsl:text>
241 </xsl:template>
242
243 <xsl:template match="itemizedlist|orderedlist|procedure">
244   <xsl:if test="title">
245     <xsl:text>.PP&#10;</xsl:text>
246     <xsl:call-template name="bold">
247       <xsl:with-param name="node" select="title"/>
248       <xsl:with-param name="context" select="."/>
249     </xsl:call-template>
250     <xsl:text>&#10;</xsl:text>
251   </xsl:if>
252   <!-- * DocBook allows just about any block content to appear in -->
253   <!-- * lists before the actual list items, so we need to get that -->
254   <!-- * content (if any) before getting the list items -->
255   <xsl:apply-templates
256     select="*[not(self::listitem) and not(self::title)]"/>
257   <xsl:apply-templates select="listitem"/>
258   <!-- * If this list is a child of para and has content following -->
259   <!-- * it, within the same para, then add a blank line and move -->
260   <!-- * the left margin back to where it was -->
261   <xsl:if test="parent::para and following-sibling::node()">
262     <xsl:text>.sp&#10;</xsl:text>
263     <xsl:text>.RE&#10;</xsl:text>
264   </xsl:if>
265 </xsl:template>
266
267 <xsl:template match="itemizedlist[ancestor::listitem or ancestor::step  or ancestor::glossdef]|
268   orderedlist[ancestor::listitem or ancestor::step or ancestor::glossdef]|
269   procedure[ancestor::listitem or ancestor::step or ancestor::glossdef]">
270   <xsl:if test="title">
271     <xsl:text>.PP&#10;</xsl:text>
272     <xsl:call-template name="bold">
273       <xsl:with-param name="node" select="title"/>
274       <xsl:with-param name="context" select="."/>
275     </xsl:call-template>
276     <xsl:text>&#10;</xsl:text>
277   </xsl:if>
278   <xsl:apply-templates/>
279   <xsl:if test="following-sibling::node() or
280     parent::para[following-sibling::node()] or
281     parent::simpara[following-sibling::node()] or
282     parent::remark[following-sibling::node()]">
283     <xsl:text>.RS</xsl:text> 
284     <xsl:if test="not($list-indent = '')">
285       <xsl:text> </xsl:text>
286       <xsl:value-of select="$list-indent"/>
287     </xsl:if>
288     <xsl:text>&#10;</xsl:text>
289   </xsl:if>
290 </xsl:template>
291
292 <!-- ================================================================== -->
293   
294 <!-- * for simplelist type="inline", render it as a comma-separated list -->
295 <xsl:template match="simplelist[@type='inline']">
296   <!-- * if dbchoice PI exists, use that to determine the choice separator -->
297   <!-- * (that is, equivalent of "and" or "or" in current locale), or literal -->
298   <!-- * value of "choice" otherwise -->
299   <xsl:variable name="localized-choice-separator">
300     <xsl:choose>
301       <xsl:when test="processing-instruction('dbchoice')">
302         <xsl:call-template name="select.choice.separator"/>
303       </xsl:when>
304       <xsl:otherwise>
305         <!-- * empty -->
306       </xsl:otherwise>
307     </xsl:choose>
308   </xsl:variable>
309
310   <xsl:for-each select="member">
311     <xsl:apply-templates/>
312     <xsl:choose>
313       <xsl:when test="position() = last()"/> <!-- do nothing -->
314       <xsl:otherwise>
315         <xsl:text>, </xsl:text>
316         <xsl:if test="position() = last() - 1">
317           <xsl:if test="$localized-choice-separator != ''">
318             <xsl:value-of select="$localized-choice-separator"/>
319             <xsl:text> </xsl:text>
320           </xsl:if>
321         </xsl:if>
322       </xsl:otherwise>
323     </xsl:choose>
324   </xsl:for-each>
325   <xsl:text>&#10;</xsl:text>
326 </xsl:template>
327
328 <!-- * if simplelist type is not inline, render it as a one-column vertical -->
329 <!-- * list (ignoring the values of the type and columns attributes) -->
330 <xsl:template match="simplelist">
331   <xsl:for-each select="member">
332     <xsl:text>.RS</xsl:text> 
333     <xsl:if test="not($list-indent = '')">
334       <xsl:text> </xsl:text>
335       <xsl:value-of select="$list-indent"/>
336     </xsl:if>
337     <xsl:text>&#10;</xsl:text>
338     <xsl:apply-templates/>
339     <xsl:text>&#10;</xsl:text>
340     <xsl:text>.RE&#10;</xsl:text>
341   </xsl:for-each>
342 </xsl:template>
343
344 <!-- ================================================================== -->
345
346 <!-- * We output Segmentedlist as a table, using tbl(1) markup. There -->
347 <!-- * is no option for outputting it in manpages in "list" form. -->
348 <xsl:template match="segmentedlist">
349   <xsl:if test="title">
350     <xsl:text>.PP&#10;</xsl:text>
351     <xsl:call-template name="bold">
352       <xsl:with-param name="node" select="title"/>
353       <xsl:with-param name="context" select="."/>
354     </xsl:call-template>
355     <xsl:text>&#10;</xsl:text>
356   </xsl:if>
357   <xsl:text>.\" line length increase to cope w/ tbl weirdness&#10;</xsl:text>
358   <xsl:text>.ll +(\n(LLu * 62u / 100u)&#10;</xsl:text>
359   <!-- * .TS = "Table Start" -->
360   <xsl:text>.TS&#10;</xsl:text>
361   <!-- * first output the table "format" spec, which tells tbl(1) how -->
362   <!-- * how to format each row and column. -->
363   <xsl:for-each select=".//segtitle">
364     <!-- * l = "left", which hard-codes left-alignment for tabular -->
365     <!-- * output of all segmentedlist content -->
366     <xsl:text>l</xsl:text>
367   </xsl:for-each>
368   <!-- * last line of table format section must end with a dot -->
369   <xsl:text>.&#10;</xsl:text>
370   <!-- * optionally suppress output of segtitle -->
371   <xsl:choose>
372     <xsl:when test="$man.segtitle.suppress != 0">
373       <!-- * non-zero = "suppress", so do nothing -->
374     </xsl:when>
375     <xsl:otherwise>
376       <!-- * "0" = "do not suppress", so output the segtitle(s) -->
377       <xsl:apply-templates select=".//segtitle" mode="table-title"/>
378       <xsl:text>&#10;</xsl:text>
379     </xsl:otherwise>
380   </xsl:choose>
381   <xsl:apply-templates/>
382   <!-- * .TE = "Table End" -->
383   <xsl:text>.TE&#10;</xsl:text>
384   <xsl:text>.\" line length decrease back to previous value&#10;</xsl:text>
385   <xsl:text>.ll -(\n(LLu * 62u / 100u)&#10;</xsl:text>
386   <!-- * put a blank line of space below the table -->
387   <xsl:text>.sp&#10;</xsl:text>
388 </xsl:template>
389
390 <xsl:template match="segmentedlist/segtitle" mode="table-title">
391   <xsl:call-template name="italic">
392     <xsl:with-param name="node" select="."/>
393     <xsl:with-param name="context" select="."/>
394   </xsl:call-template>
395   <xsl:choose>
396     <xsl:when test="position() = last()"/> <!-- do nothing -->
397     <xsl:otherwise>
398       <!-- * tbl(1) treats tab characters as delimiters between -->
399       <!-- * cells; so we need to output a tab after each -->
400       <!-- * segtitle except the last one -->
401       <xsl:text>&#09;</xsl:text>
402     </xsl:otherwise>
403   </xsl:choose>
404 </xsl:template>
405
406 <xsl:template match="segmentedlist/seglistitem">
407   <xsl:apply-templates/>
408   <xsl:text>&#10;</xsl:text>
409 </xsl:template>
410
411 <xsl:template match="segmentedlist/seglistitem/seg">
412   <!-- * the T{ and T} stuff are delimiters to tell tbl(1) that -->
413   <!-- * the delimited contents are "text blocks" that groff(1) -->
414   <!-- * needs to process -->
415   <xsl:text>T{&#10;</xsl:text>
416   <xsl:variable name="contents">
417     <xsl:apply-templates/>
418   </xsl:variable>
419   <xsl:value-of select="normalize-space($contents)"/>
420   <xsl:text>&#10;T}</xsl:text>
421   <xsl:choose>
422     <xsl:when test="position() = last()"/> <!-- do nothing -->
423     <xsl:otherwise>
424       <!-- * tbl(1) treats tab characters as delimiters between -->
425       <!-- * cells; so we need to output a tab after each -->
426       <!-- * segtitle except the last one -->
427       <xsl:text>&#09;</xsl:text>
428     </xsl:otherwise>
429   </xsl:choose>
430 </xsl:template>
431
432 <!-- ==================================================================== -->
433
434 <xsl:template match="calloutlist">
435   <xsl:if test="title|info/title">
436     <xsl:call-template name="formal.object.heading"/>
437   </xsl:if>
438   <!-- * This template was originally copied over from the HTML -->
439   <!-- * calloutlist template, which precedes the following -->
440   <!-- * apply-templates with the comment "Preserve order of PIs and -->
441   <!-- * comments"; I'm not certain that it will actually have that -->
442   <!-- * effect for all cases, and it seems like there is probably a -->
443   <!-- * better way to do it, but anyway, I’m preserving it here for -->
444   <!-- * consistency. -->
445   <xsl:apply-templates 
446     select="*[not(self::callout or self::title or self::titleabbrev)]
447     |comment()[not(preceding-sibling::callout)]
448     |processing-instruction()[not(preceding-sibling::callout)]"/>
449   <!-- * put callout list into a table -->
450   <xsl:text>.TS&#10;</xsl:text>
451   <xsl:text>tab(:);&#10;</xsl:text>
452   <!-- * the following defines the row layout for the table: two columns, -->
453   <!-- * with the first cell in each row right-aligned, and the second -->
454   <!-- * cell left aligned with a width of 75% of the line length -->
455   <xsl:text>r lw(\n(.lu*75u/100u).&#10;</xsl:text>
456   <xsl:apply-templates select="callout
457     |comment()[preceding-sibling::callout]
458     |processing-instruction()[preceding-sibling::callout]"/>
459   <xsl:text>.TE&#10;</xsl:text>
460 </xsl:template>
461
462 <xsl:template match="calloutlist/title"/>
463
464 <xsl:template match="callout">
465   <!-- * first cell of each row is the set of callout numbers for this -->
466   <!-- * particular callout -->
467   <xsl:call-template name="callout.arearefs">
468     <xsl:with-param name="arearefs" select="@arearefs"/>
469   </xsl:call-template>
470   <!-- * end of the first cell in the row; the \h hackery is to correct -->
471   <!-- * for the excessive horizontal whitespace that tbl(1) adds between -->
472   <!-- * cells in the same row -->
473   <xsl:text>\h'-2n':</xsl:text>
474   <!-- * start the next cell in the row, which has the prose contents -->
475   <!-- * (description/explanation) for the callout -->
476   <xsl:text>T{&#10;</xsl:text>
477   <xsl:apply-templates/>
478   <xsl:text>T}&#10;</xsl:text>
479   <!-- * end of the last cell and end of the row -->
480 </xsl:template>
481
482 <xsl:template name="callout.arearefs">
483   <xsl:param name="arearefs"></xsl:param>
484   <!-- * callout can have multiple values in its arearefs attribute, so -->
485   <!-- * we use the position param to track the postion of each value -->
486   <xsl:param name="position">1</xsl:param>
487   <xsl:if test="$arearefs!=''">
488     <xsl:choose>
489       <xsl:when test="substring-before($arearefs,' ')=''">
490         <xsl:call-template name="callout.arearef">
491           <xsl:with-param name="arearef" select="$arearefs"/>
492           <xsl:with-param name="position" select="$position"/>
493         </xsl:call-template>
494       </xsl:when>
495       <xsl:otherwise>
496         <xsl:call-template name="callout.arearef">
497           <xsl:with-param name="arearef"
498             select="substring-before($arearefs,' ')"/>
499           <xsl:with-param name="position" select="$position"/>
500         </xsl:call-template>
501       </xsl:otherwise>
502     </xsl:choose>
503     <xsl:call-template name="callout.arearefs">
504       <xsl:with-param name="arearefs"
505         select="substring-after($arearefs,' ')"/>
506       <xsl:with-param name="position" select="$position + 1"/>
507     </xsl:call-template>
508   </xsl:if>
509 </xsl:template>
510
511 <xsl:template name="callout.arearef">
512   <xsl:param name="arearef"></xsl:param>
513   <!-- * callout can have multiple values in its arearefs attribute, so -->
514   <!-- * we use the position param to track the postion of each value -->
515   <xsl:param name="position"></xsl:param>
516   <xsl:variable name="targets" select="key('id',$arearef)"/>
517   <xsl:variable name="target" select="$targets[1]"/>
518
519   <xsl:call-template name="check.id.unique">
520     <xsl:with-param name="linkend" select="$arearef"/>
521   </xsl:call-template>
522
523   <xsl:choose>
524     <xsl:when test="count($target)=0">
525       <xsl:text>???</xsl:text>
526     </xsl:when>
527     <xsl:when test="local-name($target)='co'">
528       <!-- * if this is not the first value in the set of values in the -->
529       <!-- * arearef attribute for this callout, then we prepend a groff -->
530       <!-- * non-breaking space to it, to prevent groff from injecting -->
531       <!-- * linebreaks into the output. For callout instances with -->
532       <!-- * multiple values in their arearefs attributes, that results -->
533       <!-- * in all of callout numbers beings listed on the same line. -->
534       <xsl:if test="not($position = 1)">
535         <xsl:text>\ </xsl:text>
536       </xsl:if>
537       <xsl:apply-templates select="$target"
538         mode="calloutlist-callout-number"/>
539     </xsl:when>
540     <!-- * the manpages stylesheet does not really support areaset and -->
541     <!-- * area (because we can't/don't actually render the callout bugs -->
542     <!-- * at the specified coordinates); however, the following (for -->
543     <!-- * what it's worth) might cause the callout numbers in the -->
544     <!-- * calloutlist to be render at least (then again, maybe it won't; -->
545     <!-- * it's not actually been tested... -->
546     <xsl:when test="local-name($target)='areaset'">
547       <xsl:call-template name="callout-bug">
548         <xsl:with-param name="conum">
549           <xsl:apply-templates select="$target" mode="conumber"/>
550         </xsl:with-param>
551       </xsl:call-template>
552     </xsl:when>
553     <xsl:when test="local-name($target)='area'">
554       <xsl:choose>
555         <xsl:when test="$target/parent::areaset">
556           <xsl:call-template name="callout-bug">
557             <xsl:with-param name="conum">
558               <xsl:apply-templates
559                 select="$target/parent::areaset" mode="conumber"/>
560             </xsl:with-param>
561           </xsl:call-template>
562         </xsl:when>
563         <xsl:otherwise>
564           <xsl:call-template name="callout-bug">
565             <xsl:with-param name="conum">
566               <xsl:apply-templates select="$target"
567                 mode="conumber"/>
568             </xsl:with-param>
569           </xsl:call-template>
570         </xsl:otherwise>
571       </xsl:choose>
572     </xsl:when>
573     <xsl:otherwise>
574       <xsl:text>???</xsl:text>
575     </xsl:otherwise>
576   </xsl:choose>
577 </xsl:template>
578
579 <!-- * we bold the actual callout bugs and put -->
580 <!-- * parenthesis around them -->
581 <xsl:template name="callout-bug">
582   <xsl:param name="conum" select='1'/>
583   <xsl:text>\fB(</xsl:text>
584   <xsl:value-of select="$conum"/>
585   <xsl:text>)\fR</xsl:text>
586 </xsl:template>
587
588 <!-- * we bold the callout numbers and follow each -->
589 <!-- * with a period -->
590 <xsl:template name="calloutlist-callout-number">
591   <xsl:param name="conum" select='1'/>
592   <xsl:text>\fB</xsl:text>
593   <xsl:value-of select="$conum"/>
594   <xsl:text>.\fR</xsl:text>
595 </xsl:template>
596
597 <xsl:template match="co" mode="calloutlist-callout-number">
598   <xsl:call-template name="calloutlist-callout-number">
599     <xsl:with-param name="conum">
600       <xsl:number count="co"
601         level="any"
602         from="programlisting|screen|literallayout|synopsis"
603         format="1"/>
604     </xsl:with-param>
605   </xsl:call-template>
606 </xsl:template>
607
608 </xsl:stylesheet>