Debian Codegraph @

texmf-dist/bibtex/bst/directory/letter.bst

raw
1 %% letter.bst
2 %% Copyright 1998-2003 Christophe Geuzaine <[email protected]>
3 %
4 % $Id: letter.bst,v 1.7 2003/09/15 05:40:31 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 `letter.bst'
12 % 'directory' database: all fields
13 %
14 % The parts you may want to customize are labeled with "CUSTOM"
15 %
16
17 INTEGERS { nameptr namesleft numnames numaux len }
18 STRINGS { s t u v }
19
20 % ------------------------------------------------------------
21 % E N T R I E S
22 % ------------------------------------------------------------
23
24 ENTRY
25 { name
26 address
27 street
28 city
29 state
30 zip
31 country
32 p.address
33 p.street
34 p.city
35 p.state
36 p.zip
37 p.country
38 r.address
39 r.street
40 r.city
41 r.state
42 r.zip
43 r.country
44 w.title
45 w.name
46 w.address
47 w.street
48 w.city
49 w.state
50 w.zip
51 w.country
52 }
53 {}
54 {}
55
56 % ------------------------------------------------------------
57 % G E N E R A L
58 % ------------------------------------------------------------
59
60 FUNCTION {not}
61 { { #0 }
62 { #1 }
63 if$
64 }
65
66 FUNCTION {and}
67 { 'skip$
68 { pop$ #0 }
69 if$
70 }
71
72 FUNCTION {or}
73 { { pop$ #1 }
74 'skip$
75 if$
76 }
77
78 % ------------------------------------------------------------
79 % F O R M A T S
80 % ------------------------------------------------------------
81
82 FUNCTION {format.names}
83 { 's :=
84 #1 'nameptr :=
85 s num.names$ 'numnames :=
86 numnames 'namesleft :=
87 { namesleft #0 > }
88 {
89 % CUSTOM uncomment one of the following lines to have the behaviour on the right
90 s nameptr "{ff }{vv }{ll}{, jj}" format.name$ 't := % Christophe de Geuzaine, jr
91 % s nameptr "{f. }{vv }{ll}{, jj}" format.name$ 't := % C. de Geuzaine, jr
92 % s nameptr "{vv }{ll}{ f.}{, jj}" format.name$ 't := % de Geuzaine C., jr
93 % s nameptr "{vv }{ll}{, ff}{, jj}" format.name$ 't := % de Geuzaine, Christophe, jr
94
95 nameptr #1 >
96 { namesleft #1 >
97 { ", " * t * }
98 { " {\dirandf} " * t * }
99 if$
100 }
101 't
102 if$
103 nameptr #1 + 'nameptr :=
104 namesleft #1 - 'namesleft :=
105 }
106 while$
107 }
108
109 FUNCTION {format.name}
110 { name empty$
111 { "" }
112 { name format.names }
113 if$
114 }
115
116 FUNCTION {format.address}
117 { address empty$
118 {
119 street empty$ city empty$ state empty$ zip empty$ country empty$
120 and and and and
121 { "" }
122 { " \dirnext "
123 street empty$ { "" * } { street " \dirnext " * * } if$
124 city empty$ { "" * } { city " " * * } if$
125 state empty$ { "" * } { state " " * * } if$
126 zip empty$ { "" * } { zip " " * * } if$
127 country empty$ { "" * } { country * } if$
128 }
129 if$
130 }
131 { " \dirnext " address * }
132 if$
133 }
134
135 FUNCTION {format.p.address}
136 { p.address empty$
137 {
138 p.street empty$ p.city empty$ p.state empty$ p.zip empty$ p.country empty$
139 and and and and
140 { "" }
141 { " \dirnext "
142 p.street empty$ { "" * } { p.street " \dirnext " * * } if$
143 p.city empty$ { "" * } { p.city " " * * } if$
144 p.state empty$ { "" * } { p.state " " * * } if$
145 p.zip empty$ { "" * } { p.zip " " * * } if$
146 p.country empty$ { "" * } { p.country * } if$
147 }
148 if$
149 }
150 { " \dirnext " p.address * }
151 if$
152 }
153
154 FUNCTION {format.r.address}
155 { r.address empty$
156 {
157 r.street empty$ r.city empty$ r.state empty$ r.zip empty$ r.country empty$
158 and and and and
159 { "" }
160 { " \dirnext "
161 r.street empty$ { "" * } { r.street " \dirnext " * * } if$
162 r.city empty$ { "" * } { r.city " " * * } if$
163 r.state empty$ { "" * } { r.state " " * * } if$
164 r.zip empty$ { "" * } { r.zip " " * * } if$
165 r.country empty$ { "" * } { r.country * } if$
166 }
167 if$
168 }
169 { " \dirnext " r.address * }
170 if$
171 }
172
173 FUNCTION {format.w.title}
174 { w.title empty$
175 { "" }
176 { " \dirnext " w.title * }
177 if$
178 }
179
180 FUNCTION {format.w.name}
181 { w.name empty$
182 { "" }
183 { " \dirnext " w.name * }
184 if$
185 }
186
187 FUNCTION {format.w.address}
188 { w.address empty$
189 {
190 w.street empty$ w.city empty$ w.state empty$ w.zip empty$ w.country empty$
191 and and and and
192 { "" }
193 { " \dirnext "
194 w.street empty$ { "" * } { w.street " \dirnext " * * } if$
195 w.city empty$ { "" * } { w.city " " * * } if$
196 w.state empty$ { "" * } { w.state " " * * } if$
197 w.zip empty$ { "" * } { w.zip " " * * } if$
198 w.country empty$ { "" * } { w.country * } if$
199 }
200 if$
201 }
202 { " \dirnext " w.address * }
203 if$
204 }
205
206 % ------------------------------------------------------------
207 % P E R S O N E N T R Y
208 % ------------------------------------------------------------
209
210 FUNCTION { person }
211 {
212 "\diritem{" write$
213 format.name write$
214 "}{" write$
215 "d." cite$ * write$
216 "}" write$
217
218 newline$
219
220 "\diritem{" write$
221 "\dirbegin " write$
222 format.name write$
223 format.p.address write$
224 "\dirend " write$
225 "}{" write$
226 "p." cite$ * write$
227 "}" write$
228
229 newline$
230
231 "\diritem{" write$
232 "\dirbegin " write$
233 format.name write$
234 format.r.address write$
235 "\dirend " write$
236 "}{" write$
237 "r." cite$ * write$
238 "}" write$
239
240 newline$
241
242 "\diritem{" write$
243 "\dirbegin " write$
244 format.name write$
245 format.w.title write$
246 format.w.name write$
247 format.w.address write$
248 "\dirend " write$
249 "}{" write$
250 "w." cite$ * write$
251 "}" write$
252
253 newline$
254 }
255
256 % ------------------------------------------------------------
257 % C O M P A N Y E N T R Y
258 % ------------------------------------------------------------
259
260
261 FUNCTION { company }
262 {
263 "\diritem{" write$
264 name write$
265 "}{" write$
266 "d." cite$ * write$
267 "}" write$
268
269 newline$
270
271 "\diritem{" write$
272 "\dirbegin " write$
273 name write$
274 format.address write$
275 "\dirend " write$
276 "}{" write$
277 "p." cite$ * write$
278 "}" write$
279
280 newline$
281
282 "\diritem{" write$
283 "\dirbegin " write$
284 name write$
285 format.address write$
286 "\dirend " write$
287 "}{" write$
288 "r." cite$ * write$
289 "}" write$
290
291 newline$
292
293 "\diritem{" write$
294 "\dirbegin " write$
295 name write$
296 format.address write$
297 "\dirend " write$
298 "}{" write$
299 "w." cite$ * write$
300 "}" write$
301
302 newline$
303 }
304
305 % ------------------------------------------------------------
306 % P L A C E E N T R Y
307 % ------------------------------------------------------------
308
309 FUNCTION { place }
310 {
311 "\diritem{" write$
312 name write$
313 "}{" write$
314 "d." cite$ * write$
315 "}" write$
316
317 newline$
318
319 "\diritem{" write$
320 "\dirbegin " write$
321 name write$
322 format.address write$
323 "\dirend " write$
324 "}{" write$
325 "p." cite$ * write$
326 "}" write$
327
328 newline$
329
330 "\diritem{" write$
331 "\dirbegin " write$
332 name write$
333 format.address write$
334 "\dirend " write$
335 "}{" write$
336 "r." cite$ * write$
337 "}" write$
338
339 newline$
340
341 "\diritem{" write$
342 "\dirbegin " write$
343 name write$
344 format.address write$
345 "\dirend " write$
346 "}{" write$
347 "w." cite$ * write$
348 "}" write$
349
350 newline$
351 }
352
353 % ------------------------------------------------------------
354 % M A I N
355 % ------------------------------------------------------------
356
357 READ
358 ITERATE {call.type$}
359