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>
16 # The framework (biblatex|bibtex)
19 # Cite style variants (default|authoryear|natbib)
20 # We provide both authoryear and numerical citations
21 CiteEngineType authoryear|numerical
23 # Default style files for either engine type
24 DefaultBiblio authoryear:plainnat|numerical:plainnat
26 # Maximum number of names before "et al." chimes in
30 # The syntax of the cite command definitions below is:
31 # LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
33 # * LyXName: The LyX name as output in the LyX file. For
34 # portability reasons, we try to use the same
35 # name for same-formatted commands in the
36 # different engines (thus many names stem from
38 # * Alias: A (comma-separated) list of commands that fall
39 # back to the given LyX name in the current engine.
40 # This is a bit like "ObsoletedBy" in the layouts.
41 # * latexcmd: The actual LaTeX command that is output.
43 # Alias and latexcmd are optional. If no latexcmd is given, the
44 # LyXName will be output to LaTeX.
48 # * Capitalization indicates that the command also has a capitalized
49 # form (\Latexcmd vs. \latexcmd). These usually enforce upcasing of
50 # name prefixes (von Goethe => Von Goethe).
51 # * Brackets [] indicate the number of optional arguments (0, 1, 2).
52 # * The star * indicates there is a starred version of the command
53 # (\latexcmd* vs. \latexcmd). By default, the starred version means:
54 # Expand the author list even if the maxnames setting would cause
55 # BibTeX/Biber to shorten it with "et al.".
56 # If the star has a different meaning for a command, it can be
57 # specified in angle brackets: <!_stardesc!_stardesctooltip>.
58 # Maximal two translatable macro keywords, marked by the prefix '!_',
59 # can be given. The first points to the string that replaces the
60 # "Full aut&hor list" checkbox label in the Citation dialog, the
61 # second one an optional tooltip for this checkbox. Note that these
62 # two macros have to be defined in the CiteFormat section (see below),
63 # dropping the '!' from the prefix (see below), e.g.:
64 # _stardesc Starred command label
65 # _stardesctooltip Tooltip for the starred command checkbox.
68 # CITE COMMAND DEFINITIONS for either engine type
97 # The following defines how the commands are represented in the GUI
98 # (inset button and citation dialog) as well as in XHTML, docbook and
101 # There are common definitions (default) and specific definitions for
102 # either cite engine type (which overwrite existing defaults.
108 # 1. Translatable bits (need to be marked by _ prefix)
111 _addtobib Add to bibliography only.
114 # 2. Macros re-used in the style definitions
116 # A link that lets us jump to the bibliography entry in LyXHTML
117 # %clean:key% will be substituted by the cite key to give a unique id
118 !startlink {!<a href='#LyXCite-%clean:key%'>!}
121 # "Author et al." or "??"
122 !abbrvauthor {%abbrvauthor%[[%abbrvauthor%]][[??]]}
124 !textbefore {%textbefore%[[%textbefore% ]]}
126 !textafter {%textafter%[[, %textafter%]]}
127 # Add a year if it exists (else "??") and possibly a modifier (as in 2017a)
128 !year {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]]}
131 !nextauthor {%next%[[%!sep% %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%]]}
133 !nextkey {%next%[[%!sep% %key%%!nextkey%]]}
135 !nextyear {%next%[[%!sep% %!startlink%%!year%%!endlink%%!nextyear%]]}
138 # ACTUAL STYLE DEFINITIONS
140 # (identical in authoryear and numerical)
143 # "(cf. Year; NextYear, p. xx)" [Authoryear] / "(cf. Year, NextYear, p. xx)" [Numerical]
144 citeyearpar %!open%%!textbefore%%!startlink%%!year%%!endlink%%!nextyear%%!textafter%%!close%
145 # "Add to bibliography only." (dialog) / "[ID] (not cited)" (button)
146 nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]}
149 CiteFormat authoryear
157 # "Author et al. (cf. Year..."
158 !makecitet %!startlink%%!abbrvauthor%%!endlink% %!open%%!textbefore%%!year%%!nextcitet%
159 # "Author et al. cf. Year..." [sic!]
160 !makecitealt %!startlink%%!abbrvauthor% %!textbefore%%!year%%!endlink%%!nextcitealt%
161 # "Author et al., Year..."
162 !makecitealp %!startlink%%!abbrvauthor%, %!year%%!endlink%%!nextcitealp%
164 # "...); Nextauthor (Year..."
165 !nextcitet {%next%[[%!close%%!sep% %!startlink%%!abbrvauthor%%!endlink% %!open%%!year%%!nextcitet%]]}
166 # "...; NextAuthor et al. Year..."
167 !nextcitealt {%next%[[%!sep% %!makecitealt%]]}
168 # "...; NextAuthor et al., Year..."
169 !nextcitealp {%next%[[%!sep% %!makecitealp%]]}
172 # ACTUAL STYLE DEFINITIONS
174 # (additions and modifications to default)
177 # "Author (cf. Year); NextAuthor (Year, p. xx)"
178 citet %!makecitet%%!textafter%%!close%
179 # "(cf. Author et al., Year; NextAuthor et al., Year, p. xx)"
180 citep %!open%%!textbefore%%!makecitealp%%!textafter%%!close%
181 # "cf. Author et al., Year; NextAuthor et al., Year, p. xx"
182 citealp %!textbefore%%!makecitealp%%!textafter%
183 # "Author cf. Year; NextAuthor Year, p. xx" [sic!]
184 citealt %!makecitealt%%!textafter%
185 # "Author; NextAuthor, p. xx"
186 citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%%!textafter%
187 # "Year; NextYear, p. xx"
188 citeyear %!startlink%%!year%%!endlink%%!nextyear%%!textafter%
190 # Fallback style: "Author (cf. Year); NextAuthor (Year, p. xx)"
191 cite %!makecitet%%!textafter%%!close%
202 # "Author [cf. ID..."
203 !makecitet %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%
205 !makecitealt %!abbrvauthor% %!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%
207 !hashkey {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
209 # "...], NextAuthor [ID..."
210 !nextcitet {%next%[[%!close%%!sep% %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%]]}
211 # "..., NextAuthor ID..."
212 !nextcitealt {%next%[[%!sep% %!abbrvauthor% {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%]]}
213 # FIXME: What is this?
214 !nexthashid {%next%[[%!sep% #ID%!nexthashid%]]}
216 !nexthashkey {%next%[[%!sep% %!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
219 # ACTUAL STYLE DEFINITIONS
221 # (additions and modifications to default)
224 # "[cf. ID, NextID, p. xx]"
225 citep %!open%%!textbefore%%!hashkey%%!textafter%%!close%
226 # "Author [cf. ID], Nextauthor [NextID, p. xx]"
227 citet %!makecitet%%!textafter%%!close%
228 # "cf. ID, NextID, p. xx"
229 citealp %!textbefore%%!hashkey%%!textafter%
230 # "Author cf. ID, NextAuthor ID, p. xx"
231 citealt %!makecitealt%%!textafter%
232 # "Author, NextAuthor"
233 citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%
235 citeyear %!startlink%%!year%%!endlink%%!nextyear%
237 # Fallback style: "[cf. ID, NextID, p. xx]"
238 cite %!open%%!textbefore%%!hashkey%%!textafter%%!close%