Moving docs tree to docs-xml to make room for generated docs in the release tarball.
[gd/samba-autobuild/.git] / docs-xml / xslt / db2latex-xsl / xsl / citation.mod.xsl
1 <?xml version='1.0'?>
2 <!DOCTYPE xsl:stylesheet [ <!ENTITY % xsldoc.ent SYSTEM "./xsldoc.ent"> %xsldoc.ent; ]>
3 <!--############################################################################# 
4 |       $Id: citation.mod.xsl,v 1.6 2003/12/29 01:30:32 j-devenish Exp $
5 |- #############################################################################
6 |       $Author: j-devenish $
7 + ############################################################################## -->
8
9 <xsl:stylesheet
10         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11         xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
12         exclude-result-prefixes="doc" version='1.0'>
13
14
15         <doc:reference id="citation" xmlns="">
16                 <referenceinfo>
17                         <releaseinfo role="meta">
18                                 $Id: citation.mod.xsl,v 1.6 2003/12/29 01:30:32 j-devenish Exp $
19                         </releaseinfo>
20                         <authorgroup>
21                                 &ramon;
22                                 &james;
23                         </authorgroup>
24                         <copyright>
25                                 <year>2000</year><year>2001</year><year>2002</year><year>2003</year>
26                                 <holder>Ramon Casellas</holder>
27                         </copyright>
28                         <revhistory>
29                                 <doc:revision rcasver="1.6">&rev_2003_05;</doc:revision>
30                         </revhistory>
31                 </referenceinfo>
32                 <title>Citations <filename>citation.mod.xsl</filename></title>
33                 <partintro>
34
35                         <para>This file contains a single XSL template that maps <doc:db
36                         basename="citation">citations</doc:db> to the &LaTeX;
37                         <function condition="latex">cite{}</function>. command.</para>
38
39                 </partintro>
40         </doc:reference>
41
42         <doc:template basename="citation" xmlns="">
43                 <refpurpose> Process <doc:db>citation</doc:db> elements  </refpurpose>
44                 <doc:description>
45
46                         <para>
47
48                         Outputs a <function condition="latex">cite{...}</function> command
49                         using the text value of the <doc:db>citation</doc:db>.
50
51                         </para>
52
53                 </doc:description>
54                 <doc:variables>
55                         &no_var;
56                 </doc:variables>
57                 <doc:notes>
58                         &essential_preamble;
59                 </doc:notes>
60                 <doc:samples>
61                         <simplelist type='inline'>
62                                 &test_book;
63                                 &test_cited;
64                         </simplelist>
65                 </doc:samples>
66         </doc:template>
67
68         <xsl:template match="citation">
69                 <!-- todo: biblio-citation-check -->
70                 <xsl:text>\docbooktolatexcite{</xsl:text>
71                         <xsl:value-of select="."/>
72                 <xsl:text>}{}</xsl:text>
73         </xsl:template>
74
75         <doc:template xmlns="">
76                 <refpurpose> Essential preamble for <filename>citation.mod.xsl</filename> support </refpurpose>
77                 <doc:description>
78                         <para>
79
80                                 Defines <function
81                                 condition="latex">docbooktolatexcite</function>. This function
82                                 helps to integrate <doc:db>bibioentry</doc:db>/@<sgmltag
83                                 class="attribute">id</sgmltag> and
84                                 <doc:db>bibioentry</doc:db>/<doc:db>abbrev</doc:db> with
85                                 &LaTeX;.
86                                 Also defines <function condition="latex">docbooktolatexbackcite</function>
87                                 for compatability with <productname>hyperref</productname>'s
88                                 <productname>backref</productname> functionality.
89
90                         </para>
91                 </doc:description>
92                 <doc:seealso>
93                         <itemizedlist>
94                                 <listitem><simpara>&preamble;</simpara></listitem>
95                         </itemizedlist>
96                 </doc:seealso>
97         </doc:template>
98
99         <xsl:template name="latex.preamble.essential.citation">
100                 <xsl:text>
101                         <![CDATA[
102 %\usepackage{cite}
103 %\renewcommand\citeleft{(}  % parentheses around list
104 %\renewcommand\citeright{)} % parentheses around list
105 \newcommand{\docbooktolatexcite}[2]{%
106   \@ifundefined{docbooktolatexcite@#1}%
107   {\cite{#1}}%
108   {\def\@docbooktolatextemp{#2}\ifx\@docbooktolatextemp\@empty%
109    \cite{\@nameuse{docbooktolatexcite@#1}}%
110    \else\cite[#2]{\@nameuse{docbooktolatexcite@#1}}%
111    \fi%
112   }%
113 }
114 \newcommand{\docbooktolatexbackcite}[1]{%
115   \ifx\Hy@backout\@undefined\else%
116     \@ifundefined{docbooktolatexcite@#1}{%
117       % emit warning?
118     }{%
119       \ifBR@verbose%
120         \PackageInfo{backref}{back cite \string`#1\string' as \string`\@nameuse{docbooktolatexcite@#1}\string'}%
121       \fi%
122       \Hy@backout{\@nameuse{docbooktolatexcite@#1}}%
123     }%
124   \fi%
125 }
126 ]]>
127                 </xsl:text>
128         </xsl:template>
129
130 </xsl:stylesheet>
131
132