summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/contract/contract.dtx
blob: cc83aa1df1868e4974cf740908acc1f0a89eae7e (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
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
% \iffalse meta-comment
% ======================================================================
% contract.dtx
% Copyright (c) 2007–2024 Markus Kohm
%
% This file is part of the LaTeX2e KOMA-Script bundle.
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, version 1.3c of the license.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later and of this work.
%
% This work has the LPPL maintenance status "author-maintained".
%
% The Current Maintainer and author of this work is Markus Kohm.
%
% This work consists of the files listed in MANIFEST.md.
% ======================================================================
%<identify>%%% --- docstrip run: identify ---
%<doc>%%% --- docstrip run: doc ---
%<init>%%% --- docstrip run: init ---
%<options>%%% --- docstrip run: options ---
%<postoptions>%%% --- docstrip run: postoptions ---
%<body>%%% --- docstrip run: body ---
%<final>%%% --- docstrip run: final ---
%<*dtx>
\expandafter\ifx\csname ProvidesFile\endcsname\relax
  \def\ProvidesFile#1[#2]{}
\fi
\ProvidesFile{contract.dtx}[%
%</dtx>
%<package&identify>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
%<package&identify>\ProvidesPackage{contract}[%
%<*dtx|(package&identify)>
  2024-02-07 v0.91
%<*dtx>
  source of
%</dtx>
  package for jurists
]
%</dtx|(package&identify)>
%<*dtx>
\ifx\documentclass\undefined
%</dtx>
%<*ins>
  \input docstrip.tex
  \generate{\usepreamble\defaultpreamble
%    \file{contract.ins}{%
%      \from{contract.dtx}{ins}%
%    }%
    \file{contract.sty}{%
      \from{contract.dtx}{package,identify}%
      \from{contract.dtx}{package,init}%
      \from{contract.dtx}{package,options}%
      \from{contract.dtx}{package,postoptions}%
      \from{contract.dtx}{package,body}%
      \from{contract.dtx}{package,final}%
    }%
  }%
%</ins>
%<*dtx>
\else
  \let\endbatchfile\relax
\fi
%</dtx>
%<*ins>
\endbatchfile
%</ins>
%<*dtx>
\documentclass[USenglish]{koma-script-source-doc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[ngerman,main=USenglish]{babel}
\usepackage{hvlogos}
\usepackage{tabularx}
\usepackage{graphicx}

% Note: The scrguide-… packages may currently not be available in any TeX
%       distribution.
\usepackage[colorize]{scrguide-listings}
\usepackage{scrguide-doclink}
\usepackage{scrguide-index}

\usepackage{booktabs}
\usepackage{csquotes}
\usepackage[style=alphabetic,autolang=other]{biblatex}
\begin{filecontents}{\jobname.bib}
@online{pkg:babel,
  author={Bezos López, Javier and Braams, Johannes L.},
  version={24.1},
  date={2024-01-07},
  title={\pkg*{babel} --- Multilingual support for \LaTeX, Lua\LaTeX,
         \XeLaTeX{} and Plain \TeX},
  url={https://ctan.org/pkg/babel},
  urldate={2024-01-08},
  note={This package manages culturally-determined typographical (and other)
        rules for a wide range of languages. A document may select a single
        language to be supported, or it may select several, in which case the
        document may switch from one language to another in a variety of ways.
        
        Babel uses contributed configuration files that provide the detail of
        what has to be done for each language, as well as \file{.ini} files
        for about 300 languages from around the World, including many written
        in non-Latin and RTL scripts. Many of them work with pdf\LaTeX, as
        well as with \XeLaTeX{} and Lua\LaTeX, out of the box. A few even
        work with plain formats.},
}
@online{pkg:koma-script,
  author={Markus Kohm},
  version={3.41},
  date={2023-07-07},
  title={{\KOMAScript} --- A bundle of versatile classes and packages},
  url={https://ctan.org/pkg/koma-script},
  urldate={2023-07-14},
  note={The \KOMAScript{} bundle provides replacements for the \cls*{article},
        \cls*{report}, and \cls*{book} classes with emphasis on typography and
        versatility. There is also a letter class.},
}
@manual{pkg:koma-script:manual:de,
  langid={ngerman},
  author={Markus Kohm},
  date={2023-06-16},
  title={{\KOMAScript}},
  subtitle={Die Anleitung},
  url={http://mirrors.ctan.org/macros/latex/contrib/koma-script/scrguide-de.pdf}
,
  urldate={2023-07-04},
}
@manual{pkg:koma-script:manual:en,
  author={Markus Kohm},
  date={2023-06-16},
  title={{\KOMAScript}},
  subtitle={The Guide},
  url={http://mirrors.ctan.org/macros/latex/contrib/koma-script/scrguide-en.pdf},
  urldate={2023-07-14},
}
@book{bk:koma-script,
  langid   ={ngerman},
  author   ={Kohm, Markus},
  title    ={{\KOMAScript}},
  subtitle ={Eine Sammlung von Klassen und Paketen für {\LaTeXe}},
  year     =2020,
  edition  =7,
  publisher={Lehmanns Media},
  address  ={Berlin},
  series   ={Edition DANTE},
  isbn     ={978-3-96543-097-6},
  note     ={Print-Ausgabe},
}
@book{ebk:koma-script,
  langid   ={ngerman},
  author   ={Kohm, Markus},
  title    ={{\KOMAScript}},
  subtitle ={Eine Sammlung von Klassen und Paketen für {\LaTeXe}},
  year     =2020,
  edition  =7,
  publisher={Lehmanns Media},
  address  ={Berlin},
  series   ={Edition DANTE},
  isbn     ={978-3-96543-103-4},
  note     ={eBook-Ausgabe},
}
\@online{pkg:parskip,
  author    ={Frank Mittelbach and Robin Fairbairns and H. Partl},
  version   ={2.0h},
  date      ={2021-03-14},
  title     ={\pkg*{parskip} --- Layout with zero \len{parindent}, non-zero \len{parskip}},
  url       ={https://www.ctan.org/pkg/parskip},
  urldate   ={2024-01-19},
  note      ={Simply changing \len{parskip} and \len{parindent} leaves a
              layout that is untidy; this package (though it is no
              substitute for a properly-designed class) helps alleviate this
              untidiness.},
}
@manual{pkg:parskip:manual,
  author    ={Frank Mittelbach},
  title     ={The \pkg*{parskip} package},
  date      ={2021-03-14},
  abstract  ={The \pkg*{parskip} package helps in implementing paragraph
              layouts where the paragraphs are separated by a vertical space
              instead of (or in addition to) indenting them.

              The package can be used with any document class at any size.
              By default it produces the following paragraph layout: Zero
              \len{parindent} and non-zero \len{parskip}. The stretchable
              glue in \len{parskip} helps \LaTeX{} in finding the best place
              for page breaks},
  url       ={http://mirrors.ctan.org/macros/latex/contrib/parskip/parskip.pdf},
  urldate   ={2024-01-19},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\setcounter{StandardModuleDepth}{2}
\setcounter{IndexColumns}{2}
\setcounter{GlossaryColumns}{2}
\providecommand*\targ[1]{\texttt{\char`\{#1\char`\}}}
\providecommand*\toarg[1]{\texttt{[#1]}}
\newenvironment{syntax}{%
  \list{}{%
    \listparindent -\leftmargin
    \rightmargin \leftmargin
    \leftmargin 2\leftmargin
    \itemindent \listparindent
    \parsep     0pt plus 1pt
  }%
  \def\obeyedlinedline{\item\relax}%
  \obeylines
  \obeyedlinedline
  \MacroFont
}{%
  \endlist
}
\makeatletter
\newenvironment{desctabular}{%
  \renewcommand*{\arraystretch}{1.25}%
  \newcommand{\entry}[2]{%
    \l@addto@macro\desctab@content{%
      \relax
      \renewcommand*\arraystretch{1}\begin{tabular}[t]{@{}l@{}}##1\end{tabular}
      & ##2\tabularnewline
    }%
  }
  \newcommand\desctab@content{\begin{tabularx}{\linewidth}{@{}lX@{}}\toprule}%
}{%
    \desctab@content
    \bottomrule
  \end{tabularx}
}
\makeatother
\newenvironment{desclist}{%
  \newcommand*{\desccaption}[2]{%
    \par
    \vspace{5\baselineskip}\pagebreak[2]\vspace{-5\baselineskip}\nopagebreak
    \captionof{table}{##1}\nopagebreak
    \begin{desctabular}
  }%
}{%
  \end{desctabular}
}
\newenvironment{Example}{%
  \lstset{belowskip=0pt plus 1pt minus .5pt}%
  \labeling{{\usekomafont{disposition}\Examplename:}}
  \item[{\usekomafont{disposition}\Examplename:}]%
}{%
  \endlabeling
}
\newcaptionname{USenglish}{\Examplename}{Example}

\DeclareTOCStyleEntry[dynnumwidth,dynindent]{section}{section}
\DeclareTOCStyleEntries[dynnumwidth,dynindent]{subsection}
  {subsection,subsubsection}

\DeclareLinkFallback{Counter}{tocdepth}
  {https://en.wikibooks.org/wiki/LaTeX/Tables_of_Contents_and_Lists_of_Figures}  
\DeclareLinkFallback{Macro}{arabic}
  {https://en.wikibooks.org/wiki/LaTeX/Counters#Counter_style}
\DeclareLinkFallback{Macro}{begin}
  {https://en.wikibooks.org/wiki/LaTeX/Basics#LaTeX_environments}
\DeclareLinkFallback{Macro}{bfseries}
  {https://en.wikibooks.org/wiki/LaTeX/Fonts#Font_styles}
\DeclareLinkFallback{Macro}{end}
  {https://en.wikibooks.org/wiki/LaTeX/Basics#LaTeX_environments}
\DeclareLinkFallback{Macro}{refstepcounter}
  {https://en.wikibooks.org/wiki/LaTeX/Counters#Counter_manipulation}
\DeclareLinkFallback{Macro}{sffamily}
  {https://en.wikibooks.org/wiki/LaTeX/Fonts#Font_styles}

\DeclareLinkFallback{Macro}{newcommand}
  {https://mirrors.ctan.org/macros/latex/base/usrguide-historic.pdf#subsection.3.4}  
\DeclareLinkFallback{Macro}{renewcommand}
  {https://mirrors.ctan.org/macros/latex/base/usrguide-historic.pdf#subsection.3.4}  
  
\DeclareLinkFallback{Macro}{defineshorthand}
  {http://mirrors.ctan.org/macros/latex/required/babel/base/babel.pdf#subsection.1.10}  
\DeclareLinkFallback{Macro}{useshorthands}
  {http://mirrors.ctan.org/macros/latex/required/babel/base/babel.pdf#subsection.1.10}  
  
\DeclareLinkFallback{Macro}{setkeys}
  {https://mirrors.ctan.org/macros/latex/required/graphics/keyval.pdf#section.3}

\DeclareLinkFallback{Macro}{documentclass}
  {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#12}
\DeclareLinkFallback{Macro}{dots}
  {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#a7}
\DeclareLinkFallback{Macro}{label}
  {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2b}
\DeclareLinkFallback{Macro}{large}
  {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#b3}
\DeclareLinkFallback{Macro}{pageref}
  {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2b}
\DeclareLinkFallback{Macro}{paragraph}
  {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2a}
\DeclareLinkFallback{Macro}{ref}
  {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2b}
\DeclareLinkFallback{Macro}{section}
  {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2a}
\DeclareLinkFallback{Macro}{subparagraph}
  {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2a}
\DeclareLinkFallback{Macro}{usepackage}
  {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#13}

\DeclareLinkFallback{Macro}{addsec}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:maincls.cmd.addsec}
\DeclareLinkFallback{Macro}{markboth}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:maincls.cmd.markboth}
\DeclareLinkFallback{Macro}{markright}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:maincls.cmd.markright}

\DeclareLinkFallback{Macro}{newkomafont}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:maincls-experts.cmd.newkomafont}

\DeclareLinkFallback{Macro}{providecaptionname}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrbase.cmd.providecaptionname}

\DeclareLinkFallback{Macro}{KOMAoption}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrextend.cmd.KOMAoption}
\DeclareLinkFallback{Macro}{KOMAoptions}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrextend.cmd.KOMAoptions}
\DeclareLinkFallback{Macro}{addtokomafont}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrextend.cmd.addtokomafont}
\DeclareLinkFallback{Macro}{setkomafont}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrextend.cmd.setkomafont}
\DeclareLinkFallback{Macro}{usekomafont}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrextend.cmd.usekomafont}
\DeclareLinkFallback{Macro}{usekomafont}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:maincls-experts.cmd.newkomafont}

\DeclareLinkFallback{Macro}{DeclareTOCStyleEntry}
  {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:tocbasic.cmd.DeclareTOCStyleEntry}
\begin{document}
  \nocite{pkg:koma-script}
  \DocInput{contract.dtx}
\end{document}
%</dtx>
% \fi
%
% \changes{v0.0.1}{2023-10-10}{new \KOMAScript{} spin-off}
% \changes{v0.9}{2024-02-02}{first release as standalone package}
%
% \GetFileInfo{contract.dtx}
% \title{\LaTeX{} Package \pkg*{contract}\thanks{%
%     The repository of this package can be found at
%     \url{https://github.com/komascript/latex-contract} where you also should
%     report issues.%^^A
%   }%^^A
% }
% \date{Version \fileversion{} of \filedate}
% \author{\href{mailto:komascript@gmx.info}{Markus Kohm}}
% \maketitle
% \begin{abstract}
%   The \pkg*{contract} package is intended for cautelar jurisprudence.  It is
%   intended to provide flexible help for lawyers and notaries in drafting
%   contracts, statutes and legal commentaries.  It has been developed in
%   cooperation with Dr~Alexander Willand, and is still in the process of
%   development.
%
%   Package \pkg*{contract} is a
%   \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} spin-off. It has
%   been released from 2011 till 2023 as \pkg*{scrjura}. With
%   \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} 3.42
%   \pkg*{scrjura} is removed from
%   \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} and released as
%   new package \pkg*{contract}.
% \end{abstract}
%
% \tableofcontents
% \listoftables
% \listoffigures
%
% \addpart{User Manual}
%
% If you want to write a contract\Index{contract}, the articles of association
% for a company or an association, a law, or a legal commentary, the package
% \pkg*{contract} will provide typographical support. Although \pkg*{contract}
% is intended to provide general help for legal documents, the contract is the
% central element of the package. Particular attention is paid to
% clauses\Index{clause}, titles, and numbered provisions\,---\,if there are
% several of them in a clause\,---, numbered sentences, entries in the table
% of contents, and cross references according to German standards.
%
% The package has been developed in cooperation with Dr Alexander Willand of
% Karls\-ruhe. Many of its features go back to constructive inquiries from
% Prof Heiner Richter of the Hochschule Stralsund University of Applied
% Sciences.
%
% Some of you may search for the German user manual formally available in
% \cite{pkg:koma-script:manual:de}. The author's acute overload has resulted
% in this no longer being freely available. However, the corresponding chapter
% in \cite{bk:koma-script} and \cite{ebk:koma-script} is still accessible and
% applicable with appropriate adjustments to the package name.
%
%
% \section{Package Loading and Option Setting}
%
% You can load the package as common using:
% \begin{syntax}
%  \cs{usepackage}\oarg{options}|{contract}|\quad.
% \end{syntax}
% In case of package \pkg*{contract} the \meta{options} are
% \meta{key}|=|\meta{value} options.
% \begin{description}
% \item[Note:] In case of using package \pkg*{contract} with package
%   \pkg{hyperref} you should load \pkg{hyperref} always after
%   \pkg*{contract}.
% \end{description}
%
% \DescribeCommand\contractSetup
% To change options after loading the package, you should use:
% \begin{syntax}
%   \cs{contractSetup}\marg{options}
% \end{syntax}
% with \meta{options} is a comma separated list of \meta{key}=\meta{value}
% options as explained before.
% \begin{description}
% \item[Note:] Currently the options are still implemented using the internal
%   \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} package
%   \href{https://www.ctan.org/pkg/koma-script}{\pkg*{scrkbase}}. Therefore
%   you could also setup \meta{options} using the
%   \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} commands
%   \cs{KOMAoptions} or \cs{KOMAoption}, which are described in
%   \cite{pkg:koma-script:manual:en}. Moreover, because of the implementation,
%   currently \cs{contractSetup} could also be used to setup other
%   \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} options not
%   related to package \pkg*{contract}. However, you should avoid this,
%   because it will fail, when the implementation will be changed.
% \end{description}
%
% \section{Changing the Fonts of Elements}
% \label{sec:textmarkup}
%
% Currently package \pkg*{contract} still uses the font selection features of
% the internal \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}
% package \pkg{scrkbase}. So the commands \cs{setkomafont},
% \cs{addtokomafont}, and \cs{usekomafont}, which are described in
% \cite{pkg:koma-script:manual:en}, can be used to change the fonts of the
% following elements:
% \begin{description}\setkomafont{descriptionlabel}{}
% \item[{\fnt{Clause}:}] \hfill\\
%   Alias for \fnt{\meta{environment}.Clause} within any contract environment,
%   e.\,g., \fnt{contract.Clause} within environment \env{contract}. If no
%   corresponding element is defined, \fnt{contract.Clause} is used.
% \item[{\fnt{contract.Clause}:}]
%   \hfill\mbox{(Default: \cs{sffamily}\cs{bfseries}\cs{large})}\\
%   The heading of a \cs{Clause} within the environment \env{contract}.
% \item[{\fnt{\meta{environment}.Clause}:}]
%   \hfill\mbox{(Default: \emph{none})}\\
%   The heading of a \cs{Clause} within environment \meta{environment}, which
%   has been defined using \cs{DeclareNewJuraEnvironment}, if the font has
%   been setup using property |ClauseFont| or the element has been defined
%   explicitly.
% \item[{\fnt{parnumber}:}]
%   \hfill\mbox{(Default: \emph{empty})}\\
%   The paragraph number within a contract environment.
% \item[{\fnt{sentencenumber}:}]
%   \hfill\mbox{(Default: \emph{empty})}\\
%   The sentence number printed by \cs{Sentence}.
% \end{description}
%
% \begin{description}
% \item[Note:] There are plans to no longer use package \pkg*{scrkbase}, but
%   maybe package \pkg{scrextend} instead, if \pkg*{scrjura} is used with a
%   non-\KOMAScript{} class. So the commands \cs{setkomafont},
%   \cs{addtokomafont} and \cs{usekomafont} would still be available in
%   future.
% \end{description}
%
% \section{Clauses in the Table of Contents}
% \label{sec:toc}
%
% The headings of clauses can also be added automatically to the table of
% contents, if desired. For this the package uses command
% \cs{DeclareTOCStyleEntry} of
% \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} package
% \pkg{tocbasic} to define an entry level named |cpar|. Usage of package
% \pkg{tocbasic} also means, that you should not use another package to
% configure the Table of Contents, e.g., \pkg{tocloft}, \pkg{tocstyle} etc.
%
% \DescribeOption{juratotoc}
% \SpecialOptionIndex{juratotoc\quotechar=\meta{boolean}}
% \SpecialOptionIndex{juratotoc\quotechar=\meta{integer}}
% Clauses\Index{clause} are shown in the table of contents only if their
% level number is less than or equal to the
% \cnt{tocdepth} counter.  By default, the level
%   number is \len{maxdimen}, which is also used if the option is switched
% off using \opt[element=juratotoc]{juratotoc=false}. Because the
% \cnt{tocdepth} counter usually has a one-digit value,
% clause entries are therefore not normally displayed in the table of contents.
%
% If you switch on the option using the
% \opt[element=juratotoc]{juratotoc=true}, the level number 2 is used so that
% clauses are shown in the table of contents on the same level as
% subsections. For the default setting of \cnt{tocdepth}, clauses are then
% shown in all \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}
% classes or standard classes.
%
% You can also use \opt[element=juratotoc]{juratotoc=\meta{integer}} to use
% \meta{integer} instead of \len{maxdimen} or 2 as level number.
%
% Internally usage of this option results in a call of
% \begin{syntax}
%   \cs{DeclareTOCStyleEntry}\toarg{level=\meta{integer}}\targ{default}\targ{cpar}
% \end{syntax}
% respectively
% \begin{syntax}
%   \cs{DeclareTOCStyleEntry}\toarg{level=2}\targ{default}\targ{cpar}
% \end{syntax}
% respectively
% \begin{syntax}
%   \cs{DeclareTOCStyleEntry}\toarg{level=\cs{maxdimen}}\targ{default}\targ{cpar}\quad.
% \end{syntax}
%
% \DescribeOption[noindex]{juratocindent}
% \SpecialOptionIndex{juratocindent\quotechar=\meta{length}}
% \DescribeOption[noindex]{juratocnumberwidth}
% \SpecialOptionIndex{juratocnumberwidth\quotechar=\meta{length}}
% These options determine the indentation and spacing for clause entries in
% the table of contents. Any valid \meta{length} can be assigned. The defaults
% are the same as for subsection entries in \cls{scrartcl}.
%
% Internally, usage of these options results in calls to:
% \begin{syntax}
%   \cs{DeclareTOCStyleEntry}\toarg{indent=\meta{length}}\targ{default}\targ{cpar}
% \end{syntax}
% respective
% \begin{syntax}
%   \cs{DeclareTOCStyleEntry}\toarg{numwidth=\meta{length}}\targ{default}\targ{cpar}\quad.
% \end{syntax}
%
% \section{Environment for Contracts}
% \label{sec:contract}
%
% The essential mechanisms of package \pkg*{contract} are available only
% inside contract environments, either the predefined \env{contract} or any
% other environment defined with command \cs{DeclareNewJuraEnvironment}.
%
% \DescribeEnv{contract}^^A
% Currently, this is the one and only predefined environment for
% \pkg*{contract}. Using it activates automatic numbering of paragraphs and
% the \cs{Clause} and \cs{SubClause} commands, which will be documented below,
% are given concrete form.
%
% The \env{contract} environment must
% not be nested within itself. Within a document, however, you can use the
% environment several times. The clauses within these environments are treated
% as if they were within a single environment. As a result, ending the
% environment really only temporarily interrupts it, and the old environment is
% continued by the beginning of a new environment. However, you cannot end the
% environment within a clause. If you want instead print several contracts,
% you would need to define several contract environments using command
% \cs{DeclareNewJuraEnvironment}.
%
% \DescribeOption{contract}
% The whole document becomes a contract\Index{contract} if you use this option
% while loading the package with:
% \begin{syntax}
%   \cs{usepackage}\toarg{\opt{contract}}\targ{contract}
% \end{syntax}
% or as a global option with \cs{documentclass}. The document then behaves
% exactly as if it would contain one \env{contract} environment.
%
%
% \subsection{Clauses}
% \label{sec:clause}
%
% Clauses^^A
% \Index[see{clause}]{section}^^A
% \Index[see{clause}]{paragraph}^^A
% \Index[indexmain]{clause}^^A
% \footnote{%^^A
%   In English, a ``clause'' in a legal document is a section, paragraph, or
%   phrase that relates to a particular point. Although it is common in English
%   to also use the terms ``article'' or ``section'' for what we here call a
%   ``clause'', we use the latter term throughout to avoid confusion with the
%   \cls{article} class and the \cs{section} and
%   \cs{paragraph} sectioning divisions of most document
%   classes.} in a legal sense are defined in package \pkg*{contract} only
% within contracts\Index{contract}, that is inside the
% \env{contract} environment or other environments declared
% with \cs{DeclareNewJuraEnvironment}.
%
% \DescribeCommand{\Clause}
% \DescribeCommand{\SubClause}
% Each clause starts either with \cs{Clause}\oarg{property list} or
% \cs{SubClause}\oarg{property list}.  The optional argument \meta{property
% list} is a comma separated list of \meta{key}|=|\meta{value}.
%
% These are the most important commands inside of a contract. Without using
% any additional \meta{key}, \cs{Clause} creates the heading of a clause,
% which consists of the sign ``\S'', followed by its number. In contrast,
% \cs{SubClause} creates the heading of a clause with the last number used by
% \cs{Clause} and adds a lower-case letter. \cs{SubClause} is mainly intended
% for cases where an act or a contract is amended and not only are clauses
% changed or deleted but new clauses are inserted between existing ones
% without completely changing the numbering.
%
% Both commands accept a comma-separated list of \meta{key}|=|\meta{value}
% properties and also some \meta{key}s without value. An overview
% of the available properties is shown in \autoref{tab:Clause.options}.
% The most important of them will be discussed in more detail.
%
% \begin{table}
%   \captionabove{Available properties for the optional argument of
%     \cs{Clause} and \cs{SubClause}}%^^A
%   \label{tab:Clause.options}
%   \begin{desctabular}
%     \entry{|dummy|}{%^^A
%       The heading will not be printed but is counted in the automatic
%       numbering.%^^A
%     }%^^A
%     \entry{|head=|\meta{running head}}{%^^A
%       If running heads are active, this \meta{running head} is used instead
%       of the clause \meta{title}.%^^A
%     }%^^A
%     \entry{|nohead|}{%^^A
%       The running head stays unchanged.%^^A
%     }%^^A
%     \entry{|notocentry|}{%^^A
%       Does not make an entry into the table of contents.%^^A
%     }%^^A
%     \entry{|number=|\meta{number}}{%^^A
%       Uses \meta{number} for the output of the clause number.%^^A
%     }%^^A
%     \entry{|preskip=|\meta{skip}}{%^^A
%       Changes the vertical \meta{skip} before the clause heading.%^^A
%     }%^^A
%     \entry{|postskip=|\meta{skip}}{%^^A
%       Changes the vertical \meta{skip} after the clause heading.%^^A
%     }%^^A
%     \entry{|title=|\meta{title}}{%^^A
%       The clause \meta{title} will be printed in addition to the clause
%       number. This is also used as the default for the \meta{running head}
%       and the \meta{entry} in the table of contents.%^^A
%     }%^^A
%     \entry{|tocentry=|\meta{entry}}{%^^A
%       Regardless of the clause \meta{title}, an \meta{entry} into the
%       table of contents will be made, if such entries are activated (see
%       option \opt{juratotoc}).%^^A
%     }%^^A
%   \end{desctabular} 
% \end{table}
%
% By default, a skip of two lines is inserted before the heading and a skip of
% one line afterwards. You can change the size of these skips with the
% |preskip| and |postskip| properties. The new values apply not only
% to the current clause but from the current clause until the end of the
% current contract environment. You can also make the appropriate settings in
% advance with
% \begin{syntax}
%   \cs{setkeys}\targ{\env{contract}}%^^A
%   \targ{preskip=\meta{skip},postskip=\meta{skip}}
% \end{syntax}
% regardless of the specific clause and outside of a contract environment. You
% can also set these options inside the preamble after loading
% \pkg*{contract}, but you cannot set them while loading the package or by
% using \cs{contractSetup}.
%
% By default, clause headings use the font style
% \cs{sffamily}\cs{bfseries}\cs{large}. See \autoref{sec:textmarkup} for
% information about how to change the font for element \fnt{contract.Clause}.
%
% With the |title|, |head|, and |tocentry| property, you can title a clause in
% addition to the number. You should enclose the \meta{value} of each property
% inside curly brackets. Otherwise, for example, commas which are meant to be
% part of the \meta{value} will be confused with the delimiters between
% different properties of the \meta{property list}. Empty values for |head|
% and |tocentry| cause empty entries. If you want to avoid an entry, use the
% |nohead| resp. |notocentry| property.
%
% Instead of consecutive numbers, you can also set a clause number manually
% with the |number| property. However, this does not affect the numbers of
% the subsequent clauses. Empty numbers are not possible.  Fragile commands
% inside |number| have to be protected with \cs{protect}. You should use
% only numbers and letters as a |number|.
%
% With the |dummy| property, you can suppress the output of the whole heading
% of a clause. The automatic numbering, however, will still count this
% clause. In this way, you can skip an automatically numbered clause with
%\begin{syntax}
%  \cs{Clause}\toarg{dummy}
%\end{syntax}
% in case the clause corresponding clause has been deleted in a later version
% of a contract.
%
% Note that the |dummy| property only accepts the \meta{value}s |true| and
% |false|. All other \meta{value}s are usually ignored, but can lead to an
% error message in the worst case scenario.
%
% \DescribeCommand{\Clauseformat}
% As already mentioned, clauses and subclauses are normally numbered. The
% number is formatted with the help of the \cs{Clauseformat} command, which
% expects the \meta{number} as the only argument. The default is the
% following:
%\begin{syntax}
%  \cs{newcommand*}\targ{\cs{Clauseformat}}\toarg{1}\targ{\cs{S}~\#1}
%\end{syntax}
% This produces the section mark, \cs{S} (\S), followed by a non-breaking
% space and the number. If you redefine this command, be sure it remains
% expandable.
%
% \DescribeOption{juratitlepagebreak}^^A
% \SpecialOptionIndex{juratitlepagebreak\quotechar=\meta{boolean}}^^A
% Usually, page breaks are prohibited within heading of all kinds. However,
% some lawyers require page breaks within clause headings. You can allow such
% a break by using option \opt{juratitlepagebreak} or
% \opt[element=juratitlepagebreak]{juratitlepagebreak=\meta{boolean}}. Boolean
% values of \texttt{true} or \texttt{false} can be used to toggle the option
% on or off. Using the option without a value is the same as using
% \texttt{true}. The option can be used as an optional argument of
% \cs{documentclass}, \cs{usepackage} when loading package \pkg*{contract}, or
% as an argument of \cs{contractSetup}.
%
% \DescribeOption[noindex]{clausemark}
% \SpecialOptionIndex{clausemark\quotechar=\meta{value}}
% Since clauses are a subordinate structure with independent numbering, they
% do not produce running heads by default. You can, however, create running
% heads with various settings using:
% \begin{syntax}
%   \opt{clausemark}=\meta{value}
% \end{syntax}
% as an optional argument of \cs{documentclass}, \cs{usepackage} when loading
% package \pkg*{contract}, or as an argument of \cs{contractSetup}. You can
% find the available \meta{value}s and their meanings in
% \autoref{tab:clausemark}.
% \begin{table}
%   \captionabove{Available values for the \opt{clausemark} option to
%     activate running heads}%^^A
%   \label{tab:clausemark}%^^A
%   \begin{desctabular}
%     \entry{\optvalue{both}}{%^^A
%       Clauses generate left and right marks for running heads, if the
%       document provides automatic running heads.%^^A
%       \SpecialOptionIndex{clausemark\quotechar=both}%^^A
%     }%^^A
%     \entry{\optvalue{false}, \optvalue{off}, \optvalue{no}}{%^^A
%       Clauses do not generate marks for running heads and therefore do not
%       change running heads.%^^A
%       \SpecialOptionIndex{clausemark\quotechar=false}%^^A
%     }%^^A
%     \entry{\optvalue{forceboth}}{%^^A
%       Clauses use \cs{markboth} to generate left and right
%       marks for running heads even if the document does not provide
%       automatic running heads for the current page style.%^^A
%       \SpecialOptionIndex{clausemark\quotechar=forceboth}%^^A
%     }%^^A
%     \entry{\optvalue{forceright}}{%^^A
%       Clauses use \cs{markright} to generate right marks for
%       running heads even if the document does not provide automatic running
%       heads for the current page style.%^^A
%       \SpecialOptionIndex{clausemark\quotechar=forceright}%^^A
%     }%^^A
%     \entry{\optvalue{right}}{%^^A
%       Clauses generate right marks for running heads, if the document
%       provides automatic running heads.%^^A
%       \SpecialOptionIndex{clausemark\quotechar=right}%^^A
%     }%^^A
%   \end{desctabular}
% \end{table}
%^^A
%
%
% \subsection{Paragraphs}
% \label{sec:par}
% \Index{paragraph>numbering}%^^A
% Within clauses, \pkg*{contract} usually numbers paragraphs automatically.
% With this, the paragraphs provide a powerful structuring element, similar to
% \cs{paragraph} or \cs{subparagraph} in
% normal documents. For this reason, contracts usually use a vertical skip
% between paragraphs. The \pkg*{contract} package does not provide its own
% mechanism for this. Instead, you should uses the
% \opt{parskip}\SpecialOptionIndex{parskip} option of the
% \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}
% classes. If you do not use a
% \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} class, see the
% documentation of the used class or package \pkg{parskip}
% \nocite{pkg:parskip}\cite{pkg:parskip:manual}.
%
%
% \DescribeOption{parnumber}
% \SpecialOptionIndex{parnumber\quotechar=\meta{value}}
% The option can be used as an optional argument of \cs{documentclass},
% \cs{usepackage} when loading package \pkg*{contract}, or as an argument of
% \cs{contractSetup}.
%
% The default numbering of paragraphs is
% \opt[element=parnumber]{parnumber=auto}\SpecialOptionIndex{parnumber\quotechar=auto}
% and
% \opt[element=parnumber]{parnumber=true}\SpecialOptionIndex{parnumber\quotechar=true}. Sometimes
% you may need to disable the automatic numbering. You can do this with
% \opt[element=parnumber]{parnumber=false}\SpecialOptionIndex{parnumber\quotechar=false}.
% In this case, only the sentence numbering is reset.
%
% To implement this option, it has been necessary to hook into the
% paragraph-building mechanism of \LaTeX. In some rare cases, this can have a
% negative effect. If so, you can undo the change with
% \opt[element=parnumber]{parnumber=manual}\SpecialOptionIndex{parnumber\quotechar=manual}.
% On the other hand, \LaTeX{} itself sometimes undoes the change. In those
% cases you can activate it again with
% \opt[element=parnumber]{parnumber=auto}\SpecialOptionIndex{parnumber\quotechar=auto}.
%
% Clauses that consist of a single paragraph do not automatically receive a
% paragraph number. For this to work, there must not be two clauses with an
% identical number in a document. However should you ever need such numbering,
% you should switch to another contract environment (see
% \cs{DeclareNewJuraEnvironment}). Note that the number of
% paragraphs in a clause is not available before the end of the
% clause. Therefore you need a least two \LaTeX{} runs before the automatic
% paragraph numbering is correct.
%
%
% \DescribeCounter{par}
% \DescribeCommand{\thepar}
% \DescribeCommand{\parformat}
% \DescribeCommand{\parformatseparation}
% For numbering the paragraphs inside a clause we use the \cnt{par} counter.
% The output of \cs{thepar} will display an Arabic number, because the
% default is \cs{arabic}\targ{par}. \cs{parformat} provides the
% format, which is \cs{thepar} in rounded brackets. When numbering a
% paragraph manually, you should also use \cs{parformat}. It makes sense to
% call \cs{parformat} with a subsequent \cs{parformatseparation}, or at
% least a \cs{nobreakspace} or tilde.
%
% With automatic numbering, \cs{parformat} is followed by
% \cs{parformatseparation}, which currently consists of
% \cs{nonbreakspace}, the non-breakable space.
%
% The paragraph number is usually printed using the currently active font.
% See \autoref{sec:textmarkup} for information how to change the font of the
% \fnt{parnumber} element.
%
% \begin{description}
% \item{Note:} \pkg*{contract} currently assumes internally that
%   \cs{thepar} is an Arabic number. Therefore you should definitely not
%   redefine it!
% \end{description}
%
%
% \DescribeCommand{\withoutparnumber}
% If the paragraph number is not printed, \pkg*{contract} executes the
% \cs{withoutparnumber} command at the beginning of the new paragraph. The
% initial definition of this command is empty. This means it is a kind of
% dummy command that does nothing. It has been implemented because of a user
% request. Most users can ignore this command.
%
%
% \DescribeCommand{\ellipsispar}
% \DescribeCommand{\parellipsis}
% Sometimes\,---\,particularly in comparative commentaries\,---\,it is
% desirable to omit paragraphs but to mark the omission. Those omitted
% paragraphs\Index{paragraph>omission} should be taken into account by the
% paragraph counter. The package \pkg*{contract} provides the command
% \cs{ellipsispar} to do this.
%
% By default, \cs{ellipsispar} omits precisely one paragraph. Using the
% optional argument of
% \begin{syntax}
%   \cs{ellipsispar}\oarg{number}
% \end{syntax}
% you can omit multiple paragraphs. In any case, the output shows just one
% unnumbered paragraph, which consists only of the ellipsis defined by
% \cs{parellipsis}. The automatic numbering of paragraphs takes the
% \meta{number} of omitted paragraphs into account.
% \begin{Example}
%   Suppose you are writing a comment on the German\footnote{Please remember,
%   this translation does not refer to an existing law but is only an example
%   of how you might realise such a commentary with \pkg*{contract}.} penal
%   code, but only on paragraph 3 of \S~2. Nevertheless, you'd like to
%   indicate the omission indirectly. You can do this with:
%\begin{lstcode}[gobble=1]
%  \documentclass[parskip=half]{scrartcl}
%  \usepackage{contract}
%  \begin{document}
%  \begin{contract}
%    \Clause{title={Temporal application},number=2}
%    \ellipsispar[2]
%
%    If the law that applies at the time the criminal act is
%    committed is changed before the verdict, then the most
%    lenient law shall be applicable.
%
%    \ellipsispar[3]
%  \end{contract}
%  \end{document}
%\end{lstcode}
%   To see the result, just give it a try.
% \end{Example}
%
% The ellipsis is by default \cs{textellipsis}, if such a command is
% defined. If not, \cs{dots} is used. You can redefine \cs{parellipsis} at any
% time with \cs{renewcommand}.
%
%
% \subsection{Sentences}
% \label{sec:sentence}
%
% \Index{sentence>number}%^^A
% Paragraphs in contracts consist of one or more sentences, some of which may
% also be numbered. However, as automatic numbering is cumbersome and
% error-prone, it has not yet been implemented in
% \pkg*{contract}. Semi-automatic numbering, however, is supported.
%
% \DescribeCounter{sentence}
% \DescribeCommand{\thesentence}
% \DescribeCommand{\sentencenumberformat}
% \DescribeCommand{\Sentence}
% Manual numbering of sentences is done with the \cs{Sentence} command. It
% adds one to the \cnt{sentence} counter. By default,
% \cs{sentencenumberformat} prints \cs{thesentence} as an Arabic number in
% superscript.
%
% The sentence number is usually printed using the currently active font.
% See \autoref{sec:textmarkup} for information how to change the font of the
% \fnt{sentencenumber} element.
%
% Using \pkg{babel} offers an easy way to define a shorthand for
% \cs{Sentence}:%^^A
% \phantomsection\label{sec:shorthandexample}%^^A
%\begin{lstcode}[moretexcs={useshorthands,defineshorthand},gobble=1]
%  \useshorthands{'}
%  \defineshorthand{'S}{\Sentence\ignorespaces}
%\end{lstcode}
% With this definition, any space after \lstinline|'S| will be ignored. You
% can even use the dot as an abbreviation for a dot and a new sentence number:
%\begin{lstcode}[moretexcs={useshorthands,defineshorthand},gobble=1]
%  \defineshorthand{'.}{. \Sentence\ignorespaces}
%\end{lstcode}
% For details regarding \cs{useshorthands} and \cs{defineshorthand},
% please consult the manual of the \pkg{babel} package (see
% \cite{pkg:babel}). You can find an example of their application in
% \autoref{sec:example}, \autopageref{sec:example}.%^^A
%
%
% \section{Cross References}
% \label{sec:ref}
%
% The conventional mechanism to set cross references using \cs{label},
% \cs{ref}, and \cs{pageref} does not suffice for clauses, paragraphs, and
% sentences.  Therefore \pkg*{contract} provides additional commands.
%
% \DescribeCommand{\ref}
% \DescribeCommand{\refL}
% \DescribeCommand{\refS}
% \DescribeCommand{\refN}
% The commands
% \begin{syntax}
%   \cs{ref}\marg{label}
%   \cs{refL}\marg{label}
%   \cs{refS}\marg{label}
%   \cs{refN}\marg{label}
% \end{syntax}
% give a full reference to clause, paragraph and sentence. \cs{refL} is a long
% text, \cs{refS} a short text, and \cs{refN} an abbreviated, numeric form.
% \cs{ref} defaults to \cs{refL}.
%
%
% \DescribeCommand{\refClause}
% \DescribeCommand{\refClauseN}
% The commands
% \begin{syntax}
%   \cs{refClause}\marg{label}
%   \cs{refClauseN}\marg{label}
% \end{syntax}
% reference a clause without displaying the paragraph or
% sentences. \cs{refClause} puts a section mark (\S) in front of the
% reference, while \cs{refClauseN} does not.
%
%
% \DescribeCommand{\refPar}
% \DescribeCommand{\refParL}
% \DescribeCommand{\refParS}
% \DescribeCommand{\refParN}
% The commands
% \begin{syntax}
%   \cs{refPar}\marg{label}
%   \cs{refParL}\marg{label}
%   \cs{refParS}\marg{label}
%   \cs{refParN}\oarg{number format}\marg{label}
% \end{syntax}
% reference a paragraph of a clause. The differences between the forms
% correspond to the differences between \cs{refL}, \cs{refN} and \cs{refS}. A
% feature worth noting is the optional argument of \cs{refParN}. Usually the
% numeric reference to a paragraph uses a Roman number. You can, however,
% specify a different \meta{number format} in the optional argument. This
% option primarily makes sense to use Arabic numbers. By default, \cs{refPar}
% is \cs{refParL}.
%
%
% \DescribeCommand{\refSentence}
% \DescribeCommand{\refSentenceL}
% \DescribeCommand{\refSentenceS}
% \DescribeCommand{\refSentenceN}
% The commands
% \begin{syntax}
%   \cs{refSentence}\marg{label}
%   \cs{refSentenceL}\marg{label}
%   \cs{refSentenceS}\marg{label}
%   \cs{refSentenceN}\marg{label}
% \end{syntax}
% reference a sentence of a paragraph. Again, there is a long text form, a
% short text form, and a numerical form. By default, \cs{refSentence} is
% \cs{refSentenceL}.%^^A
%
%
% \DescribeOption[noindex]{ref}
% \SpecialOptionIndex{ref\quotechar=\meta{value}}
% The results of \cs{ref}, \cs{refPar}, and \cs{refSentence} depend on the
% option
% \begin{syntax}
%   \opt{ref}|=|\meta{value}
% \end{syntax}
% that can be used as an optional argument of \cs{documentclass},
% \cs{usepackage} when loading package \pkg*{contract}, or as an argument of
% \cs{contractSetup}.  The default is \opt[element=ref]{ref=long} and
% therefore \cs{refL}, \cs{refParL} and \cs{refSentenceL}.  You can find the
% available \meta{value}s for his option and their meaning in
% \autoref{tab:ref}.%^^A
% %^^A
% \begin{table}
%   \captionabove[{%^^A
%     Available values for the \opt{ref} option to configure the
%     cross reference format%^^A
%   }]{%^^A
%     Available values for the \opt{ref} option to configure the
%     cross reference format of \cs{ref},
%     \cs{refPar}, and \cs{refSentence}%^^A
%     \label{tab:ref}%^^A
%   }%^^A
%   \begin{desctabular}
%     \entry{\optvalue{long}}{%^^A
%       A combination of \optvalue{parlong} and \optvalue{sentencelong}.%^^A
%       \SpecialOptionIndex{ref\quotechar=long}%^^A
%     }%^^A
%     \entry{\optvalue{numeric}}{%^^A
%       A combination of \optvalue{parnumeric} and
%       \optvalue{sentencenumeric}.%^^A
%       \SpecialOptionIndex{ref\quotechar=numeric}%^^A
%     }%^^A
%     \entry{\optvalue{clauseonly}, \optvalue{onlyclause},\\
%            \optvalue{ClauseOnly}, \optvalue{OnlyClause}}{%^^A
%       A combination of \optvalue{paroff} and \optvalue{sentenceoff}. Note
%       that \cs{refPar} and \cs{refSentence}
%       produce empty results!%^^A
%       \SpecialOptionIndex{ref\quotechar=long}%^^A
%     }%^^A
%     \entry{\optvalue{parlong}, \optvalue{longpar},\\
%            \optvalue{ParL}}{%^^A
%       Paragraphs are referenced in long textual form.%^^A
%       \SpecialOptionIndex{ref\quotechar=parlong}%^^A
%     }%^^A
%     \entry{\optvalue{parnumeric}, \optvalue{numericpar}, \optvalue{ParN}}{%^^A
%       Paragraphs are referenced in simple numerical form.%^^A
%       \SpecialOptionIndex{ref\quotechar=parnumeric}%^^A
%     }%^^A
%     \entry{\optvalue{paroff}, \optvalue{nopar}}{%^^A
%       Paragraphs have no reference. Note that \cs{refPar}
%       produces an empty result!%^^A
%       \SpecialOptionIndex{ref\quotechar=paroff}%^^A
%     }%^^A
%     \entry{\optvalue{parshort}, \optvalue{shortpar}, \optvalue{ParS}}{%^^A
%       Paragraphs are referenced in short textual form.%^^A
%       \SpecialOptionIndex{ref\quotechar=parshort}%^^A
%     }%^^A
%     \entry{\optvalue{sentencelong}, \optvalue{longsentence}, \\
%            \optvalue{SentenceL}}{%^^A
%       Sentences are referenced in long textual form.%^^A
%       \SpecialOptionIndex{ref\quotechar=parlong}%^^A
%     }%^^A
%     \entry{\optvalue{sentencenumeric}, \optvalue{numericsentence},\\
%            \optvalue{SentenceN}}{%^^A
%       Sentences are referenced in simple numeric form.%^^A
%       \SpecialOptionIndex{ref\quotechar=sentencenumeric}%^^A
%     }%^^A
%     \entry{\optvalue{sentenceoff}, \optvalue{nosentence}}{%^^A
%       Sentences have no reference. Note that
%       \cs{refSentence} produces an empty result!%^^A
%       \SpecialOptionIndex{ref\quotechar=sentenceoff}%^^A
%     }%^^A
%     \entry{\optvalue{sentenceshort}, \optvalue{shortsentence},\\
%            \optvalue{SentenceS}}{%^^A
%       Sentences are referenced in short textual form.%^^A
%       \SpecialOptionIndex{ref\quotechar=sentenceshort}%^^A
%     }%^^A
%     \entry{\optvalue{short}}{%^^A
%       A combination of \optvalue{parshort} and \optvalue{sentenceshort}.%^^A
%       \SpecialOptionIndex{ref\quotechar=value}%^^A
%     }%^^A
% \end{desctabular}
% \end{table}
%
% \begin{Example}
%   Suppose you always want to reference paragraphs in the form ``paragraph 1
%   in clause 1''. As there is no predefined command for this, you have to
%   create your own definition from the available options. You can achieve
%   this easily with:%^^A
%\begin{lstcode}[gobble=1]
%  \newcommand*{\refParM}[1]{%
%    paragraph~\refParN[arabic]{#1} 
%    in clause~\refClauseN{#1}%
%  }
%\end{lstcode}
%   This new command can be used in the same way as
%   \cs{refParL}.%^^A
% \end{Example}%^^A
%
% You can find examples of results of the basic commands\,---\,this means the
% commands, that are independent from option \opt{ref}\,---\,in
% \autoref{tab:refexamples}.%^^A
% %^^A
% \begin{table}
%   \KOMAoptions{captions=topbeside}%^^A
%   \setcapindent{0pt}%^^A
%   \begin{captionbeside}{Example outputs of the \opt{ref}-independent 
%     cross reference commands}[l]
%     \begin{tabular}[t]{ll}
%       \toprule
%       Command                               & Example output \\
%       \midrule
%       \cs{refL}\marg{label}           & \S{} 1 paragraph 1 sentence 1 \\
%       \cs{refS}\marg{label}           & \S{} 1 par. 1 sent. 1 \\
%       \cs{refN}\marg{label}           & \S{} 1 I 1. \\
%       \cs{refClause}\marg{label}   & \S{} 1 \\
%       \cs{refClauseN}\marg{label}  & 1 \\
%       \cs{refParL}\marg{label}        & paragraph 1 \\
%       \cs{refParS}\marg{label}        & par. 1 \\
%       \cs{refParN}\marg{label}        & I \\
%       \cs{refParN}\toarg{arabic}\marg{label} & 1 \\
%       \cs{refParN}\toarg{roman}\marg{label} & i \\
%       \cs{refSentenceL}\marg{label}   & sentence 1 \\
%       \cs{refSentenceS}\marg{label}   & sent. 1 \\
%       \cs{refSentenceN}\marg{label}   & 1. \\
%       \bottomrule
%    \end{tabular}
%   \end{captionbeside}
%   \label{tab:refexamples}
% \end{table}
%
%
% \section{Additional Contract Environments}
% \label{sec:newenv}
%
% Some users do not use \pkg*{contract} to draft contracts or commentaries on
% individual laws but to examine different types of laws, which may not
% necessarily use the section prefix (\S) before the title of each clause but
% perhaps something like ``Art.'' or ``IAS'', and so forth. An independent
% counter is also required for each of these different clause types.
%
% \DescribeCommand{\DeclareNewJuraEnvironment}
% You can use:
% \begin{syntax}
%   \cs{DeclareNewJuraEnvironment}\marg{environment}\oarg{property list}\\%^^A
%   \marg{start commands}\marg{end commands}
% \end{syntax}
% to define new and independent environments for contracts or other legal
% texts. The argument \meta{environment} is the name of the new environment,
% of course. The \meta{start commands} are commands which will be executed at
% the beginning of the environment, as if they were added directly after
% \cs{begin}\marg{environment}. Correspondingly \meta{end commands} will be
% executed at the end of the environment, as if added directly before
% \cs{end}\marg{environment}. Without a \meta{property list} the new
% environment behaves like the \env{contract} environment, but with its own
% counters. You can use several \meta{key}|=|\meta{value} properties as a
% comma-separated \meta{property list}.  See
% \autoref{tab:DeclareNewJuraEnvironment} for the currently supported
% \meta{options}.
%
% \begin{table}
%   \captionabove{Properties provided by \cs{DeclareNewJuraEnvironment} for
%     new contract environments}\label{tab:DeclareNewJuraEnvironment}%^^A
%   \begin{desctabular}
%   \entry{|Clause=|\meta{command}}{%^^A
%     Defines the \meta{command} to which the \cs{Clause}
%     command is mapped within the environment. This \meta{command}, like the
%     one documented for \env{contract}, expects exactly one
%     argument. To use it correctly requires advanced knowledge of the
%     \pkg*{contract}'s internal functioning. Furthermore, the requirements
%     for the \meta{command} may change in future versions. Therefore it is
%     recommended not to use this option!%^^A
%   }%^^A
%   \entry{|ClauseFont=|\meta{commands}}{%^^A
%     If this property is used, a new \fnt{\meta{environment}.Clause}
%     element is defined with the
%     \meta{commands} used as its default setting. If the element was
%     previously defined as an alias, it will become an independent element
%     instead. If it has already been defined as an independent element, the
%     \meta{commands} are used as new font settings. Please note the
%     limitations for font settings in \autoref{sec:textmarkup}.%^^A
%   }%^^A
%   \entry{|SubClause=|\meta{command}}{%^^A
%     Defines the \meta{command} to which the
%     \cs{SubClause} command is mapped within the
%     environment. This \meta{command}, like the one documented for
%     \env{contract}, expects exactly one argument. To use it
%     correctly requires advanced knowledge of the \pkg*{contract}'s internal
%     functioning. Furthermore, the requirements for the \meta{command} may
%     change in future versions. Therefore it is recommended not to use this
%     property!%^^A
%   }%^^A
%   \entry{|Sentence=|\meta{command}}{%^^A
%     Defines the \meta{command} to which the \cs{Sentence}
%     is mapped within the environment. This \meta{command} must not have an
%     argument. Typically it should add one to the
%     \cnt{sentence} (using \cs{refstepcounter}) counter and display it
%     appropriately. It is particularly important to avoid adding unwanted
%     spaces.%^^A
%   }%^^A
%   \entry{|ClauseNumberFormat=|\meta{command}}{%^^A
%     Formats the numbers of clauses within the environment. The
%     \meta{command} should expect exactly one argument: the number of the
%     clause. If the \meta{command} implements a series of commands and the
%     number is the last argument of a that series, you can directly use the
%     series of commands as \meta{command}.%^^A
%   }
%   \end{desctabular}
% \end{table}
% \begin{Example}
%   To define the environment for articles we mentioned in the preface of this
%   section, it is sufficient to write:
%\begin{lstcode}[gobble=1]
%  \DeclareNewJuraEnvironment{Article}[ClauseNumberFormat=Art.~]{}{}
%\end{lstcode}
%   If we are using a \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}
%   class and want to separate the paragraphs in this environment with space
%   instead of using paragraph indentation, we can use:
%\begin{lstcode}[gobble=1]
%  \DeclareNewJuraEnvironment{Article}[ClauseNumberFormat=Art.~]
%                            {\KOMAoptions{parskip}}{}
%\end{lstcode}
%   In cross references, ``Art.'' will  of course be used instead of ``\S''.%^^A
%
%   The new environment is used like \env{contract}:
%\begin{lstcode}[gobble=1]
%  \begin{Article}
%    \Clause{}
%    Human dignity is inviolable. To respect and protect people is a
%    duty of all state authority.
%  \end{Article}
%\end{lstcode}
% \end{Example}
%
%
% \section{Support for Different Languages}
% \label{sec:babel}
%
% The \pkg*{contract} package has been developed in cooperation with a German
% lawyer. Therefore it initially supported only the languages |german|,
% |ngerman|, |austrian|, and |naustrian|. Nevertheless, it has been designed
% to support common language packages like \pkg{babel}. Users can easily make
% changes by using \cs{providecaptionname}. If you have definitive information
% about the correct legal terms and conventions of a language, please contact
% the \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} author. Support
% for English has been added in this way, and so \pkg*{contract} now also
% provides terms for the languages |english|, |american|, |british|,
% |canadian|, |USenglish|, and |UKenglish|.
%
% \DescribeCommand{\parname}
% \DescribeCommand{\partshortname}
% \DescribeCommand{\sentencename}
% \DescribeCommand{\sentenceshortname}
% These are the language-dependent terms used by \pkg*{contract}. The meaning
% of the terms and their English defaults are shown in
% \autoref{tab:captionnames}. The package itself defines them by
% using \cs{providecaptionname} inside
% \cs{begin}\targ{document} only if other requirements have not already
% been met. If you use \pkg*{contract} with an unsupported language, the
% package will throw an error.%^^A
% %^^A
% \begin{table}
%   \KOMAoptions{captions=topbeside}%^^A
%   \setcapindent{0pt}%^^A
%   \begin{captionbeside}
%     [{%^^A
%       Meanings and English defaults of language-dependent terms%^^A
%     }]{%^^A
%       Meanings and English defaults of language-dependent terms, if not
%       already defined%^^A
%     } [l]
%     \begin{tabular}[t]{lll}
%       \toprule
%       Command                   & Meaning                   & Default \\
%       \midrule
%       \cs{parname}           & long form ``paragraph''   & paragraph \\
%       \cs{parshortname}      & short form ``paragraph''  & par. \\
%       \cs{sentencename}      & long form ``sentence''    & sentence \\
%       \cs{sentenceshortname} & short form ``sentence''   & sent. \\
%       \bottomrule
%     \end{tabular}
%   \end{captionbeside}
%   \label{tab:captionnames}
% \end{table}
% 
%
%
% \section{A Detailed Example}
% \label{sec:example}
%
% You may remember the letter from the \cls{scrlttr2} chapter of the
% \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} manual
% \cite{pkg:koma-script:manual:en}, in which a club member wanted to remind
% the board about an overdue meeting that was prescribed by the club's
% by-laws. Such club by-laws are a kind of contract, and you can create them
% using \pkg*{contract}.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=1-2}]{contract-example-en.tex}%^^A
% We use class \cls{scrartcl}. Because paragraph distance instead of paragraph
% indentation is usual in club by-laws, we load the class with option
% \opt[element=parskip]{parskip=half}.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=4-4}]{contract-example-en.tex}%^^A
% The club rules are in British English. Therefore we load the \pkg{babel}
% package with the \opt{british} option too.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange={6-6,8-8}}]{contract-example-en.tex}%^^A
% We make some default font settings. Earlier versions of the example also
% loaded the \pkg{textcomp} package here for an improved section mark
% (\S). Since \LaTeX{} 2020/02/01, however, the desired functionality is
% directly integrated in the \LaTeX{} kernel.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=11-11}]{contract-example-en.tex}%^^A
% Later in the document, we want lists numbered not with Arabic numbers but with
% lower-case letters. We can do this easily with the \pkg{enumerate}
% package. Alternatively, we could have used the \pkg{enumitem} package.
%
% \lstinputcode[{moretexcs={useshorthands,defineshorthand},%^^A
%   xleftmargin=2em,%^^A
%   linerange=13-21}]{contract-example-en.tex}%^^A
% Now it is time for \pkg*{contract}. The
% \opt[element=clausemark]{clausemark=forceboth}\SpecialOptionIndex{clausemark=forceboth}
% option forces clauses to create left and right marks for the running
% head. On the other hand, we do not want \cs{section} to change the marks for
% the running head.  Therefore we use the \pstyle{myheadings} page style. This
% page style generally does not provide automatic running heads.
%
% Later, we also want a table of contents with the clauses. This can be
% achieved with the \opt{juratotoc} option. Doing so we will see that the
% default width for these numbers is insufficient for the clause numbers in
% the table of contents. With
% \opt[element=juratocnumberwidth]{juratocnumberwidth=2.5em}\SpecialOptionIndex{juratocnumberwidth\quotechar=\meta{length}},
% we reserve more space.
%
% The definition of shorthands has already been explained in
% \autoref{sec:shorthandexample}. In this example we do the same thing
% to simplify the input.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=23-23}]{contract-example-en.tex}%^^A
% It is time to begin the actual document.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=25-29}]{contract-example-en.tex}%^^A
% Like other documents, the by-laws have a title. We created it with the usual
% \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} commands%\iffalse
% (see \autoref{sec:maincls.titlepage}, starting on
% \autopageref{sec:maincls.titlepage})%\fi
% .
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=31-31}]{contract-example-en.tex}%^^A
% As already mentioned, we want to create a table of contents.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=33-37}]{contract-example-en.tex}%^^A
% Preambles are not unusual in club by-laws. Here we use
% \cs{addsec} to create one because we want it to have an entry
% in the table of contents.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=39-39}]{contract-example-en.tex}%^^A
% Here we use a small trick. The articles of the club by-laws should be numbered
% with upper-case letters instead of Arabic numbers, just as 
% the appendix sections of an article using \cls{scrartcl} are.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=41-43}]{contract-example-en.tex}%^^A
% We begin the contract with the first article.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=44-54}]{contract-example-en.tex}%^^A
% The first clause has a number and a title. We will do the same with all
% following clauses.
%
% The first paragraph of the clause contains nothing unusual. Because it is not
% the only paragraph, every paragraph will be automatically preceded by a
% paragraph number. Note that the numbering the first paragraph requires at
% least two \LaTeX{} runs. Since this is the case for the table of contents as
% well, this does not create any additional problems.
%
% In the second paragraph we have two sentences. Here we can see the shorthands
% \texttt{'S} and \texttt{'.} in action. The first one only generates the
% sentence number. The second one generates not only the full stop but also the
% sentence number. With this, both sentences are numbered.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=55-70}]{contract-example-en.tex}%^^A
% The second clause: again this contains several paragraphs, some of which
% include several sentences. The second paragraph also has a numbered list. In
% the last paragraph, we set a label, because we want to reference it later.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=72-78}]{contract-example-en.tex}%^^A
% The third clause contains something special: a cross reference. Here we use
% the long form with clause, paragraph, and sentence. If we decided later that
% sentences should not be included in the reference, we could use the
% \opt{ref=nosentence} option to set this globally.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=80-81}]{contract-example-en.tex}%^^A
% Here we have a special kind of clause. In earlier versions of the club
% by-laws, 
% this was a real clause, but it was later removed. However, the
% numbering of the following clauses should not be changed by removing this
% one. Therefore the \cs{Clause} statement has not been
% removed but supplemented by |dummy| property. With this, we also can set
% a label even though the clause will not be printed.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=82-86}]{contract-example-en.tex}%^^A
% Another article begins. To avoid problems with the paragraph numbering, we
% interrupt the \env{contract} environment.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=87-87}]{contract-example-en.tex}%^^A
% The first clause of the next article also has been deleted.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=89-98}]{contract-example-en.tex}%^^A
% Here we have a real clause again. We cross reference one of the deleted
% clauses and also set a label.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=100-104}]{contract-example-en.tex}%^^A
% Once more, this is a special kind of clause. This time we have not removed a
% clause but added one without renumbering the following clauses. To do so,
% we use \cs{SubClause}. Therefore the clause number is the
% same like the previous one but with an appended ``a''.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=106-126}]{contract-example-en.tex}%^^A
% The other clauses of this article are very usual. You already know all the
% features used for them.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=128-141}]{contract-example-en.tex}%^^A
% There follows another article no special features.
%
% \lstinputcode[{xleftmargin=2em,%^^A
%   linerange=143-143}]{contract-example-en.tex}%^^A
% Then the \LaTeX{} document ends. You can see first three pages in
% \autoref{fig:example}.%^^A
% %^^A
% \begin{figure}
%   \centering
%   \frame{\includegraphics[page=1,width=.482\textwidth,%^^A
%   height=.49\textheight,keepaspectratio]{contract-example-en}}\enskip
%   \frame{\includegraphics[page=2,width=.482\textwidth,%^^A
%   height=.49\textheight,keepaspectratio]{contract-example-en}}\par
%   \smallskip
%   \frame{\includegraphics[page=3,width=.482\textwidth,%^^A
%   height=.49\textheight,keepaspectratio]{contract-example-en}}\enskip
%   \frame{\includegraphics[page=4,width=.482\textwidth,%^^A
%   height=.49\textheight,keepaspectratio]{contract-example-en}}\par
%   \caption{The four pages of the CfCH example of
%     \protect\autoref{sec:example}}
%   \label{fig:example}
% \end{figure}
%
% \section{From \pkg*{scrjura} to \pkg*{contract}}
% \label{sec:switchpackage}
%
% If you have been using the \pkg*{scrjura} package and are now switching to
% the \pkg*{contract} package, there are a few things you need to be aware of:
% \begin{itemize}
% \item Instead of
%   \begin{syntax}
%     \cs{usepackage}\oarg{options}\targ{scrjura}\quad,
%   \end{syntax}
%   should now use
%   \begin{syntax}
%     \cs{usepackage}\oarg{options}\targ{contract}\quad.
%   \end{syntax}
%   The same \meta{options} are allowed as the \pkg*{scrjura} package
%   understands.
% \item Instead of using \cs{KOMAoptions} or \cs{KOMAoption} to set
%   \meta{options} for the \pkg*{contract} package, use \cs{contractSetup}.
% \item The \cs{Clause} and \cs{SubClause} commands now have an optional
%   argument instead of a mandatory argument. This makes more sense because it
%   is allowed to use \cs{Clause} or \cs{SubClause} without an
%   argument. Instead of braces, the list of properties must be given
%   in square brackets, for example:
%\begin{lstcode}[gobble=1]
%   \Clause[title={title of clause}]
%\end{lstcode}
%   Therefore, even more care should be taken to ensure that the values of
%   each property are enclosed in braces. Otherwise, there may be problems not
%   only with commas, but also with square brackets in the values.
% \item Check your code if you have used or redefined any internal macros as
%   several of them have been renamed.
% \end{itemize}
%
% \section{State of Development}
% \label{sec:draft}
%
% Since \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}~3.24, the
% \pkg*{scrjura} package has shared the version number of the classes and
% other important packages of
% \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}. Package
% \pkg*{contract} on the other hand now has a new version number independent
% from \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}.
%
% Independent from the version number you should note that so far, the
% interaction of the \env{contract} environment with the many different
% settings possible with other \LaTeX{} environments, packages, or classes has
% not been tested. The main reason for this is that \pkg*{contract} is very
% specialized and far beyond the author's ordinary practice. So the author
% mostly relies on detailed user feedback.
%
%
% \MaybeStop{%
%   \printbibliography[heading=bibintoc]
%   \PrintChanges
%   \PrintIndex
% }
%
% \addpart{Implementation}
%
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
% \changes{scrjura-v0.7b}{2014/11/11}{General renaming of ``Paragraph'' into
%   ``Clause''}
%
% \section{Cooperation with \pkg{hyperref}}
%
% If \pkg{hyperref} has already loaded before \pkg*{contract} the package cannot
% work correctly. So we throw an error. Maybe it would be a good idea to make
% this error fatal. But currently it is only an error.
%    \begin{macrocode}
%<*init>
\@ifpackageloaded{hyperref}{%
  \PackageError{contract}{Package hyperref already loaded}{%
    If you want to use package contract with package hyperref, you have
    to\MessageBreak
    load package contract before package hyperref.\MessageBreak
    To solve the problem, you just should move the loading of package
    hyperref\MessageBreak
    behind the loading of package contract.}%
}
%</init>
%    \end{macrocode}
%
% \section{Prerequisites}
%
% We need package \pkg{scrkbase}. We could load this also together with
% \pkg{tocbasic}, which is loaded later. But loading it on its own, we can
% require a minimum version.
% \begin{description}
% \item[Todo:] Package \pkg*{contract} is no longer a
%   \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} package. So it
%   should not use the internal
%   \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} package
%   \pkg{scrkbase}. For keys of contract environments we can just load
%   \pkg{scrbase}. For package options we should either also switch to
%   \pkg{scrbase} or use native key-value options of \LaTeX. After doing so we
%   would be able to replace \pkg*{scrkbase} at least by \pkg{scrextend}. With
%   this package we still could use commands like
%   \cs{setkomafont}. Theoretically we would also be able to still use
%   \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} options, but this
%   would still not be recommended.
% \end{description}
%    \begin{macrocode}
%<*init>
\RequirePackage{scrkbase}[2013/03/26]
%</init>
%    \end{macrocode}
%
% And now, \pkg{tocbasic}.
%    \begin{macrocode}
%<*init>
\RequirePackage{tocbasic}
%</init>
%    \end{macrocode}
%
% \section{Options}
%
% \begin{option}{contract}
% \begin{macro}{\if@documentcontract,
%               \@documentcontractfalse,\@documentcontracttrue}
% \changes{scrjura-v3.36}{2022/01/25}{switched to a
% \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} option} Option
% \opt{contract} can be used to make the whole document to be a 
% contract. But in this case you are not allowed to reuse the \env{contract}
% environment in the document. Nor is it allowed to stop or restart the
% contract. With older \LaTeX{} this is done by adding \cs{contract} to the
% end of \cs{document}. With an up to date \LaTeX{} we us a hook.
%    \begin{macrocode}
%<*options>
\KOMA@ifkey{contract}{@documentcontract}
\IfLTXAtLeastTF{2020/10/01}{%
  \AddToHook{begindocument/end}{%
    \RelaxFamilyKey[.contract.sty]{KOMA}{contract}%
    \if@documentcontract\expandafter\contract\fi
  }%
}{%
  \g@addto@macro\document{%
    \RelaxFamilyKey[.contract.sty]{KOMA}{contract}%
    \if@documentcontract\expandafter\contract\fi
  }%
}
%</options>
%    \end{macrocode}
% \end{macro}
% \end{option}
%
% \begin{option}{juratotoc}
% \changes{scrjura-v3.39}{2022/11/11}{initial dot in member argument of
%   option storage commands removed}
% Allow to set the toc level of the entries. Value \optvalue{true} is
% the same like \optvalue{2}, value \optvalue{false} is the same like
% \cs{maxdimen}.  \changes{scrjura-v0.7}{2013/11/04}{usage of renewed
% interface with \cs{FamilyKeyState}}
% \changes{scrjura-v0.9a}{2015/03/09}{internal value storage}
% \begin{macro}{\if@juratotoc}
% \changes{scrjura-v0.6}{2011/09/29}{replaced by counter}
% \begin{counter}{juratoclevel}
% \changes{scrjura-v0.6}{2011/09/29}{definition moved}
% \changes{scrjura-v3.27}{2019/02/25}{removed}
% \begin{macro}{\toclevel@cpar}
% \changes{scrjura-v0.7}{2013/06/09}{new, because of \pkg{hyperref}}
% \changes{scrjura-v3.27}{2019/02/25}{handled by \pkg{tocbasic}}
%    \begin{macrocode}
%<*options>
\KOMA@key{juratotoc}[true]{%
  \KOMA@set@ifkey{juratotoc}{@tempswa}{#1}%
  \ifx\FamilyKeyState\FamilyKeyStateProcessed
    \if@tempswa
      \DeclareTOCStyleEntry[level=2]{default}{cpar}%
    \else
      \DeclareTOCStyleEntry[level=\maxdimen]{default}{cpar}%
    \fi
  \else
    \DeclareTOCStyleEntry[level=#1]{default}{cpar}%
  \fi
  \KOMA@kav@xreplacevalue{contract.sty}{juratotoc}{\cpartocdepth}%
}
\KOMA@kav@xadd{contract.sty}{juratotoc}{\cpartocdepth}%
%</options>
%    \end{macrocode}
% \end{macro}
% \end{counter}
% \end{macro}
% \end{option}
%
% \begin{option}{juratocnumberwidth,juratocindent}
% \changes{scrjura-v0.6}{2011/09/29}{new}
% \changes{scrjura-v0.7}{2013/11/04}{usage of renewed interface with
%   \cs{FamilyKeyState}}
% \changes{scrjura-v0.9a}{2015/03/09}{internal value storage}
% \changes{scrjura-v3.39}{2022/11/11}{initial dot in member argument of option storage
%   commands removed}
% \begin{ilength}{\cpar@numberwidth,\cpar@indent}
% \changes{scrjura-v0.6}{2011/09/29}{new}
% \changes{scrjura-v3.27}{2019/02/25}{replaced by usage of \cs{DeclareTOCStyleEntry}}
% Indent and number width of the toc entries.
% \begin{description}
% \item[Todo:] Since we are using package \pkg{tocbasic} for the ToC entries
%   these options (and lengths) are not needed any longer, but users should
%   use \cs{DeclareTOCStyleEntry} to setup the number width and indent of the
%   entries.
% \end{description}
%    \begin{macrocode}
%<*options>
\KOMA@key{juratocnumberwidth}{%
  \DeclareTOCStyleEntry[numwidth=#1]{default}{cpar}%
  \FamilyKeyStateProcessed
  \KOMA@kav@replacevalue{contract.sty}{juratocnumberwidth}{#1}%
}
\KOMA@kav@add{contract.sty}{juratocnumberwidth}{2em}
\KOMA@key{juratocindent}{%
  \DeclareTOCStyleEntry[indent=#1]{default}{cpar}%
  \FamilyKeyStateProcessed
  \KOMA@kav@replacevalue{contract.sty}{juratocindent}{#1}%
}
\KOMA@kav@add{contract.sty}{juratocindent}{1.5em}%
%</options>
%    \end{macrocode}
% \end{ilength}
% \end{option}
%
% \begin{option}{juratitlepagebreak}
% \changes{scrjura-v0.5b}{2010/04/05}{new}
% The options sets the boolean \cs{if@juratitlepagebreak}.
% \begin{macro}{\if@juratitlepagebreak,
%               \@juratitlepagebreaktrue,\@juratitlepagebreakfalse}
% If the boolean is \cs{iftrue} page breaks inside clause headings are
% allowed (which is not recommended).
% \begin{description}
% \item[Todo:] Re-implementation either using a native key-value option (easy)
%   or a new \pkg{scrbase} family.
% \end{description}
%    \begin{macrocode}
%<*options>
\KOMA@ifkey{juratitlepagebreak}{@juratitlepagebreak}
%</options>
%    \end{macrocode}
% \end{macro}
% \end{option}
%
% \begin{option}{parnumber}
% \changes{scrjura-v0.6}{2011/09/29}{new}
% \changes{scrjura-v0.6a}{2012/10/15}{value mistake message changed}
% \changes{scrjura-v0.7}{2013/11/04}{usage of renewed interface with
%   \cs{FamilyKeyState}}
% \changes{scrjura-v0.9a}{2015/03/09}{internal value storage}
% \changes{scrjura-v3.28}{2019/11/18}{\cs{ifstr} renamed into \cs{Ifstr}}
% \changes{scrjura-v3.39}{2022/11/11}{initial dot in member argument of option storage
%   commands removed}
% The options switches the (automatic) paragraph numbering.
% \begin{description}
% \item[Todo:] Re-implementation either using a native key-value option (easy)
%   or a new \pkg{scrbase} family.
% \end{description}
%    \begin{macrocode}
%<*options>
\newif\ifparnumber
\KOMA@key{parnumber}[true]{%
  \Ifstr{#1}{auto}{%
    \AutoPar
    \FamilyKeyStateProcessed
    \KOMA@kav@remove{contract.sty}{parnumber}{manual}%
    \KOMA@kav@remove{contract.sty}{parnumber}{auto}%
    \KOMA@kav@add{contract.sty}{parnumber}{auto}%
  }{%
    \Ifstr{#1}{manual}{%
      \ManualPar
      \FamilyKeyStateProcessed
      \KOMA@kav@remove{contract.sty}{parnumber}{manual}%
      \KOMA@kav@remove{contract.sty}{parnumber}{auto}%
      \KOMA@kav@add{contract.sty}{parnumber}{manual}%
    }{%
      \KOMA@set@ifkey{parnumber}{parnumber}{#1}%
      \KOMA@kav@replacebool{contract.sty}{parnumber}{parnumber}%
    }%
  }%
}
\KOMA@kav@add{contract.sty}{parnumber}{true}
\KOMA@kav@add{contract.sty}{parnumber}{auto}
%</options>
%    \end{macrocode}
% \end{option}
%
% \begin{option}{paragraphmark,clausemark}
% \changes{scrjura-v0.9h}{2016/04/11}{\opt{paragraphmark} renamed to
%   \opt{clausemark}}
% \changes{scrjura-v0.7}{2013/11/04}{usage of renewed interface with
%   \cs{FamilyKeyState}}
% \changes{scrjura-v0.9a}{2015/03/09}{internal value storage}
% \changes{scrjura-v3.39}{2022/11/11}{initial dot in member argument of option
%   storage commands removed}
% \begin{description}
% \item[Todo:] Re-implementation either using a native key-value option
%   or a new \pkg{scrbase} family (easy).
% \end{description}
%   \begin{option}{markright,markboth}
% \changes{scrjura-v0.7}{2013/11/04}{deprecated}
% \changes{scrjura-v3.39}{2022/11/16}{only with \KOMAScript~3}
% \begin{description}
% \item[Todo:] Remove deprecated options, because they need an internal
%   \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} macro.
% \end{description}
% \begin{command}{\Clausemark}
% \changes{scrjura-v0.5e}{2011/08/31}{support for \cs{MakeMarkcase}}
% The options are used to activate either \cs{markright} or \cs{markboth} for
% clauses. \cs{Clausemark} expects not only the title but also the
% number. So it differs from, e.g., \cs{chaptermark}, which uses the counter
% automatically. But maybe I will change this some time.
%    \begin{macrocode}
%<*options>
\newcommand*{\Clausemark}[1]{}
\KOMA@key{clausemark}{%
  \begingroup
    \KOMA@set@ncmdkey{clausemark}{@tempa}{%
      {false}{0},{off}{0},{no}{0},%
      {forceright}{1},%
      {forceboth}{2},%
      {right}{3},%
      {both}{4}%
    }{#1}%
  \ifx\FamilyKeyState\FamilyKeyStateProcessed
    \ifcase\number\@tempa
      \endgroup
      \let\Clausemark\@gobble
    \or
      \endgroup
      \renewcommand*{\Clausemark}[1]{%
        \markright{\csname MakeMarkcase\endcsname{##1}}}%
    \or
      \endgroup
      \renewcommand*{\Clausemark}[1]{%
        \markboth{\csname MakeMarkcase\endcsname{##1}}%
                 {\csname MakeMarkcase\endcsname{##1}}}%
    \or
      \endgroup
      \renewcommand*{\Clausemark}[1]{%
        \ifx
          \@mkboth\@gobbletwo
        \else
          \markright{\csname MakeMarkcase\endcsname{##1}}%
        \fi}%
    \or
      \endgroup
      \renewcommand*{\Clausemark}[1]{%
        \@mkboth{\csname MakeMarkcase\endcsname{##1}}%
                {\csname MakeMarkcase\endcsname{##1}}}%
    \else
      \endgroup
    \fi
    \FamilyKeyStateProcessed
  \else
    \endgroup
    \FamilyKeyStateUnknownValue
  \fi
  \KOMA@kav@xreplacevalue{contract.sty}{clausemark}{#1}%
}
\KOMA@kav@add{contract.sty}{clausemark}{false}
\@ifundefined{KOMA@DeclareDeprecatedOption}{}{%
  \KOMA@DeclareDeprecatedOption[contract]{markright}{clausemark=forceright}%
  \KOMA@DeclareDeprecatedOption[contract]{markboth}{clausemark=forceboth}%
}
\KOMA@key{paragraphmark}{%
  \PackageWarningNoLine{contract}{%
    You've used obsolete option `paragraphmark'.\MessageBreak
    Usage of this option is deprecated.\MessageBreak
    You should simply replace `paragraphmark'\MessageBreak
    by `clausemark'%
  }%
  \KOMAExecuteOptions[.contract.sty]{clausemark=#1}%
}
%</options>
%    \end{macrocode}
% \end{command}
% \end{option}
% \end{option}
%
% \begin{option}{ref}
% \changes{scrjura-v0.5d}{2010/06/07}{new values \optvalue{nopar},
%   \optvalue{nosentence}, \optvalue{OnlyParagraph}}
% \changes{scrjura-v0.7}{2013/11/04}{usage of renewed interface with
%   \cs{FamilyKeyState}}
% \changes{scrjura-v0.9a}{2015/03/09}{internal value storage}
% \changes{scrjura-v3.39}{2022/11/11}{initial dot in member argument of option
%   storage commands removed}
% \begin{description}
% \item[Todo:] Re-implementation either using a native key-value option
%   or a new \pkg{scrbase} family (easy).
% \end{description}
% \begin{option}{parcitename,sentencecitename}
% \changes{scrjura-v0.5d}{2010/06/07}{deprecated}
% \changes{scrjura-v3.39}{2022/11/16}{only with \KOMAScript~3}
% The formatting of the references of paragraphs and sentences. There are a
% long a short and a numeric form.
% \begin{description}
% \item[Todo:] Remove deprecated options, because they need an internal
%   \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} macro.
% \end{description}
% \begin{macro}{\parcite@format,\sentencecite@format}
% Default is the long form. Corresponding values of the two helper macros are:
% 0 = long, 1 = short, 2 = numerical, -1 = nothing.
%    \begin{macrocode}
%<*options>
\newcommand*{\parcite@format}{0}
\newcommand*{\sentencecite@format}{0}
%    \end{macrocode}
% \end{macro}
% The options can be used to change the default.
%    \begin{macrocode}
\KOMA@key{ref}{%
  \begingroup
    \KOMA@set@ncmdkey{ref}{@tempa}{%
      {parlong}{1},{longpar}{1},{ParL}{1},%
      {parshort}{2},{shortpar}{2},{ParS}{2},%
      {parnumeric}{3},{numericpar}{3},{ParN}{3},%
      {paroff}{4},{nopar}{4},%
      {sentencelong}{10},{longsentence}{10},{SentenceL}{10},%
      {sentenceshort}{20},{shortsentence}{20},{SentenceS}{20},%
      {sentencenumeric}{30},{numericsentence}{30},{SentenceN}{30},%
      {sentenceoff}{40},{nosentence}{40},%
      {long}{11},%
      {short}{22},%
      {numeric}{33},%
      {paragraphonly}{44},{onlyparagraph}{44},%
      {ParagraphOnly}{44},{OnlyParagraph}{44}%
    }{#1}%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \aftergroup\FamilyKeyStateProcessed
      \@tempcnta=\@tempa\relax
      \@tempcntb=\z@
      \@whilenum \@tempcnta>9 \do{%
        \advance\@tempcnta -10\relax
        \advance\@tempcntb \@ne\relax
      }%
      \ifcase \@tempcnta
      \or
        \aftergroup\def\aftergroup\parcite@format
        \aftergroup{\aftergroup0\aftergroup}%
      \or
        \aftergroup\def\aftergroup\parcite@format
        \aftergroup{\aftergroup1\aftergroup}%
      \or
        \aftergroup\def\aftergroup\parcite@format
        \aftergroup{\aftergroup2\aftergroup}%
      \or
        \aftergroup\def\aftergroup\parcite@format
        \aftergroup{\aftergroup-\aftergroup1\aftergroup}%
      \fi
      \ifcase \@tempcntb
      \or
        \aftergroup\def\aftergroup\sentencecite@format
        \aftergroup{\aftergroup0\aftergroup}%
      \or
        \aftergroup\def\aftergroup\sentencecite@format
        \aftergroup{\aftergroup1\aftergroup}%
      \or
        \aftergroup\def\aftergroup\sentencecite@format
        \aftergroup{\aftergroup2\aftergroup}%
      \or
        \aftergroup\def\aftergroup\sentencecite@format
        \aftergroup{\aftergroup-\aftergroup1\aftergroup}%
      \fi
    \else
      \aftergroup\FamilyKeyStateUnknownValue
    \fi
  \endgroup
  \ifx\FamilyKeyState\FamilyKeyStateProcessed
    \KOMA@kav@removekey{contract.sty}{ref}%
    \ifcase\parcite@format
      \KOMA@kav@add{contract.sty}{ref}{parlong}%
    \or
      \KOMA@kav@add{contract.sty}{ref}{parshort}%
    \or
      \KOMA@kav@add{contract.sty}{ref}{parnumeric}%
    \or
      \KOMA@kav@add{contract.sty}{ref}{paroff}%
    \fi
    \ifcase\sentencecite@format
      \KOMA@kav@add{contract.sty}{ref}{sentencelong}%
    \or
      \KOMA@kav@add{contract.sty}{ref}{sentenceshort}%
    \or
      \KOMA@kav@add{contract.sty}{ref}{sentencenumeric}%
    \or
      \KOMA@kav@add{contract.sty}{ref}{sentenceoff}%
    \fi
  \fi
}
\KOMA@kav@add{contract.sty}{ref}{parlong}%
\KOMA@kav@add{contract.sty}{ref}{sentencelong}%
\@ifundefined{KOMA@DeclareDeprecatedOption}{}{%
  \KOMA@DeclareDeprecatedOption[contract]{parcitename}{ref=parlong}
  \KOMA@DeclareDeprecatedOption[contract]{sentencecitename}{ref=sentencelong}
}
%</options> 
%    \end{macrocode}
% \end{option}
% \end{option}
%
% Execute the options.
%    \begin{macrocode}
%<*postoptions>
\KOMAProcessOptions\relax
%</postoptions>
%    \end{macrocode}
%
% \section{Deprecated Paragraph Commands}
%
% All these commands are deprecated and now generate error messages instead of
% code.
%
% \begin{command}{\Paragraph,\SubParagraph,\refParagraph,\refParagraphN,
%                 \DeprecatedParagraph,\ParagraphCompatibilityHacks}
% \changes{scrjura-v1.0}{2014/11/22}{throw error for deprecated commands but
%   only once}
% \begin{description}
% \item[Todo:] Remove deprecated commands, because they already throw errors
%   for about nine years.
% \end{description}
%    \begin{macrocode}
%<*body>
\providecommand*{\DeprecatedParagraph}{%
  \PackageError{contract}{modification of old document needed}{%
    It seem that this document was made for scrjura up to version
    0.7a.\MessageBreak
    Since scrjura version 0.9 \string\Paragraph, \string\SubParagraph, and all
    depending\MessageBreak
    commands, options, and counters have been renamed.\MessageBreak
    You should replace the terms `Paragraph' and `paragraph` by `Clause`
    and\MessageBreak
    `clause` if they are part of the name of a contract feature, otherwise
    this\MessageBreak
    document may produce severall additional error messages and maybe the
    wrong\MessageBreak
    result. Sorry for the inconvenience.%
  }%
  \ParagraphCompatibilityHacks
}
\newcommand*{\ParagraphCompatibilityHacks}{%
  \PackageWarning{contract}{compatibility hacks for `\string\Paragraph'
    executed.\MessageBreak
    There is no support for documents using these hacks!\MessageBreak
    There is no warranty for real compatibility!\MessageBreak
    Even if the LaTeX run of the document doesn't report\MessageBreak
    any error, the result may be completely wrong.\MessageBreak
    Therefore it is recommended to solve the problem,\MessageBreak
    instead of trying to work around using the\MessageBreak
    compatibility hacks%
  }%
  \gdef\Paragraph{\Clause}%
  \gdef\SubParagraph{\SubClause}%
  \gdef\c@Paragraph{\c@Clause}%
  \gdef\cl@Paragraph{\cl@Clause}%
  \gdef\c@SubParagraph{\c@SubClause}%
  \gdef\cl@SubParagraph{\cl@SubClause}%
  \gdef\theParagraph{\theClause}%
  \gdef\theSubParagraph{\theSubClause}%
  \gdef\refParagraph{\refClause}%
  \gdef\refParagraphN{\refClauseN}%
  \aliaskomafont{Paragraph}{Clause}%
  \scr@ifundefinedorrelax{Paragraphmark}{}{%
    \global\let\Clausemark\Paragraphmark
  }%
}
\providecommand*{\Paragraph}{\DeprecatedParagraph\Paragraph}
\providecommand*{\SubParagraph}{\DeprecatedParagraph\SubParagraph}
\providecommand*{\refParagraph}{\DeprecatedParagraph\refParagraph}
\providecommand*{\refParagraphN}{\DeprecatedParagraph\refParagraphN}
%</body>
%    \end{macrocode}
% \end{command}
%
%
% \section{Contracts, Clauses, Paragraphs and Sentences}
%
%
% \begin{macro}{\contract@env@type}
% \changes{scrjura-v0.5d}{2010/04/28}{new}
% \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@env@type} renamed}
% \changes{v0.0.1}{2023-10-10}{\cs{scrjura@env@type} renamed}
% This macro shows the currently active \pkg*{contract} environment.
%    \begin{macrocode}
%<*body>
\newcommand*{\contract@env@type}{}
%</body>
%    \end{macrocode}
% \end{macro}
%
%
% \begin{command}{\ellipsispar}
% \changes{scrjura-v0.7}{2013/05/02}{new}
% \changes{scrjura-v0.7b}{2014/11/03}{\cs{thecontractAbsoluteClause} made more
%   flexible}
% \changes{scrjura-v0.9g}{2016/03/25}{write to \file{aux}-file only \cs{if@filesw}}
% \begin{command}{\parellipsis}
% \changes{scrjura-v0.7}{2013/05/02}{new}
% Count one or more paragraphs given by the optional argument but print
% \cs{parellipsis} instead of a real paragraph. The default is either
% \cs{dots} or \cs{textellipsis} if available.
% \changes{scrjura-v0.7}{2013/05/02}{new}
%    \begin{macrocode}
%<*body>
\newcommand*{\ellipsispar}[1][1]{%
  \begingroup
    \KOMAoptions{parnumber=manual}\parellipsis\par
    \addtocounter{par}{#1}%
    \if@filesw
      \protected@write\@auxout{}{%
        \string\newmaxpar{\contract@env@type}%
                         {\csname the\contract@env@type 
                           AbsoluteClause\endcsname}%
                         {\thepar}%
      }%
    \fi
  \endgroup
  \addtocounter{par}{-1}\refstepcounter{par}%
  \ignorespaces
}
\newcommand*{\parellipsis}{%
  \scr@ifundefinedorrelax{textellipsis}{\dots}{\textellipsis}%
}
%</body>
%    \end{macrocode}
% \end{command}
% \end{command}
%
% \begin{environment}{contract}
% \changes{scrjura-v0.5d}{2010/04/28}{missing error message added}
% \changes{scrjura-v0.5d}{2010/04/28}{not self-redefining any more}
% \changes{scrjura-v0.5d}{2010/04/28}{defining \cs{jura@env@type}}
% \changes{scrjura-v3.36}{2022/01/25}{defining an environment (because of hooks)}
% \begin{macro}{\if@contract@skiphyperref}
% \changes{v0.0.1}{2023-10-10}{\cs{if@scrjura@skiphyperref} renamed}
% \begin{counter}{contractClause}
% \begin{command}{\thecontractClause}
% \changes{scrjura-v0.9b}{2015/05/01}{must use counter \cnt{Clause} instead of
%   \cnt{contractClause}}
% \begin{macro}{\contract@Clauseformat}
% \begin{command}{\Clauseformat,\paragraphformat}
% \changes{scrjura-v0.6b}{2013/04/16}{redefinition of \cs{paragraphformat}}
% \begin{counter}{contractSubClause}
% \changes{scrjura-v0.9b}{2015/05/01}{must use counter \cnt{SubClause} instead of
%   \cnt{contractSubClause}}
% \begin{command}{\thecontractSubClause}
% \begin{counter}{contractAbsoluteClause}
% \changes{scrjura-v0.7}{2013/04/18}{new (internal) counter for all clauses to make
%   it possible to reset the users clause counter}
% It is not allowed to nest the \env{contract} environments, but you can end
% them and start them new. But this would not end the contract and start a new
% contract but only delay it for some other code.
%    \begin{macrocode}
%<*body>
\newenvironment{contract}{%
  \ifx\contract@env@type\@empty
    \let\@doendpe\contract@doendpe
    \let\Clause\contract@paragraph
    \let\c@Clause\c@contractClause
    \edef\cl@Clause{\cl@Clause\cl@contractClause}%
    \let\SubClause\contract@subparagraph
    \let\c@SubClause\c@contractSubClause
    \edef\cl@SubClause{\cl@SubClause\cl@contractSubClause}%
    \let\Sentence\contract@sentence
    \renewcommand*{\contract@env@type}{contract}%
    \aliaskomafont{Clause}{contract.Clause}%
  \else
    \PackageError{contract}{nested `contract` detected}{%
      You may not use a `contract' environment inside\MessageBreak
      a `\contract@env@type' environment or after loading\MessageBreak
      package `contract' with option `\contract@env@type'!}%
  \fi
}{}
\let\if@contract@skiphyperref\iftrue
\let\cl@Clause\@empty
\let\cl@SubClause\@empty
\newcounter{contractClause}
\renewcommand*{\thecontractClause}{%
  {\contract@Clauseformat{\arabic{Clause}}}}
\DeclareRobustCommand*{\contract@Clauseformat}[1]{\Clauseformat{#1}}
\newcommand*{\Clauseformat}[1]{\S~#1}
\newcounter{contractSubClause}
\@addtoreset{SubClause}{Clause}
\renewcommand*{\thecontractSubClause}{%
  {\theClause\alph{SubClause}}}
\newcounter{contractAbsoluteClause}
%</body>
%    \end{macrocode}
% \end{counter}
% \end{command}
% \end{counter}
% \end{command}
% \end{macro}
% \end{command}
% \end{counter}
% \end{macro}
% \end{environment}
%
% \begin{command}{\DeclareNewJuraEnvironment}
% \changes{scrjura-v0.9}{2014/11/12}{new}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifnextchar} replaced by
%   \cs{kernel@ifnextchar}}
% Using \cs{@defjuraenvironment} to define a new juristic environment. This
% can be done only in document preamble.
%    \begin{macrocode}
%<*body>
\newcommand*{\DeclareNewJuraEnvironment}[1]{%
  \@ifundefined{#1}{\expandafter\let\csname #1\expandafter\endcsname
    \csname end#1\endcsname}{}%
  \@ifundefined{#1}{\let\reserved@defjuraenvironment\@defjuraenvironment}{%
    \PackageError{contract}{ignorring declaration of `#1'}{%
      You've tried to declare jura environment `#1', but
      environment\MessageBreak
      `#1' or command
      \expandafter\string\csname #1\endcsname\space or
      \expandafter\string\csname end#1\endcsname\MessageBreak
      already exists.\MessageBreak
      Declaration will be ignored}%
    \long\def\reserved@defjuraenvironment##1[##2]##3##4{}%
  }%
  \kernel@ifnextchar [%]
    {\reserved@defjuraenvironment{#1}}{\reserved@defjuraenvironment{#1}[]}%
}
\@onlypreamble\DeclareNewJuraEnvironment
%    \end{macrocode}
% \begin{macro}{\@defjuraenvironment}
% \changes{scrjura-v0.9}{2014/11/04}{new}
% \changes{scrjura-v3.25}{2017/12/08}{new command options \texttt{ClauseFont}}
% \changes{scrjura-v3.25}{2017/12/08}{\cs{reserved@defjuraenvironment} set
%   back to \cs{relax}}
% \changes{scrjura-v3.25}{2017/12/08}{using local instead of global command
%   options}
% This command is used to define a new \pkg*{contract} environment like
% \env{contract}. Several options are provided (see the user manual for
% details).
%    \begin{macrocode}
\DefineFamily{KOMAarg}
\DefineFamilyMember{KOMAarg}
\newcommand{\@defjuraenvironment}{}
\long\def\@defjuraenvironment#1[#2]#3#4{%
  \let\reserved@defjuraenvironment\relax
%    \end{macrocode}
% The counters:
%    \begin{macrocode}
  \newcounter{#1Clause}%
  \newcounter{#1AbsoluteClause}%
  \newcounter{#1SubClause}%
  \FamilyCSKey[.contract.sty]{KOMAarg}{Clause}{#1@Clause}%
  \FamilyCSKey[.contract.sty]{KOMAarg}{SubClause}{#1@SubClause}%
  \FamilyCSKey[.contract.sty]{KOMAarg}{Sentence}{#1@Sentence}%
  \DefineFamilyKey[.contract.sty]{KOMAarg}{ClauseNumberFormat}{%
    \expandafter\def\csname #1@Clauseformat \endcsname####1{##1{####1}}%
    \expandafter\edef\csname #1@Clauseformat\endcsname{%
      \noexpand\protect\expandafter\noexpand\csname #1@Clauseformat \endcsname
    }%
    \FamilyKeyStateProcessed
  }
  \DefineFamilyKey[.contract.sty]{KOMAarg}{ClauseFont}{%
    \IfExistskomafont{#1.Clause}{%
      \IfIsAliaskomafont{#1.Clause}{%
        \expandafter\let\csname scr@fnt@instead@#1.Clause\endcsname\relax
        \newkomafont{#1.Clause}{##1}%
      }{\setkomafont{#1.Clause}{##1}}%
    }{%
      \newkomafont{#1.Clause}{##1}%
    }%
  }
  \FamilyExecuteOptions[.contract.sty]{KOMAarg}{#2}%
  \RelaxFamilyKey[.contract.sty]{KOMAarg}{ClauseFont}%
  \RelaxFamilyKey[.contract.sty]{KOMAarg}{ClauseNumberFormat}%
  \RelaxFamilyKey[.contract.sty]{KOMAarg}{Sentence}%
  \RelaxFamilyKey[.contract.sty]{KOMAarg}{SubClause}%
  \RelaxFamilyKey[.contract.sty]{KOMAarg}{Clause}%
  \@ifundefined{#1@Clauseformat}{%
    \expandafter\DeclareRobustCommand\expandafter*%
    \csname #1@Clauseformat\endcsname[1]{\Clauseformat{##1}}%
  }{}%
%    \end{macrocode}
% \changes{scrjura-v0.9c}{2015/05/13}{defining \cs{the\dots Clause}}
% \changes{scrjura-v0.9f}{2016/02/24}{\cs{protect}\cs{@nameuse} instead of
%     \cs{csname}\dots\cs{endcsname}}
%    \begin{macrocode}
  \expandafter\renewcommand\expandafter*\csname the#1Clause\endcsname{%
    \protect\@nameuse{#1@Clauseformat}{\arabic{#1Clause}}}%
%    \end{macrocode}
% Environment:
%    \begin{macrocode}
  \newenvironment{#1}{%
    \par
    \ifx\contract@env@type\@empty
      \edef\contract@env@type{#1}%
      \let\@doendpe\contract@doendpe
      \expandafter\let\expandafter\c@Clause\csname c@#1Clause\endcsname
      \edef\cl@Clause{\cl@Clause\csname cl@#1Clause\endcsname}%
      \expandafter\let\expandafter\c@SubClause
        \csname c@#1SubClause\endcsname
      \edef\cl@SubClause{\cl@SubClause
        \csname cl@#1SubClause\endcsname}%
      \@ifundefined{#1@Clause}{%
        \let\Clause\contract@paragraph
      }{%
        \expandafter\let\expandafter\Clause
        \csname #1@Clause\endcsname
      }%
      \@ifundefined{#1@SubClause}{%
        \let\SubClause\contract@subparagraph
      }{%
        \expandafter\let\expandafter\SubClause
        \csname #1@SubClause\endcsname
      }%
      \@ifundefined{#1@Sentence}{%
        \let\Sentence\contract@sentence
      }{%
        \expandafter\let\expandafter\Sentence\csname #1@Sentence\endcsname
      }%
      \@ifundefined{\contract@env@type @everypar}{%
        \expandafter\let
        \csname \contract@env@type @everypar\endcsname
        \contract@everypar
      }{}%
%    \end{macrocode}
% Font alias for \fnt{Clause}. If neither a font not an alias is defined for
% the new environment \fnt{contract.Clause} is used.
% \changes{scrjura-v3.25}{2017/12/08}{Font alias fixed}
%    \begin{macrocode}
      \IfExistskomafont{#1.Clause}{%
        \IfIsAliaskomafont{#1.Clause}{%
          \aliaskomafont{Clause}{\csname scr@fnt@instead@#1.Clause\endcsname}%
        }{%
          \aliaskomafont{Clause}{#1.Clause}%
        }%
      }{%
        \aliaskomafont{Clause}{contract.Clause}%
      }%
      #3%
    \else
      \PackageError{contract}{nested contract environments detected}{%
        You must not use a `#1' environment inside\MessageBreak
        a `\contract@env@type' environment or after loading\MessageBreak
        package `contract' with option `\contract@env@type'!}%
    \fi
  }{%
    #4%
    \par
  }%
}
%</body>
%    \end{macrocode}
% \end{macro}%^^A \@dewjuraenvironment
% \end{command}%^^A \DeclareNewJuraEnvironment
%
% \begin{macro}{\contract@paragraph}
% This is the \cs{Clause} used by contracts. A contract consists (usually) of
% several clauses. Each clause has optional elements managed by
% \meta{key}=\meta{value} pairs handled by \pkg{scrkbase} and last but not
% least by \pkg{keyval}.
% \begin{option}{title,head,nohead}
% \begin{option}{entry,noentry}
% \changes{scrjura-v0.6}{2011/09/30}{deprecated}
% \begin{option}{tocentry,notocentry}
% \changes{scrjura-v0.6}{2011/09/30}{new}
% Title, running head and toc entry of the clause. The title is the default
% for running head and toc entry. But you can also use an empty value for
% each of them or use the \texttt{no\dots} options to switch them off.
%    \begin{macrocode}
%<*body>
\define@key{contract}{title}{%
  \def\contract@title{#1}%
  \ifx\contract@entry\relax\def\contract@entry{\contract@title}\fi
  \ifx\contract@head\relax\def\contract@head{\contract@title}\fi
}
\define@key{contract}{entry}{%
  \PackageWarning{contract}{deprecated option `entry'.\MessageBreak
    You should use option `tocentry' instead of\MessageBreak
    option `entry'%
  }%
  \def\contract@entry{#1}}
\define@key{contract}{tocentry}{\def\contract@entry{#1}}
\define@key{contract}{noentry}[]{%
  \PackageWarning{contract}{deprecated option `noentry'.\MessageBreak
    You should use option `notocentry' instead of\MessageBreak
    option `noentry'%
  }%
  \let\contract@entry\relax}
\define@key{contract}{notocentry}[]{\let\contract@entry\relax}
\define@key{contract}{head}{\def\contract@head{#1}}
\define@key{contract}{nohead}[]{\let\contract@head\relax}
%    \end{macrocode}
% \end{option}
% \end{option}
% \end{option}
% \begin{option}{number}
% The number can be changed manually. But clauses without numbers are not
% allowed. So if you use an empty value, the number is automatically set.
%    \begin{macrocode}
\define@key{contract}{number}{\def\contract@number{#1}}
%    \end{macrocode}
% \end{option}
% \begin{macro}{\contract@preskip,\contract@postskip}
% \begin{option}{preskip,postskip}
% The options are used to specify the distance before and after the
% clause. The preset value of these options are the global settings done by
% |\setkeys{contract}{…}|.
%    \begin{macrocode}
\newcommand*{\contract@preskip}{2\baselineskip}
\newcommand*{\contract@postskip}{\baselineskip}
\define@key{contract}{preskip}{\def\contract@preskip{#1}}
\define@key{contract}{postskip}{\def\contract@postskip{#1}}
%    \end{macrocode}
% \end{option}
% \end{macro}
% \begin{option}{dummy}
% The option switches the boolean \cs{ifcontract@dummy}.
% \begin{macro}{\ifcontract@dummy}
% If the boolean is \cs{iftrue} the clause will not be printed. But note: you
% cannot use this to remove the paragraphs or sentences of the clause. But you
% can use this option to generate holes in the numbering without manually
% manipulating the counters.
%    \begin{macrocode}
\newif\ifcontract@dummy
\define@key{contract}{dummy}[true]{\csname contract@dummy#1\endcsname}
%    \end{macrocode}
% \end{macro}
% \end{option}
% \begin{fontelement}{contract.Clause}
% \begin{macro}{\contract@paragraph@font}
% \changes{scrjura-v3.25}{2017/12/08}{using element \fnt{Clause} instead of
%   \fnt{contract.Clause}}
% Correctly this macro should be named \cs{contract@paragraph@format}. But it
% is already used by some users for ugly tricks. So I will not rename it to
% avoid problems for existing documents. Additionally it would be better to
% use a new macro per environment. However the same reason not to change this.
%    \begin{macrocode}
\newkomafont{contract.Clause}{\sffamily\bfseries\large}
\newcommand*{\contract@paragraph@font}{\usekomafont{Clause}%
  \@hangfrom}
%    \end{macrocode}
% \end{macro}
% \end{fontelement}
% \begin{counter}{@AbsClause}
% \begin{macro}{\theH@AbsClause}
% \changes{scrjura-v3.41}{2023/06/24}{Ulrike Fischer requested to use \cs{def} instead
%   of \cs{newcommand*}}
% \begin{command}{\theHClause,\theHSubClause}
% \changes{scrjura-v3.41}{2023/06/24}{Ulrike Fischer requested to use \cs{def} instead
%   of \cs{newcommand*}}
%    \begin{macrocode}
% Here we have some not good tested code for \pkg{hyperref}.
\newcounter{@AbsClause}
\def\theH@AbsClause{P-\arabic{@AbsClause}}
\def\theHClause{\theH@AbsClause}
\def\theHSubClause{\theH@AbsClause}
%    \end{macrocode}
% \end{command}
% \end{macro}
% \end{counter}
% For the headings we use manual paragraph numbering, because we don't want
% any paragraph numbering inside the heading. After initializing the options
% they are processed.
% \changes{scrjura-v0.7}{2013/04/18}{increase counter
%   \cnt{contractAbsoluteClause}}
% \changes{scrjura-v0.7b}{2014/11/03}{more flexible
%   \cnt{\meta{environment}AbsoluteClause}}
% \changes{v0.0.2}{2024/01/23}{the argument is optional}
%    \begin{macrocode}
\NewDocumentCommand\contract@paragraph {o} {%
  \stepcounter{\contract@env@type AbsoluteClause}%
  \ManualPar\parnumbertrue
  \let\contract@title\relax
  \let\contract@entry\relax
  \let\contract@head\relax
  \let\contract@number\relax
  \contract@dummyfalse
  \IfValueT{#1}{\setkeys{contract}{#1}}%
%    \end{macrocode}
% Unless this is a dummy clause, the headings will be initialized and vertical
% skips will be done.
% \changes{scrjura-v0.6a}{2012/10/08}{missing \cs{par} added}
%    \begin{macrocode}
  \ifcontract@dummy\else
    \par
    \@afterindentfalse
    \addvspace{\contract@preskip}%
  \fi
%    \end{macrocode}
% If there isn't a manual number, we use the next number. If there is a manual
% number, this number is printed and we take care that labels and
% \pkg{hyperref} also use the manual number.
% \changes{scrjura-v0.6b}{2013/04/16}{using \cs{contract@Clauseformat} for manual
%   numbers too}
% \changes{scrjura-v0.9c}{2015/05/13}{\cs{thecontractClause} replaced by
%   environment-dependent macro}
%    \begin{macrocode}
  \ifx\contract@number\relax
    \let\p@Clause\@empty
    \expandafter\let\expandafter\theClause
      \csname the\contract@env@type Clause\endcsname
    \refstepcounter{Clause}%
  \else
    \begingroup
      \let\@elt\@stpelt
      \cl@Clause
    \endgroup
%    \end{macrocode}
% \changes{scrjura-v0.9f}{2016/02/24}{\cs{protect}\cs{@nameuse} instead of
%   \cs{csname}\dots\cs{endcsname}}
% \changes{scrjura-v3.41}{2023/06/24}{update of \cs{@currentcounter} added}
%    \begin{macrocode}
    \protected@edef\theClause{%
      \protect\@nameuse{\contract@env@type @Clauseformat}{\contract@number}%
    }%
    \protected@edef\@currentlabel{\theClause}%
    \def\@currentcounter{Clause}%
  \fi
  \stepcounter{@AbsClause}%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname if@skiphyperref\endcsname\relax
  \else
    \expandafter\let\csname if@contract@skiphyperref\expandafter\endcsname
    \csname if@skiphyperref\endcsname
  \fi
  \if@contract@skiphyperref\else
    \hyper@refstepcounter{@AbsClause}%
%<+trace>    \typeout{absolute Number: \the@AbsClause^^JLabel: `\@currentHref'}%
  \fi
%    \end{macrocode}
% For simplification we use the code of clauses for sub-clauses.
%    \begin{macrocode}
  \let\theSubClause\theClause
%    \end{macrocode}
% Unless for dummy clauses, the heading is printed, the toc entry is done
% and also the running head.
% \changes{scrjura-v0.7}{2013/04/28}{distance behind the number is part of the number}
% \changes{scrjura-v0.9i}{2017/02/23}{usage of \cs{ext@toc}}
%    \begin{macrocode}
  \ifcontract@dummy\else
    \begingroup
      \if@juratitlepagebreak\else\interlinepenalty\@M\fi
      \contract@paragraph@font{\theClause
        \ifx\contract@title\relax\else\enskip\fi}%
      \contract@title
      \ifx\contract@entry\relax\else
        \expandafter\addxcontentsline\expandafter{\ext@toc}%
        {cpar}[\theClause]\contract@entry
        \addxcontentsline{cpa}{cpar}[\theClause]\contract@entry
      \fi
      \ifx\contract@head\relax\else
        \expandafter\Clausemark\expandafter{%
          \expandafter\theSubClause\expandafter\enskip\contract@head}%
      \fi
      \par
    \endgroup\nobreak\vskip\contract@postskip
%    \end{macrocode}
% Last but not least paragraph numbering is initialized.
%    \begin{macrocode}
    \contract@afterheading
  \fi
}
%</body>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\contract@subparagraph}
% \changes{scrjura-v0.6a}{2012/10/08}{missing \cs{par} added}
% \changes{scrjura-v0.7}{2013/04/18}{increasing counter
%    \cnt{contractAbsoluteClause}}
% \changes{scrjura-v0.7}{2013/04/28}{distance after number}
% \changes{scrjura-v0.9i}{2017/02/23}{usage of \cs{ext@toc}}
% \changes{scrjura-v3.41}{2023/06/24}{update of \cs{@currentcounter} added}
% \changes{v0.0.2}{2024/01/23}{the argument is optional}
% This is almost the same like \cs{contract@paragraph}.
%    \begin{macrocode}
%<*body>
\NewDocumentCommand \contract@subparagraph {o}{%
  \stepcounter{\contract@env@type AbsoluteClause}%
  \ManualPar\parnumbertrue
  \let\contract@title\relax
  \let\contract@entry\relax
  \let\contract@head\relax
  \let\contract@number\relax
  \contract@dummyfalse
  \IfValueT{#1}{\setkeys{contract}{#1}}%
  \ifcontract@dummy\else
    \par
    \@afterindentfalse
    \vskip\contract@preskip
  \fi
  \ifx\contract@number\relax
    \let\p@SubClause\@empty
    \let\theSubClause\thecontractSubClause
    \refstepcounter{SubClause}%
  \else
    \begingroup
      \let\@elt\@stpelt
      \cl@SubClause
    \endgroup
    \protected@edef\theSubClause{\theClause\contract@number}%
    \protected@edef\@currentlabel{\theSubClause}%
    \def\@currentcounter{SubClause}%
  \fi
  \stepcounter{@AbsClause}%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname if@skiphyperref\endcsname\relax
  \else
    \expandafter\let\csname if@contract@skiphyperref\expandafter\endcsname
    \csname if@skiphyperref\endcsname
  \fi
  \if@contract@skiphyperref\else
    \hyper@refstepcounter{@AbsClause}%
%<+trace>    \typeout{absolute Number: \the@AbsClause^^JLabel: `\@currentHref'}%
  \fi
  \ifcontract@dummy\else
    \begingroup
      \if@juratitlepagebreak\else\interlinepenalty\@M\fi
      \contract@paragraph@font{\theSubClause
        \ifx\contract@title\relax\else\enskip\fi}%
      \contract@title
      \ifx\contract@entry\relax\else
        \expandafter\addxcontentsline\expandafter{\ext@toc}%
        {cpar}[\theSubClause]\contract@entry
        \addxcontentsline{cpa}{cpar}[\theSubClause]\contract@entry
      \fi
      \ifx\contract@head\relax\else
        \expandafter\Clausemark\expandafter{%
          \expandafter\theSubClause\expandafter\enskip\contract@head}%
      \fi
      \par
    \endgroup
    \nobreak\vskip\contract@postskip
    \contract@afterheading
  \fi
}
%</body>
%    \end{macrocode}
% \end{macro}
%
% \begin{command}{\AutoPar,\ManualPar}
% Switching between automatic or manual paragraph numbers for all
% \pkg*{contract} environments.
%    \begin{macrocode}
%<*body>
\newcommand*{\AutoPar}{%
  \expandafter\let\expandafter\contract@used@everypar
  \csname \contract@env@type @everypar\endcsname
}
\newcommand*{\ManualPar}{%
  \let\contract@used@everypar\relax
}
%</body>
%    \end{macrocode}
% \end{command}
%
% \begin{macro}{\contract@afterheading}
% \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@afterheading} renamed}
% \changes{scrjura-v0.7b}{2014/11/03}{no argument}
% \changes{scrjura-v3.27}{2019/02/25}{\cs{CheckCommand} for \cs{@afterheading}}
% \changes{v0.0.1}{2023-10-10}{\cs{scrjura@afterheading} renamed}
% Similar to \cs{afterheading} but with automatic paragraph numbers.
% \begin{description}
% \item[ToDo:] Test if this can be done using \LaTeX{} hooks, depending on the
%   \LaTeX{} release.
% \end{description}
%    \begin{macrocode}
%<*body>
\CheckCommand*{\@afterheading}{%
  \@nobreaktrue
  \everypar{%
    \if@nobreak
      \@nobreakfalse
      \clubpenalty \@M
      \if@afterindent \else
        {\setbox\z@\lastbox}%
      \fi
    \else
      \clubpenalty \@clubpenalty
      \everypar{}%
    \fi}%
}
\newcommand*{\contract@afterheading}{%
  \@nobreaktrue
  \everypar{%
    \if@nobreak
      \@nobreakfalse
      \clubpenalty \@M
      \if@afterindent \else
        {\setbox\z@\lastbox}%
      \fi
    \else
      \clubpenalty \@clubpenalty
      \everypar{%
        \contract@used@everypar
      }%
    \fi
    \contract@used@everypar
  }%
  \AutoPar
}
%    \end{macrocode}
% \begin{macro}{\contract@used@everypar}
% \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@everypar} renamed}
% \changes{v0.0.1}{2023-10-10}{\cs{scrjura@everypar} renamed}
% The macro to be used at the very beginning of every paragraph to add the
% number. To be used only inside \pkg*{contract} environments, so empty
% outside.
%    \begin{macrocode}
\newcommand*{\contract@used@everypar}{}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@doendpe}
% \LaTeX{} used this macro, to reset all paragraph actions at the end of
% environments. To avoid unwanted switching-off of the paragraph number it
% will be reinitialized.
% \begin{macro}{\contract@doendpe}
% \changes{v0.0.1}{2023-10-10}{\cs{scrjura@doendpe} renamed}
% \begin{macro}{\IncludeInRelease}
% \changes{scrjura-v0.9e}{2015/11/03}{used temporary}
% \changes{scrjura-v3.28}{2019/11/18}{\cs{ifstr} renamed into \cs{Ifstr}}
% \begin{macro}{\@gobble@IncludeInRelease}
% \changes{scrjura-v0.9e}{2015/11/03}{used temporary}
% \begin{macro}{\EndIncludeInRelease}
% \changes{scrjura-v0.9e}{2015/11/03}{used temporary}
% From \LaTeX{} 2015/01/01 a different definition of \cs{@doendpe} is used. So
% we also have to use different versions depending on the release. We do so
% with some tricks. Maybe this should be replaced by usage of
% \cs{IfLTXAtLeastTF} from already loaded \pkg{scrbase}.
% \begin{description}
% \item[Todo:] Using \cs{everypar} is evil and should be replaced by using a
%   generic paragraph hook.
% \end{description}
%    \begin{macrocode}
\providecommand*{\IncludeInRelease}[3]{%
  \PackageInfo{contract}{temporary definition of \string\IncludeInRelease}%
  \Ifstr{#1}{0000/00/00}{%
    \let\IncludeInRelease\@undefined
    \def\EndIncludeInRelease{\let\EndIncludeInRelease\@undefined}%
  }{%
    \let\EndIncludeInRelease\relax
    \long\def\@gobble@IncludeInRelease##1\EndIncludeInRelease{%
      \let\@gobble@IncludeInRelease\@undefined
    }%
    \expandafter\@gobble@IncludeInRelease
  }%
}
\IncludeInRelease{2015/01/01}{\@doendpe}{clubpenalty fix}
\CheckCommand*\@doendpe{\@endpetrue
     \def\par{\@restorepar
              \clubpenalty\@clubpenalty
              \everypar{}\par\@endpefalse}\everypar
               {{\setbox\z@\lastbox}%
                \everypar{}\@endpefalse}}
\newcommand*{\contract@doendpe}{%
  \@endpetrue
  \def\par{%
    \@restorepar
    \clubpenalty\@clubpenalty
    \everypar{%
      \csname contract@used@everypar\endcsname
    }%
    \par\@endpefalse
  }%
  \everypar{%
    {\setbox\z@\lastbox}\everypar{%
      \csname contract@used@everypar\endcsname
    }%
    \@endpefalse
  }%
}
\EndIncludeInRelease
\IncludeInRelease{0000/00/00}{\@doendpe}{clubpenalty fix}
\CheckCommand*\@doendpe{\@endpetrue
  \def\par{\@restorepar\everypar{}\par\@endpefalse}\everypar
  {{\setbox\z@\lastbox}\everypar{}\@endpefalse}}
\newcommand*{\contract@doendpe}{%
  \@endpetrue
  \def\par{%
    \@restorepar\everypar{%
      \csname contract@used@everypar\endcsname
    }%
    \par\@endpefalse
  }%
  \everypar{%
    {\setbox\z@\lastbox}\everypar{%
      \csname contract@used@everypar\endcsname
    }%
    \@endpefalse
  }%
}
\EndIncludeInRelease
%</body>
%    \end{macrocode}
% \end{macro}%^^A \EndIncludeInRelease
% \end{macro}%^^A \@gobble@IncludeInRelease
% \end{macro}%^^A \IncludeInRelease
% \end{macro}%^^A \contract@doendpe
% \end{macro}%^^A \@doendpe
% \end{macro}%^^A \contract@used@everypar
%
% \section{Entry to Table of Contents}
% \begin{macro}{\l@cpar}
% Toc entry of contract clauses.
% \changes{scrjura-v3.27}{2019/02/25}{usage of \pkg{tocbasic}}
% This is done using \pkg{tocbasic}. The definition has to be part of the
% initialization of the package, otherwise package options wouldn't be able to
% change the setting.
%    \begin{macrocode}
%<*init>
\DeclareTOCStyleEntry[%
  indent=1.5em,
  numwidth=2em,
  level=\maxdimen
]{default}{cpar}
%</init>
%    \end{macrocode}
% \end{macro}
%
% \section{Numbering of Paragraphs and Sentences}
%
% \begin{macro}{\contract@separator}
% \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@separator} renamed}
% \changes{v0.0.1}{2023-10-10}{\cs{scrjura@separator} renamed}
% Used to make it possible to remove white spaces at the beginning or end.
%    \begin{macrocode}
%<*body>
\DeclareRobustCommand*{\contract@separator}[1]{#1}
%</body>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\contract@usetype}
% \changes{scrjura-v0.5d}{2010/04/28}{new}
% \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@usetype} renamed}
% \changes{v0.0.1}{2023-10-10}{\cs{scrjura@usetype} renamed}
% By default it is robust but does only call \cs{contract@@usetype} with the
% only argument.
% \begin{macro}{\contract@@usetype}
% \changes{scrjura-v0.5d}{2010/04/28}{new}
% \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@@usetype} renamed}
% \changes{v0.0.1}{2023-10-10}{\cs{scrjura@@usetype} renamed}
% This second command is not robust and can easily be redefined. But by
% default it also does nothing but eating the argument.
%    \begin{macrocode}
%<*body>
\DeclareRobustCommand*{\contract@usetype}[1]{\contract@@usetype{#1}}
\newcommand*{\contract@@usetype}[1]{}
%</body>
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\contract@everypar}
% The \cs{contract@everpar} used by contracts.
% \begin{macro}{\ifparnumber,\parnumbertrue,\parnumberfalse}
% \changes{scrjura-v0.6}{2011/09/29}{moved the definition into the definition of the
%   option}
% \begin{counter}{par}
% \begin{command}{\thepar,\theHpar}
% \changes{scrjura-v3.41}{2023/06/24}{Ulrike Fischer requested to use \cs{def} instead
%   of \cs{newcommand*}}
% \begin{command}{\parformat}
% \changes{scrjura-v0.7}{2013/06/07}{new font element \fnt{parnumber}}
% \begin{command}{\parformatseparation}
% \changes{scrjura-v0.9f}{2016/02/06}{new}
% \begin{macro}{\p@par}
% \changes{scrjura-v0.5d}{2010/04/28}{added \cs{jura@usetype} with argument
%   \cs{jura@env@type}}
% \begin{command}{\withoutparnumber}
% \changes{scrjura-v3.25}{2017/12/19}{new}
% The boolean defines if paragraph numbers have to be used. If they are
% deactivated also manual paragraph numbers are deactivated and the paragraphs
% are not counted. Otherwise the paragraphs are numbered using \cs{thepar}. It
% is important to reset the paragraph counter with every clause and
% sub-clause. And for labels the parent object the clause has to be used.
%    \begin{macrocode}
%<*body>
\newcounter{par}
\renewcommand*{\thepar}{\arabic{par}}
\def\theHpar{\theH@AbsClause-\Roman{par}}
\newcommand*{\parformat}{(\thepar)}
\newcommand*{\parformatseparation}{\nobreakspace}
\newkomafont{parnumber}{}
\renewcommand*\p@par{{\contract@usetype{\contract@env@type}\theSubClause\contract@separator{\nobreakspace}}}
\@addtoreset{par}{Clause}
\@addtoreset{par}{SubClause}
\newcommand*{\withoutparnumber}{}
%</body>
%    \end{macrocode}
% \end{command}
% \end{macro}
% \end{command}
% \end{command}
% \end{command}
% \end{counter}
% \end{macro}
% \changes{scrjura-v0.5c}{2010/04/26}{first argument of \cs{newmaxpar} and second
%   argument of \cs{getmaxpar} is \meta{contract} not \meta{contractpars}}
% \changes{scrjura-v0.5c}{2010/04/26}{\cs{contract@Clauseformat} expands while writing
%   to its own argument}
% \changes{scrjura-v0.7}{2013/04/18}{using counter \cnt{contractAbsoluteClause}}
% \changes{scrjura-v0.7}{2013/05/23}{initializing sentence number for manually
%   numbered paragraphs to 0 instead of 1, because first action of
%   \cs{Sentence} is increasing the number}
% \changes{scrjura-v0.7}{2013/05/23}{recognize paragraph number of \cs{thisparnumber}}
% \changes{scrjura-v0.7}{2013/06/06}{if paragraph numbers are not completely numerical
%   always set the number}
% \changes{scrjura-v0.7b}{2014/11/03}{more flexible replacement of
%   \cnt{contractAbsoluteClause}}
% \changes{scrjura-v0.9f}{2016/02/06}{\cs{nobreakspace} replaced by
%     \cs{parformatseparation}}
% \changes{scrjura-v0.9g}{2016/03/25}{writing to \file{aux}-file \cs{if@filesw}}
%    \begin{macrocode}
%<*body>
\newcommand*{\contract@everypar}{%
  \ifparnumber
    \ifx\contract@special@par\relax
      \ifx\contract@special@reset@par\relax\else
        \global\let\thepar\contract@special@reset@par
        \global\let\contract@special@reset@par\relax
      \fi
      \refstepcounter{par}%
      \refstepcounter{sentence}%
    \else
      \ifx\contract@special@reset@par\relax
        \global\let\contract@special@reset@par\thepar
      \fi
      \global\let\thepar\contract@special@par
      \global\let\contract@special@par\relax
      \setcounter{sentence}{0}\refstepcounter{sentence}%
    \fi
    \begingroup
      \if@filesw
        \protected@write\@auxout{%
          \expandafter\let\csname \contract@env@type @Clauseformat\endcsname
          \@firstofone
        }{%
          \string\newmaxpar{\contract@env@type}%
                           {\csname the\contract@env@type 
                             AbsoluteClause\endcsname}%
                           {\thepar}%
        }%
      \fi
      \getmaxpar\@tempa{\contract@env@type}%
                       {\csname the\contract@env@type AbsoluteClause\endcsname}%
%<+trace>      \typeout{Stored max is \@tempa}%
      \def\reserved@a##1\@nnil{\def\@tempa{##1}}%
      \afterassignment\reserved@a\@tempcnta=0\@tempa\relax\@nnil
      \ifnum \@tempcnta>\@ne
        {\usekomafont{parnumber}{\parformat\parformatseparation}}%
      \else
        \def\reserved@a{\relax}%
        \ifx\@tempa\reserved@a
          \withoutparnumber
        \else
          {\usekomafont{parnumber}{\parformat\parformatseparation}}%
        \fi
      \fi
    \endgroup
  \else
    \begingroup\withoutparnumber\endgroup
    \setcounter{sentence}{-1}\refstepcounter{sentence}%
  \fi
}
%</body>
%    \end{macrocode}
% \end{macro}
%
% \begin{command}{\thisparnumber}
% \changes{scrjura-v0.7}{2013/05/23}{new}
% \begin{macro}{\contract@special@par,\contract@special@reset@par}
% \changes{scrjura-v0.7}{2013/05/23}{new}
% \changes{v0.0.1}{2023-10-10}{\cs{scrjura@special@par} renamed}
% \changes{v0.0.1}{2023-10-10}{\cs{scrjura@special@reset@par} renamed}
% You can use this for manual paragraph numbering. But the number has to be
% fully expandable!
%    \begin{macrocode}
%<*body>
\newcommand*{\thisparnumber}[1]{%
  \def\contract@special@par{#1}%
}
\newcommand*{\contract@special@par}{}
\let\contract@special@par\relax
\newcommand*{\contract@special@reset@par}{}
\let\contract@special@reset@par\relax
%</body>
%    \end{macrocode}
% \end{macro}%^^A \contract@special@par
% \end{command}%^^A\thisparnumber
%
%
% \section{Referencing}
%
% \begin{command}{\refL}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% \begin{macro}{\ref@L}
% Similar to \cs{ref} but always the long form.
%    \begin{macrocode}
%<*body>
\newcommand*{\refL}{\kernel@ifstar {\ref@L*}{\ref@L{}}}
\newcommand*{\ref@L}[2]{%
  \begingroup
    \def\parcite@format{0}%
    \let\sentencecite@format\parcite@format
    \ref#1{#2}%
  \endgroup
}
%    \end{macrocode}
% \end{macro}
% \end{command}
%
% \begin{command}{\refS}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% \begin{macro}{\ref@S}
% Similar to \cs{ref} but always the short form.
%    \begin{macrocode}
\newcommand*{\refS}{\kernel@ifstar {\ref@S*}{\ref@S{}}}
\newcommand*{\ref@S}[2]{%
  \begingroup
    \def\parcite@format{1}%
    \let\sentencecite@format\parcite@format
    \ref#1{#2}%
  \endgroup
}
%    \end{macrocode}
% \end{macro}
% \end{command}
%
% \begin{command}{\refN}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% \begin{macro}{\ref@N}
% Similar to \cs{ref} but always the numerical form.
%    \begin{macrocode}
\newcommand*{\refN}{\kernel@ifstar {\ref@N*}{\ref@N{}}}
\newcommand*{\ref@N}[2]{%
  \begingroup
    \def\parcite@format{2}%
    \let\sentencecite@format\parcite@format
    \ref#1{#2}%
  \endgroup
}
%    \end{macrocode}
% \end{macro}
% \end{command}
%
% \begin{command}{\refClause}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% \begin{macro}{\ref@Clause}
% Reference only the clause of a clause, paragraph or sentence. For better
% compatibility with \pkg{hyperref} there is also a star version if
% \pkg{hyperref} is used. Without \pkg{hyperref} the star version is nonsense.
%    \begin{macrocode}
\newcommand*{\refClause}{%
  \kernel@ifstar {\ref@Clause*}{\ref@Clause{}}
}
\newcommand*{\ref@Clause}[2]{%
  \expandafter\ifx\csname r@#2\endcsname\relax
    \ref#1{#2}%
  \else
    \begingroup
%    \end{macrocode}
% Copy all parts of the reference but the first one to \cs{@tempb}.
%    \begin{macrocode}
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\def
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\@tempb
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter{%
        \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}%
%    \end{macrocode}
% Copy the first part of the reference to \cs{@tempa}.
%    \begin{macrocode}
      \def\@tempc##1##2\@nil{##1}%
      \let\contract@separator\@gobble
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \csname r@#2\endcsname\noexpand\@nil}%
%    \end{macrocode}
% Copy the first part of \cs{@tempa} to \cs{@tempb}.
%    \begin{macrocode}
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \@tempa\@nil}%
      \let\@@protect\protect
      \let\protect\noexpand
      \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}%
      \let\protect\@@protect
      \ref#1{#2}%
    \endgroup
  \fi
}
%    \end{macrocode}
% \end{macro}
% \end{command}
%
% \begin{command}{\refClauseN}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% \begin{macro}{\ref@ClauseN}
% Reference only the clause number of a clause, a paragraph or a sentence.
% For improved compatibility with \pkg{hyperref} there is also a star version
% if \pkg{hyperref} is used. Without \pkg{hyperref} the star version is
% nonsense.
%    \begin{macrocode} 
\newcommand*{\refClauseN}{%
  \kernel@ifstar {\ref@ClauseN*}{\ref@ClauseN{}}
}
\newcommand*{\ref@ClauseN}[2]{%
  \begingroup
    \let\Clauseformat\relax
    \ref@Clause{#1}{#2}%
  \endgroup
}
%    \end{macrocode}
% \end{macro}
% \end{command}
%
% \begin{command}{\refPar}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% \begin{macro}{\ref@Par}
% References only the paragraph of a paragraph or sentence.
% For improved compatibility with \pkg{hyperref} there is also a star version
% if \pkg{hyperref} is used. Without \pkg{hyperref} the star version is
% nonsense.
%    \begin{macrocode}
\newcommand*{\refPar}{%
  \kernel@ifstar {\ref@Par*}{\ref@Par{}}
}
\newcommand*{\ref@Par}[2]{%
  \expandafter\ifx\csname r@#2\endcsname\relax
    \ref#1{#2}%
  \else
    \begingroup
%    \end{macrocode}
% Copy all parts of the reference but the first one to \cs{@tempb}.
%    \begin{macrocode}
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\def
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\@tempb
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter{%
        \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}%
%    \end{macrocode}
% Copy the first part of the reference to \cs{@tempa}.
%    \begin{macrocode}
      \def\@tempc##1##2\@nil{##1}%
      \let\contract@separator\@gobble
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \csname r@#2\endcsname\noexpand\@nil}%
%    \end{macrocode}
% Copy the second part of \cs{@tempa} to \cs{@tempa} ablegen.
%    \begin{macrocode}
      \def\@tempc##1##2##3\@nil{##2}%
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \@tempa{%
          \protect\G@refundefinedtrue
          \nfss@text{\reset@font\bfseries ??}%
          \@latex@warning{Reference `#2' on page \thepage \space
            with undefined par number}%
        }\noexpand\@nil}%
      \let\@@protect\protect
      \let\protect\noexpand
      \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}%
      \let\protect\@@protect
      \ref#1{#2}%
    \endgroup
  \fi
}
%    \end{macrocode}
% \end{macro}
% \end{command}
%
% \begin{command}{\refParL}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% \begin{macro}{\ref@ParX}
% The same but long.
%    \begin{macrocode}
\newcommand*{\refParL}{%
  \kernel@ifstar {\ref@ParX0*}{\ref@ParX0{}}
}
\newcommand*{\ref@ParX}[3]{%
  \begingroup
    \def\parcite@format{#1}%
    \let\sentencecite@format\parcite@format
    \ref@Par{#2}{#3}%
  \endgroup
}
%    \end{macrocode}
% \end{macro}
% \end{command}
%
% \begin{command}{\refParS}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% The same but short.
%    \begin{macrocode}
\newcommand*{\refParS}{%
  \kernel@ifstar {\ref@ParX1*}{\ref@ParX1{}}
}
%    \end{macrocode}
% \end{command}
%
% \begin{command}{\refParN}
% \begin{macro}{\ref@ParN}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifnextchar} replaced by
%   \cs{kernel@ifnextchar}}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% \begin{macro}{\ref@@ParN}
% The same but numerical.
%    \begin{macrocode}
\newcommand*{\refParN}{%
  \kernel@ifstar {\ref@ParN2*}{\ref@ParN2{}}
}
\newcommand*{\ref@ParN}[2]{%
  \kernel@ifnextchar [%]
    {\ref@@ParN{#1}{#2}}%
    {\ref@ParX{#1}{#2}}%
}
\newcommand*{\ref@@ParN}{}
\def\ref@@ParN#1#2[#3]#4{%
  \begingroup
    \renewcommand*{\parnumericformat}[1]{%
      \csname @#3\endcsname{\number ##1\relax}%
    }%
    \ref@ParX{#1}{#2}{#4}%
  \endgroup
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{command}
%
% \begin{command}{\refSentence}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% \begin{macro}{\ref@Sentence}
% Reference only the sentence of a sentence.
% For improved compatibility with \pkg{hyperref} there is also a star version
% if \pkg{hyperref} is used. Without \pkg{hyperref} the star version is
% nonsense.
%    \begin{macrocode}
\newcommand*{\refSentence}{%
  \kernel@ifstar {\ref@Sentence*}{\ref@Sentence{}}
}
\newcommand*{\ref@Sentence}[2]{%
  \expandafter\ifx\csname r@#2\endcsname\relax
    \ref#1{#2}%
  \else
    \begingroup
%    \end{macrocode}
% Copy all parts of the reference to \cs{@tempb}.
%    \begin{macrocode}
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\def
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\@tempb
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter{%
        \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}%
%    \end{macrocode}
% Copy the first part of the reference to \cs{@tempa}.
%    \begin{macrocode}
      \def\@tempc##1##2\@nil{##1}%
      \let\contract@separator\@gobble
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \csname r@#2\endcsname\noexpand\@nil}%
%    \end{macrocode}
% Copy the third part of \cs{@tempa} to \cs{@tempa}.
%    \begin{macrocode}
      \def\@tempc##1##2##3##4\@nil{##3}%
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \@tempa{}{%
          \protect\G@refundefinedtrue
          \nfss@text{\reset@font\bfseries ??}%
          \@latex@warning{Reference `#2' on page \thepage \space
            with undefined sentence number}%
        }\noexpand\@nil}%
      \let\@@protect\protect
      \let\protect\noexpand
      \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}%
      \let\protect\@@protect
      \ref#1{#2}%
    \endgroup
  \fi
}
%    \end{macrocode}
% \end{macro}
% \end{command}
%
% \begin{command}{\refSentenceL}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% \begin{macro}{\ref@SentenceX}
% The same but long.
%    \begin{macrocode}
\newcommand*{\refSentenceL}{%
  \kernel@ifstar {\ref@SentenceX0*}{\ref@SentenceX0{}}
}
\newcommand*{\ref@SentenceX}[3]{%
  \begingroup
    \def\parcite@format{#1}%
    \let\sentencecite@format\parcite@format
    \ref@Sentence{#2}{#3}%
  \endgroup
}
%    \end{macrocode}
% \end{macro}
% \end{command}
%
% \begin{command}{\refSentenceS}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% The same but short.
%    \begin{macrocode}
\newcommand*{\refSentenceS}{%
  \kernel@ifstar {\ref@SentenceX1*}{\ref@SentenceX1{}}
}
%    \end{macrocode}
% \end{command}
%
% \begin{command}{\refSentenceN}
% \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
% The same but numeric.
%    \begin{macrocode}
\newcommand*{\refSentenceN}{%
  \kernel@ifstar {\ref@SentenceX2*}{\ref@SentenceX2{}}
}
%</body>
%    \end{macrocode}
% \end{command}
%
% \begin{macro}{\contract@sentence}
% \changes{scrjura-v0.7a}{2014/01/28}{using \cs{textsuperscript}}
% \changes{scrjura-v0.7a}{2014/01/28}{\cs{nobreak}\cs{hskip}\cs{z@} added to allow
%   hyphenation of the first word after the sentence mark}
% Numbering of sentences.
% \begin{counter}{sentence}
% \begin{command}{\thesentence,\theHsentence}
% \changes{scrjura-v3.41}{2023/06/24}{Ulrike Fischer requested to use \cs{def} instead
%   of \cs{newcommand*}}
% \begin{macro}{\p@sentence}
% \changes{scrjura-v3.27}{2019/10/09}{adaption for \LaTeX{} 2019-10-01}
% The counter is used for numbering the sentences. It is important to add the
% paragraph as parent object to labels. The original method to make it
% possible to use \cs{thesentence} as an argument of \cs{p@sentence} does not
% work any longer using \LaTeX{} 2019-10-01 or newer. It would result in an
% error message. So the code has to be adapted to the new definition of
% \cs{refstepcounter} in \LaTeX{} 2019-10-01. From this version it uses
% \cs{labelformat}. Don't ask me, what I think about the fact, that every new
% versions of \LaTeX{} can break existing packages and package authors have to
% find out such incompatibilities on their own.
%    \begin{macrocode}
%<*body>
\newcounter{sentence}[par]
\renewcommand*{\thesentence}{\arabic{sentence}}
\def\theHsentence{\theHpar-\arabic{sentence}}
\scr@ifundefinedorrelax{labelformat}{%
  \renewcommand*{\p@sentence}{\expandafter\p@@sentence}
  \newcommand*{\p@@sentence}[1]{\p@par{{\par@cite{\thepar}}%
      \contract@separator{\nobreakspace}}{\sentence@cite{#1}}}%
}{%
  \labelformat{sentence}{\p@par{{\par@cite{\thepar}}%
      \contract@separator{\nobreakspace}}{\sentence@cite{#1}}}%
}
\newcommand*{\contract@sentence}{%
%    \end{macrocode}
% \changes{scrjura-v0.9e}{2015/11/04}{first start the paragraph then print the number}
% \changes{scrjura-v3.26}{2018/07/20}{new font element \fnt{sentencenumber}}
% \changes{scrjura-v3.26}{2018/07/20}{new formatting \cs{sentencenumberformat}}
% For the numbering it is important not to increase the paragraph number at
% the very beginning, because the paragraph already does so. To make this
% work, the paragraph has to start before we print the number. But immediately
% after a \env{minipage}, a list or a \cs{parbox} we should behave as not
% being at the beginning of a paragraph.
%    \begin{macrocode}
  \ifvmode
    \if@endpe
      \refstepcounter{sentence}%
    \else
      \leavevmode
    \fi
  \else
    \refstepcounter{sentence}%
  \fi
  {\usekomafont{sentencenumber}{\sentencenumberformat}}%
  \nobreak\hskip\z@
}
%    \end{macrocode}
% \begin{fontelement}{sentencenumber}
% \begin{command}{\sentencenumberformat}
% \changes{scrjura-v3.26}{2018/07/20}{new}
% Formatting an font can be changed using font element \fnt{sentencenumber}
% and command \cs{sentencenumberformat}. The last has the preset
% \cs{textsuperscript}.
%    \begin{macrocode}
\newkomafont{sentencenumber}{}
\newcommand*{\sentencenumberformat}{\textsuperscript{\thesentence}}
%</body>
%    \end{macrocode}
% \end{command}
% \end{fontelement}
% \end{macro}
% \end{command}
% \end{counter}
% \end{macro}
%
% \begin{macro}{\par@cite}
% \begin{command}{\parciteformat}
% \changes{scrjura-v0.5d}{2010/04/28}{argument moved}
% Reference style for paragraphs.
%    \begin{macrocode}
%<*body>
\DeclareRobustCommand*{\par@cite}[1]{\parciteformat{#1}}
\newcommand*{\parciteformat}[1]{%
  \ifcase \parcite@format
    \expandafter\parlongformat
  \or
    \expandafter\parshortformat
  \or
    \expandafter\parnumericformat
  \else
    \unskip\expandafter\@gobble
  \fi
  {#1}%
}
%    \end{macrocode}
% \end{command}
% \end{macro}
%
% \begin{macro}{\sentence@cite}
% \begin{command}{\sentenceciteformat}
% \changes{scrjura-v0.5d}{2010/04/28}{argument moved}
% Reference style for sentences. Preset is \cs{@arabic}.
%    \begin{macrocode}
\DeclareRobustCommand*{\sentence@cite}[1]{\sentenceciteformat{#1}}
\newcommand*{\sentenceciteformat}[1]{%
  \ifcase \sentencecite@format
    \expandafter\sentencelongformat
  \or
    \expandafter\sentenceshortformat
  \or
    \expandafter\sentencenumericformat
  \else
    \unskip\expandafter\@gobble
  \fi
  {#1}%
}
%    \end{macrocode}
% \end{command}
% \end{macro}
%
% \begin{command}{\parlongformat,\parshortformat,\parnumericformat,
%                 \sentencelongformat,\sentenceshortformat,
%                 \sentencenumericformat}
% The six formattings.
%    \begin{macrocode}
\newcommand*{\parlongformat}[1]{\parname~#1}
\newcommand*{\parshortformat}[1]{\parshortname~#1}
\newcommand*{\parnumericformat}[1]{\@Roman{\number #1\relax}}
\newcommand*{\sentencelongformat}[1]{\sentencename~#1}
\newcommand*{\sentenceshortformat}[1]{\sentenceshortname~#1}
\newcommand*{\sentencenumericformat}[1]{\@arabic{\number #1\relax}.}
%</body>
%    \end{macrocode}
% \end{command}
%
% \section{Language Dependent Names}
%
% \begin{command}{\parname,\parshortname,\sentencename,\sentenceshortname}
% \begin{macro}{\contract@lang@error}
% \changes{scrjura-v0.7}{2013/09/19}{Usage of \cs{PackageError} instead of
%   \cs{PackageErrorNoLine}}
% \changes{scrjura-v3.24}{2017/05/29}{adaption for language name bug in
%   \pkg{babel}~3.10}
% \changes{v0.0.1}{2023-10-10}{\cs{scrjura@lang@error} renamed}
% The names of paragraphs and sentences and their short versions. The English
% names are donated by ``m.eik''.
%    \begin{macrocode}
%<*body>
\newcommand*{\parname}{Paragraph}
\AtBeginDocument{%
  \providecaptionname{german,ngerman,austrian,naustrian}\parname{Absatz}%
  \providecaptionname{german,ngerman,austrian,naustrian}\parshortname{Abs.}%
  \providecaptionname{german,ngerman,austrian,naustrian}\sentencename{Satz}%
  \providecaptionname{german,ngerman,austrian,naustrian}\sentenceshortname{S.}%
  \providecaptionname{english,american,british,canadian,%
    USenglish,UKenglish,usenglish,ukenglish}\parname{paragraph}%
  \providecaptionname{english,american,british,canadian,%
    USenglish,UKenglish,usenglish,ukenglish}\parshortname{par.}%
  \providecaptionname{english,american,british,canadian,%
    USenglish,UKenglish,usenglish,ukenglish}\sentencename{sentence}%
  \providecaptionname{english,american,british,canadian,%
    USenglish,UKenglish,usenglish,ukenglish}\sentenceshortname{sent.}%
}
\providecommand*{\parname}{\contract@lang@error{\parname}}
\providecommand*{\parshortname}{\contract@lang@error{\parshortname}}
\providecommand*{\sentencename}{\contract@lang@error{\sentencename}}
\providecommand*{\sentenceshortname}{\contract@lang@error{\sentenceshortname}}
\newcommand*{\contract@lang@error}[1]{%
  \PackageError{contract}{%
    current language not supported%
  }{%
    Currently contract only supports languages `german', `ngerman',
    `austrian',\MessageBreak
    `naustrian', `english', `american', `british', `canadian',
    `USenglish',\MessageBreak
    `UKenglish', `usenglish`, and `ukenglish'.\MessageBreak
    It seems, that you are using another language (maybe `\languagename') or
    that\MessageBreak
    your language selection isn't compatible to package `babel'.\MessageBreak
    Because of this you have to define `\string#1' by yourself!\MessageBreak
    It would be nice if you'll send your definitions to the author.%
  }%
  \textbf{??}%
}
%</body>
%    \end{macrocode}
% \end{macro}
% \end{command}
%
% \section{Using Values from last \LaTeX{} Run}
%
% \begin{command}{\newmaxpar}
% \changes{scrjura-v0.6b}{2013/04/16}{\cs{\#1@Clauseformat} expands to its argument}
% \begin{command}{\getmaxpar}
% \changes{scrjura-v0.6}{2011/09/30}{argument no 3 is expanded using
%   \cs{protected@edef}}
% \changes{scrjura-v0.5c}{2010/04/26}{\cs{protected@edef} replaced by \cs{edef}}
% \changes{scrjura-v0.5c}{2010/04/26}{\cs{\#2@Clauseformat} expands to its argument}
% Two helper macros, to save a counter in a \file{aux}-file and get the value
% back or another value of it is not in the \file{aux}-file.
%    \begin{macrocode}
%<*body>
\newcommand*{\newmaxpar}[3]{%
  \begingroup
    \expandafter\let\csname #1@Clauseformat\endcsname\@firstofone
    \protected@edef\@tempa{#2}\@onelevel@sanitize\@tempa
    \expandafter\xdef\csname max@#1@\@tempa\endcsname{#3}%
  \endgroup
}
\newcommand*{\getmaxpar}[3]{%
  \begingroup
    \expandafter\let\csname #2@Clauseformat\endcsname\@firstofone
    \protected@edef\@tempa{#3}%
    \@onelevel@sanitize\@tempa
    \expandafter\ifx \csname max@#2@\@tempa\endcsname\relax
      \edef\@tempa{\endgroup\edef\noexpand#1{\expandafter\the\value{par}}}%
    \else
      \edef\@tempa{\endgroup
        \edef\noexpand#1{\csname max@#2@\@tempa\endcsname}}%
    \fi
  \@tempa
}
%    \end{macrocode}
% \changes{scrjura-v0.7b}{2014/11/10}{added fallback code to \file{aux}-file}
% \changes{scrjura-v0.9g}{2015/03/25}{write to \file{aux}-file \cs{if@filesw}}
% Because some users remove \pkg*{contract} from their documents without
% deleting the \file{aux}-file, we add a fallback definition of \cs{newmaxpar}
% to the \file{aux}-file. This avoids error messages because of undefined
% \cs{newmaxpar}.
%    \begin{macrocode}
\AtBeginDocument{%
  \if@filesw
    \immediate\write\@auxout{%
      \string\providecommand*\string\newmaxpar[3]{}
    }%
  \fi
}
%</body>
%    \end{macrocode}
% \end{command}
% \end{command}
%
% \iffalse
%</package>
% \fi
%
% \Finale
%
\endinput
% Local Variables:
% mode: doctex
% ispell-local-dictionary: "en_US"
% eval: (flyspell-mode 1)
% TeX-master: t
% TeX-engine: luatex-dev
% eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx"))
% End:
%
% LocalWords:  cautelar