Debian Codegraph @

texmf-dist/bibtex/bst/chet/chetref.bst

raw
1 % chetref.bst (version 2.3a)
2 % Copyright 2026 Andreas Stergiou
3 %
4 % This work may be distributed and/or modified under the
5 % conditions of the LaTeX Project Public License, either version 1.3
6 % of this license or (at your option) any later version.
7 % The latest version of this license is in
8 % http://www.latex-project.org/lppl.txt
9 % and version 1.3 or later is part of all distributions of LaTeX
10 % version 2005/12/01 or later.
11
12 ENTRY
13 { address
14 author
15 archive
16 booktitle
17 chapter
18 collaboration
19 doi
20 edition
21 editor
22 eprint
23 howpublished
24 institution
25 journal
26 key
27 month
28 note
29 number
30 organization
31 pages
32 publisher
33 school
34 series
35 SLACcitation
36 title
37 type
38 primaryClass
39 url
40 volume
41 year
42 }
43 {}
44 { label }
45
46 STRINGS { s t }
47
48 FUNCTION {not}
49 { { #0 }
50 { #1 }
51 if$
52 }
53
54 FUNCTION {and}
55 { 'skip$
56 { pop$ #0 }
57 if$
58 }
59
60 FUNCTION {or}
61 { { pop$ #1 }
62 'skip$
63 if$
64 }
65
66 INTEGERS { nameptr namesleft numnames }
67
68 FUNCTION {format.names}
69 { 's :=
70 #1 'nameptr :=
71 s num.names$ 'numnames :=
72 numnames 'namesleft :=
73 { namesleft #0 > }
74 { s nameptr "{f.~}{vv~~}{ll}{,~jj}" format.name$ 't :=
75 nameptr #1 >
76 { namesleft #1 >
77 { ", " * t * }
78 { t "others" =
79 { " et~al." * }
80 { " \& " * t * }
81 if$
82 }
83 if$
84 }
85 't
86 if$
87 nameptr #1 + 'nameptr :=
88 namesleft #1 - 'namesleft :=
89 }
90 while$
91 }
92
93 FUNCTION {first.page}
94 { 't :=
95 ""
96 { t empty$ not
97 t #1 #1 substring$ duplicate$ "-" = not
98 swap$ duplicate$ "," = not
99 swap$ "+" = not
100 and and and }
101 {
102 t #1 #1 substring$ *
103 t #2 global.max$ substring$ 't :=
104 }
105 while$
106 }
107
108 INTEGERS { output.state }
109
110 FUNCTION {output}
111 {
112 's :=
113 s empty$
114 'skip$
115 {
116 output.state #1 =
117 { ", " write$ newline$ }
118 { #1 'output.state := }
119 if$
120 s write$
121 }
122 if$
123 }
124
125 FUNCTION {begin.entry}
126 {
127 "\bibitem{" cite$ * "}" * write$ newline$
128 #0 'output.state :=
129 }
130
131 FUNCTION {fin.entry}
132 {
133 "\mciteBstWouldAddEndPuncttrue" write$ newline$
134 "\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct\newline}" write$ newline$
135 "{\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax" write$ newline$
136 "\EndOfBibitem" write$
137 }
138
139 FUNCTION {format.authors}
140 {
141 collaboration empty$
142 { "" }
143 { author empty$
144 { collaboration " Collaboration" * }
145 { collaboration " Collaboration, " * }
146 if$
147 }
148 if$
149 author empty$
150 { "" }
151 { author format.names }
152 if$
153 *
154 }
155
156 FUNCTION {format.url}
157 {
158 url empty$
159 { "" }
160 { "\href{" url * "}{\nolinkurl{" * url * "}}" * }
161 if$
162 }
163
164 FUNCTION {format.editor}
165 {
166 editor empty$
167 { "" }
168 { "ed: " editor format.names * }
169 if$
170 }
171
172 FUNCTION {format.title}
173 { title empty$
174 { "" }
175 { "\textit{``" title * "''}" *}
176 if$
177 }
178
179 STRINGS { nvol ndoi }
180
181 FUNCTION {format.journal}
182 {
183 journal empty$
184 { "" }
185 {
186 volume empty$ { "no volume for journal in " cite$ * warning$ } 'skip$ if$
187 pages empty$ { "no pages for journal in " cite$ * warning$ } 'skip$ if$
188 year empty$ { "no year for journal in " cite$ * warning$ } 'skip$ if$
189
190 volume 'nvol :=
191
192 journal "JHEP" = nvol text.length$ #2 = and
193 { year #3 #2 substring$ nvol * 'nvol := }
194 'skip$
195 if$
196
197 doi empty$ { "" } { doi } if$ 'ndoi :=
198
199 journal "JHEP" = ndoi "" = and
200 {
201 year #1 #3 substring$ "200" = year #1 #3 substring$ "199" = or
202 {
203 "10.1088/1126-6708/" year *
204 "/" * nvol #3 #2 substring$ *
205 "/" * pages first.page *
206 'ndoi :=
207 }
208 {
209 "10.1007/JHEP" nvol #3 #2 substring$ * "(" * year * ")" * pages first.page *
210 'ndoi :=
211 }
212 if$
213 }
214 'skip$
215 if$
216 ""
217 ndoi "" = { } { "\doiref{" * ndoi * "}{" * } if$
218 journal *
219 " \textbf{" *
220 nvol *
221 "}, " *
222 pages first.page *
223 year empty$
224 { }
225 { " (" * year * ")\ignorespaces" * }
226 if$
227 ndoi "" = { } { "}" * } if$
228 "\ignorespaces" *
229 }
230 if$
231 }
232
233 INTEGERS { spacen spacepos }
234
235 FUNCTION { formatarxiv }
236 {
237 's :=
238 s #1 #6 substring$ "arXiv:" =
239 {
240 s #7 s text.length$ #6 - substring$ 's :=
241 }
242 'skip$
243 if$
244
245 s text.length$ 'spacen :=
246 #0 'spacepos :=
247 { spacepos spacen < }
248 { spacepos #1 + 'spacepos :=
249 s spacepos #1 substring$ " " =
250 {
251 spacepos #1 - 'spacen :=
252 s #1 spacen substring$ 's :=
253 }
254 'skip$
255 if$
256 }
257 while$
258 s
259 }
260
261 FUNCTION { arxivprefix }
262 {
263 's :=
264 s #1 #1 substring$ chr.to.int$ "0" chr.to.int$ <
265 s #1 #1 substring$ chr.to.int$ "9" chr.to.int$ > +
266 'skip$
267 {
268 "arXiv:" s * 's :=
269 }
270 if$
271 s
272 }
273
274 FUNCTION {format.primaryClass}
275 {
276 primaryClass empty$
277 { "" }
278 { " \![" primaryClass * "]" *}
279 if$
280 }
281
282 FUNCTION { format.eprint }
283 { eprint empty$
284 { "" }
285 { "\texttt{\arxivref{" eprint formatarxiv * "}{" * eprint formatarxiv arxivprefix * format.primaryClass * "}}\ignorespaces" * }
286 if$
287 }
288
289 FUNCTION {format.note}
290 { note empty$
291 { "" }
292 { note "\ignorespaces" * }
293 if$
294 }
295
296 FUNCTION {format.date}
297 { year empty$
298 { "" }
299 { " (" year * ")\ignorespaces" *}
300 if$
301 }
302
303 FUNCTION {format.publisher}
304 { publisher empty$
305 { "" }
306 { publisher format.date *}
307 if$
308 }
309
310 FUNCTION {format.address}
311 { address empty$
312 { "" }
313 { address }
314 if$
315 }
316
317 FUNCTION {format.edition}
318 { edition empty$
319 { "" }
320 { edition "l" change.case$ " edition" * }
321 if$
322 }
323
324 FUNCTION {format.pages}
325 { pages empty$
326 { "" }
327 { "p.~" pages * "\ignorespaces" *}
328 if$
329 }
330
331 FUNCTION {article}
332 {
333 crossref missing$ 'skip$ { "crossref in " cite$ * warning$} if$
334 author missing$ collaboration missing$ and { "author missing in " cite$ * warning$} 'skip$ if$
335 title missing$ journal missing$ and eprint missing$ and note missing$ and { "title, journal, eprint and note missing in " cite$ * warning$} 'skip$ if$
336 begin.entry
337 format.authors output
338 format.title output
339 format.journal output
340 format.eprint output
341 format.note output
342 format.url output
343 fin.entry
344 }
345
346
347 FUNCTION {book}
348 {
349 crossref missing$ 'skip$ { "crossref in " cite$ * warning$} if$
350 author missing$ editor missing$ and { "author and editor missing in " cite$ * warning$} 'skip$ if$
351 title missing$ { "title missing in " cite$ * warning$} 'skip$ if$
352 publisher missing$ { "publisher missing in " cite$ * warning$} 'skip$ if$
353
354 begin.entry
355 format.authors output
356 format.editor output
357 format.title output
358 format.edition output
359 format.publisher output
360 format.address output
361 format.pages output
362 format.eprint output
363 format.note output
364 format.url output
365 fin.entry
366 }
367
368 FUNCTION {inbook}
369 {
370 author missing$ editor missing$ and { "author and editor missing in " cite$ * warning$} 'skip$ if$
371 title missing$ { "title missing in " cite$ * warning$} 'skip$ if$
372 booktitle missing$ { "booktitle missing in " cite$ * warning$} 'skip$ if$
373 begin.entry
374 format.authors output
375 format.title output
376 booktitle empty$ 'skip$ { "in \textit{``" booktitle * "''}" * output } if$
377 format.edition output
378 format.editor output
379 format.pages output
380 format.publisher output
381 format.address output
382 format.eprint output
383 format.note output
384 format.url output
385 fin.entry
386 }
387
388 FUNCTION {inproceedings} { inbook }
389
390 FUNCTION {conference} { inbook }
391
392 FUNCTION {incollection} { inbook }
393
394 FUNCTION {misc}
395 {
396 begin.entry
397 format.authors output
398 format.title output
399 howpublished empty$ 'skip$ { howpublished output } if$
400 format.eprint output
401 format.note output
402 format.url output
403 fin.entry
404 }
405
406 FUNCTION {unpublished} { misc }
407
408 FUNCTION {phdthesis}
409 {
410 author missing$ { "author missing in " cite$ * warning$} 'skip$ if$
411 title missing$ { "title missing in " cite$ * warning$} 'skip$ if$
412 school missing$ { "school missing in " cite$ * warning$} 'skip$ if$
413 begin.entry
414 format.authors output
415 format.title output
416 school empty$
417 { "PhD thesis" format.date * }
418 { "PhD thesis, " school * format.date * }
419 if$ output
420 format.eprint output
421 format.note output
422 format.url output
423 fin.entry
424 }
425
426 FUNCTION {mastersthesis}
427 {
428 author missing$ { "author missing in " cite$ * warning$} 'skip$ if$
429 title missing$ { "title missing in " cite$ * warning$} 'skip$ if$
430 school missing$ { "school missing in " cite$ * warning$} 'skip$ if$
431 begin.entry
432 format.authors output
433 format.title output
434 school empty$
435 { "Master's thesis" format.date * }
436 { "Master's thesis, " school * format.date * }
437 if$ output
438 format.eprint output
439 format.note output
440 format.url output
441 fin.entry
442 }
443
444 FUNCTION {techreport}
445 {
446 author missing$ { "author missing in " cite$ * warning$} 'skip$ if$
447 title missing$ { "title missing in " cite$ * warning$} 'skip$ if$
448 begin.entry
449 format.authors output
450 format.title output
451 institution empty$ 'skip$ { institution output } if$
452 number empty$
453 { year empty$ { "" } { "(" year * ")\ignorespaces" * } if$ }
454 { "Report No. " number * format.date * }
455 if$ output
456 format.eprint output
457 format.note output
458 format.url output
459 fin.entry
460 }
461
462 FUNCTION {default.type} { article }
463
464 READ
465
466 STRINGS { longest.label }
467
468 INTEGERS { number.label longest.label.width }
469
470 FUNCTION {initialize.longest.label}
471 { "" 'longest.label :=
472 #1 'number.label :=
473 #0 'longest.label.width :=
474 }
475
476 FUNCTION {longest.label.pass}
477 { number.label int.to.str$ 'label :=
478 number.label #1 + 'number.label :=
479 label width$ longest.label.width >
480 { label 'longest.label :=
481 label width$ 'longest.label.width :=
482 }
483 'skip$
484 if$
485 }
486
487 EXECUTE {initialize.longest.label}
488
489 ITERATE {longest.label.pass}
490
491 FUNCTION {begin.bib}
492 { preamble$ empty$
493 'skip$
494 { preamble$ write$ newline$ }
495 if$
496 "%bibliography generated by chetref.bst" write$ newline$
497 "\ifx\mcitethebibliography\mciteundefinedmacro" write$ newline$
498 " \let\mcitethebibliography\thebibliography" write$ newline$
499 " \expandafter\let\csname endmcitethebibliography\endcsname\endthebibliography" write$ newline$
500 " \def\mcitedefaultmidpunct{,~}" write$ newline$
501 " \def\mcitedefaultendpunct{.}" write$ newline$
502 " \def\mcitedefaultseppunct{;}" write$ newline$
503 " \def\EndOfBibitem{}" write$ newline$
504 " \def\mciteBstWouldAddEndPuncttrue{}" write$ newline$
505 " \def\mciteBstWouldAddEndPunctfalse{}" write$ newline$
506 " \def\mciteSetBstMidEndSepPunct#1#2#3{#2}" write$ newline$
507 "\fi" write$ newline$
508 "\begin{mcitethebibliography}{" longest.label * "}" * write$ newline$
509 "\ifx\href\asklfhas\newcommand{\href}[2]{#2}\fi" write$ newline$
510 "\ifx\arxivref\asklfhas\newcommand{\arxivref}[2]{\href{https://arxiv.org/abs/#1}{#2}}\fi" write$ newline$
511 "\ifx\doiref\asklfhas\newcommand{\doiref}[2]{\href{https://doi.org/#1}{#2}}\fi" write$ newline$
512 "\parskip 0pt" write$ newline$
513 "\normalsize" write$ newline$
514 newline$
515 }
516
517 EXECUTE {begin.bib}
518
519 ITERATE {call.type$}
520
521 FUNCTION {end.bib}
522 {
523 "\end{mcitethebibliography}" write$ newline$
524 }
525
526 EXECUTE {end.bib}