1 # \DeclareLyXCiteEngine[biblatex.sty]{Biblatex}
3 # Biblatex supports many author-year and numerical styles. It is mainly
4 # aimed at the Humanities. It is highly customizable, fully localized
5 # and provides many features that are not possible with BibTeX.
6 # The use of 'biber' as bibliography processor is advised.
9 # Author: Jürgen Spitzmüller <spitz@lyx.org>
15 # The framework (biblatex|bibtex)
16 CiteFramework biblatex
18 # Cite style variants (default|authoryear|natbib)
19 # We provide both authoryear and numerical citations
20 CiteEngineType authoryear|numerical
22 # Default style files for either engine type
23 DefaultBiblio authoryear:authoryear|numerical:numeric
25 # Maximum number of names before "et al." chimes in
29 # The syntax of the cite command definitions below is:
30 # LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
32 # * LyXName: The LyX name as output in the LyX file. For
33 # portability reasons, we try to use the same
34 # name for same-formatted commands in the
35 # different engines (thus many names stem from
37 # * Alias: A (comma-separated) list of commands that fall
38 # back to the given LyX name in the current engine.
39 # This is a bit like "ObsoletedBy" in the layouts.
40 # * latexcmd: The actual LaTeX command that is output.
42 # Alias and latexcmd are optional. If no latexcmd is given, the
43 # LyXName will be output to LaTeX.
47 # * The LyXName "keyonly" has a special meaning: only the citation key,
48 # without any latex command, is output.
49 # * Capitalization indicates that the command also has a capitalized
50 # form (\Latexcmd vs. \latexcmd). These usually enforce upcasing of
51 # name prefixes (von Goethe => Von Goethe).
52 # * Brackets [] indicate the number of optional arguments (0, 1, 2).
53 # * The star * indicates there is a starred version of the command
54 # (\latexcmd* vs. \latexcmd). By default, the starred version means:
55 # Expand the author list even if the maxnames setting would cause
56 # BibTeX/Biber to shorten it with "et al.".
57 # If the star has a different meaning for a command, it can be
58 # specified in angle brackets: <!_stardesc!_stardesctooltip>.
59 # Maximal two translatable macro keywords, marked by the prefix '!_',
60 # can be given. The first points to the string that replaces the
61 # "Full aut&hor list" checkbox label in the Citation dialog, the
62 # second one an optional tooltip for this checkbox. Note that these
63 # two macros have to be defined in the CiteFormat section, dropping
64 # the '!' from the prefix (see below), e.g.:
65 # _stardesc Starred command label
66 # _stardesctooltip Tooltip for the starred command checkbox.
67 # * A trailing $ indicates that a command features "qualified citation
68 # lists" (a specific Biblatex feature)
71 # CITE COMMAND DEFINITIONS for either engine type
74 Cite$|citealt,citealp[][]
77 Citeauthor*<!_citeauthorstar!_citeauthorstartooltip>[][]
78 citeyearpar[][]=parencite*
80 citebyear[][]=citeyear
81 Footcite$[][]=smartcite
83 citetitle*<!_citetitlestar!_citetitlestartooltip>[][]
91 cite$|parencite,citep,citealt,citealp[][]
94 Footcite$[][]=smartcite
96 Citeauthor*<!_citeauthorstar!_citeauthorstartooltip>[][]
97 citeyear|parencite*,citebyear[][]=citeyear*
98 citetitle*<!_citetitlestar!_citetitlestartooltip>[][]
110 # The following defines how the commands are represented in the GUI
111 # (inset button and citation dialog) as well as in XHTML, docbook and
114 # There are common definitions (default) and specific definitions for
115 # either cite engine type (which overwrite existing defaults.
118 # Input standard format definitions for the bibliography
119 Input stdciteformats.inc
125 # 1. Translatable bits (need to be marked by _ prefix, if translated to the GUI language,
126 # or B_, if translated to the buffer language)
127 # Note that preceding and trailing spaces matter.
130 _addtobib Add to bibliography only.
135 _fullcite bibliography entry
136 _bibentry Full bibliography entry.
139 # GUI strings for the starred commands
140 _citeauthorstar S&horten author list[[Possible substitute to All aut&hors]]
141 _citeauthorstartooltip Force a short author list (using et al.)
142 _citetitlestar F&orce full title[[Possible substitute to All aut&hors]]
143 _citetitlestartooltip Use full title even if shorttitle exists
144 # The following are handled by BiblioInfo
146 B_namesep , [[separate author names in citation, except for last name]]
147 B_lastnamesep , and [[separate name of last author in citation]]
148 B_pairnamesep and [[separate two authors in citation]]
151 # 2. Macros re-used in the style definitions
153 # A link that lets us jump to the bibliography entry in LyXHTML
154 # %clean:key% will be substituted by the cite key to give a unique id
155 !startlink {!<a href='#LyXCite-%clean:key%'>!}
158 # Add " , and " before the last item (but " and " if there are only two), else ", "
159 !smartsep {%second%[[{%next%[[%B_namesep%]][[%B_pairnamesep%]]}]][[{%next%[[%B_namesep%]][[%B_lastnamesep%]]}]]}
161 # A dummy year modifier. This just indicates that a modifier might be output,
162 # to differentiate \cite* and \citeyear
165 # "...; Nextauthor ..."
166 !nextauthor {%next%[[%!sep% %!startlink%%!abbrvciteauthor%%!endlink%%!nextauthor%]]}
167 # Handle starred command: abbr. or full author list
168 !makenextauthor {%next%[[%!sep% %!startlink%%!makeauthor%%!endlink%%!makenextauthor%]]}
169 # "...; [NextID] ..."
170 !nextkey {%next%[[%!sep% %key%%!nextkey%]]}
171 # "...; Nextyear ..." (including extra label, as in 2017a)
172 !nextyear {%next%[[%!sep% %!startlink%%!year%%!endlink%%!nextyear%]]}
173 # "...; Nextyear ..." (including emulated extra label, as in 2017[a])
174 !nextshmyear {%next%[[%!sep% %!startlink%%!shmyear%%!endlink%%!nextshmyear%]]}
175 # "...; Nextyear ..." (without any extra label)
176 !nextbyear {%next%[[%!sep% %!startlink%%!byear%%!endlink%%!nextbyear%]]}
177 # "...; Nexttitle ..."
178 !makenexttitle {%next%[[%!sep% %!startlink%%!maketitle%%!endlink%%!makenexttitle%]]}
180 !nextfullcite {%next%[[%!sep% %bibentry%%!nextfullcite%]]}
182 # "Author et al." (if > 3 authors) or "??"
183 !abbrvciteauthor {%abbrvciteauthor%[[%abbrvciteauthor%]][[??]]}
184 # "Author et al." (always) or "??"
185 !forceabbrvciteauthor {%forceabbrvciteauthor%[[%forceabbrvciteauthor%]][[??]]}
186 # Handle starred command: force of abbr. author list, independent of maxcitenames
187 !makeauthor {%ifstar%[[%!forceabbrvciteauthor%]][[%!abbrvciteauthor%]]}
189 !textbefore {%textbefore%[[%textbefore% ]]}
191 !textafter {%textafter%[[, %textafter%]]}
192 # "prenote " (for qualified lists)
193 !ctextbefore {%curpretext%[[%curpretext% ]]}
194 # ", postnote" (for qualified lists)
195 !ctextafter {%curposttext%[[, %curposttext%]]}
196 # Add a year if it exists (else "??") and possibly a modifier (as in 2017a)
197 !year {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]]}
198 # Add a year if it exists (else "??") and indicate a possible modifier (as in 2017[a])
199 !myear {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]][[{%export%[[]][[%!dummymod%]]}]]}
200 # Add a shorthand if it exists else myear (see above)
201 !shmyear {%shorthand%[[%shorthand%]][[%!myear%]]}
202 # Add a year if it exists (else "??") without any modifier at all
203 !byear {%year%[[%year%]][[??]]}
204 # Add a shorttitle or title if it exists (else "??")
205 !makeshorttitle {%shorttitle%[[%shorttitle%]][[{%title%[[%title%]][[??]]}]]}
206 # Add a title (or "??")
207 !maketitle {%ifstar%[[{%title%[[%title%]][[??]]}]][[%!makeshorttitle%]]}
209 !fullcite %!startlink%%bibentry%%!endlink%%!nextfullcite%
212 # ACTUAL STYLE DEFINITIONS
214 # (identical in authoryear and numerical)
217 # "cf. Author; Nextautor, p. xx"
218 citeauthor %!textbefore%%!startlink%%!makeauthor%%!endlink%%!makenextauthor%%!textafter%
219 # "cf. Year; Nextyear, p. xx" (including extra label, as in 2017a)
220 citeyear %!textbefore%%!startlink%%!shmyear%%!endlink%%!nextshmyear%%!textafter%
221 # "cf. Year; Nextyear, p. xx" (without any extra label)
222 citebyear %!textbefore%%!startlink%%!byear%%!endlink%%!nextbyear%%!textafter%
223 # "cf. Year; Nextyear, p. xx" (without any extra label)
224 citetitle %!textbefore%%!startlink%%!maketitle%%!endlink%%!makenexttitle%%!textafter%
225 # "Bibliography entry." (dialog) / "cf. Key; NextKey..., p. xx (bibliography entry)" (button)
226 fullcite {%dialog%[[%_bibentry%]][[%!textbefore%{%label%[[%!fullcite%]][[%key%%!nextkey% (%_fullcite%)]]}%!textafter%}]]}
227 # "Footnote: Full bibliography entry." (dialog) / "Foot: Key (bibliography entry)"
228 footfullcite {%dialog%[[%_footnote%]][[%_foot%]]}: {%dialog%[[%_bibentry%]][[{%label%[[%!fullcite%]][[%key%%!nextkey% (%_fullcite%)]]}]]}
229 # "Add to bibliography only." (dialog) / "[ID] (not cited)" (button)
230 nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]}
231 # Output only the key
232 keyonly {%dialog%[[%_keyonly%]][[%_key%: %key%%!nextkey%]]}
235 CiteFormat authoryear
243 # "cf. Author et. al Year..."
244 !makecite %!ctextbefore%%!startlink%%!abbrvciteauthor% %!year%%!endlink%%!ctextafter%%!nextcite%
245 # Author et al. (cf. Year...
246 !maketextcite {%ifqualified%[[%!textbefore%]]}%!startlink%%!abbrvciteauthor%%!endlink% %!open%{%ifqualified%[[%!ctextbefore%]][[%!textbefore%]]}%!year%%!ctextafter%%!nexttextcite%
248 # "...; Nextauthor Year..."
249 !nextcite {%next%[[%!sep% %!makecite%]]}
250 # "...); Nextauthor (Year..."
251 !nexttextcite {%next%[[%!close%%!smartsep%%!startlink%%!abbrvciteauthor%%!endlink% %!open%%!ctextbefore%%!year%%!ctextafter%%!nexttextcite%]]}
253 # Add a year if it exists (else title, else "??") and possibly a modifier (as in 2017a)
254 !yeartitle {%year%[[%year%{%modifier%[[%modifier%]][[{%export%[[]][[%!dummymod%]]}]]}]][[{%title%[[%title%]][[??]]}]]}
255 # Add a shorthand if it exists, else yeartitle (above)
256 !shyeartitle {%shorthand%[[%shorthand%]][[%!yeartitle%]]}
257 # "...; Shorthand|Nextyear ..." (including extra label, as in 2017a)
258 !nextshyeartitle {%next%[[%!sep% %!startlink%%!yeartitle%%!endlink%%!nextshyeartitle%]]}
261 # ACTUAL STYLE DEFINITIONS
263 # (additions and modifications to default)
266 # "cf. Author A Year; Author B Year, p. xx"
267 cite %!textbefore%%!makecite%%!textafter%
268 # "cf. Author A (Year),[ and] Author B (Year, p. xx)"
269 citet %!maketextcite%%!textafter%%!close%
270 # "(cf. Author A Year; Author B Year, p. xx)"
271 citep %!open%%!textbefore%%!makecite%%!textafter%%!close%
272 # This prints year or title, if year is missing
273 citeyear %!textbefore%%!startlink%%!shyeartitle%%!endlink%%!nextshyeartitle%%!textafter%
274 # "(cf. Year; Nextyear, p. xx)"
275 citeyearpar %!open%%!textbefore%%!startlink%%!shmyear%%!endlink%%!nextshmyear%%!textafter%%!close%
276 # "Footnote: cf. Author A Year; Author B Year, p. xx."
277 footcite {%dialog%[[%_footnote%]][[%_foot%]]}: %!textbefore%%!makecite%%!textafter%.
278 # "Auto: (cf. Author A Year; Author B Year, p. xx)"
279 autocite {%dialog%[[%_autocite%]][[%_auto%]]}: %!open%%!textbefore%%!makecite%%!textafter%%!close%
286 # 1. Translatable bits (need to be marked by _ prefix, if translated to the GUI language,
287 # or B_, if translated to the buffer language)
290 _superscript Superscript
293 # 2. Macros re-used in the style definitions
299 # "Author [cf. ID..."
300 !maketextcite %!abbrvciteauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nexttextcite%
302 !makekey %!ctextbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!ctextafter%%!nextkey%
304 # "...); Nextauthor [ID..."
305 !nexttextcite {%next%[[%!close%%!smartsep%%!abbrvciteauthor% %!open%%!ctextbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nexttextcite%]]}
307 !nextkey {%next%[[%!sep% %!ctextbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!ctextafter%%!nextkey%]]}
310 # ACTUAL STYLE DEFINITIONS
312 # (additions and modifications to default)
315 # "[cf. ID, NextID, p. xx]"
316 cite %!open%%!textbefore%%!makekey%%!textafter%%!close%
317 # "Author [cf. ID],[ and] Nextauthor [NextID, p. xx]"
318 citet %!maketextcite%%!textafter%%!close%
319 # "Footnote: cf. ID, NextID, p. xx."
320 footcite {%dialog%[[%_footnote%]][[%_foot%]]}: %!textbefore%%!makekey%%!textafter%.
321 # "Auto: (cf. Author A Year; Author B Year, p. xx)"
322 autocite {%dialog%[[%_autocite%]][[%_auto%]]}: %!open%%!textbefore%%!makekey%%!textafter%%!close%
323 # "Superscript: ID" (dialog) / "Super: ID" (button)
324 supercite {%dialog%[[%_superscript%]][[%_super%]]}: %!makekey%