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
27 # The syntax of the cite command definitions below is:
28 # LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
30 # * LyXName: The LyX name as output in the LyX file. For
31 # portability reasons, we try to use the same
32 # name for same-formatted commands in the
33 # different engines (thus many names stem from
35 # * Alias: A (comma-separated) list of commands that fall
36 # back to the given LyX name in the current engine.
37 # This is a bit like "ObsoletedBy" in the layouts.
38 # * latexcmd: The actual LaTeX command that is output.
40 # Alias and latexcmd are optional. If no latexcmd is given, the
41 # LyXName will be output to LaTeX.
45 # * Capitalization indicates that the command also has a capitalized
46 # form (\Latexcmd vs. \latexcmd). These usually enforce upcasing of
47 # name prefixes (von Goethe => Von Goethe).
48 # * Brackets [] indicate the number of optional arguments (0, 1, 2).
49 # * The star * indicates there is a starred version of the command
50 # (\latexcmd* vs. \latexcmd). By default, the starred version means:
51 # Expand the author list even if the maxnames setting would cause
52 # BibTeX/Biber to shorten it with "et al.".
53 # If the star has a different meaning for a command, it can be
54 # specified in angle brackets: <!_stardesc!_stardesctooltip>.
55 # Maximal two translatable macro keywords, marked by the prefix '!_',
56 # can be given. The first points to the string that replaces the
57 # "Full aut&hor list" checkbox label in the Citation dialog, the
58 # second one an optional tooltip for this checkbox. Note that these
59 # two macros have to be defined in the CiteFormat section (see below),
60 # dropping the '!' from the prefix (see below), e.g.:
61 # _stardesc Starred command label
62 # _stardesctooltip Tooltip for the starred command checkbox.
65 # CITE COMMAND DEFINITIONS for either engine type
94 # The following defines how the commands are represented in the GUI
95 # (inset button and citation dialog) as well as in XHTML, docbook and
98 # There are common definitions (default) and specific definitions for
99 # either cite engine type (which overwrite existing defaults.
105 # 1. Translatable bits (need to be marked by _ prefix)
108 _addtobib Add to bibliography only.
111 # 2. Macros re-used in the style definitions
113 # A link that lets us jump to the bibliography entry in LyXHTML
114 # %clean:key% will be substituted by the cite key to give a unique id
115 !startlink {!<a href='#LyXCite-%clean:key%'>!}
118 # "Author et al." or "??"
119 !abbrvauthor {%abbrvauthor%[[%abbrvauthor%]][[??]]}
121 !textbefore {%textbefore%[[%textbefore% ]]}
123 !textafter {%textafter%[[, %textafter%]]}
124 # Add a year if it exists (else "??") and possibly a modifier (as in 2017a)
125 !year {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]]}
128 !nextauthor {%next%[[%!sep% %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%]]}
130 !nextkey {%next%[[%!sep% %key%%!nextkey%]]}
132 !nextyear {%next%[[%!sep% %!startlink%%!year%%!endlink%%!nextyear%]]}
135 # ACTUAL STYLE DEFINITIONS
137 # (identical in authoryear and numerical)
140 # "(cf. Year; NextYear, p. xx)" [Authoryear] / "(cf. Year, NextYear, p. xx)" [Numerical]
141 citeyearpar %!open%%!textbefore%%!startlink%%!year%%!endlink%%!nextyear%%!textafter%%!close%
142 # "Add to bibliography only." (dialog) / "[ID] (not cited)" (button)
143 nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]}
146 CiteFormat authoryear
154 # "Author et al. (cf. Year..."
155 !makecitet %!startlink%%!abbrvauthor%%!endlink% %!open%%!textbefore%%!year%%!nextcitet%
156 # "Author et al. cf. Year..." [sic!]
157 !makecitealt %!startlink%%!abbrvauthor% %!textbefore%%!year%%!endlink%%!nextcitealt%
158 # "Author et al., Year..."
159 !makecitealp %!startlink%%!abbrvauthor%, %!year%%!endlink%%!nextcitealp%
161 # "...); Nextauthor (Year..."
162 !nextcitet {%next%[[%!close%%!sep% %!startlink%%!abbrvauthor%%!endlink% %!open%%!year%%!nextcitet%]]}
163 # "...; NextAuthor et al. Year..."
164 !nextcitealt {%next%[[%!sep% %!makecitealt%]]}
165 # "...; NextAuthor et al., Year..."
166 !nextcitealp {%next%[[%!sep% %!makecitealp%]]}
169 # ACTUAL STYLE DEFINITIONS
171 # (additions and modifications to default)
174 # "Author (cf. Year); NextAuthor (Year, p. xx)"
175 citet %!makecitet%%!textafter%%!close%
176 # "(cf. Author et al., Year; NextAuthor et al., Year, p. xx)"
177 citep %!open%%!textbefore%%!makecitealp%%!textafter%%!close%
178 # "cf. Author et al., Year; NextAuthor et al., Year, p. xx"
179 citealp %!textbefore%%!makecitealp%%!textafter%
180 # "Author cf. Year; NextAuthor Year, p. xx" [sic!]
181 citealt %!makecitealt%%!textafter%
182 # "Author; NextAuthor, p. xx"
183 citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%%!textafter%
184 # "Year; NextYear, p. xx"
185 citeyear %!startlink%%!year%%!endlink%%!nextyear%%!textafter%
187 # Fallback style: "Author (cf. Year); NextAuthor (Year, p. xx)"
188 cite %!makecitet%%!textafter%%!close%
199 # "Author [cf. ID..."
200 !makecitet %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%
202 !makecitealt %!abbrvauthor% %!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%
204 !hashkey {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
206 # "...], NextAuthor [ID..."
207 !nextcitet {%next%[[%!close%%!sep% %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%]]}
208 # "..., NextAuthor ID..."
209 !nextcitealt {%next%[[%!sep% %!abbrvauthor% {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%]]}
210 # FIXME: What is this?
211 !nexthashid {%next%[[%!sep% #ID%!nexthashid%]]}
213 !nexthashkey {%next%[[%!sep% %!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
216 # ACTUAL STYLE DEFINITIONS
218 # (additions and modifications to default)
221 # "[cf. ID, NextID, p. xx]"
222 citep %!open%%!textbefore%%!hashkey%%!textafter%%!close%
223 # "Author [cf. ID], Nextauthor [NextID, p. xx]"
224 citet %!makecitet%%!textafter%%!close%
225 # "cf. ID, NextID, p. xx"
226 citealp %!textbefore%%!hashkey%%!textafter%
227 # "Author cf. ID, NextAuthor ID, p. xx"
228 citealt %!makecitealt%%!textafter%
229 # "Author, NextAuthor"
230 citeauthor %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%
232 citeyear %!startlink%%!year%%!endlink%%!nextyear%
234 # Fallback style: "[cf. ID, NextID, p. xx]"
235 cite %!open%%!textbefore%%!hashkey%%!textafter%%!close%