]> git.lyx.org Git - lyx.git/blob - lib/citeengines/jurabib.citeengine
Merge branch 'master' into biblatex2
[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 # Excludes: basic | natbib | biblatex
8
9 # Author: Julien Rioux <jrioux@lyx.org>
10
11 Format 63
12
13 Requires jurabib
14
15 # The framework (biblatex|bibtex)
16 CiteFramework bibtex
17
18 # Cite style variants (default|authoryear|natbib)
19 # We provide only authoryear citations
20 CiteEngineType authoryear
21
22 # Default style file
23 DefaultBiblio  jurabib
24
25 # Maximum number of names before "et al." chimes in
26 MaxCiteNames 3
27
28
29 # The syntax of the cite command definitions below is:
30 # LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
31
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
36 #             natbib).
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.
41 #
42 # Alias and latexcmd are optional. If no latexcmd is given, the
43 # LyXName will be output to LaTeX.
44 #
45 # Note further:
46 #
47 # * Capitalization indicates that the command also has a capitalized
48 #   form (\Latexcmd vs. \latexcmd). These usually enforce upcasing of
49 #   name prefixes (von Goethe => Von Goethe).
50 # * Brackets [] indicate the number of optional arguments (0, 1, 2).
51 # * The star * indicates there is a starred version of the command
52 #   (\latexcmd* vs. \latexcmd). By default, the starred version means:
53 #   Expand the author list even if the maxnames setting would cause
54 #   BibTeX/Biber to shorten it with "et al.".
55 #   If the star has a different meaning for a command, it can be
56 #   specified in angle brackets: <!_stardesc!_stardesctooltip>.
57 #   Maximal two translatable macro keywords, marked by the prefix '!_',
58 #   can be given. The first points to the string that replaces the
59 #   "Full aut&hor list" checkbox label in the Citation dialog, the
60 #   second one an optional tooltip for this checkbox. Note that these
61 #   two macros have to be defined in the CiteFormat section (see below),
62 #   dropping the '!' from the prefix (see below), e.g.:
63 #   _stardesc Starred command label
64 #   _stardesctooltip Tooltip for the starred command checkbox.
65
66
67
68 # FIXME: support for these jurabib styles (fileformat)
69 # citefield []{}
70 # footcite [][]
71 # footcitetitle [][]
72 # footcitet [][]
73 # footcitep [][]
74 # footcitealt [][]
75 # footcitealp [][]
76 # footciteauthor [][]
77 # footciteyear [][]
78 # footciteyearpar [][]
79 # footfullcite [][]
80
81 #
82 # CITE COMMAND DEFINITIONS
83 #
84 CiteEngine authoryear
85         # \cite* is not implemented: use \cite instead, it's the same
86         cite [][]
87         citetitle [][]
88         citet [][]
89         citep [][]
90         citealt [][]
91         citealp [][]
92         citeauthor [][]
93         citeyear [][]
94         citeyearpar [][]
95         fullcite [][]
96         nocite
97 End
98
99 #
100 # CITE FORMAT
101 #
102
103 # The following defines how the commands are represented in the GUI
104 # (inset button and citation dialog) as well as in XHTML, docbook and
105 # plain text output.
106 #
107 CiteFormat authoryear
108         #
109         # MACROS
110         #
111         # 1. Translatable bits (need to be marked by _ prefix)
112         #    Note that preceding and trailing spaces matter.
113         #
114         _notcited not cited
115         _addtobib Add to bibliography only.
116         _fullcite bibliography entry
117         _bibentry Bibliography entry.
118         _before before
119         _shorttitle short title
120         # The following are handled by BiblioInfo
121         _etal  et al.
122         _namesep /
123         _lastnamesep /
124         _pairnamesep /
125
126         #
127         # 2. Macros re-used in the style definitions
128         #
129         !open (
130         !sep ;
131         !close )
132         !obracket [
133         !cbracket ]
134
135         # A link that lets us jump to the bibliography entry in LyXHTML
136         # %clean:key% will be substituted by the cite key to give a unique id
137         !startlink {!<a href='#LyXCite-%clean:key%'>!}
138         !endlink {!</a>!}
139
140         # "ShortAuthor", "Author" or "??"
141         !shortauthor {%shortauthor%[[%shortauthor%]][[{%abbrvauthor%[[%abbrvauthor%]][[??]]}]]}
142         # "... ShortTitle"
143         !shorttitle {%shorttitle%[[ %shorttitle%]][[{%dialog%[[ <%_shorttitle%>]][[%!makejurashorttitle%]]}]]}
144         # Title or "??"
145         !maketitle {%title%[[ %title%]][[ ??]]}
146         # "Journal Volume [Year]"
147         !jurashorttitle {%journal%[[ %journal%]]}{%volume%[[ %volume%]]}{%year%[[ %!obracket%%year%%!cbracket%]]}
148         # Handle short title fallback
149         !makejurashorttitle {%ifentrytype:article%[[%!jurashorttitle%]][[{%ifentrytype:periodical%[[%!jurashorttitle%]][[ %!maketitle%]]}]]}
150         # "prenote "
151         !textbefore {%textbefore%[[%textbefore% ]]}
152         # "/prenote" (button) / "/prenote/<before>" (dialog)
153         !textbefore2 {%textbefore%[[/%textbefore%]][[{%dialog%[[/<%_before%>]]}]]}
154         # ", postnote"
155         !textafter {%textafter%[[, %textafter%]]}
156         # " postnote"
157         !textafter2 {%textafter%[[ %textafter%]]}
158         # Add a year if it exists (else "??") and possibly a modifier (as in 2017a)
159         !year {%year%[[%year%]][[??]]}{%modifier%[[%modifier%]]}
160
161         # "ShortAuthor/prenote postnote..."
162         !cite %!startlink%%!shortauthor%%!endlink%%!textbefore2%%!textafter2%%!nextcite%
163         # "ShortAuthor/prenote ShortTitle postnote..."
164         !citetitle %!startlink%%!shortauthor%%!endlink%%!textbefore2%%!shorttitle%%!textafter2%%!nextcitetitle%
165         # "prenote ShortAuthor (Year, postnote)..."
166         !citet %!textbefore%%!startlink%%!shortauthor%%!endlink% %!open%%!year%%!textafter%%!close%%!nextcitet%
167         # "(prenote ShortAuthor, Year, postnote)"
168         !citep %!open%%!citealp%%!close%
169         # "prenote ShortAuthor Year, postnote..."
170         !citealt %!textbefore%%!startlink%%!shortauthor% %!year%%!endlink%%!textafter%%!nextcitealt%
171         # "prenote ShortAuthor, Year, postnote..."
172         !citealp %!textbefore%%!startlink%%!shortauthor%, %!year%%!endlink%%!textafter%%!nextcitealp%
173         # "prenote ShortAuthor, postnote..."
174         !citeauthor %!textbefore%%!startlink%%!shortauthor%%!endlink%%!textafter%%!nextauthor%
175         # "prenote Year, postnote..."
176         !citeyear %!textbefore%%!startlink%%!year%%!endlink%%!textafter%%!nextyear%
177         # "prenote (Year), postnote..."
178         !citeyearpar %!textbefore%%!open%%!startlink%%!year%%!endlink%%!close%%!textafter%%!nextyearpar%
179         # "prenote in: Key, postnote..."
180         !fullcite {%textbefore%[[%textbefore% in: ]]}%bibentry%{%textafter%[[ %textafter%]]}%!nextfullcite%
181
182         # "...; ShortAuthor postnote..."
183         !nextcite {%next%[[%!sep% %!startlink%%!shortauthor%%!endlink%%!textafter2%%!nextcite%]]}
184         # "...; ShortAuthor ShortTitle postnote..."
185         !nextcitetitle {%next%[[%!sep% %!startlink%%!shortauthor%%!endlink%%!shorttitle%%!textafter2%%!nextcitetitle%]]}
186         # "...; prenote ShortAuthor (Year, postnote)..."
187         !nextcitet {%next%[[%!sep% %!citet%]]}
188         # "...; prenote ShortAuthor Year, postnote..."
189         !nextcitealt {%next%[[%!sep% %!citealt%]]}
190         # "...; prenote ShortAuthor, Year, postnote..."
191         !nextcitealp {%next%[[%!sep% %!citealp%]]}
192         # "...; prenote ShortAuthor, postnote..."
193         !nextauthor {%next%[[%!sep% %!citeauthor%]]}
194         # "...; prenote Year, postnote..."
195         !nextyear {%next%[[%!sep% %!citeyear%]]}
196         # "...; prenote (Year), postnote..."
197         !nextyearpar {%next%[[%!sep% %!citeyearpar%]]}
198         # "...; Key, postnote..."
199         !nextfullcite {%next%[[%!sep% %bibentry%%textafter%%!nextfullcite%]]}
200         # "...; Key..."
201         !nextkey {%next%[[%!sep% %key%%!nextkey%]]}
202
203         #
204         # ACTUAL STYLE DEFINITIONS
205         #
206
207         # "ShortAuthor/prenote postnote; NextShortAuthor postnote..."
208         cite %!cite%
209         # "ShortAuthor/prenote ShortTitle postnote; NextShortAuthor ShortTitle postnote..."
210         citetitle %!citetitle%
211         # "prenote ShortAuthor (Year, postnote); prenote NextShortAuthor (Year, postnote)..."
212         citet %!citet%
213         # "(prenote ShortAuthor, Year, postnote)"
214         citep %!citep%
215         # "prenote ShortAuthor Year, postnote; prenote NextShortAuthor Year, postnote..."
216         citealt %!citealt%
217         # "prenote ShortAuthor, Year, postnote.; prenote NextShortAuthor, Year, postnote..."
218         citealp %!citealp%
219         # "prenote ShortAuthor, postnote; prenote NextShortAuthor, postnote..."
220         citeauthor %!citeauthor%
221         # "prenote Year, postnote; prenote Year, postnote..."
222         citeyear %!citeyear%
223         # "prenote (Year), postnote; prenote (Year), postnote..."
224         citeyearpar %!citeyearpar%
225         # "Bibliography entry." (dialog) / "Key; Key ... (full cite)" (button)
226         fullcite {%dialog%[[%_bibentry%]][[{%label%[[%!fullcite%]][[%key%%!nextkey% (%_fullcite%)]]}]]}
227         # "Add to bibliography only." (dialog) / "Key; Key ... (not cited)" (button)
228         nocite {%dialog%[[%_addtobib%]][[%key%%!nextkey% (%_notcited%)]]}
229 End