-
Notifications
You must be signed in to change notification settings - Fork 1
/
gatech-thesis-losa.bst
executable file
·264 lines (233 loc) · 5.08 KB
/
gatech-thesis-losa.bst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
% gatech-thesis-losa.bst: This style is used by the gatech-thesis-losa.sty
% style to provide support for a 'List of Symbols or Abbreviations'
% within the context of gatech-thesis.cls. The advantages of
% creating a separate .bst file are that the formatting of the
% losa glossary can be different from that of other "real" glossaries
% which are also based on the gloss.sty package.
%
% This file was adapted from the file `glsplain.bst' taken from the
% gloss package.
%
% Original information:
% ORIG:
% ORIG: (c) 1998 Jose Luis Diaz, 1999-2002 Jose Luis Diaz and Javier Bezos.
% ORIG: All Rights Reserved.
% ORIG:
% ORIG: This file is part of the gloss distribution release 1.5.2
% ORIG: --------------------------------------------------------
% ORIG:
% ORIG: This file can be redistributed and/or modified under the terms
% ORIG: of the LaTeX Project Public License Distributed from CTAN
% ORIG: archives in directory macros/latex/base/lppl.txt; either
% ORIG: version 1 of the License, or any later version.
% ORIG:
% ORIG: % History of v0.1
% ORIG: % ~~~~~~~~~~~~~~~
% ORIG: % 1997/06/25 (JLDdA) Original version, by Jose Luis Diaz de Arriba (and an
% ORIG: % unindicted co-conspirator)
% ORIG: % History of v1.0
% ORIG: % ~~~~~~~~~~~~~~~
% ORIG: % 1999/07/29 (JBL) Rewritten in full. Now it warns if a required field is
% ORIG: % missing, conforms the new gloss.sty syntax, and
% ORIG: % writes headings for each letter. The heading,
% ORIG: % short, and group fiels have been added.
% ORIG: % History of v1.1-1.4
% ORIG: % ~~~~~~~~~~~~~~~~~~~
% ORIG: % 1999/10/10 (JBL) Lots of changes.
% ORIG: % History of v.1.5
% ORIG: % ~~~~~~~~~~~~~~~~
% ORIG: % 2001/08/02 (JBL) Added the sort-short field for compatility
% ORIG: % with glsshort.bst
STRINGS { last.heading s t star.period}
ENTRY
{ word
sort-word
definition
heading
group
short
sort-short
}
{}
{ ucword }
FUNCTION {not}
{ { #0 }
{ #1 }
if$
}
FUNCTION {has.period}
{ duplicate$
add.period$ =
}
FUNCTION {str.length}
{ 't :=
#0
{ t empty$ not }
{ t #2 global.max$ substring$
't :=
#1 +
}
while$
}
FUNCTION {upper.first}
{ duplicate$
#1 text.prefix$
duplicate$
"u" change.case$
's :=
str.length
#1 + entry.max$ substring$
s swap$ *
}
FUNCTION {check.required}
{ 's :=
duplicate$ empty$
{ "Empty " s * " in " * cite$ * warning$ }
'skip$
if$
}
FUNCTION {field.or.null}
{ duplicate$ empty$
{ pop$ "" }
'skip$
if$
}
FUNCTION {push.sortword}
{ sort-word empty$
{ word field.or.null }
'sort-word
if$
}
FUNCTION {check.alpha}
{ duplicate$
purify$
empty$
{ "Non alphabetical " cite$ *
" entry without group field" * warning$ }
'skip$
if$
}
FUNCTION {push.heading}
{ heading empty$
{ word field.or.null
#1 text.prefix$
check.alpha
}
'heading
if$
}
FUNCTION {begin.entry}
{ newline$
"\begin{losaitem" star.period * write$
"}{" write$
cite$ write$
"}{" write$
word write$
"}{" write$
ucword write$
"}{" write$
short field.or.null write$
"}" write$
newline$
}
FUNCTION {end.entry}
{ "\end{losaitem" star.period "}" * * write$
newline$
}
FUNCTION {set.vars}
{ word field.or.null
"word" check.required
upper.first
'ucword :=
}
FUNCTION {losadef}
{ definition field.or.null
"definition" check.required
duplicate$ has.period
{ "*" }
{ "" }
if$
'star.period := % definition is stored for later writing
begin.entry % this outputs word, ucword, and short
write$ % writes definition
end.entry
}
FUNCTION {gd}
{ definition field.or.null
"definition" check.required
duplicate$ has.period
{ "*" }
{ "" }
if$
'star.period := % definition is stored for later
begin.entry % this outputs word, ucword, and short
write$ % writes definition
end.entry
}
FUNCTION {default.type} { losadef }
FUNCTION {presort}
{ set.vars
push.sortword
group empty$
{ purify$ "L" }
'group
if$ % sort-word heading
swap$ * % heading * sort-word
"l" change.case$
'sort.key$ :=
}
FUNCTION {begin.thelosa}
{ "\begin{thelosa}"
write$
newline$
preamble$ empty$
'skip$
{ preamble$ write$ newline$ }
if$
}
FUNCTION {end.thelosa}
{ newline$
"\end{thelosa}" write$
newline$
}
FUNCTION {call.entries}
{ group empty$
'push.heading
{ heading empty$
'skip$
{ "Ignoring heading because there is group field in "
cite$ *
warning$
}
if$
group
}
if$
"u" change.case$
duplicate$
group empty$
'skip$
{ "$$$$$" * }
if$
duplicate$
last.heading =
{ pop$ pop$ }
{ newline$
'last.heading :=
group empty$
{ "\losaheading{" }
{ "\losagroup{" }
if$
swap$ * "}" *
write$
newline$
}
if$
call.type$
}
READ
ITERATE {presort}
SORT
EXECUTE {begin.thelosa}
ITERATE {call.entries}
EXECUTE {end.thelosa}