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