-
Notifications
You must be signed in to change notification settings - Fork 0
/
huplain.bst
1910 lines (1768 loc) · 53.6 KB
/
huplain.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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%
% huplain.bst -- plain.bst in Hungarian
% by [email protected] at Thu Oct 30 10:10:04 CET 2003
% tetex-url at Mon May 3 20:01:40 CEST 2004
% derived from BibTeX standard bibliography style `plain'
% version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% !! title={Az foo} -> key={foo}
% !! auto add space into URLs longer than 70 characters
% !! don't remove double-accent in T1 encoding: \'{\`a}}
% !! sort year
% !! make sure about Hungarian typography of {proceedings} and {inproceedings}
% it is better now to have talked=1, (Elhangzott a ... címû konferencián)
% !! also remove space after \ae before calling purify$
% !! crossrefs
% !! ` type '
% !! hu ordering: author, year, title if author is present
% title, year if author is missing!
% !! use and document ``address''
% !! MSZ 3401--81. A bibliográfiai tételek betûrendbe sorolásának szabályai.
% !! MSZ 3402--80. Könyvek bibliográfiai adatközlése és belsõ elrendezése.
% !! MSZ 3424/*-*. Bibliográfiai leírás. *.
% !! MSZ 3432-85. Szavak és szókapcsolatok rövidítése a bibliográfiai leírásban.
% !! MSZ 3440/*-*. A bibiliográfiai leírás besorolási adatai. *.
% !! abbrv style for J.-P. Sartre
% !! test all entry types
% !! optional \uppercase or \textsc
% !! "5~ {\hbox{ja}}nu\'ar" #1 "({l,}{ff,})" format.name$ warning$
% !! format.name$ keeps the first char of the name only, so specify {Gy}ula
% !! don't use width$ ??, because it's the cmr10 font in 1987.
% !! getting the first chars of names
% !! \include...
% !! bibgerman.sty, gerplain.bst, language = "german" | "USenglish" | "english" etc.
% \selectlanguage{...} \bibitem...
% !! doc: parametric volume: `kötet' (volumeisyearly={1}) instead of `évf.'
% OK: smaller space for \newblock
% OK: huname: name in hungarian order
% SUXX: cannot read current (overridden) MACRO values from .bst
% SUXX: #161 int.to.chr$ doesn't work (out of bounds), stupid BibTeX...
% Dat: @preamble { "..." # "..." }
% Dat: bibtex removes spaces from end of field contents
% Dat: `volume=' is `évfolyam'
% Dat: Doc: key={{ }.}
% Dat: Doc: write non-decaptilized titles: title = {Fejtõ {Ferenc} és a szociáldemokrácia},
% Dat: print debug messages with "foo" warning$
%
ENTRY
{ address
author
booktitle
chapter
edition
editor
howpublished
institution
journal
key
month
note
number
organization
pages
publisher
school
series
title
type
volume
year
street
zip
city
phone
mobile
name
numvolumes
numpages
tetex-url
ctan-url
url
isbn
issn
nocheck % ****pts****
huname % ****pts****
inputenc % ****pts****
author2 % ****pts****
talked % ****pts****
volumeisyearly % ****pts****
% vvv for fmts
firstname.fmt % ****pts****
lastname.fmt % ****pts****
}
{}
{ label adr.char } % !! what does this mean?
FUNCTION {not}
{ { #0 }
{ #1 }
if$
}
FUNCTION {and}
{ 'skip$
{ pop$ #0 }
if$
}
FUNCTION {or}
{ { pop$ #1 }
'skip$
if$
}
STRINGS { ss tt }
%STRINGS { acc.latin2.160 acc.latin1.160 acc.160 }
%FUNCTION {init.accs} {
% " A L LS SSTZ-ZZ a l ls sstz zzRAAAALCCCEEEEIIDDNNOOOO*RUUUUYTsraaaalccceeeeiiddnnoooo/ruuuuytd" 'acc.latin2.160 :=
% " ! | <!- m +23 m 1 > AAAAAAACEEEEIIIIDNOOOOO*OUUUUYTsaaaaaaaceeeeiiiidnooooo/ouuuuyty" 'acc.latin1.160 :=
%}
%%** @param #1 string
%%** @return string
%FUNCTION {rmacc.latinx} { % ****pts****
% 'tt :=
% "" 'ss :=
% { tt empty$ not } {
% #1
% { duplicate$ tt swap$ #1 substring$
% duplicate$ "" = { pop$ #0 } { chr.to.int$ #160 < } if$
% } { #1 + } while$
% duplicate$ tt swap$ #1 swap$ #1 - substring$
% % duplicate$ ";" * warning$
% ss swap$ * 'ss :=
% duplicate$ tt swap$ #1 substring$
% duplicate$ "" = { pop$ } {
% chr.to.int$ #159 - acc.160 swap$ #1 substring$
% ss swap$ * 'ss :=
% #1 +
% } if$
% tt swap$ global.max$ substring$ 'tt :=
% % tt warning$
% } while$
% ss
%}
%
%%** @param #1 a string
%%** @return a string
%FUNCTION {rmacc} { % **** pts ****
% inputenc empty$ 'skip$ {
% inputenc "latin1" = { acc.latin1.160 'acc.160 := rmacc.latinx } 'skip$ if$
% inputenc "latin2" = { acc.latin2.160 'acc.160 := rmacc.latinx } 'skip$ if$
% } if$
%}
STRINGS { acc4.latin2.160 acc4.latin1.160 acc4.160 }
FUNCTION {init.accs4} {
"%%%%%%%%%%%%%%%%%%%%%%%%%%%%\S %\" quote$ "{}%%%%%%%%%%%%%%%%%%%%%%%%\={}%%%%%%%%%%%%%%%%\'{}%%%%\P %%%%%\c\ %%%%%%%%%%%%%%%%%%%%%%%%%%%%\`A%\'A%\^A%\~A%\" quote$ "A%\r A\AE%\c C\`E%\'E%\^E%\" quote$ "E%\`I%\'I%\^I%\" quote$ "I%\DH%\~N%\`O%\'O%\^O%\~O%\" quote$ "O%%%%%\O %\`U%\'U%\^U%\" quote$ "U%\'Y%\TH%\ss%\`a%\'a%\^a%\~a%\" quote$ "a%\r a\ae%\c c\`e%\'e%\^e%\" quote$ "e%\`\i\'\i\^\i\" quote$ "\i\dh%\~n%\`o%\'o%\^o%\~o%\" quote$ "o%%%%%\o %\`u%\'u%\^u%\" quote$ "u%\'y%\th%\" quote$ "y%" * * * * * * * * * * * * * * * * * * * * * * * * 'acc4.latin1.160 :=
"%%%%\k A\u{}\L %%%%%\v L\'S%\S %\" quote$ "{}\v S\c S\v T\'Z%%%%%\v Z\.Z%%%%%\k a\k\ \l %\'{}\v l\'s%\v{}\c\ \v s\c s\v t\'z%\H{}\v z\.z%\'R%\'A%\^A%\u A\" quote$ "A%\'L%\'C%\c C\v C\'E%\k E\" quote$ "E%\v E\'I%\^I%\v D\DJ%\'N%\v N\'O%\^O%\H O\" quote$ "O%%%%%\v R\r U\'U%\H U\" quote$ "U%\'Y%\c T\ss%\'r%\'a%\^a%\u a\" quote$ "a%\'l%\'c%\c c\v c\'e%\k e\" quote$ "e%\v e\'\i\^\i\v d\dj%\'n%\v n\'o%\^o%\H o\" quote$ "o%%%%%\v r\r u\'u%\H u\" quote$ "u%\'y%\c t\.{}" * * * * * * * * * * * * * * * * * * 'acc4.latin2.160 :=
}
%** @param #1 string
%** @return string
FUNCTION {rmacc4.latinx} { % ****pts****
'tt :=
"" 'ss :=
{ tt "" = not } { % Dat: empty$ is true for space
#1
{ duplicate$ tt swap$ #1 substring$
duplicate$ "" = { pop$ #0 } { chr.to.int$ #160 < } if$
} { #1 + } while$
duplicate$ tt swap$ #1 swap$ #1 - substring$
% duplicate$ ";" * warning$
ss swap$ * 'ss :=
duplicate$ tt swap$ #1 substring$
duplicate$ "" = { pop$ } {
% chr.to.int$ #159 - acc.160 swap$ #1 substring$
duplicate$ chr.to.int$
acc4.160 swap$ duplicate$ + duplicate$ + #639 - #4 substring$
duplicate$ "%%%%" = {
pop$
} {
swap$ pop$
duplicate$ #4 #1 substring$ "%" = { #1 #3 substring$ } 'skip$ if$
"{" swap$ * "}" *
} if$
ss swap$ * 'ss :=
#1 +
} if$
tt swap$ global.max$ substring$ 'tt :=
% tt warning$
} while$
ss
}
%** Changes "á" to "{\'a}" etc.
%** @param #1 a string
%** @return a string
FUNCTION {rmacc4} { % **** pts ****
inputenc empty$ 'skip$ {
inputenc "latin1" = { acc4.latin1.160 'acc4.160 := rmacc4.latinx } 'skip$ if$
inputenc "latin2" = { acc4.latin2.160 'acc4.160 := rmacc4.latinx } 'skip$ if$
} if$
}
INTEGERS { acc.fwd }
%** Changes "fo{\'o}h{\H u}s" to "fo\'oh\H us". Helps keeping ligatures.
%** Changes `{\ae}' to `\ae ' and `{\\XY}' to `\XY '
%** Changes only known accents inside braces, followed by 1 or 2 accented
%** letters.
%** Dat: previous \oe must be inserted as {\\oe}, the same for {\DH} etc.
%** @param #1 string
%** @return string
FUNCTION {rmbrace.accs} { % ****pts****
% Dat: LaTeX non-alphanumeric accents \`\'\^\~\"\=\.
% Dat: LaTeX accents for purify$: \c\u\v\H\d\b\t\r
% Dat: specially removed: {\?...} -> ...
'tt :=
"" 'ss :=
{ tt "" = not } {
#1
{ duplicate$ tt swap$ #2 substring$
duplicate$ "" = { pop$ #0 } { "{\" = not } if$
} { #1 + } while$
duplicate$ tt swap$ #1 swap$ #1 - substring$
% duplicate$ ";" * warning$
ss swap$ * 'ss :=
duplicate$ tt swap$ #2 + #1 substring$
"}" = { #3 } {
duplicate$ tt swap$ #3 + #1 substring$
"}" = { % `{\i}' etc.
duplicate$ tt swap$ #2 + #1 substring$
duplicate$ "o" = {#4} {
duplicate$ "O" = {#4} {
duplicate$ "l" = {#4} {
duplicate$ "L" = {#4} {
duplicate$ "i" = {#4} {
duplicate$ "j" = {#4} {
#3} % Dat: disallow other {\X}
if$} if$} if$} if$} if$} if$
swap$ pop$
} {
duplicate$ tt swap$ #4 + #1 substring$
"}" = { #5 } {
duplicate$ tt swap$ #5 + #1 substring$
"}" = { #6 } { #3 } if$
} if$
} if$
} if$
'acc.fwd :=
% Status: offset-of-"\{"
%%acc.fwd int.to.str$ warning$
acc.fwd #3 = {
duplicate$ tt swap$ acc.fwd substring$ % copy 3 bytes
} {
duplicate$ #1 + tt swap$ acc.fwd #2 - substring$ % keep "\'o" or "\H u" only
%%duplicate$ warning$
duplicate$ "\oe" = {#5} {
duplicate$ "\OE" = {#5} {
duplicate$ "\ae" = {#5} {
duplicate$ "\AE" = {#5} {
duplicate$ "\aa" = {#5} {
duplicate$ "\AA" = {#5} {
duplicate$ "\th" = {#5} {
duplicate$ "\TH" = {#5} {
duplicate$ "\dh" = {#5} {
duplicate$ "\DH" = {#5} {
duplicate$ "\dj" = {#5} {
duplicate$ "\DJ" = {#5} {
duplicate$ "\ng" = {#5} {
duplicate$ "\NG" = {#5} {
duplicate$ "\ss" = {#5} {
duplicate$ "\SS" = {#5} {
duplicate$ "\o" = {#5} {
duplicate$ "\O" = {#5} {
duplicate$ "\l" = {#5} {
duplicate$ "\L" = {#5} {
duplicate$ "\i" = {#5} {
duplicate$ "\j" = {#5} {
duplicate$ #2 #1 substring$
duplicate$ "`" = {#1} {
duplicate$ "'" = {#1} {
duplicate$ "^" = {#1} {
duplicate$ "~" = {#1} {
duplicate$ quote$ = {#1} {
duplicate$ "=" = {#1} {
duplicate$ "." = {#1} {
duplicate$ "c" = {#2} {
duplicate$ "u" = {#2} {
duplicate$ "v" = {#2} {
duplicate$ "H" = {#2} {
duplicate$ "d" = {#2} {
duplicate$ "b" = {#2} {
duplicate$ "t" = {#2} {
duplicate$ "r" = {#2} {
duplicate$ "?" = {#3} {
duplicate$ "\" = {#4} { % added at Mon May 17 15:39:30 CEST 2004
#0} if$} if$} if$} if$} if$} if$} if$} if$} if$}
if$} if$} if$} if$} if$} if$} if$} if$
% Stack: "\'o" "'" 0|1|2
swap$ pop$
} if$} if$} if$} if$} if$} if$} if$} if$} if$} if$} if$} if$} if$} if$}
if$} if$} if$} if$} if$} if$} if$} if$
% Stack: "\'o" 0|1|2|3
duplicate$ #5 = {
pop$ " " * % `{\oe}' becomes `\oe '
} { duplicate$ #4 = {
pop$ #2 global.max$ substring$ % include single backlsash
" " * % add space so `{\\th}' becomes `\th '
} { duplicate$ #3 = {
pop$ #3 global.max$ substring$
} { duplicate$ #2 = {
pop$
duplicate$ #3 #1 substring$
" " =
} 'skip$ if$
% Stack: "\'o" 0|1
'skip$ { "{" swap$ * "}" * } if$
} if$ } if$ } if$
} if$
ss swap$ * 'ss :=
acc.fwd + tt swap$ global.max$ substring$ 'tt :=
} while$
ss
}
% ---
INTEGERS { output.state before.all mid.sentence after.sentence after.block
cur.adr.char after.authors }
STRINGS { s t ls rs }
FUNCTION {init.state.consts}
{ #0 'before.all :=
#1 'mid.sentence :=
#2 'after.sentence :=
#3 'after.block :=
#4 'after.authors :=
}
FUNCTION {output.nonnull}
{ 's :=
output.state mid.sentence =
{ ", " * write$ }
{ output.state after.block =
{ add.period$ write$
newline$
"\bibNewBlock " write$
}
{ output.state before.all =
'write$
{ output.state after.authors =
{ write$ newline$ "\bibNewBlock " write$ }
{ add.period$ " " * write$ }
if$
}
if$
}
if$
mid.sentence 'output.state :=
}
if$
s
}
FUNCTION {output}
{ duplicate$ empty$
'pop$
'output.nonnull
if$
}
FUNCTION {output.check}
{ 't :=
duplicate$ empty$
{ pop$
nocheck empty$ { "empty " t * " in " * cite$ * warning$ } {} if$
}
'output.nonnull
if$
}
% @return a string
FUNCTION {output.bibitem}
{ newline$
"\bibitem{" write$
cite$ write$
"}" write$
inputenc empty$ {} { " \bibInputEncoding{" inputenc "}" * * write$ } if$
newline$
""
before.all 'output.state :=
}
FUNCTION {fin.entry}
{ add.period$
write$
newline$
inputenc empty$ 'skip$ { "\bibResetInputEncoding" write$ newline$ } if$
}
FUNCTION {new.block}
{ output.state before.all =
'skip$
{ after.block 'output.state := }
if$
}
% ****pts****
FUNCTION {new.block.authors} {
duplicate$ empty$ 'skip$ { ":" * } if$
output.state before.all =
'skip$
{ after.authors 'output.state := }
if$
}
FUNCTION {new.sentence}
{ output.state after.block =
'skip$
{ output.state before.all =
'skip$
{ after.sentence 'output.state := }
if$
}
if$
}
FUNCTION {new.block.checka}
{ empty$
'skip$
'new.block
if$
}
FUNCTION {new.block.checkb}
{ empty$
swap$ empty$
and
'skip$
'new.block
if$
}
FUNCTION {new.sentence.checka}
{ empty$
'skip$
'new.sentence
if$
}
FUNCTION {new.sentence.checkb}
{ empty$
swap$ empty$
and
'skip$
'new.sentence
if$
}
FUNCTION {field.or.null}
{ duplicate$ empty$
{ pop$ "" }
'skip$
if$
}
FUNCTION {emphasize}
{ duplicate$ empty$
{ pop$ "" }
{ "{\em " swap$ * "}" * }
if$
}
INTEGERS { nameptr namesleft numnames }
FUNCTION {format.isbn}
{ isbn empty$
{ "" }
{ new.block "ISBN " isbn * }
if$
}
FUNCTION {format.issn}
{ issn empty$
{ "" }
{ new.block "ISSN " issn * }
if$
}
%** <string-of-length-1> is.url.split.char <0-or-1>
%** Is the spefified char candidate to split the URL at?
FUNCTION {is.url.split.char} {
duplicate$ "/" = { pop$ #1 } {
duplicate$ "." = { pop$ #1 } {
duplicate$ "?" = { pop$ #1 } {
duplicate$ "&" = { pop$ #1 } {
duplicate$ "-" = { pop$ #1 } {
pop$ #0 } if$ } if$ } if$ } if$ } if$
}
%** <string> string.length <length>
%** Imp: a faster implementation
%** Dat: destroys 'ls
FUNCTION {string.length} {
'ls :=
#1
{ duplicate$ ls swap$ #1 substring$ "" = #1 swap$ - }
{ #1 + } while$
#1 -
"" 'ls :=
}
INTEGERS { last.split.ofs }
%** <url> split.url <url-with-spaces>
%** We have to add spaces (works with \usepackage{url}), because otherwise
%** bibtex adds a % at column 79.
%** After a maxinmum of 71 chars, a space gets inserted.
%** Clobbers 'ss, 'ls and 'rs.
FUNCTION {split.url} {
% We add spaces after the last is.url.split.char
'ss := % save original string
#0 'last.split.ofs := % Dat: last offset to split _after_
"" 'rs :=
#1 % loop variable
{ duplicate$ ss swap$ #1 substring$ "" = #1 swap$ - } % more chars in ss
{ duplicate$ ss swap$ #1 substring$ is.url.split.char {
duplicate$ 'last.split.ofs :=
} 'skip$ if$
duplicate$ #70 > {
last.split.ofs #0 = {
duplicate$ 'last.split.ofs := % Dat: split at any char if cannot split at good position
} 'skip$ if$
rs ss #1 last.split.ofs substring$ " " * * 'rs :=
ss last.split.ofs #1 + ss string.length substring$ 'ss :=
%% ss warning$
last.split.ofs - #1 + % decrement loop variable
%% duplicate$ warning$
#0 'last.split.ofs :=
} { #1 + } if$
} while$
pop$ % Dat: pop loop variable
rs ss *
"" 'ss :=
"" 'rs :=
}
FUNCTION {output.url} {
url empty$
{ "" }
{ new.block "" output.nonnull
before.all 'output.state :=
newline$ % Dat: bibtex breaks lines -- let it be longer
"\bibUrll{URL} >" url split.url * ">" * }
if$ output
ctan-url empty$
{ "" }
{ new.block "" output.nonnull
before.all 'output.state :=
newline$ % Dat: bibtex breaks lines -- let it be longer
"\bibUrll{CTAN} >" ctan-url split.url * ">" * }
if$ output
tetex-url empty$
{ "" }
{ new.block "" output.nonnull
before.all 'output.state :=
newline$ % Dat: bibtex breaks lines -- let it be longer
"\bibUrll{te\TeX} >" tetex-url * split.url ">" * }
if$ output
}
% ****pts****
STRINGS { nfmt0 nfmt1 nfmt2 nfmt3 }
STRINGS {firstname.fmt0 lastname.fmt0}
FUNCTION {init.nfmt0} {
"ff" 'firstname.fmt0 :=
"ll" 'lastname.fmt0 :=
% "f." 'firstname.fmt0 := % similar to abbrev.bst
}
FUNCTION {init.nfmts} {
"{" firstname.fmt0 "~}{vv~}{" lastname.fmt0 "}{, jj}" * * * * 'nfmt0 :=% 0: English order
"{jj~}{vv~}{" lastname.fmt0 "}{~" firstname.fmt0 "}" * * * * 'nfmt1 := % 1: Hungarian name in Hungarian bib
"{vv~}{" lastname.fmt0 "}{, " firstname.fmt0 "}{, jj}" * * * * 'nfmt2 := % 2: English name in Hungarian bib
"{jj~}{vv~}{ll}{~f.}" 'nfmt3 := % 3: Hungarian name in Hungarian bib, abbreviated name
}
FUNCTION {format.names}
{ rmacc4 's := % ****pts****
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > } {
% ****pts****
huname empty$ { s nameptr nfmt0 format.name$ 't := }{ % empty: English order
huname "0" = { s nameptr nfmt0 format.name$ 't := }{ % 0: English order
huname "1" = { s nameptr nfmt1 format.name$ 't := }{ % 1: Hungarian name in Hungarian bib
huname "2" = { s nameptr nfmt2 format.name$ 't := } % 2: English name in Hungarian bib
{ s nameptr nfmt3 format.name$ 't := } % 3: Hungarian name in Hungarian bib, abbreviated name
if$ }if$ }if$ }if$
% ^^^ Dat: important to have no space in {ll} for "others"
t rmbrace.accs 't := % ****pts****
nameptr #1 >
{ namesleft #1 >
{ "\bibAnd 0" * t * }
{ % numnames #2 > { "," * } 'skip$ if$ % ****pts****
%% t ";;" * warning$
t "others" =
{ "\bibEtAl ." * }
{ numnames #2 > { "\bibAnd 2" } { "\bibAnd 1"} if$ * t * }
if$
}
if$
}
't
if$
%% t warning$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
} while$
}
FUNCTION {format.authors}
{ author empty$
{ "" }
{ author format.names }
if$
}
FUNCTION {format.editors}
{ editor empty$
{ "" }
{ editor format.names
editor num.names$ #1 > { "\bibEd 1" } { "\bibEd 0" } if$ * %****pts****
}
if$
}
FUNCTION {format.title}
{ title empty$
{ "" }
{ title rmacc4 "t" change.case$ rmbrace.accs } % Dat: ****pts**** get used to it in English...
if$
}
FUNCTION {n.dashify}
{ 't :=
""
{ t empty$ not }
{ t #1 #1 substring$ "-" =
{ t #1 #2 substring$ "--" = not
{ "--" *
t #2 global.max$ substring$ 't :=
}
{ { t #1 #1 substring$ "-" = }
{ "-" *
t #2 global.max$ substring$ 't :=
}
while$
}
if$
}
{ t #1 #1 substring$ *
t #2 global.max$ substring$ 't :=
}
if$
}
while$
}
% Dat: possible months formats in .bib:
% month = jun # "-" # aug, --> "j\'unius--\allowbreak augusztus" !!
% month = jun, --> "j\'unius"
% month = "8~" # feb, --> "február 8."
% month = nov # ", " # dec, --> "november\nobreak\hskip--\allowbreak december"
FUNCTION {format.date}
{ year empty$
{ month empty$
{ "" }
{ "there's a month but no year in " cite$ * warning$
month
}
if$
}
{ month empty$
'year
{ year ".\ " *
month #1 "{ll}{~ff.}" format.name$ % convert "december" -> "december"; "5~december" -> "december~5."
% ^^^ !! convert "janu\'ar--febru\'ar" and "janu\'ar, febru\'ar" to "j--f"...
% ^^^ !! convert . to \hbox{.} at end, to have frenchspacing...
* } % !! date
if$
}
if$
}
FUNCTION {format.btitle}
{ title rmbrace.accs emphasize
}
%** <a> <b> tie.or.space.connect "<b><conc><a>"
%** <conc> is ~ if <b> is long (>=3 normal letters)
FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #3 <
{ "~" }
{ " " }
if$
swap$ * *
}
FUNCTION {numpages.output} { % ****pts****
numpages empty$ 'skip$ {
numpages "p." tie.or.space.connect output
} if$
}
FUNCTION {note.output} { % ****pts****
note empty$ 'skip$ { note rmbrace.accs output.nonnull } if$
}
FUNCTION {either.or.check}
{ empty$
'pop$
{ "can't use both " swap$ * " fields in " * cite$ * warning$ }
if$
}
FUNCTION {format.series} { % ****pts****
series empty$ { "" } {
series
type$ "inproceedings" = type$ "proceedings" = or
{ " kon\-fe\-ren\-cia\-so\-ro\-zat" } { " sorozat" } if$
*
} if$
}
% Dat: INCOLLECTION: number = 23, series = "Fast Computers",
FUNCTION {format.bvolume} { % ****pts****
volume empty$ number empty$ and {
series empty$ 'skip$ { format.series output new.block } if$
% ^^^ Dat: don't emphasize {Osiris kézikönyvek sorozat}, because it's after the book title.
numvolumes empty$ { "" }
{ "\bibNumVolumes {" numvolumes "}." * * } if$ % ****pts****
} {
"numvolumes and volume/number" numvolumes either.or.check
series empty$ 'skip$ { format.series output } if$ % Dat: no new.block
number empty$
{ volume }
{ "volume and number" volume either.or.check number } if$
n.dashify
duplicate$ #-1 #1 substring$ "-" = 'skip$ 'add.period$ if$
"\bibVolume {" swap$ * "}." *
} if$
}
FUNCTION {format.edition}
{ edition empty$
{ "" }
{ output.state mid.sentence =
{ edition rmacc4 "l" change.case$ }
{ edition rmacc4 "t" change.case$ }
if$
add.period$
" kiad." * % Dat: " kiad.": Gyurgyák János: Szerkesztõk és szerzõk kézikönyve, 533. oldal, 2. sor.
}
if$
}
% Dat: `FUNCTION {multi.page.check}' not needed
%** Used by type$ {inbook} and {incollection}
%** English typography has:
%** pages 23--45 (pages={23--45})
%** pp. 23--45. (pages={23--45})
%** p. 23. (pages=={23}: on page 23)
%** p. 234 (numpages=234: the book has 234 pages)
%** Hungarian typography has:
%** 234 p. (numpages=234)
%** 23--45. p (pages={23--45})
%** 23. p. (pages=23)
FUNCTION {format.pages} { % ****pts****
pages empty$
{ "" }
{ pages add.period$ n.dashify "p." tie.or.space.connect }
if$
}
FUNCTION {volume.caption} { % ****pts****
volumeisyearly empty$ { "1" } { volumeisyearly } if$ % default is "1"
"0" = { "k\" quote$ "otet" * * } { "\'evf." } if$
}
FUNCTION {format.vol.num.pages} { % ****pts****
volume duplicate$ empty$ { pop$ "" } {
add.period$
volume.caption % "\'evf."
tie.or.space.connect } if$
year empty$ {
nocheck empty$ { "empty year in " cite$ * warning$ } 'skip$ if$
} {
duplicate$ empty$
{ pop$ format.date add.period$ }
{ " (" * format.date * ")" * } if$
} if$
number empty$ 'skip$ {
duplicate$ empty$ 'skip$ { " " * } if$
volume empty$ nocheck empty$ and { "there's a number but no volume in " cite$ * warning$ } 'skip$ if$
number add.period$ "sz." tie.or.space.connect *
} if$
}
FUNCTION {format.chapter.pages}
{ chapter empty$
{ "" } % 'format.pages
{ chapter
type empty$ { "fejezet" } {
type "subsection" = { "alszakasz" } {
type "subsubsection" = { "alalszakasz" } {
type "chapter" = { "fejezet" } {
type "section" = { "szakasz" } {
type "part" = { "r{\'e}sz" } {
type "appendix" = { "f{\" quote$ "u}ggel{\'e}k" * * } {
type rmacc4 "l" change.case$ } if$ } if$ } if$ } if$ } if$ } if$ } if$
tie.or.space.connect
% Dat: no format.pages here % ****pts****
}
if$
}
FUNCTION {format.in.edited} { % ****pts****
editor "self" = % ****pts****
{ "\bibInSelf0" }
{ "In " format.editors * ": " * } if$
booktitle rmbrace.accs emphasize *
}
FUNCTION {format.in.ed.booktitle} {
booktitle empty$
{ "" }
{ editor empty$
% vvv "In ": Gyurgyák János: Szerkesztõk és szerzõk kézikönyve, 130. oldal, 12. sor.
{ "In " booktitle rmbrace.accs emphasize * }
'format.in.edited if$
} if$
}
INTEGERS { len }
FUNCTION {chop.word}
{ 's :=
'len :=
s #1 len substring$ =
{ s len #1 + global.max$ substring$ }
's
if$
}
%* @param #1 a string beginning with a possibly accented letter
%* @return "" or "z", corresponding to the Hungarian definite article "a" and "az"
FUNCTION {article.az} {
rmacc4 % remove accents smartly
purify$
"l" change.case$
#1 #1 substring$
duplicate$ " " = {"z"} { % hack
duplicate$ "a" = {"z"} {
duplicate$ "e" = {"z"} {
duplicate$ "i" = {"z"} {
duplicate$ "o" = {"z"} {
duplicate$ "u" = {"z"} {
""} if$ }if$ }if$ }if$ }if$ }if$
swap$ pop$
}
%** by [email protected] at Thu Nov 9 17:03:00 CET 2006
%** @example "foo}" split.last.brace "foo" "}"
%** @example "food" split.last.brace "food" ""
FUNCTION {split.last.brace} {
duplicate$ #-1 #1 substring$ "}" =
{ duplicate$ string.length #1 - #1 swap$ substring$ "}" }
{ "" } if$
}
%** by [email protected] at Thu Nov 9 17:03:00 CET 2006
%** Clobbers 'rs and 'ls
%** @example "foobar" "bar" replace.at.end "foo" 1
%** @example "foobar!" "bar" replace.at.end "foobar!" 0
FUNCTION {remove.at.end} {
'rs := % save pattern string % Dat: string.length destroys 'ls
duplicate$ rs string.length #-1 swap$
substring$ rs =
{ duplicate$ string.length rs string.length - #1 swap$ substring$ #1 }
{ #0 } if$
}
FUNCTION {format.in.talked.booktitle} {
booktitle empty$
{ "" }
{ editor empty$
{
booktitle duplicate$ 's :=
"A " swap$ #2 swap$ chop.word
"Az " swap$ #3 swap$ chop.word
%% duplicate$ warning$
s = {
"a" booktitle article.az *
booktitle rmbrace.accs emphasize
tie.or.space.connect
} { booktitle rmbrace.accs emphasize } if$
% Dat: now: "a~{\em Foo Konferencia}"
split.last.brace
swap$
% Dat: now "}" "a~{\em Foo Konferencia"
% vvv Imp: maybe we don't need \- here, because it
% prevents hyphenation in earlier parts of the word
"Conference" remove.at.end { "Con\-fe\-ren\-ce-en" * swap$ * } {
"conference" remove.at.end { "con\-fe\-ren\-ce-en" * swap$ * } {
"Konferencia" remove.at.end { "Kon\-fe\-ren\-ci\'an" * swap$ * } {
"konferencia" remove.at.end { "kon\-fe\-ren\-ci\'an" * swap$ * } {
swap$ * " c{\'i}m{\H u} konferenci{\'a}n" *
} if$ } if$ } if$ } if$
%% duplicate$ warning$
% Dat: now "a~{\em Foo Konferencián}"
% or "a~{\em Foo} címû konferencián"
%% "alma" string.length warning$
"Elhangzott " swap$ *
} 'format.in.edited if$
} if$
}
FUNCTION {empty.misc.check}
{ author empty$ title empty$ howpublished empty$
month empty$ year empty$ note empty$
and and and and and
key empty$ not and
{ "all relevant fields are empty in " cite$ * warning$ }
'skip$
if$
}
%** @param #1 default value for `type'
FUNCTION {format.thesis.type} { % ****pts****
type empty$ 'skip$ { pop$ type } if$
rmacc4 "t" change.case$ rmbrace.accs
}
FUNCTION {format.tr.number} % ****pts****
{ type empty$
{ "{\bibTechRep 0}" } % Dat: `{'..`}' to avoid "t" change.case$
'type
if$
number empty$
{ rmacc4 "t" change.case$ }
{ number add.period$ swap$ tie.or.space.connect }
if$
}
FUNCTION {format.article.crossref}
{ key empty$
{ journal empty$
{ "need key or journal for " cite$ * " to crossref " * crossref *
warning$
""
}
{ "In {\em " journal * "\/}" * }
if$
}
{ "In " key * }
if$
" \cite{" * crossref * "}" *
}
FUNCTION {format.crossref.editor}
{ editor #1 "{vv~}{ll}" format.name$
editor num.names$ duplicate$
#2 >
{ pop$ " \bibEtAl ." * }
{ #2 <
'skip$