summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/camel/law.dtx
blob: b88eb650c37981e06efc3be9e0bb085e21c7a3cc (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\usepackage{camel}
\usepackage{array}

\def\fileversion{0.1d}
\def\filedate{1997/01/09}
\def\docdate {1997/01/09}

\EnableCrossrefs
\RecordChanges                  % Gather update information
\CodelineIndex                  % Index code by line number
%\OnlyDescription  % comment out for implementation details
\let\lawhline=\hline
\begin{document}
\citationstyle{law}
\citationdata{camel}
\title{The {\sc Law} module for the {\sc Camel} Bibliography
  Engine\thanks{%
   This file has version number \fileversion{} dated
   \filedate{}.
   The documentation was last revised on \docdate.
   The documentation and the code for {\sc Camel}
   are \copyright{} 1992--95 Frank Bennett, Jr.  Distribution
   and use are freely welcomed, on the sole condition that
   acknowledgement of the {\sc Camel} package, its {\sc Law}
   module and of their author
   be made in any published using these utilities.
      }}
\author{Frank G Bennett, Jr.\thanks{Lecturer in the Commercial
    Laws of the Far East, School of
    Oriental and African Studies, University of London.
    Acknowledgements of the numerous people who have provided
    comments and suggestions in the development of this module
    and of the {\sc Camel} package itself are listed in the users'
    guide to that software.}}
\maketitle
\DocInput{law.dtx}
\end{document}
%</driver>
% \fi
% \CheckSum{741}
% 
%\iffalse
%
% Copyright (C) 1992-1995 by Frank Bennett.  All rights reserved.
%
% IMPORTANT NOTICE:
% 
% You are not allowed to change this file.  You may however copy
% this file to a file with a different name and then change the
% copy if (a) you do not charge for the modified code, (b) you
% acknowledge Camel and its author(s) in the new file, if it
% is distributed to others, and (c) you attach these same
% conditions to the new file.
% 
% You are not allowed to distribute this file alone.  You are not
% allowed to take money for the distribution or use of this file
% (or a changed version) except for a nominal charge for copying
% etc.
% 
% You are allowed to distribute this file under the condition that
% it is distributed with all of its contents, intact.
% 
% For error reports, or offers to help make Camel a more powerful,
% friendlier, and altogether more thrilling package, please contact me on
% fb@soas.ac.uk
% 
%\fi
%
%
% \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty}
% \DoNotIndex{\@flushglue,\@gobble,\@input}
% \DoNotIndex{\@makefnmark,\@makeother,\@maketitle}
% \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa}
% \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue}
% \DoNotIndex{\@thanks,\@thefnmark,\@topnum}
% \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin}
% \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces}
% \DoNotIndex{\|,\~,\ ,\active,\advance,\aftergroup,\begingroup,\bgroup}
% \DoNotIndex{\cal,\csname,\def,\documentstyle,\dospecials,\edef}
% \DoNotIndex{\egroup}
% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist}
% \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global}
% \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn}
% \DoNotIndex{\ifcase}
% \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item}
% \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower}
% \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing}
% \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc}
% \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut}
% \DoNotIndex{\strutbox}
% \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt}
% \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@}
% \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim}
% \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary}
% \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle}
% \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode}
% \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip}
% \DoNotIndex{\nopagebreak}
% \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle}
% \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb}
% \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar}
% \DoNotIndex{\[,\{,\},\]}
% \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode}
% \DoNotIndex{\baselineskip,\begin,\tw@}
% \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,\m,\n,\o,\p,\q}
% \DoNotIndex{\r,\s,\t,\u,\v,\w,\x,\y,\z,\A,\B,\C,\D,\E,\F,\G,\H}
% \DoNotIndex{\I,\J,\K,\L,\M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z}
% \DoNotIndex{\1,\2,\3,\4,\5,\6,\7,\8,\9,\0}
% \DoNotIndex{\!,\#,\$,\&,\',\(,\),\+,\.,\:,\;,\<,\=,\>,\?,\_}
% \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother}
% \DoNotIndex{\meaning,\newenvironment,\par,\relax,\renewenvironment}
% \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined}
% \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc}
% \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar}
% \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode}
% \DoNotIndex{\lccode,\newtoks,\onecolumn,\openin,\p@,\SelfDocumenting}
% \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf}
% \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse}
% \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault}
% \DoNotIndex{\bfdefault}
% \setcounter{StandardModuleDepth}{1}
% \MakeShortVerb{\"}
% 
% \begin{abstract}
% \noindent The {\tt Law} module for the {\sc Camel} bibliography
% package and \BibTeX{} attempts to implement fully automated typesetting
% of citations in the so-called Blue Book style used in
% the publication of legal materials.  This
% demanding style requires context sensitive
% in-footnote cross-referencing
% between citations.
% \end{abstract}
%
% \noindent An adage in office management is that you should
% only touch incoming paper once; to respond to it, to file
% it, to forward it, or to destroy it.  A number of 
% commercial citation
% database managers provide a facility for ``filing'' citations
% in a flexible form, the idea being to extend this principle
% to citations as well as paper.  A hanging point for this
% strategy as been in-text context-sensitive citation styles.
% Database managers are at their best in exporting 
% entire bibliographies
% and lists of authorities.  Some packages are
% capable of scanning a document for citation ``tags'', 
% which eliminates the need to separately select bibliography
% items in the database.  Some, too, can replace ``tags''
% in the document with the formatted text of a citation.
% But once the text is replaced, the format of citations
% added in this way is fixed; conversion is a one-way process.
%
% A more serious problem is that, while the database manager
% can easily identify the {\em tag}, it is far more difficult,
% without logical markup, to identify its 
% {\em context\/}---whether it occurs in a footnote, how many
% items were in the preceding footnote, how many articles
% by the same author are cited in the document, and so forth.
% As a result, citation formatting of cross-referenced styles
% is still generally done by hand.
%
% One of the most demanding cross-referenced styles is that
% laid down in {\sl A Uniform System of Citation}, or ``the Blue
% Book'', for the citation of legal materials.  This style
% has survived the era of computerization largely because
% most U.S. law journals using the style are edited by highly
% competitive law students.  Staff members contribute their
% editorial time to their journal free of charge, because of
% the value of listing law journal membership on their resume.
% The Blue Book style minimizes the bulk of citation
% text, while conveying sufficient information to the reader
% for the location of cited material.  It is also designed
% to provide all information required for the location of
% {\em primary\/} legal authority from the face of any citation
% to it, without tracing down cross-references.
%
% A first attempt to address this problem was made in 
% the complementary \LexiTeX{}
% and \LexiBib{} packages, for \LaTeX{} and \BibTeX{}
% respectively.  Lessons learned from developing these
% packages suggested that a comprehensive formatting package
% for legal citations could serve as the foundation for
% a modular, highly generalized citation and bibliography
% formatting system.  The logical code from these packages
% was excised and used in the drafting of the {\sc Camel}
% bibliography engine.  The typesetting code was then used
% to assemble the {\sc Law} module for {\sc Camel}.
%
% The implications of such a system are particularly interesting
% if it comes to be widely used in the publication of
% law journals or, even better, in the publication of court
% judgements.  The efficiency with which
% citations can be reported to citation services would be
% increased, since \BibTeX-format database entries
% are in a standard format that can
% be processed electronically.  These same lists could
% be made available as text-searchable databases of authority.
% Network discussions of legal issues could be accompanied by
% growing lists of annotated authority, available for all to
% use.
%
% To use this package, all you should need to do is unpack
% the files by running {\tt law.ins} (thanks to Robin Fairbairns
% for pushing me toward a standard-ish method of installation!),
% copy the style files to their respective homes, and follow the
% markup conventions described in the {\sc Camel} manual.  The
% same should apply to any other bibliography
% modules produced for {\sc Camel} in the future, no matter what
% sort of contortions they put your citation data through before
% they end up on the page.  If it has extensive documentation,
% it's {\em not\/} a {\sc Camel} module!
%
% You are not under an obligation to enjoy this package.  If you
% have complaints, you can contact me on {\tt fb@soas.ac.uk}.
%
%\StopEventually{}
% \section{The style code}
% \subsubsection{Entry type specific functions}
% The functions below should not be used as general utilities;
% they are designed specifically for use with a particular entry
% type.  While they could be placed directly into the entry
% functions to which they apply, defining them separately
% helps improve the transparency of the code.
%
% \DescribeEnv{build.bridges}
% I'm not actually sure whether this function belongs in {\tt
% camel.dtx} or in {\tt law.dtx}.  What it does is to insert (or
% not insert) an appropriate "\bridges" declaration into the {\tt
% .bbl} file for the current citation.  It is governed by a
% string existing on the stack when it is invoked, and leaves
% nothing on the stack.  Toggles are {\tt schedules}, {\tt sections} and {\tt
% articles}.  Season to taste.
%    \begin{macrocode}
%<*bstfunctions>
FUNCTION {build.bridges}
  { duplicate$ empty$
    { pop$ skip$ }
    { duplicate$ "sections" =
      { pop$ "\bridges{\ \S~}{}{\ \S\S~}{\ }{\ \S~}{\ \S\S~}"
      "" "" must.must.must
      }

      { duplicate$ "articles" =
        { pop$
          "\bridges{\ art.~}{}{\ arts.~}{\ }{\ art.~}{\ arts.~}"
          "" "" must.must.must
        }
        { "schedules" =
          { "\bridges{\ sched.~}{}{\ scheds.~}{\ }{\ sched.~}{\ scheds.~}"
            "" "" must.must.must
          }
          'skip$
          if$
        }if$
      }if$
    }if$
 }
%    \end{macrocode}
% \DescribeEnv{get.a.kinda.sort.key}
% It is early days for the sorting of bibliographies in {\sc
% Camel}.  This will give a rough key.
%    \begin{macrocode}
FUNCTION { get.a.kinda.sort.key }
{     author empty$
     { title empty$
       { "0000" }
       { title "*" "forward" gather.chars pop$
         duplicate$ "l" change.letter.case "the" =
         { pop$ "*" "forward" gather.chars pop$ swap$ pop$ }
         { duplicate$ "l" change.letter.case "a" =
           { pop$ "*" "forward" gather.chars pop$ swap$ pop$ }
           { swap$ pop$
           }if$
         }if$
       }if$
     }
     { author #1 "{ll}" format.name$
     }if$
}
%    \end{macrocode}
% \DescribeEnv{j.format.division}
% This function assembles the various fields relevant to the
% division of a Japanese court into a single string.
%    \begin{macrocode}
FUNCTION {j.format.division}
 { division empty$
   'skip$
   { dc.. court "end" first.in.second
     { pop$ " No.~" 's := "endlabel" 't := }
     { pop$ sc.. court "start" first.in.second
       { pop$ "No.\ " 's := "frontlabel" 't := }
       {  pop$ " " 's :=  "endlabel" 't :=
       }if$
     }if$
   }if$
   division s divno t field.tag.no.combine
 }
%    \end{macrocode}
%
% \subsubsection{Entry type functions}
% Now we define the type functions for all entry types that may
% appear
% in the {\tt*.bib} file---e.g., functions like `"article"' and 
% `"book"'.  These
% are the routines that actually generate the "*.bbl" file output
% for
% the entry.  These must all precede the "READ" command.  In
% addition, the
% style designer should have a function `"default.type"' for
% unknown types.\footnote{This comment by Oren Patashnik.}
% 
% \DescribeEnv{article}
% This function performs the necessary operations for
% exporting a valid \LexiTeX\ citation to an article.
% For this and for all citation types defined in the
% \LexiBib{} style, the goal is to provide reasonably
% complete commentary, so that anyone wanting to
% alter the behaviour of the style can set to work
% with a fair degree of confidence about what needs to
% be done to achieve a particular result.
%    \begin{macrocode}
FUNCTION {article}
%    \end{macrocode}
% The "article" entry is used for all kinds of material, so
% it ends up as one of the most complex entries.  Before we
% do anything, we have to check whether the default {\sc Camel}
% bridges are acceptable.  There are two types of situations to watch out
% for.  First, if the volume and the number are both
% non-empty, we need to add a special set of substitute bridges.
% Alternatively, if both "volume" and "number" are empty,
% but the date is more specific than just a year, we
% assume we are dealing with a newspaper.  In either case,
% we use the same special set of bridges.
%    \begin{macrocode}
{ volume empty$ not number empty$ not and
  volume empty$ number empty$ year "mo.dd.yy" format.date
  pop$ itemcount #1 = not and and or
  { "\bridges{,\ p.~}{,\ }{,\ }{\ }{\ at~}{\ at~}" 
    "" "" must.must.must 
    newline$
  }
%    \end{macrocode}
% Second, the {\tt @article} entry type, like many entry types in
% the Blue Book style normally places 
% white space between the title
% and a pinpoint page number.  If the title ends in a numeral
% this will be confusing, so the Blue Book requires that we
% separate the two with a comma in this case.  The following
% adjustment to bridging punctuation accomplishes this purpose.
%    \begin{macrocode}
  { title type.last.char "numeral" =
    { "\bridges{,\ }{,\ }{,\ }{\ }{\ at~}{\ at~}"
      "" "" must.must.must
      newline$
    }
    'skip$
    if$
  }if$
%    \end{macrocode}
% \changes{1995/07/08}{v0.1a}{Function {\tt type.last.char} and
% {\tt\protect\string\protect\bridges} declaration used to handle titles ending
% in a numeral correctly (by the insertion of a comma).  Added to
% the {\tt @article} and {@book} entries as a trial; will
% propagate to other entry types once this change is trusted.}
% Then we write the citation leader, to prepare for outputting the
% actual content of the citation text.
%    \begin{macrocode}
 "\lexibib{article}{" cite$ "}{" must.must.must
 get.a.kinda.sort.key 
 "}{" "" must.must.must 
%    \end{macrocode}
% The author name is pushed to the stack, followed by a toggle
% to trigger last-name-only formatting.  Then the "format.names"
% reduces this to a single, appropriately-formatted string,
% possibly the null string.  All that is left to do is push a
% set a braces, a null string to make up three arguments to the
% export routine, and write the lot on the output
% file unconditionally, using "must.must.must".
%    \begin{macrocode}
author  "lastonly" format.names
"}{"
""
must.must.must
%    \end{macrocode}
% Next comes the title of the article.  This is not specially
% formatted; we simply push the title field, then a warning
% string
% followed by a check for whether it is empty or not, then
% braces and a null string, and write again.
%    \begin{macrocode}
title "title" check
"}{"
""
must.must.must
%    \end{macrocode}
% The next bit is actually rather thorny.  There are three
% possible cases.  The first is where both a volume number
% and an issue number exist.  In this case, we use a
% verbose form of reference. In the second, there is no
% volume number, but possibly an issue number.  This is
% the proper form for Commonwealth legal materials,
% and requires the year in brackets, followed by the 
% issue number to show the volume within the year.
% Third, we may simply have a volume number by itself.
% This calls for the citation form for most journals,
% and U.S. case reporters.
%    \begin{macrocode}
  volume empty$ not number empty$ not and
  { journal "journal" check ", v.~" volume must.must.must
    ", n.~" number "}{" must.must.must }
  { volume empty$ not
    { volume "\ " journal "journal" check empty.to.null
      might.ifone.must
      "}{" "" "" must.must.must}
    { year "mo.dd.yy" format.date itemcount #1 =
      { "[" swap$ "] " iftwo.might.iftwo
      number "\ " journal "journal" check might.ifone.must
      "}{" "" "" must.must.must}
      { pop$ number empty$
        { "\\" journal "journal" check "\\" must.must.must
          "}{" "" "" must.must.must }
        { number "\ " journal "journal" check might.ifone.must
          "}{" "" "" must.must.must
        }if$
      }if$
    }if$
  }if$ 
%    \end{macrocode}
% The Blue Book does not like page ranges
% so we need to clean
% out anything following a dash in the "pages" field.  The
% "short" option
% toggles this behaviour on.  We also check to see that the page
% is not empty.  This is followed by braces, a null string, and
% output.
%    \begin{macrocode}
pages "short" format.pages "pages" check
"}{"
""
must.must.must
%    \end{macrocode}
% We add the year next, but only if the "volume" field is
% non-empty (if "volume" is empty, we'll have put the year
% is as a bracketed volume number, Commonwealth-style.
% We could use just the year (this is normal for Blue Book
% style, but we'll add the month for good measure, if it's
% been provided in the "year" field.
%    \begin{macrocode}
volume empty$ not
  { "(" "" "" must.must.must
    publisher ":\ " "" might.ifone.must
    "" year "mo.dd.yy" format.date ")" must.must.must }
  { year "mo.dd.yy" format.date itemcount #1 =
    'pop$
    { "" "" must.must.must
    }if$
  }if$
%    \end{macrocode}
% Finally, we have to tangle with cross-references.
% Yuck.  (Not a complaint about \BibTeX, just a general
% response to the design problems inherent in the task).
% Formatting depends on whether there is a "crossref" entry.
% Hear that, guys?  If you don't use the "crossref" field,
% we'll short-change you on formatting service.
%    \begin{macrocode}
crossref empty$
%    \end{macrocode}
% If there is no "crossref", we just push a brace and a couple
% of nulls, and write.  Done!  Hurray!
%    \begin{macrocode}
{ "}" "" "" must.must.must }
%    \end{macrocode}
% But if there {\em was\/} a "crossref", we've got work to do.
% Darn.  The first thing we do is have a look at "booktitle".
% This should be non-null in this situation; there's no sense
% setting up a cross-reference to an individual volume of
% a journal unless there's something special to be said
% about it.
%    \begin{macrocode}
{ booktitle empty$
%    \end{macrocode}
% So if no "booktitle" is found, we whinge and format
% as for a no-cross-reference entry.
%    \begin{macrocode}
  { "no booktitle (name of special issue) for "
     cite$ "/" crossref ".  Why a crossref?" * * * * warning$
    "}" "" "" must.must.must }
%    \end{macrocode}
% If there {\em is\/} a "booktitle", though, 
% and if the "volume" field is non-empty (which
% means that we just printed, or at least should
% have printed, the year), we close the
% parens following the year (which is opened by \LexiTeX),
% and open another (which will be closed by \LexiTeX).
% That's it for conditional punctuation; we follow
% with "booktitle", which should be 
% the title or subject description of the special
% issue of the journal.
%    \begin{macrocode}
  { volume empty$ {""} {") ("} if$ booktitle "}" must.must.must}
  if$
}if$
%    \end{macrocode}
% Add a fresh new line in the export file, and we're done!  Whew!
%    \begin{macrocode}
newline$
}
%    \end{macrocode}
%
% \DescribeEnv{book}
% This is the entry for books, which includes individual
% volumes in a series, and multi-volume works with a single
% title.  Correct me if I'm wrong, but I think this latter
% citation type is not supported by \BibTeX.  \LexiBib{}
% manages it by allowing the user to specify the volume
% number in the text using the optional ":<number>:" argument to
% the "\lexicite" tag.
%    \begin{macrocode}
FUNCTION {book}
%    \end{macrocode}
% This entry type normally places white space between the title
% and a pinpoint page number.  If the title ends in a numeral
% this will be confusing, so the Blue Book requires that we
% separate the two with a comma in this case.  The following
% adjustment to bridging punctuation accomplishes this purpose.
%    \begin{macrocode}
{ title type.last.char "numeral" =
    { "\bridges{,\ }{}{,\ }{\ }{\ at~}{\ at~}"
      "" "" must.must.must
      newline$
    }
    { units empty.to.null "paras" =
      { "\bridges{,\ para.~}{}{,\ paras.~}{\ }{,\ para.~}{,\ paras.}"
        "" "" must.must.must
        newline$
      }
      'skip$
      if$
    }if$
%    \end{macrocode}
% Next, after the opener, we push the opening macro tag for a book
% entry, the nickname of the citation, and a couple of
% braces.  This is all mandatory and can safely be given
% unconditional export.
%    \begin{macrocode}
  "\lexibib{book}{" cite$ "}{" must.must.must
   get.a.kinda.sort.key "" "}{" must.must.must
%    \end{macrocode}
% A non-empty "volume" field means we need a leading
% volume number in the Blue Book style.  If a volume
% number (or anything else) is found in the "volume"
% field of a book entry, we replace it with a 
% "volno" macro.  This will expand in the document to
% whatever the author has specified using the optional
% ":<number>" argument to "\lexicite".  For example,
% volume 8 of "holdsworth" would be: "\lexicite:8:{holdsworth}".
%    \begin{macrocode}
  volume empty$
  { "" }
  { "\volno\ " }
  if$
%    \end{macrocode}
% The author comes first.  We push the contents of the
% "author" field, then the toggle string ``"firstinitial"'',
% and run  the "format.names" function to produce the name
% formatted properly for a book entry.  Then we push
% fa couple of braces
% and force all three items ("\volno" or null, "author", and
% braces) onto the output.
%    \begin{macrocode}
  author
  "firstinitial" format.names "}{" must.must.must
%    \end{macrocode}
% The title may be a simple name for a single volume,
% or it may be in title/subtitle format.  Title/subtitle
% can be written into the "title" entry directly as
% ``\meta{title}: \meta{subtitle}''.  We provide for
% an alternative form here, just in case "booktitle"
% is used for the main title --- conservation of
% data.  If there is no "booktitle", we push the title, then
% check to be sure it's non-empty, then write it onto output.
% If "booktitle" exists, we push it, then a colon, then
% "title", followed by a conditional write on output that
% will suppress the colon if "title" is empty.
% Finally, we push the closing braces and an opening
% parens (for the year info) and write that stuff on output.
%    \begin{macrocode}
  booktitle empty$
    { title "title" check "" ""  must.must.must }
    { booktitle ": " title must.ifthree.might
    }if$
  type empty.to.null "cmnd" =
  type empty.to.null "command" =
  type empty.to.null "command papers" =
  or or
  { ", " year "mo.dd.yy" format.date
    ", " "Cmnd. "
    * * *
    series empty$
    { "no.~" }
    { "Ser.~" series ", No.~" * *
    }if$
  number "number" check
   * *
   "" "" must.must.must
   }
   'skip$
   if$
  "}{}{}{" "(" "" must.must.must
%    \end{macrocode}
% We're now in the final ``field'' of the \LexiTeX{} entry.
% This is mainly for the year, but we also give the 
% name of the editor(s) or translator(s) 
% if present.  If there is no
% editor or translator, we'll put a series name here, to help identify
% the source.  We don't put both, because this would
% confuse things (there can be book editors and
% series editors too, and the Blue Book style is 
% too streamlined to distinguish the two elegantly).
% So our first task is to see if there is an editor\ldots
%    \begin{macrocode}
    editor empty$ translator empty$ and
%    \end{macrocode}
% \ldots{} and if there is none, we put in a
% series name if it exists.  
% The "series" \BibTeX{} field should be used for the
% name of the series of which a volume forms a part,
% but some folks might accidentally use "booktitle".
% We'll be forgiving and accept it anyway.
%    \begin{macrocode}
    { series empty$
%    \end{macrocode}
%  If both
% "series" is empty, we've nothing to do.
%    \begin{macrocode}
      'skip$
%    \end{macrocode}
%
% If "series" exists, we push it, followed by
% a bridge and a series item number,
% and a toggle for the "field.tag.no.combine" function.
% The "endlabel" toggle causes this function to put
% the bridge and the number after the series name,
% if a number exists, and push the lot back as a single
% item on the stack.  Otherwise it leaves just the series
% name.
%
% And last, we put up a comma to close, and do a mandatory
% export of the lot.
%    \begin{macrocode}
      { series " No.~" number
      "endlabel" field.tag.no.combine ", " "" must.must.must }
      if$
    }
%    \end{macrocode}
% If either the editor or the translator fields were not empty,
% we format the editor or translator name
% instead, and put those details here.
%    \begin{macrocode}
    { editor translator either.or "firstinitial" format.names
%    \end{macrocode}
% We need to append the correct designator, either ``ed.''\ or
% ``trans.''.  The "either.or" function will use the second
% item pushed if both are non-empty, so we take advantage of
% this ``feature'' in making our choice of designators; the
% "ed." or "eds." strings are only used if the "translator"
% field is empty.  And finally, we push a null string to
% round out, and do a compulsory export.
%    \begin{macrocode}
      translator empty$
      { editor num.names$ #1 >
        { " eds.\ " }
        { " ed.\ " }
        if$
      }
      { " trans.\ " }
      if$
      "" must.must.must
    }if$
%    \end{macrocode}
% We also need to indicate the edition, if any.
%    \begin{macrocode}
  edition " ed.\ " "" might.ifone.must
%    \end{macrocode}
% The year itself is easy.  We push the year, do a check to issue
% a warning if necessary, then run format.date over it,
% which yields the year in "theyear", which can be pushed
% back onto the stack.  Then we fill out to six
% \LexiTeX{} fields in
% all, and do a compulsory export.
%    \begin{macrocode}
  type empty.to.null "cmnd" =
  type empty.to.null "command" =
  type empty.to.null "command papers" =
  or or
  { "" }
  { year "mo.dd.yy" format.date
  }if$
  ")}" "" must.must.must
%    \end{macrocode}
% A new line for a new macro, and we're done!  Rejoice!
% On to the next function definition!
%    \begin{macrocode}
  newline$
}
%    \end{macrocode}
%
% \DescribeEnv{incollection}
% This is for those nasty entries that are created when someone
% publishes an article in a collection of essays edited by someone
% else.
%    \begin{macrocode}
FUNCTION{incollection}
{ "\lexibib{incollection}{" cite$ "}{" must.must.must
   get.a.kinda.sort.key "" "}{" must.must.must
  author "lastonly" format.names "author" check
  "}{" "" must.must.must
  title "title" check
  "}{" "" must.must.must
  chapter empty$
    { "\\in \\" }
    { "\\" type empty$
      { "chapter " chapter "chapter" check " of \\" * * * }
      { type " " chapter "chapter" check " of \\" * * * * 
      }if$
    }if$
  booktitle "booktitle" check
  "}{" must.must.must
  pages "short" format.pages "pages" check
  "}{" "(" must.must.must
% We're now in the final ``field'' of the \LexiTeX{} entry.
% The coding here is the same as for a "book" entry; the
% reader is referred to that entry for the commentary
% on the following code.
%    \begin{macrocode}
    editor empty$ translator empty$ and
    { series empty$
      'skip$
      { series " No.~" number
      "endlabel" field.tag.no.combine ", " "" must.must.must }
      if$
    }
    { editor booktranslator either.or "firstinitial" format.names
      booktranslator empty$
      { editor num.names$ #1 >
        { " eds.\ " }
        { " ed.\ " }
        if$
      }
      { " trans.\ " }
      if$
      "" must.must.must
    }if$
  edition " ed.\ " "" might.ifone.must
  year "mo.dd.yy" format.date ")}" "" must.must.must
  newline$
}
%    \end{macrocode}
% \DescribeEnv{inbook}
% There is significant massaging of the use to which
% "title" and "booktitle" is put here.  If both occur,
% but are different, the form is ``"title" in "booktitle"'',
% or ``"title", chapter X of "booktitle"''.
% If both occur, but are the same, the treatment depends
% on whether "chapter" occurs.  If it does not occur,
% the style complains --- an "@inbook" entry should always
% refer to a chapter or other specific unit if the
% "title" and "booktitle" are the same.  If it does occur,
% then the chapter or other specifier is treated as a
% volume number inserted as an option to "\source" using "v=",
% the "title" being inserted as the title of the work.
%    \begin{macrocode}
FUNCTION{inbook}
{ "\lexibib{inbook}{" cite$ "}{" must.must.must
  get.a.kinda.sort.key "" "}{" must.must.must
  author "firstinitial" format.names "author" check
  "}{" "" must.must.must
  title booktitle =
    { chapter empty$
      { "no chapter or separate title for inbook entry " cite$ * warning$
      }
      { "{\rm " "Chapter" type either.or.nowarning 
        " " chapter " of} " * * * *
      }if$
    }
    { ""
    }if$
  title "title" check
  "}{" must.must.must
  title booktitle =
    { "" }
    { chapter empty$
      { "{\rm in} " }
      { type empty$
        { "{\rm Chapter " chapter " of} " * * }
        { "{\rm " type " " chapter " of} " * * * *
        }if$
      }if$
    }if$
  booktitle "booktitle" check
  "}{" must.must.must
  pages "short" format.pages "pages" check
  "}{" "(" must.must.must
% We're now in the final ``field'' of the \LexiTeX{} entry.
% The coding here is the same as for a "book" entry; the
% reader is referred to that entry for the commentary
% on the following code.
%    \begin{macrocode}
    translator empty$
    { series empty$
      'skip$
      { series " No.~" number
      "endlabel" field.tag.no.combine ", " "" must.must.must }
      if$
    }
    { translator "firstinitial" format.names
      " trans.\ "
      "" must.must.must
    }if$
  edition " ed.\ " "" might.ifone.must
  year "mo.dd.yy" format.date ")" "}" must.must.must
  newline$
}
%    \end{macrocode}
%
%    \begin{macrocode}
FUNCTION{booklet}
{ "\lexibib{booklet}{" cite$ "}{" must.must.must
  get.a.kinda.sort.key "" "}{" must.must.must
  author "full" format.names "}{" "" must.must.must
  "\\" title "\\}{}{}{(" must.must.must
  howpublished ", " "" might.ifone.must
  year "mo.dd.yy" format.date
  ")}" "" must.must.must
  newline$
}
%    \end{macrocode}
% \changes{1994/12/12}{1.0g}{Added the `techreport' function,
% to support draft article sent to Pedro Aphalo for comments.}
%    \begin{macrocode}
FUNCTION {techreport}
{"\lexibib{techreport}{" cite$ "}{" must.must.must
  get.a.kinda.sort.key "" "}{" must.must.must
  institution author either.or.nowarning
  "full" format.names "author & institution" check
  "}{" title "title" check must.must.must
  "}{}{}{" "(" "" must.must.must
  author empty$
    'skip$
    {institution "\ "  "" might.ifone.must
    }if$
  type empty$
    { "Technical report" }
    { type
    }if$
  type empty.to.null "Cmnd" =
  { "\ " }
  { " No.~" 
  }if$
  number "endlabel" field.tag.no.combine
  ", " "" must.must.must
  year "mo.dd.yy" format.date
  "" ")}" must.must.must
  newline$
  }
%    \end{macrocode}
%    \begin{macrocode}
FUNCTION {mastersthesis}
{"\lexibib{mastersthesis}{" cite$ "}{" must.must.must
   get.a.kinda.sort.key "}{" "" must.must.must
  author
  "full" format.names "author" check
  "}{" title "title" check must.must.must
  "}{}{}{("
  type empty$
    { "Master's Thesis" }
    { type
    }if$
  ", " must.must.must
  institution "institution" check ", " "" might.ifone.must
  year "mo.dd.yy" format.date
  ")" "}" must.must.must
  newline$
  }
%    \end{macrocode}
%
% \paragraph{Cases} Law cases are all entered using the
% {\tt @CASE} entry type.  The formatting of citations
% varies from jurisdiction to jurisdiction, so the behaviour
% of citations of this type is controlled via a "jurisdiction"
% field.  Supported jurisdictions are listed in the user
% guide.  Below, the functions for each jurisdiction are
% defined first, followed by the "case" function itself.
%
%    \begin{macrocode}
FUNCTION {clear.cite.vars}
 { 
"" 'volume.var :=
"" 'number.var :=
"" 'journal.var :=
"" 'pages.var :=
"" 'year.var :=
 }
FUNCTION {case}
%    \end{macrocode}
% Like the "article" entry, the "case" entry must make some
% pretty fine decisions about how to format material
% fed to it.  As a consequence, it is complex, but similar
% to the "article" entry in many particulars.
%    \begin{macrocode}
{ cites empty.to.null "=" *
  journal empty$
  { parse.one.cite }
  { volume empty.to.null 'volume.var :=
    number empty.to.null 'number.var :=
    journal 'journal.var :=
    pages empty.to.null 'pages.var :=
    year empty.to.null 'year.var :=
  }if$
  volume.var empty$ not number.var empty$ not and
  { "\bridges{,\ p.~}{,\ }{,\ }{\ }{\ at~}{\ at~}"
    "" "" must.must.must
    newline$ }
  'skip$
  if$
 "\lexibib{case}{" cite$ "}{" must.must.must
  get.a.kinda.sort.key "" "}{}{" must.must.must
  title empty$
  {  "Decision of the " court "court" check "" must.must.must
      " (" j.format.division ")" iftwo.might.iftwo
      ", " "" "" must.must.must
      casedate "month.dd.yy" format.date "" "" must.must.must
      "}{" "" "" must.must.must
  }
  { title "}{" "" must.must.must }
  if$
  volume.var empty$ not number.var empty$ not and
  { journal.var "journal" check ", v.~" volume.var must.must.must
    ", n.~" number.var "}{" must.must.must }
  { volume.var empty$
    { "[" year.var "mo.dd.yy" format.date "] " iftwo.might.iftwo
      number.var "\ " journal.var "journal" check might.ifone.must
      "}{" "" "" must.must.must }
    { volume.var "\ " journal.var "journal" check empty.to.null
      might.ifone.must
      "}{" "" "" must.must.must
    }if$
  }if$
pages.var "short" format.pages "pages" check
"}{"
"("
must.must.must
volume.var empty$
  'skip$
  { year.var "mo.dd.yy" format.date "" "" must.must.must
  }if$
crossref empty$
{ ")}" "" "" must.must.must }
{ booktitle empty$
  { "no booktitle (name of special issue) for "
     cite$ "/" crossref * * * warning$
    ")}" "" "" must.must.must }
  { volume.var empty$ {""} {") ("} if$ booktitle "}" must.must.must}
  if$
}if$
{ duplicate$ "=" = not }
{ parse.one.cite
  "={" "" "" must.must.must
  volume.var empty$ not number.var empty$ not and
  { journal.var "journal" check ", v.~" volume.var must.must.must
    ", n.~" number.var "}{" must.must.must }
  { volume.var empty$
    { "[" year.var "mo.dd.yy" format.date "] " iftwo.might.iftwo
      number.var "\ " journal.var "journal" check might.ifone.must
      "}{" "" "" must.must.must }
    { volume.var "\ " journal.var "journal" check empty.to.null
      might.ifone.must
      "}{" "" "" must.must.must
    }if$
  }if$
pages.var "short" format.pages "pages" check
"}{"
""
must.must.must
volume.var empty$
  'skip$
  { "(" year.var "mo.dd.yy" format.date ")" must.must.must
  }if$
crossref empty$
{ "}" "" "" must.must.must }
{ booktitle empty$
  { "no booktitle (name of special issue) for "
     cite$ "/" crossref * * * warning$
    "}" "" "" must.must.must }
  { volume.var empty$ {""} {") ("} if$ booktitle "}" must.must.must}
  if$
}if$
}while$
pop$
clear.cite.vars
newline$
annote empty.to.null write$ newline$
}
%    \end{macrocode}
% The following item adds annotations; this may be eliminated by
% stripping with "noannotes".
%    \begin{macrocode}
%<*!noannotes>
% annote empty.to.null write$ newline$
%</!noannotes>
% }
%    \end{macrocode}
%
% \DescribeEnv{j.statute}
% This function applies to Japanese statutory materials.
% \changes{1994/08/03}{v0.1c}{Added support for Japanese statutes.}
%    \begin{macrocode}
FUNCTION {j.statute}
 { "\lexibib{jstatute}{" cite$ "}{" must.must.must
   get.a.kinda.sort.key "" "}{}{" must.must.must
   title "title" check empty.to.null "}{}{}{" "" must.must.must
   title empty$ {""} {"("} if$
   "" "" must.must.must
   number empty$
     'skip$
     { type empty$
       { "Law" }
       { type
       }if$
       "\ no.~" *
       number "number" check " of "
       iftwo.might.iftwo
     }
     if$
   year "yy" format.date 
   title empty$ {""} {")"} if$
   "}" must.must.must
   newline$
 }
%    \end{macrocode}
%
% \DescribeEnv{s.statute}
% This function formats a statute entry for Singapore.
%    \begin{macrocode}
FUNCTION { s.statute }
{ "\lexibib{statute}{" cite$ "}{" must.must.must
   get.a.kinda.sort.key "" "}{}{" must.must.must
  title "title" check ", No.~" number
  "endlabel" field.tag.no.combine
  number empty$
    { "\ " * }
    { "\ of " * }
    if$
  year "mo.dd.yy" format.date "}{}{}{}" must.must.must
  newline$
}
%    \end{macrocode}
%    \begin{macrocode}
FUNCTION { e.statute }
{ "\lexibib{statute}{" cite$ "}{" must.must.must
   get.a.kinda.sort.key "" "}{}{" must.must.must
  title "title" check "\ " 
  year "mo.dd.yy" format.date must.must.must
  "}{}{}{}" "" "" must.must.must
  newline$
}
%    \end{macrocode}
%
% \DescribeEnv{statute}
% This function selects the correct statute entry function.
%    \begin{macrocode}
FUNCTION { statute }
 { type build.bridges
   jurisdiction empty.to.null duplicate$
   "japan" =
   { pop$ j.statute }
   { duplicate$ "singapore" =
     { pop$ s.statute }
     { duplicate$ "england" =
       { pop$ e.statute }
       { pop$ "IMPORTANT: unknown jurisdiction for " cite$ * warning$
       }if$
     }if$
   }if$
 }
%    \end{macrocode}
%
% \DescribeEnv{unpublished}
%
% A hastily drafted function type for unpublished materials.
%
%    \begin{macrocode}
FUNCTION {unpublished}
{ "\lexibib{book}{" cite$ "}{" must.must.must
   get.a.kinda.sort.key "" "}{" must.must.must
  author "firstinitial" format.names "}{" "" must.must.must
  title "title" check "" ""  must.must.must
  "}{}{}{" "(" "" must.must.must
   note
  ")}" "" must.must.must
  newline$
}
%    \end{macrocode}
%
% \DescribeEnv{default.type}
% We use the "book" type as our default type.  When "manual" is
% completed, we should probably use that type instead.
%    \begin{macrocode}
FUNCTION {default.type} { book }
%</bstfunctions>
%    \end{macrocode}
%
% 
% \subsection{Macro definitions}
% We don't define any macros for abbreviating law journal
% names.  Instead, we will use Blue Book abbreviations
% ``native'', with a special syntax (probably the full
% form in syntax: 
% ``"\gobble{Accountant}{}"'' immediately after
% the abbreviation) for resolving
% ambiguous abbreviations.  Meanwhile, trust me: use the
% Blue Book abbreviations and take this upcoming facility
% on faith.  And besides, do you ever {\em need\/} to spell
% out journal and reporter names?
%
% \subsection{Execution}
% With all preliminaries out of the way, our first act is
% to read in the entries from {\tt *.bib}..
%    \begin{macrocode}
%<*bstfunctions>
READ
%    \end{macrocode}
% Then we say ``Hi'' to the user.  It would be nice to make this
% the first message, but the structure of \BibTeX{} style files
% dictates that it will follow any warnings about missing
% entries.
%    \begin{macrocode}
EXECUTE {hello}
%</bstfunctions>
%    \end{macrocode}
% \section{Camel style code}
%    \begin{macrocode}
%<*lawcitestyle>
\ProvidesFile{law.cst}[1995/01/08]
%    \end{macrocode}
% \subsection{Word list}
% A list of inter-words and their corresponding expansions
% must be provided.
%    \begin{macrocode}
{\catcode`\_=13%
 \catcode`\^=13%
\gdef\@law@wordlist{%
  \\{\item}{\item}%
  \\{and}{_\ ^And }%
  \\{but-see}{_\ ^But see }%
  \\{,}{_; }%
  \\{;}{_; }%
  \\{:}{_; }%
  \\{eg}{_; ^E.g.~}%
  \\{accord}{_; ^Accord }%
  \\{see}{_; ^See }%
  \\{see-also}{_; ^See also }%
  \\{cited-in}{ cited in }%
  \\{citing}{ citing }%
  \\{cf}{_; ^Cf.~}%
  \\{compare}{_; ^Compare }%
  \\{with}{ with }%
  \\{contra}{_; ^Contra }%
  \\{but-cf}{_\ ^But cf.~}%
  \\{see-generally}{_. See generally }%
  \\{affirmed}{_, ^aff'd }%
  \\{reprinted-in}{_; ^Reprinted in }%
  \@law@nomatch}
}
%    \end{macrocode}
%
% \subsection{Print routines}
% Every ".cst" file must define a "\@law@print" macro.
% This is the macro that prints the citation, both in the
% text of the document and in the bibliography.
% The toggles set by the {\sc Camel} engine allow
% a high degree of refinement in the formatting of
% citations.  For the styles currently used in
% publishing with \LaTeX{}, relatively little of this
% power is required.  In-document citation styles
% are much more demanding; if you digest the operation
% the following "\@law@print" macro, which is suitable for
% formatting legal citations, you will find the drafting
% of author-date styles and the like quite straightforward
% by comparison.
%    \begin{macrocode}
\gdef\@law@print{%
%    \end{macrocode}
% In this particular style, a long citation (for the
% bibliography, for example) and a first in-text citation
% are identical.  These forms have separate toggles, so
% we start by equating them.
%    \begin{macrocode}
  \xdef\@law@argtwolist{\the\@ltok@argtwo}%
  \if@law@firstuseofcite\@law@longcitetrue\fi%
%    \end{macrocode}
% This toggles the printing on and off.  This toggle is
% set by the "n" option to the "\source" command.
%    \begin{macrocode}
\if@law@printcite%
  \begingroup%
  \def\@law@firstslash{\begingroup\def\\{\@law@secondslash}%
   \the\ltokspecialface}%
  \def\@law@secondslash{\endgroup\def\\{\@law@firstslash}}%
  \def\\{\@law@firstslash}%
%    \end{macrocode}
% There are two halves to the macro; one for long cite forms,
% the other for short.  Long cite forms are in the first
% half.
%    \begin{macrocode}
\if@law@longcite%
%    \end{macrocode}
% Long citations are pretty straightforward; we've gathered all
% the information we needed; now we just need to plunk it
% all down in order, pretty much.
% First to print is the author field (the second argument to the
% citation declaration command), followed by the
% author-to-title punctuation bridge.  The enclosing
% braces limit the scope of the special active character
% definitions of "^", "_" and "|".
%    \begin{macrocode}
 \global\ltokspecialface=\@ltok@authoroptionface%
 {\the\@ltok@authormainface%
 \@law@barinfull\the\@ltok@author}\the\@ltok@atot%
%    \end{macrocode}
%  Next comes similar treatment for the title.
%    \begin{macrocode}
 \global\ltokspecialface=\@ltok@titleoptionface%
 {\the\@ltok@titlemainface%
 \@law@barinfull\the\@ltok@name}\the\@ltok@ttocone%
%    \end{macrocode}
%    \begin{macrocode}
  \@law@longrecurse%
%    \end{macrocode}
% This else marks the boundary between long-form citations
% (which we have seen are relatively simple to print)
% and short-form citations (which are rather complex).
% This "\else" matches the "\if@law@longcite" conditional.
%    \begin{macrocode}
\else%
%    \end{macrocode}
% The footnote number and the accompanying bridge
% should not appear in a short-form citation if
% the citation being printed first occurred in the
% current footnote.  Rather than suppressing printing,
% we just set the relevant tokens to nil.
%    \begin{macrocode}
  \ifnum\the\@ltok@pageorfootno=\the\c@law@footnote\relax%
    \xdef\@law@temp{\the\@ltok@whereitsat}%
    \xdef\@law@temptwo{\the\@ltok@infoot}%
    \ifx\@law@temp\@law@temptwo%
     \global\@ltok@whereitsat{}%
     \global\@ltok@pageorfootno{}%
    \fi%
  \fi%
%    \end{macrocode}
% Special forms of tidying-up may be appropriate to
% each of the four classes of citation.  An appropriate
% cleaning macro is called here.
%    \begin{macrocode}
\csname @law@\the\@ltok@citetype preformat\endcsname%
%    \end{macrocode}
% If it has been found that the same citation has been
% used immediately previous to this instance,
% we use {\em Id.}  If the "\@justabove" test showed
% that {\em Id.} by itself is appropriate, we prepare
% to eat any period immediately following the citation
% macro.  Otherwise, we tack on the pinpoint reference
% and its accompanying bridge.  A fail-safe conditional
% reverts to the original plan if the pinpoint reference
% is empty.
%    \begin{macrocode}
  \if@justabove%
   {\def\,{,}%
    \Id%
     \if@l@quiteexact%
      \gdef\@law@gobble{\@ifnextchar.{\@gobble}{}}%
     \else%
      \ifcat$\the\@ltok@argtwo$%
        \gdef\@law@gobble{\@ifnextchar.{\@gobble}{}}%
      \else%

        \the\@ltok@atbridge{\@law@barkill\the\@ltok@argtwo\relax}%
        \@law@fetchparas%
        \@law@shiftparas%
        \@law@shortrecurse%
      \fi%
     \fi}%
%    \end{macrocode}
% If {\em Id.} was not called for, we have to create
% a proper short-form reference.  This "\else" corresponds
% with the "\@justabove" toggle, above.
%    \begin{macrocode}
  \else%
%    \end{macrocode}
% The author will be used in any case.  Note that the author
% and its following bridge may have been set to nil, above.
%    \begin{macrocode}
   \global\ltokspecialface=\@ltok@authoroptionface%
   {\the\@ltok@authormainface%
%  print whatever there if for the author
   \@law@barinshort\the\@ltok@author}\the\@ltok@atot%
%    \end{macrocode}
% The title information is also used, if it is present.
%    \begin{macrocode}
   \global\ltokspecialface=\@ltok@titleoptionface%
   {\the\@ltok@titlemainface%
%    \end{macrocode}
% If we have specified a nickname for this cite for
% `hereinafter' references, we use it instead of the
% title of the work.
%<*parabeta>
[Some day this might be hooked up.]
%</parabeta>
%    \begin{macrocode}
   \@law@barinshort\the\@ltok@name}%
%    \end{macrocode}
% At this point, we must make decisions concerning whether
% to use the {\em supra\/} cross-referencing form.  This
% depends on the type of citation we are working on.
% The "\@nosupra" condition is set to true if we are working
% on a case or a statute, otherwise it is set to false.
%    \begin{macrocode}
   \xdef\@law@temp{\the\@ltok@citetype}%
    \ifx\@law@temp\@law@case%
     \@nosupratrue%
    \else%
      \ifx\@law@temp\@law@statute%
       \@nosupratrue%
      \else%
       \@nosuprafalse%
      \fi%
    \fi%
%    \end{macrocode}
% Now we put the result of the above test to work.
% First, the citation form for cases or statutes, which
% do not permit the {\em supra\/} form.
%    \begin{macrocode}
    \if@nosupra%
%    \end{macrocode}
%    \begin{macrocode}
     \the\@ltok@ttocone%
     \@law@shortprint%
     \@law@shortrecurse%
    \else%
     \supra\the\@ltok@whereitsat\the\@ltok@pageorfootno%
     \the\@ltok@atbridge%
     {\def\,{,}%
     {\@law@barkill\the\@ltok@argtwo\relax}}%
    \fi%
%    \end{macrocode}
% In order, these close "\if@justabove", "\if@law@longcite"
% and "\if@law@printcite".
%    \begin{macrocode}
     \xdef\@law@temp{\the\@ltok@citetype}%
      \ifx\@law@temp\@law@statute%
       \ifcat$\the\@ltok@citefirst$%
         \the\@ltok@ptoctwo{\@law@barinshort\the\@ltok@citelast}%
       \fi%
      \fi%
  \fi%
\fi%
\endgroup%
\fi%  <- end of if@law@printcite
%    \end{macrocode}
% The "\@law@gobble" here will consume a period inserted
% automatically after a forced footnote, if the printed
% form turned out to be an {\em Id.}.  See the concluding
% code of "\@law@setup".
% \changes{1994/07/26}{2.0c}{Moved {\tt\protect\string%
% \protect\@law@forcingfalse} outside of a conditional
% expression at the end of the print routine, to correct
% the failure of the forcing mechanism to work more than once.}
% \changes{1994/12/14}{2.0l}{Fairly drastic simplification
% of the forcing mechanism, in the course of providing for
% unified handling of citation strings.  Code now much
% easier to follow.}
% \changes{1996/03/09}{0.1c}{Corrected a fatal bug in the
% parallel pinpointing mechanmism.  This required changes to both
% Camel and the Law module; the list macro of pinpoints was
% being parsed in both!}
%    \begin{macrocode}
\global\@law@longcitefalse\gdef\volno{\message{(No volume %
    for \the\@ltok@nickname)}}}%
%    \end{macrocode}
% \begin{macro}{\@law@longrecurse}
% This macro prints the tail end of long citations until
% parallels are exhausted.
%    \begin{macrocode}
\def\@law@longrecurse{%
  \@law@longprint%
  \ifnum\the\c@law@parapin>0\relax%
    \loop%
      \addtocounter{law@paracounter}{1}%
    \ifnum\the\c@law@paracounter<\the\c@law@parapin\relax%
      ; \@law@longprint%
    \repeat%
  \else%
    \loop%
      \addtocounter{law@paracounter}{1}%
    \ifnum\the\c@law@paracounter>\the\c@law@paranormal\relax%
    \else%
      ; \@law@longprint%
    \repeat%
  \fi%
%    \end{macrocode}
%
% \textit{Finally, we print the last date item, which might
% be blank if it's already been printed inside "\@law@longprint".}
% \changes{1997/01/09}{v2.0m}{Fixed loss of citelast in parallel citations.}
%
%    \begin{macrocode}
  \@law@temp}
\def\@law@shortrecurse{%
  \ifnum\the\c@law@parapin>0\relax%
    \loop%
      \addtocounter{law@paracounter}{1}%
    \ifnum\the\c@law@paracounter<\the\c@law@parapin\relax%
      \@law@pincut\@ltok@argtwo\frompinlist%
      ; \@law@shortprint%
    \repeat%
  \else%
    \loop%
      \addtocounter{law@paracounter}{1}%
    \ifnum\the\c@law@paracounter>\the\c@law@paranormal\relax%
    \else%
      ; \@law@shortprint%
    \repeat%
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@law@longprint}
%    \begin{macrocode}
\def\@law@longprint{%
  \begingroup%
  \@law@fetchparas%
  \@law@tidybridges%
%    \end{macrocode}
% If for some reason either the pinpoint argument is nil,
% or it {\em and\/} the location page token register is nil,
% we set the accompanying bridges to nil. 
%    \begin{macrocode}
  \ifcat$\the\@ltok@argtwo$%
   \global\@ltok@ptop{}%
   \global\@ltok@atbridge{}%
   \ifcat$\the\@ltok@citepage$%
     \global\@ltok@conetop{}%
    \fi%
   \fi%
%    \end{macrocode}
%    \begin{macrocode}
 \global\ltokspecialface=\@ltok@citefirstoptionface%
 {\the\@ltok@citefirstmainface%
 \@law@barinfull\the\@ltok@citefirst}%
 \@law@conetopsetup%
 \the\@ltok@conetop%
%    \end{macrocode}
% Next comes the location page and its following 
% bridge.  Both of these may be blank.  No funny
% business with the shorthand active characters is
% required, since we assume this will not contain
% any special text for which they will be required.
%    \begin{macrocode}
 \the\@ltok@citepage\the\@ltok@ptop%
%    \end{macrocode}
% A special use of "\," is defined before we expand
% the optional argument stuff.
%    \begin{macrocode}
  {\def\,{,}\@law@barkill%
   \expandafter\the\@ltok@argtwo%
   \relax}%
%    \end{macrocode}
% \textit{And finally, we print the final portion of the citation.
%  We package the citation part together with its preceding bridge.
%  If it is printed, we blank it; this gives us a simple command that
%  we can put at the end of the recursive routine that invokes this
%  code, so that the tail end of a string cite will be printed if
%  necessary, and only once.}
%  \changes{1997/01/09}{v2.0m}{Modified current-and-last comparison
%   algorithm for the last portion of the cite in parallel citations.}
%
%    \begin{macrocode}
  \xdef\@law@temp{%
    \the\@ltok@ptoctwo%
    \noexpand\@law@barinfull%
    \the\@ltok@citelast}%
  \xdef\@law@temptwo{%
    \the\@ltok@ptoctwo%
    \noexpand\@law@barinfull%
    \the\@ltok@usercitelast}%
  \ifx\@law@temp\@law@temptwo%
  \else%
    {\@law@temp}%
    \gdef\@law@temp{}%
  \fi%
    \@law@shiftparas%
  \endgroup}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@law@shortprint}
%    \begin{macrocode}
\def\@law@shortprint{%
% If {\sc Camel} sees more than one pinpoint page or section,
% the bridges preceding
% the page references must be set to their plural form.
% This change applies to both long and short form citations.
% It has to be cloned in each, however, because the decision has
% to be taken with respect to each cite in a string of parallels.
%    \begin{macrocode}
  \begingroup%
  \@law@fetchparas%
  \@law@tidybridges%
%    \end{macrocode}
% The actual recursive printing works.
%    \begin{macrocode}
     \global\ltokspecialface=\@ltok@citefirstoptionface%
     {\the\@ltok@citefirstmainface%
     \@law@barinshort\the\@ltok@citefirst}%
%    \end{macrocode}
% If the pinpoint reference is empty, we tack on the
% location page after the appropriate bridge.  Otherwise,
% we do nothing for the present; any pinpoint reference
% will be produced later on.
%  Note that the bridge
% used here will only be in plural form if something was
% given for use as a pinpoint reference.
% NB: THIS IS A TEST!!!! ******** BRACKETS TO BE PULLED!!!!
%    \begin{macrocode}
     \@law@conetopsetup%
     \the\@ltok@conetop%
     \ifcat$\the\@ltok@argtwo$%
       \the\@ltok@citepage%
     \else%
       {\@law@barkill\the\@ltok@argtwo}%
     \fi%
    \@law@shiftparas%
  \endgroup}%
%    \end{macrocode}
% \end{macro}
%
% \paragraph{Print format subroutines}
% \begin{macro}{\@law@casepreformat}
% This is empty; no special preparations are necessary
% for the printing of a case citation.
%    \begin{macrocode}
\gdef\@law@casepreformat{}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@law@statutepreformat}
% If short statutory references are in force,
% the title and the following bridge are set to nil,
% if some reference is provided in the first citation
% part.
%    \begin{macrocode}
\gdef\@law@statutepreformat{%
\if@law@statuteverbose%
\else%
  \ifcat$\the\@ltok@citefirst$%
  \else%
   \global\@ltok@name{}%
   \global\@ltok@ttocone{}%
  \fi% 
\fi%
}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@law@articlepreformat}
% If a work by the identical author has been cited more than
% once, we leave
% everything intact (the print routine does the necessary
% culling);
% otherwise, we cut the title here.  The use of
% "\@law@authortracing"
% is explained above.
%    \begin{macrocode}
\gdef\@law@articlepreformat{%
\ifcat$\the\@ltok@author$%
\else%
{\@law@clean\@ltok@author\@law@authortracing%
\expandafter\expandafter\expandafter\if\expandafter%
\csname\@law@authortracing\endcsname2%
 \else%
  \global\@ltok@atot{}\global\@ltok@name{}%
\fi}\fi}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@law@bookpreformat}
% This provides the same treatment given to articles.
%    \begin{macrocode}
\gdef\@law@bookpreformat{%
\ifcat$\the\@ltok@author$%
\else%
{\@law@clean\@ltok@author\@law@authortracing%
\expandafter\expandafter\expandafter\if\expandafter%
\csname\@law@authortracing\endcsname2%
 \else%
  \global\@ltok@atot{}\global\@ltok@name{}%
 \fi}\fi}%
%</lawcitestyle>
%    \end{macrocode}
% \end{macro}
%
% \subsection{Camel citation formats}
% The style definitions are stored in a separate file,
% to make it easier and less risky for users to play with
% the styles to produce desired output.  Table 3
% provides a guide to the macro arguments and their functions.
% \subsubsection{Books} The styles used for citing books and
% book-like things follow.
%    \begin{macrocode}
%<*lawcite>
\ProvidesFile{law.cit}[1994/12/07]
\newcitestyle{book}%
 {srsrrrB}
 {[a],\ [t][c]\ [p](pl)\ [rp]\ [e]:[id]\ at~(pl)\ at~[xrf]}
%
\newcitestyle{booklet}%
 {riririB}
 {[a],\ [t][c]\ [p](pl)\ [rp]\ [e]:[id]\ at~(pl)\ at~[xrf]}
%
\newcitestyle{techreport}%
 {riririB}
 {[a],\ [t][c]\ [p](pl)\ [rp]\ [e]:[id]\ at~(pl)\ at~[xrf]}
%
\newcitestyle{mastersthesis}%
 {riririB}
 {[a],\ [t][c]\ [p](pl)\ [rp]\ [e]:[id]\ at~(pl)\ at~[xrf]}
%    \end{macrocode}
% \subsubsection{Articles} Styles used for articles 
% and similar shortish things follow.  They're all
% the same, but the clones help keep things clear when following
% the action between \LaTeX\ and \BibTeX.
%    \begin{macrocode}
\newcitestyle{article}%
 {rsirsrA}
 {[a],\ [t],\ [c]\ [p],\ (pl),\ [rp]\ [e]:[id]\ at~(pl)\
at~[xrf]}
\newcitestyle{incollection}%
 {rsirsrA}
 {[a],\ [t],\ [c]\ [p],\ (pl),\ [rp]\ [e]:[id]\ at~(pl)\
at~[xrf]}
\newcitestyle{inbook}%
 {srirsrA}
 {[a],\ [t],\ [c]\ [p],\ (pl),\ [rp]\ [e]:[id]\ at~(pl)\
at~[xrf]}
%    \end{macrocode}
% \subsubsection{Cases} There are several styles for cases; we pretty
% much need a separate style for each jurisdiction.
%    \begin{macrocode}
\newcitestyle{case}%
 {rrirrsC}
 {[a][t],\ [c]\ [p],\ (pl),\ [rp]\ [e]:[id]\ at~(pl)\ at~[xrf]}
%    \end{macrocode}
% \subsubsection{Statutes} There are several of these.  More may
% need to be added on an {\em ad hoc\/} basis.
%    \begin{macrocode}
\newcitestyle{statute}%
 {rrrsrsS}
 {[a][t],\ [c]\ \S~[p](pl)\ \S\S~[rp]\ [e]:[id]\ \S~(pl)\
\S\S~[xrf]}
%
\newcitestyle{jstatute}%
 {rrrsrsS}
 {[a][t][c]\ \S~[p](pl)\ \S\S~[rp]\ [e]:[id]\ \S~(pl)\
\S\S~[xrf]}
%</lawcite>
%    \end{macrocode}
%
% \section{Extraction utilities}
% \subsection{The Driver}
% Here is a simple driver for extracting the files in the
% package.
% \changes{1997/01/09}{v2.0m}{Brought installation file up to
%   date for use with the new docstrip utility.}
%
%    \begin{macrocode}
%<*installer>
\def\batchfile{law.ins}
\input docstrip.tex
\preamble

Copyright (C) 1992--97 Frank Bennett, Jr.
All rights reserved.

This file is part of the Law module for the Camel package.
\endpreamble

\def\batchfile{camel.dst}      % ignored in distribution
\input docstrip.tex              % ignored in distribution

\keepsilent

\preamble
This file is part of the Law module of the Camel package.
---------------------------------------------------------
This is a generated file.  
IMPORTANT NOTICE:

You are allowed to change this file, subject to the following
conditions.  Under any circumstances, new macro definitions
should not be added to this file.  You are welcome to modify
the macro definitions contained in this file for your own
use.  If you pass a copy of the modified version to someone
else, you should (a) let me know about the change on
fb@soas.ac.uk, and (b) put a note of the changes and of your
own contact details in the file.  Furthermore, you must
acknowledge Camel and its author(s) in the new file (if it
is distributed to others), and you must attach these same
conditions to the new file.

You are not allowed to distribute this file alone.  You are not
allowed to take money for the distribution or use of this file
(or a changed version) except for a nominal charge for copying
etc.

You are allowed to distribute this file under the condition that
it is distributed with all of its contents, intact.

For error reports, or offers to help make this a more powerful,
friendlier, and better package, please contact me on
`fb' at soas.ac.uk

\endpreamble


\generate{\file{law.cst} {\from{law.dtx}{lawcitestyle}}
          \file{law.cit} {\from{law.dtx}{lawcite}}}


\postamble
\endpostamble

%<installer>% Change eng to jse below for JBibTeX support

\generate{\file{law.bst} {\from{camel.dtx}{bstheader,eng}
                          \from{law.dtx}{bstheader,eng}
                          \from{camel.dtx}{bstlibrary,eng}
                          \from{law.dtx}{bstfunctions,eng}
                          \from{camel.dtx}{bsttrailer,eng}}}

\keepsilent


\ifToplevel{
\Msg{***********************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the following}
\Msg{* file into a directory searched by TeX:}
\Msg{*}
\Msg{* \space\space law.cst}
\Msg{* \space\space law.cit}
\Msg{*}
\Msg{* You should also move the following file into a directory}
\Msg{* searched for style files by BibTeX:}
\Msg{*}
\Msg{* \space\space law.bst}
\Msg{*}
\Msg{* Other style modules can be found on CTAN in the `styles'}
\Msg{* subdirectory below Camel itself.}
\Msg{*}
\Msg{***********************************************************}
}
%</installer>
%    \end{macrocode}
% \Finale \PrintIndex \PrintChanges