]> git.lyx.org Git - lyx.git/blob - lib/citeengines/jurabib.citeengine
636b1d39da3fd59851437827bb8f6bbf9c76bbca
[lyx.git] / lib / citeengines / jurabib.citeengine
1 # \DeclareLyXCiteEngine[jurabib.sty]{Jurabib (BibTeX)}
2 # DescriptionBegin
3 #   Jurabib supports a range of author-year styles primarily suitable for law studies
4 #   and the Humanities. It includes localizations for English, German, French, Dutch,
5 #   Spanish and Italian.
6 # DescriptionEnd
7
8 # Author: Julien Rioux <jrioux@lyx.org>
9
10 Format 68
11
12 Requires jurabib
13
14 # The framework (biblatex|bibtex)
15 CiteFramework bibtex
16
17 # Cite style variants (default|authoryear|natbib)
18 # We provide only authoryear citations
19 CiteEngineType authoryear
20
21 # Default style file
22 DefaultBiblio  jurabib
23
24 # Maximum number of names before "et al." chimes in
25 MaxCiteNames 3
26
27
28 # The syntax of the cite command definitions below is:
29 # LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
30
31 # * LyXName:  The LyX name as output in the LyX file. For
32 #             portability reasons, we try to use the same
33 #             name for same-formatted commands in the
34 #             different engines (thus many names stem from
35 #             natbib).
36 # * Alias:    A (comma-separated) list of commands that fall
37 #             back to the given LyX name in the current engine.
38 #             This is a bit like "ObsoletedBy" in the layouts.
39 # * latexcmd: The actual LaTeX command that is output.
40 #
41 # Alias and latexcmd are optional. If no latexcmd is given, the
42 # LyXName will be output to LaTeX.
43 #
44 # Note further:
45 #
46 # * The LyXName "keyonly" has a special meaning: only the citation key,
47 #   without any latex command, is output.
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.
66
67
68
69 # FIXME: support for these jurabib styles (fileformat)
70 # citefield []{}
71 # footcite [][]
72 # footcitetitle [][]
73 # footcitet [][]
74 # footcitep [][]
75 # footcitealt [][]
76 # footcitealp [][]
77 # footciteauthor [][]
78 # footciteyear [][]
79 # footciteyearpar [][]
80 # footfullcite [][]
81
82 #
83 # CITE COMMAND DEFINITIONS
84 #
85 CiteEngine authoryear
86         # \cite* is not implemented: use \cite instead, it's the same
87         cite [][]
88         citetitle [][]
89         citet [][]
90         citep [][]
91         citealt [][]
92         citealp [][]
93         citeauthor [][]
94         citeyear [][]
95         citeyearpar [][]
96         fullcite [][]
97         nocite
98         keyonly
99 End
100
101 #
102 # CITE FORMAT
103 #
104
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
107 # plain text output.
108 #
109
110 # Input standard format definitions for the bibliography
111 Input stdciteformats.inc
112
113 CiteFormat authoryear
114         #
115         # MACROS
116         #
117         # 1. Translatable bits (need to be marked by _ prefix, if translated to the GUI language,
118         #    or B_, if translated to the buffer language)
119         #    Note that preceding and trailing spaces matter.
120         #
121         _notcited not cited
122         _addtobib Add to bibliography only.
123         _keyonly Key only.
124         _key Key
125         _fullcite bibliography entry
126         _bibentry Bibliography entry.
127         _before before
128         _shorttitle short title
129         # The following are handled by BiblioInfo
130         B_etal  et al.
131         B_namesep /
132         B_lastnamesep /
133         B_pairnamesep /
134
135         #
136         # 2. Macros re-used in the style definitions
137         #
138         !open (
139         !sep ;
140         !close )
141         !obracket [
142         !cbracket ]
143
144         # A link that lets us jump to the bibliography entry in LyXHTML
145         # %clean:key% will be substituted by the cite key to give a unique id
146         !startlink {!<a href='#LyXCite-%clean:key%'>!}
147         !endlink {!</a>!}
148
149         # "ShortAuthor", "Author" or "??"
150         !shortauthor {%shortauthor%[[%shortauthor%]][[{%abbrvciteauthor%[[%abbrvciteauthor%]][[??]]}]]}
151         # "... ShortTitle"
152         !shorttitle {%shorttitle%[[ %shorttitle%]][[{%dialog%[[ <%_shorttitle%>]][[%!makejurashorttitle%]]}]]}
153         # Title or "??"
154         !maketitle {%title%[[ %title%]][[ ??]]}
155         # "Journal Volume [Year]"
156         !jurashorttitle {%journal%[[ %journal%]]}{%volume%[[ %volume%]]}{%year%[[ %!obracket%%year%%!cbracket%]]}
157         # Handle short title fallback
158         !makejurashorttitle {%ifentrytype:article%[[%!jurashorttitle%]][[{%ifentrytype:periodical%[[%!jurashorttitle%]][[ %!maketitle%]]}]]}
159         # "prenote "
160         !textbefore {%textbefore%[[%textbefore% ]]}
161         # "/prenote" (button) / "/prenote/<before>" (dialog)
162         !textbefore2 {%textbefore%[[/%textbefore%]][[{%dialog%[[/<%_before%>]]}]]}
163         # ", postnote"
164         !textafter {%textafter%[[, %textafter%]]}
165         # " postnote"
166         !textafter2 {%textafter%[[ %textafter%]]}
167         # Add a year if it exists (else "??") and possibly a modifier (as in 2017a)
168         !year {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]]}
169
170         # "ShortAuthor/prenote postnote..."
171         !cite %!startlink%%!shortauthor%%!endlink%%!textbefore2%%!textafter2%%!nextcite%
172         # "ShortAuthor/prenote ShortTitle postnote..."
173         !citetitle %!startlink%%!shortauthor%%!endlink%%!textbefore2%%!shorttitle%%!textafter2%%!nextcitetitle%
174         # "prenote ShortAuthor (Year, postnote)..."
175         !citet %!textbefore%%!startlink%%!shortauthor%%!endlink% %!open%%!year%%!textafter%%!close%%!nextcitet%
176         # "(prenote ShortAuthor, Year, postnote)"
177         !citep %!open%%!citealp%%!close%
178         # "prenote ShortAuthor Year, postnote..."
179         !citealt %!textbefore%%!startlink%%!shortauthor% %!year%%!endlink%%!textafter%%!nextcitealt%
180         # "prenote ShortAuthor, Year, postnote..."
181         !citealp %!textbefore%%!startlink%%!shortauthor%, %!year%%!endlink%%!textafter%%!nextcitealp%
182         # "prenote ShortAuthor, postnote..."
183         !citeauthor %!textbefore%%!startlink%%!shortauthor%%!endlink%%!textafter%%!nextauthor%
184         # "prenote Year, postnote..."
185         !citeyear %!textbefore%%!startlink%%!year%%!endlink%%!textafter%%!nextyear%
186         # "prenote (Year), postnote..."
187         !citeyearpar %!textbefore%%!open%%!startlink%%!year%%!endlink%%!close%%!textafter%%!nextyearpar%
188         # "prenote in: Key, postnote..."
189         !fullcite {%textbefore%[[%textbefore% in: ]]}%bibentry%{%textafter%[[ %textafter%]]}%!nextfullcite%
190
191         # "...; ShortAuthor postnote..."
192         !nextcite {%next%[[%!sep% %!startlink%%!shortauthor%%!endlink%%!textafter2%%!nextcite%]]}
193         # "...; ShortAuthor ShortTitle postnote..."
194         !nextcitetitle {%next%[[%!sep% %!startlink%%!shortauthor%%!endlink%%!shorttitle%%!textafter2%%!nextcitetitle%]]}
195         # "...; prenote ShortAuthor (Year, postnote)..."
196         !nextcitet {%next%[[%!sep% %!citet%]]}
197         # "...; prenote ShortAuthor Year, postnote..."
198         !nextcitealt {%next%[[%!sep% %!citealt%]]}
199         # "...; prenote ShortAuthor, Year, postnote..."
200         !nextcitealp {%next%[[%!sep% %!citealp%]]}
201         # "...; prenote ShortAuthor, postnote..."
202         !nextauthor {%next%[[%!sep% %!citeauthor%]]}
203         # "...; prenote Year, postnote..."
204         !nextyear {%next%[[%!sep% %!citeyear%]]}
205         # "...; prenote (Year), postnote..."
206         !nextyearpar {%next%[[%!sep% %!citeyearpar%]]}
207         # "...; Key, postnote..."
208         !nextfullcite {%next%[[%!sep% %bibentry%%textafter%%!nextfullcite%]]}
209         # "...; Key..."
210         !nextkey {%next%[[%!sep% %key%%!nextkey%]]}
211
212         #
213         # ACTUAL STYLE DEFINITIONS
214         #
215
216         # "ShortAuthor/prenote postnote; NextShortAuthor postnote..."
217         cite %!cite%
218         # "ShortAuthor/prenote ShortTitle postnote; NextShortAuthor ShortTitle postnote..."
219         citetitle %!citetitle%
220         # "prenote ShortAuthor (Year, postnote); prenote NextShortAuthor (Year, postnote)..."
221         citet %!citet%
222         # "(prenote ShortAuthor, Year, postnote)"
223         citep %!citep%
224         # "prenote ShortAuthor Year, postnote; prenote NextShortAuthor Year, postnote..."
225         citealt %!citealt%
226         # "prenote ShortAuthor, Year, postnote.; prenote NextShortAuthor, Year, postnote..."
227         citealp %!citealp%
228         # "prenote ShortAuthor, postnote; prenote NextShortAuthor, postnote..."
229         citeauthor %!citeauthor%
230         # "prenote Year, postnote; prenote Year, postnote..."
231         citeyear %!citeyear%
232         # "prenote (Year), postnote; prenote (Year), postnote..."
233         citeyearpar %!citeyearpar%
234         # "Bibliography entry." (dialog) / "Key; Key ... (full cite)" (button)
235         fullcite {%dialog%[[%_bibentry%]][[{%label%[[%!fullcite%]][[%key%%!nextkey% (%_fullcite%)]]}]]}
236         # "Add to bibliography only." (dialog) / "Key; Key ... (not cited)" (button)
237         nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]}
238         # Output only the key
239         keyonly {%dialog%[[%_keyonly%]][[%_key%: %key%%!nextkey%]]}
240 End