1 # \DeclareLyXCiteEngine[natbib.sty]{Natbib (BibTeX)}
3 # Natbib supports a range of both author-year and numerical styles mainly
4 # aimed at the Humanities. It features automatic sorting and merging of
5 # numerical citations, annotations, capitalization of the `van' part of
6 # author names, shortened and full author lists, and more.
8 # Excludes: basic | jurabib | biblatex
10 # Author: Julien Rioux <jrioux@lyx.org>
17 CiteEngineType authoryear|numerical
18 DefaultBiblio authoryear:plainnat|numerical:plainnat
45 _addtobib Add to bibliography only.
47 # A link that lets us jump to the bibliography entry in LyXHTML
48 # %clean:key% will be substituted by the cite key to give a unique id
49 !startlink {!<a href='#LyXCite-%clean:key%'>!}
52 # Abbreviated author (with et al.) or "??" if there is no author
53 !abbrvauthor {%abbrvauthor%[[%abbrvauthor%]][[??]]}
55 !textbefore {%textbefore%[[%textbefore% ]]}
57 !textafter {%textafter%[[, %textafter%]]}
58 # Add a year if it exists (else "??") and possibly a modifier (as in 2017a)
59 !year {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]]}
62 !nextauthor {%next%[[%!sep% %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%]]}
64 !nextkey {%next%[[%!sep% %key%%!nextkey%]]}
66 !nextyear {%next%[[%!sep% %!startlink%%!year%%!endlink%%!nextyear%]]}
68 ## The actual cite styles (identical in authoryear and numerical except for the separator) ##
69 # (cf. Year; NextYear, p. xx) [Authoryear] / (cf. Year, NextYear, p. xx) [Numerical]
70 citeyearpar %!open%%!textbefore%%!startlink%%!year%%!endlink%%!nextyear%%!textafter%%!close%
71 # Add to bibliography only. / [ID] (not cited)
72 nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]}
81 # Author et al. (cf. Year...
82 !makecitet %!startlink%%!abbrvauthor%%!endlink% %!open%%!textbefore%%!year%%!nextcitet%
83 # Author et al. cf. Year... [sic!]
84 !makecitealt %!startlink%%!abbrvauthor% %!textbefore%%!year%%!endlink%%!nextcitealt%
85 # Author et al., Year...
86 !makecitealp %!startlink%%!abbrvauthor%, %!year%%!endlink%%!nextcitealp%
88 # ...); Nextauthor (Year...
89 !nextcitet {%next%[[%!close%%!sep% %!startlink%%!abbrvauthor%%!endlink% %!open%%!year%%!nextcitet%]]}
90 # ...; NextAuthor et al. Year...
91 !nextcitealt {%next%[[%!sep% %!makecitealt%]]}
92 # ...; NextAuthor et al., Year...
93 !nextcitealp {%next%[[%!sep% %!makecitealp%]]}
95 ## The actual cite styles (additions and modifications to default) ##
96 # Author (cf. Year); NextAuthor (Year, p. xx)
97 citet %!makecitet%%!textafter%%!close%
98 # (cf. Author et al., Year; NextAuthor et al., Year, p. xx)
99 citep %!open%%!textbefore%%!makecitealp%%!textafter%%!close%
100 # cf. Author et al., Year; NextAuthor et al., Year, p. xx
101 citealp %!textbefore%%!makecitealp%%!textafter%
102 # Author cf. Year; NextAuthor Year, p. xx [sic!]
103 citealt %!makecitealt%%!textafter%
104 # Author; NextAuthor, p. xx
105 citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%%!textafter%
106 # Year; NextYear, p. xx
107 citeyear %!startlink%%!year%%!endlink%%!nextyear%%!textafter%
109 # Fallback style: Author (cf. Year); NextAuthor (Year, p. xx)
110 cite %!makecitet%%!textafter%%!close%
120 !makecitet %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%
122 !makecitealt %!abbrvauthor% %!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%
124 !hashkey {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
126 # ...], NextAuthor [ID...
127 !nextcitet {%next%[[%!close%%!sep% %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%]]}
128 # ..., NextAuthor ID...
129 !nextcitealt {%next%[[%!sep% %!abbrvauthor% {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%]]}
130 # FIXME: What is this?
131 !nexthashid {%next%[[%!sep% #ID%!nexthashid%]]}
133 !nexthashkey {%next%[[%!sep% %!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
135 ## The actual cite styles (additions and modifications to default) ##
136 # [cf. ID, NextID, p. xx]
137 citep %!open%%!textbefore%%!hashkey%%!textafter%%!close%
138 # Author [cf. ID], Nextauthor [NextID, p. xx]
139 citet %!makecitet%%!textafter%%!close%
140 # cf. ID, NextID, p. xx
141 citealp %!textbefore%%!hashkey%%!textafter%
142 # Author cf. ID, NextAuthor ID, p. xx
143 citealt %!makecitealt%%!textafter%
145 citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%
147 citeyear %!startlink%%!year%%!endlink%%!nextyear%
149 # Fallback style: [cf. ID, NextID, p. xx]
150 cite %!open%%!textbefore%%!hashkey%%!textafter%%!close%