Debian Codegraph @

texmf-dist/bibtex/bst/directory/email-html.bst

raw
1 %% email-html.bst
2 %% Copyright 1998-2003 Christophe Geuzaine <[email protected]>
3 %
4 % $Id: email-html.bst,v 1.7 2004/02/07 23:41:45 geuzaine Exp $
5 %
6 % This program can be redistributed and/or modified under the terms
7 % of the LaTeX Project Public License distributed from CTAN
8 % archives in directory macros/latex/base/lppl.txt; either
9 % version 1 of the License, or (at your option) any later version.
10 %
11 % BibTeX bibliography style `addr-htm.bst'
12 % 'directory' database: all fields
13 %
14 % This is definitively a hack...
15 %
16 % The parts you may want to customize are labeled with "CUSTOM"
17 %
18
19 INTEGERS { nameptr namesleft numnames numaux len }
20 STRINGS { s t u v }
21
22 % ------------------------------------------------------------
23 % E N T R I E S
24 % ------------------------------------------------------------
25
26 ENTRY
27 { name
28 email
29 p.email
30 r.email
31 w.email
32 }
33 {}
34 { private.str
35 residence.str
36 work.str
37 and.str
38 }
39
40
41 % ------------------------------------------------------------
42 % G E N E R A L
43 % ------------------------------------------------------------
44
45 FUNCTION {init.strings}
46 {
47 % CUSOTM this is the 'html' equivalent for the \dirXXX customization
48 % commands
49
50 "&nbsp;<em>priv.</em>" 'private.str :=
51 "&nbsp;<em>temp.</em>" 'residence.str :=
52 "&nbsp;<em>prof.</em>" 'work.str :=
53 " and " 'and.str :=
54 }
55
56 FUNCTION {output.nonnull}
57 { 's :=
58 write$
59 newline$
60 s
61 }
62
63 FUNCTION {output}
64 { duplicate$ empty$
65 'pop$
66 'output.nonnull
67 if$
68 }
69
70 FUNCTION {not}
71 { { #0 }
72 { #1 }
73 if$
74 }
75
76 FUNCTION {and}
77 { 'skip$
78 { pop$ #0 }
79 if$
80 }
81
82 FUNCTION {or}
83 { { pop$ #1 }
84 'skip$
85 if$
86 }
87
88 FUNCTION {chop.word}
89 { 's :=
90 'len :=
91 s #1 len substring$ =
92 { s len #1 + global.max$ substring$ }
93 's
94 if$
95 }
96
97 FUNCTION {emailize}
98 { duplicate$ empty$
99 { pop$ "" }
100 { "<A HREF=" quote$ * "mailto:" * swap$ * quote$ * " >" * swap$ * "</A>" * }
101 if$
102 }
103
104 % ------------------------------------------------------------
105 % S O R T I N G F U N C T I O N S
106 % ------------------------------------------------------------
107
108 FUNCTION {sortify}
109 { purify$
110 "l" change.case$
111 }
112
113 FUNCTION {sort.names}
114 { 's :=
115 #1 'nameptr :=
116 ""
117 s num.names$ 'numnames :=
118 numnames 'namesleft :=
119 { namesleft #0 > }
120 { nameptr #1 >
121 { " " * }
122 'skip$
123 if$
124 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
125 nameptr numnames = t "others" = and
126 { "et al" * }
127 { t sortify * }
128 if$
129 nameptr #1 + 'nameptr :=
130 namesleft #1 - 'namesleft :=
131 }
132 while$
133 }
134
135
136 FUNCTION {sort.raw.names}
137 { 't :=
138 "A " #2 "L'" #2
139 "An " #3 "Au " #3 "Le " #3 "La " #3
140 "The " #4 "Les " #4 "Aux " #4
141 t
142 chop.word chop.word
143 chop.word chop.word chop.word chop.word
144 chop.word chop.word chop.word
145 sortify
146 #1 global.max$ substring$
147 }
148
149 FUNCTION {name.sort}
150 { name empty$
151 { " Name field missing in entry '" cite$ * "'" * warning$ "" }
152 { name sort.names }
153 if$
154 }
155
156 FUNCTION {raw.name.sort}
157 { name empty$
158 { " Name field missing in entry '" cite$ * "'" * warning$ "" }
159 { name sort.raw.names }
160 if$
161 }
162
163 FUNCTION {presort}
164 { type$ "company" =
165 type$ "place" =
166 or
167 { raw.name.sort }
168 { name.sort }
169 if$
170 " "
171 *
172 #1 entry.max$ substring$
173 'sort.key$ :=
174 }
175
176 % ------------------------------------------------------------
177 % P R E - A N D P O S T - H E A D E R S
178 % ------------------------------------------------------------
179
180 FUNCTION {begin.bib}
181 { "<HTML>" write$
182 newline$
183 "<TITLE>E-mail directory</TITLE>" write$
184 newline$
185 }
186
187 FUNCTION {end.bib}
188 { newline$
189 "<p><hr><center><font size=-1>This e-mail directory was generated by <A HREF= " write$
190 quote$ "http://www.geuz.org/directory/" * quote$ * write$
191 " >directory</A></center></HTML>" write$
192 newline$
193 }
194
195 % ------------------------------------------------------------
196 % F O R M A T S
197 % ------------------------------------------------------------
198
199 FUNCTION {format.names}
200 { 's :=
201 #1 'nameptr :=
202 s num.names$ 'numnames :=
203 numnames 'namesleft :=
204 { namesleft #0 > }
205 {
206 % CUSTOM uncomment one of the following lines to have the behaviour on the right
207 % s nameptr "{ff{ } }{vv{ } }{ll{ }}{, jj{ }}" format.name$ 't := % Christophe de Geuzaine, jr
208 % s nameptr "{f.{ } }{vv{ } }{ll{ }}{, jj{ }}" format.name$ 't := % C. de Geuzaine, jr
209 % s nameptr "{vv{ } }{ll{ }}{ f.{ }}{, jj{ }}" format.name$ 't := % de Geuzaine C., jr
210 s nameptr "{vv{ } }{ll{ }}{, ff{ }}{, jj{ }}" format.name$ 't := % de Geuzaine, Christophe, jr
211
212 nameptr #1 >
213 { namesleft #1 >
214 { ", " * t * }
215 { and.str * t * }
216 if$
217 }
218 't
219 if$
220 nameptr #1 + 'nameptr :=
221 namesleft #1 - 'namesleft :=
222 }
223 while$
224 }
225
226 FUNCTION {format.name}
227 { name empty$
228 { "" }
229 { name format.names }
230 if$
231 }
232
233 FUNCTION {format.email}
234 { email empty$
235 { "" }
236 { email email emailize }
237 if$
238 }
239
240 FUNCTION {format.p.flag}
241 { p.email empty$ not
242 { private.str }
243 { "" }
244 if$
245 }
246
247 FUNCTION {format.p.email}
248 { p.email empty$
249 { "" }
250 { p.email p.email emailize }
251 if$
252 }
253
254 FUNCTION {format.r.flag}
255 { r.email empty$ not
256 { residence.str }
257 { "" }
258 if$
259 }
260
261 FUNCTION {format.r.email}
262 { r.email empty$
263 { "" }
264 { r.email r.email emailize }
265 if$
266 }
267
268 FUNCTION {format.w.flag}
269 { w.email empty$ not
270 { work.str }
271 { "" }
272 if$
273 }
274
275 FUNCTION {format.w.email}
276 { w.email empty$
277 { "" }
278 { w.email w.email emailize }
279 if$
280 }
281
282
283 % ------------------------------------------------------------
284 % P E R S O N E N T R Y
285 % ------------------------------------------------------------
286
287 FUNCTION { person }
288 {
289 p.email empty$ not
290 r.email empty$ not
291 w.email empty$ not
292 or or
293 { init.strings
294
295 newline$
296 "<br><b>" write$
297 format.name write$
298 "</b>" write$
299
300 ""
301 format.p.flag output
302 format.p.email output
303 format.r.flag output
304 format.r.email output
305 format.w.flag output
306 format.w.email output
307
308 write$
309 newline$
310 }
311 { }
312 if$
313 }
314
315 % ------------------------------------------------------------
316 % C O M P A N Y E N T R Y
317 % ------------------------------------------------------------
318
319
320 FUNCTION { company }
321 {
322 email empty$ not
323 { init.strings
324
325 newline$
326 "<br><b>" write$
327 name write$
328 "</b>" write$
329
330 ""
331 format.email output
332
333 write$
334 newline$
335 }
336 { }
337 if$
338
339 }
340
341 % ------------------------------------------------------------
342 % P L A C E E N T R Y
343 % ------------------------------------------------------------
344
345 FUNCTION { place }
346 {
347 }
348
349 % ------------------------------------------------------------
350 % M A I N
351 % ------------------------------------------------------------
352
353 READ
354 ITERATE {presort}
355 SORT
356 EXECUTE {begin.bib}
357 ITERATE {call.type$}
358 EXECUTE {end.bib}
359