]> git.lyx.org Git - lyx.git/blob - lib/citeengines/natbib.citeengine
Disentangle CiteEngines and Modules
[lyx.git] / lib / citeengines / natbib.citeengine
1 # \DeclareLyXCiteEngine[natbib.sty]{Natbib}
2 # DescriptionBegin
3 #   Loads the LaTeX package natbib, a citation engine. Natbib supports
4 #   both author-year and numerical styles for citations, automatic sorting
5 #   and merging of numerical citations, annotations, capitalization of the
6 #   `van' part of author names, shortened and full author lists, and more.
7 # DescriptionEnd
8 # Excludes: basic | jurabib
9
10 # Author: Julien Rioux <jrioux@lyx.org>
11
12 Format 62
13
14 Requires natbib
15
16 CiteEngineType authoryear|numerical
17 DefaultBiblio  plainnat
18
19 CiteEngine authoryear
20         Citet*[][]
21         Citep*[][]
22         Citealt*[][]
23         Citealp*[][]
24         Citeauthor*[]
25         citeyear[]
26         citeyearpar[][]
27         nocite
28 End
29
30 CiteEngine numerical
31         Citep*[][]
32         Citealp*[][]
33         Citet*[][]
34         Citealt*[][]
35         Citeauthor*
36         citeyearpar[][]
37         citeyear
38         nocite
39 End
40
41 CiteFormat default
42         # translatable bits
43         _notcited not cited
44         _addtobib Add to bibliography only.
45
46         # macros
47         !startlink {!<a href='#LyXCite-%clean:key%'>!}
48         !endlink {!</a>!}
49
50         !nextauthor {%next%[[%!sep% %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%]]}
51         !nextkey {%next%[[%!sep% %key%%!nextkey%]]}
52         !nextyear {%next%[[%!sep% %!startlink%%!year%%!endlink%%!nextyear%]]}
53
54         !abbrvauthor {%abbrvauthor%[[%abbrvauthor%]][[??]]}
55         !textbefore {%textbefore%[[%textbefore% ]]}
56         !textafter {%textafter%[[, %textafter%]]}
57         !year {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]]}
58
59         # cite styles
60         citet %!citet%%!textafter%%!close%
61         citealt %!citealt%%!textafter%
62         citeyearpar %!open%%!textbefore%%!startlink%%!year%%!endlink%%!nextyear%%!textafter%%!close%
63         nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]}
64 End
65
66 CiteFormat authoryear
67         !open (
68         !sep ;
69         !close )
70
71         !citet %!startlink%%!abbrvauthor%%!endlink% %!open%%!textbefore%%!year%%!nextcitet%
72         !citealt %!startlink%%!abbrvauthor% %!textbefore%%!year%%!endlink%%!nextcitealt%
73         !citealp %!startlink%%!abbrvauthor%, %!year%%!endlink%%!nextcitealp%
74
75         !nextcitet {%next%[[%!close%%!sep% %!citet%]]}
76         !nextcitealt {%next%[[%!sep% %!citealt%]]}
77         !nextcitealp {%next%[[%!sep% %!citealp%]]}
78
79         cite %!citet%%!textafter%%!close%
80         citep %!open%%!textbefore%%!citealp%%!textafter%%!close%
81         citealp %!textbefore%%!citealp%%!textafter%
82         citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%%!textafter%
83         citeyear %!startlink%%!year%%!endlink%%!nextyear%%!textafter%
84 End
85
86 CiteFormat numerical
87         !open [
88         !sep ,
89         !close ]
90
91         !citet %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%
92         !citealt %!abbrvauthor% %!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%
93
94         !hashkey {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
95
96         !nextcitet {%next%[[%!close%%!sep% %!citet%]]}
97         !nextcitealt {%next%[[%!sep% %!citealt%]]}
98         !nexthashid {%next%[[%!sep% #ID%!nexthashid%]]}
99         !nexthashkey {%next%[[%!sep% %!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
100
101         cite %!open%%!textbefore%%!hashkey%%!textafter%%!close%
102         citep %!open%%!textbefore%%!hashkey%%!textafter%%!close%
103         citealp %!textbefore%%!hashkey%%!textafter%
104         citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%
105         citeyear %!startlink%%!year%%!endlink%%!nextyear%
106 End