]> git.lyx.org Git - lyx.git/blob - lib/citeengines/jurabib.citeengine
Adapt citengine to current layout format.
[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 64
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)
118         #    Note that preceding and trailing spaces matter.
119         #
120         _notcited not cited
121         _addtobib Add to bibliography only.
122         _keyonly Key only.
123         _key Key
124         _fullcite bibliography entry
125         _bibentry Bibliography entry.
126         _before before
127         _shorttitle short title
128         # The following are handled by BiblioInfo
129         _etal  et al.
130         _namesep /
131         _lastnamesep /
132         _pairnamesep /
133
134         #
135         # 2. Macros re-used in the style definitions
136         #
137         !open (
138         !sep ;
139         !close )
140         !obracket [
141         !cbracket ]
142
143         # A link that lets us jump to the bibliography entry in LyXHTML
144         # %clean:key% will be substituted by the cite key to give a unique id
145         !startlink {!<a href='#LyXCite-%clean:key%'>!}
146         !endlink {!</a>!}
147
148         # "ShortAuthor", "Author" or "??"
149         !shortauthor {%shortauthor%[[%shortauthor%]][[{%abbrvciteauthor%[[%abbrvciteauthor%]][[??]]}]]}
150         # "... ShortTitle"
151         !shorttitle {%shorttitle%[[ %shorttitle%]][[{%dialog%[[ <%_shorttitle%>]][[%!makejurashorttitle%]]}]]}
152         # Title or "??"
153         !maketitle {%title%[[ %title%]][[ ??]]}
154         # "Journal Volume [Year]"
155         !jurashorttitle {%journal%[[ %journal%]]}{%volume%[[ %volume%]]}{%year%[[ %!obracket%%year%%!cbracket%]]}
156         # Handle short title fallback
157         !makejurashorttitle {%ifentrytype:article%[[%!jurashorttitle%]][[{%ifentrytype:periodical%[[%!jurashorttitle%]][[ %!maketitle%]]}]]}
158         # "prenote "
159         !textbefore {%textbefore%[[%textbefore% ]]}
160         # "/prenote" (button) / "/prenote/<before>" (dialog)
161         !textbefore2 {%textbefore%[[/%textbefore%]][[{%dialog%[[/<%_before%>]]}]]}
162         # ", postnote"
163         !textafter {%textafter%[[, %textafter%]]}
164         # " postnote"
165         !textafter2 {%textafter%[[ %textafter%]]}
166         # Add a year if it exists (else "??") and possibly a modifier (as in 2017a)
167         !year {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]]}
168
169         # "ShortAuthor/prenote postnote..."
170         !cite %!startlink%%!shortauthor%%!endlink%%!textbefore2%%!textafter2%%!nextcite%
171         # "ShortAuthor/prenote ShortTitle postnote..."
172         !citetitle %!startlink%%!shortauthor%%!endlink%%!textbefore2%%!shorttitle%%!textafter2%%!nextcitetitle%
173         # "prenote ShortAuthor (Year, postnote)..."
174         !citet %!textbefore%%!startlink%%!shortauthor%%!endlink% %!open%%!year%%!textafter%%!close%%!nextcitet%
175         # "(prenote ShortAuthor, Year, postnote)"
176         !citep %!open%%!citealp%%!close%
177         # "prenote ShortAuthor Year, postnote..."
178         !citealt %!textbefore%%!startlink%%!shortauthor% %!year%%!endlink%%!textafter%%!nextcitealt%
179         # "prenote ShortAuthor, Year, postnote..."
180         !citealp %!textbefore%%!startlink%%!shortauthor%, %!year%%!endlink%%!textafter%%!nextcitealp%
181         # "prenote ShortAuthor, postnote..."
182         !citeauthor %!textbefore%%!startlink%%!shortauthor%%!endlink%%!textafter%%!nextauthor%
183         # "prenote Year, postnote..."
184         !citeyear %!textbefore%%!startlink%%!year%%!endlink%%!textafter%%!nextyear%
185         # "prenote (Year), postnote..."
186         !citeyearpar %!textbefore%%!open%%!startlink%%!year%%!endlink%%!close%%!textafter%%!nextyearpar%
187         # "prenote in: Key, postnote..."
188         !fullcite {%textbefore%[[%textbefore% in: ]]}%bibentry%{%textafter%[[ %textafter%]]}%!nextfullcite%
189
190         # "...; ShortAuthor postnote..."
191         !nextcite {%next%[[%!sep% %!startlink%%!shortauthor%%!endlink%%!textafter2%%!nextcite%]]}
192         # "...; ShortAuthor ShortTitle postnote..."
193         !nextcitetitle {%next%[[%!sep% %!startlink%%!shortauthor%%!endlink%%!shorttitle%%!textafter2%%!nextcitetitle%]]}
194         # "...; prenote ShortAuthor (Year, postnote)..."
195         !nextcitet {%next%[[%!sep% %!citet%]]}
196         # "...; prenote ShortAuthor Year, postnote..."
197         !nextcitealt {%next%[[%!sep% %!citealt%]]}
198         # "...; prenote ShortAuthor, Year, postnote..."
199         !nextcitealp {%next%[[%!sep% %!citealp%]]}
200         # "...; prenote ShortAuthor, postnote..."
201         !nextauthor {%next%[[%!sep% %!citeauthor%]]}
202         # "...; prenote Year, postnote..."
203         !nextyear {%next%[[%!sep% %!citeyear%]]}
204         # "...; prenote (Year), postnote..."
205         !nextyearpar {%next%[[%!sep% %!citeyearpar%]]}
206         # "...; Key, postnote..."
207         !nextfullcite {%next%[[%!sep% %bibentry%%textafter%%!nextfullcite%]]}
208         # "...; Key..."
209         !nextkey {%next%[[%!sep% %key%%!nextkey%]]}
210
211         #
212         # ACTUAL STYLE DEFINITIONS
213         #
214
215         # "ShortAuthor/prenote postnote; NextShortAuthor postnote..."
216         cite %!cite%
217         # "ShortAuthor/prenote ShortTitle postnote; NextShortAuthor ShortTitle postnote..."
218         citetitle %!citetitle%
219         # "prenote ShortAuthor (Year, postnote); prenote NextShortAuthor (Year, postnote)..."
220         citet %!citet%
221         # "(prenote ShortAuthor, Year, postnote)"
222         citep %!citep%
223         # "prenote ShortAuthor Year, postnote; prenote NextShortAuthor Year, postnote..."
224         citealt %!citealt%
225         # "prenote ShortAuthor, Year, postnote.; prenote NextShortAuthor, Year, postnote..."
226         citealp %!citealp%
227         # "prenote ShortAuthor, postnote; prenote NextShortAuthor, postnote..."
228         citeauthor %!citeauthor%
229         # "prenote Year, postnote; prenote Year, postnote..."
230         citeyear %!citeyear%
231         # "prenote (Year), postnote; prenote (Year), postnote..."
232         citeyearpar %!citeyearpar%
233         # "Bibliography entry." (dialog) / "Key; Key ... (full cite)" (button)
234         fullcite {%dialog%[[%_bibentry%]][[{%label%[[%!fullcite%]][[%key%%!nextkey% (%_fullcite%)]]}]]}
235         # "Add to bibliography only." (dialog) / "Key; Key ... (not cited)" (button)
236         nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]}
237         # Output only the key
238         keyonly {%dialog%[[%_keyonly%]][[%_key%: %key%%!nextkey%]]}
239 End