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.
8 # Excludes: basic | jurabib | natbib | biblatex-natbib
10 # Author: Jürgen Spitzmüller <spitz@lyx.org>
16 # The framework (biblatex|bibtex)
17 CiteFramework biblatex
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:authoryear|numerical:numeric
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, dropping
63 # 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
71 Cite|citealt,citealp[][]
74 Citeauthor*<!_citeauthorstar!_citeauthorstartooltip>[][]
75 citeyearpar[][]=parencite*
77 citebyear[][]=citeyear
78 Footcite[][]=smartcite
80 citetitle*<!_citetitlestar!_citetitlestartooltip>[][]
87 cite|parencite,citep,citealt,citealp[][]
90 Footcite[][]=smartcite
92 Citeauthor*<!_citeauthorstar!_citeauthorstartooltip>[][]
93 citeyear|parencite*,citebyear[][]=citeyear*
94 citetitle*<!_citetitlestar!_citetitlestartooltip>[][]
105 # The following defines how the commands are represented in the GUI
106 # (inset button and citation dialog) as well as in XHTML, docbook and
109 # There are common definitions (default) and specific definitions for
110 # either cite engine type (which overwrite existing defaults.
116 # 1. Translatable bits (need to be marked by _ prefix)
117 # Note that preceding and trailing spaces matter.
120 _addtobib Add to bibliography only.
123 _fullcite bibliography entry
124 _bibentry Full bibliography entry.
127 # GUI strings for the starred commands
128 _citeauthorstar S&horten author list[[Possible substitute to All aut&hors]]
129 _citeauthorstartooltip Force a short author list (using et al.)
130 _citetitlestar F&orce full title[[Possible substitute to All aut&hors]]
131 _citetitlestartooltip Use full title even if shorttitle exists
132 # The following are handled by BiblioInfo
134 _namesep , [[separate author names in citation, except for last name]]
135 _lastnamesep , and [[separate name of last author in citation]]
136 _pairnamesep and [[separate two authors in citation]]
139 # 2. Macros re-used in the style definitions
141 # A link that lets us jump to the bibliography entry in LyXHTML
142 # %clean:key% will be substituted by the cite key to give a unique id
143 !startlink {!<a href='#LyXCite-%clean:key%'>!}
146 # Add " , and " before the last item (but " and " if there are only two), else ", "
147 !smartsep {%second%[[{%next%[[%_namesep%]][[%_pairnamesep%]]}]][[{%next%[[%_namesep%]][[%_lastnamesep%]]}]]}
149 # A dummy year modifier. This just indicates that a modifier might be output,
150 # to differentiate \cite* and \citeyear
153 # "...; Nextauthor ..."
154 !nextauthor {%next%[[%!sep% %!startlink%%!abbrvauthor%%!endlink%%!nextauthor%]]}
155 # Handle starred command: abbr. or full author list
156 !makenextauthor {%next%[[%!sep% %!startlink%%!makeauthor%%!endlink%%!makenextauthor%]]}
157 # "...; [NextID] ..."
158 !nextkey {%next%[[%!sep% %key%%!nextkey%]]}
159 # "...; Nextyear ..." (including extra label, as in 2017a)
160 !nextyear {%next%[[%!sep% %!startlink%%!year%%!endlink%%!nextyear%]]}
161 # "...; Nextyear ..." (including emulated extra label, as in 2017[a])
162 !nextmyear {%next%[[%!sep% %!startlink%%!myear%%!endlink%%!nextmyear%]]}
163 # "...; Nextyear ..." (without any extra label)
164 !nextbyear {%next%[[%!sep% %!startlink%%!byear%%!endlink%%!nextbyear%]]}
165 # "...; Nexttitle ..."
166 !makenexttitle {%next%[[%!sep% %!startlink%%!maketitle%%!endlink%%!makenexttitle%]]}
168 !nextfullcite {%next%[[%!sep% %bibentry%%!nextfullcite%]]}
170 # "Author et al." (if > 3 authors) or "??"
171 !abbrvauthor {%abbrvauthor%[[%abbrvauthor%]][[??]]}
172 # "Author et al." (always) or "??"
173 !forceabbrvauthor {%forceabbrvauthor%[[%forceabbrvauthor%]][[??]]}
174 # Handle starred command: force of abbr. author list, independent of maxcitenames
175 !makeauthor {%ifstar%[[%!forceabbrvauthor%]][[%!abbrvauthor%]]}
177 !textbefore {%textbefore%[[%textbefore% ]]}
179 !textafter {%textafter%[[, %textafter%]]}
180 # Add a year if it exists (else "??") and possibly a modifier (as in 2017a)
181 !year {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]]}
182 # Add a year if it exists (else "??") and indicate a possible modifier (as in 2017[a])
183 !myear {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]][[{%export%[[]][[%!dummymod%]]}]]}
184 # Add a year if it exists (else "??") without any modifier at all
185 !byear {%year%[[%year%]][[??]]}
186 # Add a shorttitle or title if it exists (else "??")
187 !makeshorttitle {%shorttitle%[[%shorttitle%]][[{%title%[[%title%]][[??]]}]]}
188 # Add a title (or "??")
189 !maketitle {%ifstar%[[{%title%[[%title%]][[??]]}]][[%!makeshorttitle%]]}
191 !fullcite %!startlink%%bibentry%%!endlink%%!nextfullcite%
194 # ACTUAL STYLE DEFINITIONS
196 # (identical in authoryear and numerical)
199 # "cf. Author; Nextautor, p. xx"
200 citeauthor %!textbefore%%!startlink%%!makeauthor%%!endlink%%!makenextauthor%%!textafter%
201 # "cf. Year; Nextyear, p. xx" (including extra label, as in 2017a)
202 citeyear %!textbefore%%!startlink%%!myear%%!endlink%%!nextyear%%!textafter%
203 # "cf. Year; Nextyear, p. xx" (without any extra label)
204 citebyear %!textbefore%%!startlink%%!byear%%!endlink%%!nextbyear%%!textafter%
205 # "cf. Year; Nextyear, p. xx" (without any extra label)
206 citetitle %!textbefore%%!startlink%%!maketitle%%!endlink%%!makenexttitle%%!textafter%
207 # "Bibliography entry." (dialog) / "cf. Key; NextKey..., p. xx (bibliography entry)" (button)
208 fullcite {%dialog%[[%_bibentry%]][[%!textbefore%{%label%[[%!fullcite%]][[%key%%!nextkey% (%_fullcite%)]]}%!textafter%}]]}
209 # "Footnote: Full bibliography entry." (dialog) / "Foot: Key (bibliography entry)"
210 footfullcite {%dialog%[[%_footnote%]][[%_foot%]]}: {%dialog%[[%_bibentry%]][[{%label%[[%!fullcite%]][[%key%%!nextkey% (%_fullcite%)]]}]]}
211 # "Add to bibliography only." (dialog) / "[ID] (not cited)" (button)
212 nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]}
215 CiteFormat authoryear
223 # "cf. Author et. al Year..."
224 !makecite %!startlink%%!abbrvauthor% %!year%%!endlink%%!nextcite%
225 # Author et al. (cf. Year...
226 !maketextcite %!startlink%%!abbrvauthor%%!endlink% %!open%%!textbefore%%!year%%!nexttextcite%
228 # "...; Nextauthor Year..."
229 !nextcite {%next%[[%!sep% %!makecite%]]}
230 # "...); Nextauthor (Year..."
231 !nexttextcite {%next%[[%!close%%!smartsep%%!startlink%%!abbrvauthor%%!endlink% %!open%%!year%%!nexttextcite%]]}
233 # Add a year if it exists (else title, else "??") and possibly a modifier (as in 2017a)
234 !yeartitle {%year%[[%year%{%modifier%[[%modifier%]][[{%export%[[]][[%!dummymod%]]}]]}]][[{%title%[[%title%]][[??]]}]]}
235 # "...; Nextyear ..." (including extra label, as in 2017a)
236 !nextyeartitle {%next%[[%!sep% %!startlink%%!yeartitle%%!endlink%%!nextyeartitle%]]}
239 # ACTUAL STYLE DEFINITIONS
241 # (additions and modifications to default)
244 # "cf. Author A Year; Author B Year, p. xx"
245 cite %!textbefore%%!makecite%%!textafter%
246 # "cf. Author A (Year),[ and] Author B (Year), p. xx"
247 citet %!maketextcite%%!close%%!textafter%
248 # "(cf. Author A Year; Author B Year, p. xx)"
249 citep %!open%%!textbefore%%!makecite%%!textafter%%!close%
250 # This prints year or title, if year is missing
251 citeyear %!textbefore%%!startlink%%!yeartitle%%!endlink%%!nextyeartitle%%!textafter%
252 # "(cf. Year; Nextyear, p. xx)"
253 citeyearpar %!open%%!textbefore%%!startlink%%!myear%%!endlink%%!nextmyear%%!textafter%%!close%
254 # "Footnote: cf. Author A Year; Author B Year, p. xx."
255 footcite {%dialog%[[%_footnote%]][[%_foot%]]}: %!textbefore%%!makecite%%!textafter%.
256 # "Auto: (cf. Author A Year; Author B Year, p. xx)"
257 autocite {%dialog%[[%_autocite%]][[%_auto%]]}: %!open%%!textbefore%%!makecite%%!textafter%%!close%
264 # 1. Translatable bits (need to be marked by _ prefix)
267 _superscript Superscript
270 # 2. Macros re-used in the style definitions
276 # "Author [cf. ID..."
277 !maketextcite %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nexttextcite%
279 !makekey {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nextkey%]]}
281 # "...); Nextauthor [ID..."
282 !nexttextcite {%next%[[%!close%%!smartsep%%!abbrvauthor% %!open%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nexttextcite%]]}
284 !nextkey {%next%[[%!sep% %!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nextkey%]]}
287 # ACTUAL STYLE DEFINITIONS
289 # (additions and modifications to default)
292 # "[cf. ID, NextID, p. xx]"
293 cite %!open%%!textbefore%%!makekey%%!textafter%%!close%
294 # "Author [cf. ID],[ and] Nextauthor [NextID, p. xx]"
295 citet %!maketextcite%%!textafter%%!close%
296 # "Footnote: cf. ID, NextID, p. xx."
297 footcite {%dialog%[[%_footnote%]][[%_foot%]]}: %!textbefore%%!makekey%%!textafter%.
298 # "Auto: (cf. Author A Year; Author B Year, p. xx)"
299 autocite {%dialog%[[%_autocite%]][[%_auto%]]}: %!open%%!textbefore%%!makekey%%!textafter%%!close%
300 # "Superscript: ID" (dialog) / "Super: ID" (button)
301 supercite {%dialog%[[%_superscript%]][[%_super%]]}: %!makekey%