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
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
|
% \iffalse meta-comment
%
% Copyright (c) 2022-2023 David Purton <dcpurton@marshwiggle.net>
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3c of this license
% or (at your option) any later version. 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.
%
%<*driver>
\DocumentMetadata{}
\documentclass[a4paper]{l3doc}
\usepackage[parindent=1em]{scripture}
\usepackage[skins]{tcolorbox}
\newtcolorbox{scriptureexample}[1][]{%
bicolor, colframe=cyan, colback=cyan!10, colbacklower=white, left=2mm,
fonttitle=\normalsize\sffamily\bfseries,
subtitle style={before skip=3mm, after skip=3mm},
right=2mm, fontupper=\footnotesize, fontlower=\footnotesize, sidebyside,
sidebyside gap=6mm, sidebyside align=top, lefthand ratio=0.6, before
skip=\bigskipamount, after skip=\bigskipamount, #1
}
\tcbset{%
sidebysidecompare/.style={%
enhanced, colback=white, lefthand ratio=0.5, segmentation empty},
compare/.style={%
standard, colback=white, sidebyside=false}
}
\ExplSyntaxOn
\makeatletter
\cs_new_protected:Npn \__dcp_codedoc_environment_index:n #1
{
\@bsphack
\begingroup
\__codedoc_target:
\index
{
#1\actualchar{\protect\ttfamily#1}~(environment)
\encapchar hdclindex{\the\c@HD@hypercount}{usage}
}
\index
{
environments:\levelchar#1\actualchar{\protect\ttfamily#1}
\encapchar hdclindex{\the\c@HD@hypercount}{usage}
}
\endgroup
\@esphack
}
\cs_new_protected:Npn \__dcp_codedoc_envmacro_index:nN #1#2
{
\DoNotIndex {#1}
\bool_if:NT #2
{
\__codedoc_if_macro_internal:nF {#1}
{ \seq_gput_right:Nn \g_doc_macros_seq {#1} }
\hbox_set:Nw \l__codedoc_macro_index_box
\hbox_unpack_drop:N \l__codedoc_macro_index_box
\int_gincr:N \c@CodelineNo
\@bsphack
\begingroup
\__codedoc_target:
\index
{
#1\actualchar{\protect\ttfamily#1}~(environment)
\encapchar hdclindex{\the\c@HD@hypercount}{main}
}
\index
{
environments:\levelchar#1\actualchar{\protect\ttfamily#1}
\encapchar hdclindex{\the\c@HD@hypercount}{main}
}
\endgroup
\@esphack
\int_gdecr:N \c@CodelineNo
\exp_args:NNNo \hbox_set_end:
\tl_set:Nn \saved@indexname { \l__codedoc_index_key_tl }
}
}
\cs_new_protected:Npn \__dcp_codedoc_hook_index:n #1
{
\@bsphack
\begingroup
\__codedoc_target:
\index
{
#1\actualchar{\protect\ttfamily#1}~(hook)
\encapchar hdclindex{\the\c@HD@hypercount}{usage}
}
\index
{
hooks:\levelchar#1\actualchar{\protect\ttfamily#1}
\encapchar hdclindex{\the\c@HD@hypercount}{usage}
}
\endgroup
\@esphack
}
\cs_new_protected:Npn \__dcp_codedoc_hookmacro_index:nN #1#2
{
\DoNotIndex {#1}
\bool_if:NT #2
{
\__codedoc_if_macro_internal:nF {#1}
{ \seq_gput_right:Nn \g_doc_macros_seq {#1} }
\hbox_set:Nw \l__codedoc_macro_index_box
\hbox_unpack_drop:N \l__codedoc_macro_index_box
\int_gincr:N \c@CodelineNo
\@bsphack
\begingroup
\__codedoc_target:
\index
{
#1\actualchar{\protect\ttfamily#1}~(hook)
\encapchar hdclindex{\the\c@HD@hypercount}{main}
}
\index
{
hooks:\levelchar#1\actualchar{\protect\ttfamily#1}
\encapchar hdclindex{\the\c@HD@hypercount}{main}
}
\endgroup
\@esphack
\int_gdecr:N \c@CodelineNo
\exp_args:NNNo \hbox_set_end:
\tl_set:Nn \saved@indexname { \l__codedoc_index_key_tl }
}
}
\DeclareDocumentEnvironment { environment } { O{} +v }
{
\cs_set_eq:NN \__codedoc_function_index:n \__dcp_codedoc_environment_index:n
\__codedoc_function:nnw {#1} {#2}
}
{ \__codedoc_function_end: }
\DeclareDocumentEnvironment { hooks } { O{} +v }
{
\bool_if:NTF \l__codedoc_in_implementation_bool
{
\cs_set_eq:NN \__codedoc_macro_index:nN \__dcp_codedoc_hookmacro_index:nN
\__codedoc_macro:nnw { var , #1 } {#2}
}
{
\cs_set_eq:NN \__codedoc_function_index:n \__dcp_codedoc_hook_index:n
\__codedoc_function:nnw {#1} {#2}
}
}
{
\bool_if:NTF \l__codedoc_in_implementation_bool
{ \__codedoc_macro_end: }
{ \__codedoc_function_end: }
}
\DeclareDocumentEnvironment { option } { O{} +v }
{
\cs_set_eq:NN \__codedoc_function_index:n \SpecialOptionIndex
\__codedoc_function:nnw {#1} {#2}
}
{ \__codedoc_function_end: }
\DeclareDocumentEnvironment { envmacro } { O{} +v }
{
\cs_set_eq:NN \__codedoc_macro_index:nN \__dcp_codedoc_envmacro_index:nN
\__codedoc_macro:nnw {#1} {#2}
}
{ \__codedoc_macro_end: }
\DeclareDocumentCommand \opt { m }
{
\SpecialOptionIndex {#1}
\texttt{#1}
}
\DeclareDocumentCommand \hook { m }
{
\__dcp_codedoc_hook_index:n {#1}
\texttt {#1}
}
\DeclareRobustCommand \val {\texttt}
\makeatother
\ExplSyntaxOff
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \changes{v1.0}{2022/07/27}{First public release}
% \changes{v1.1}{2022/08/27}{Bug fixes}
% \changes{v1.2}{2022/11/02}{Bug fixes}
% \changes{v1.3}{2023/01/08}{Bug fixes}
%
% \title{The \pkg{scripture} package}
% \author{David Purton\thanks{Email: \url{dcpurton@marshwiggle.net}}}
% \date{2023/01/08 v1.3}
%
% \maketitle
%
% \begin{abstract}
% The \pkg{scripture} package provides a set of macros for typesetting
% quotations from the Bible. It provides many features commonly seen in
% Bibles such as dropped text for chapter numbers, superscripts for verse
% numbers, indented lines for poetry sections, narrow sections and hanging
% paragraphs. A reference for the quotation can optionally be added.
% \end{abstract}
%
% \tableofcontents
%
% \begin{documentation}
%
% \section{Introduction}
%
% Bibles tend to use a number of standard features when laying out chapters
% and verses. The main goal for the \pkg{scripture} package is to be able to
% quickly and easily input text and have it output nicely with minimal manual
% adjustment.
%
% The package supports dropped text for chapter numbers, superscripts for
% verse numbers, appropriately indented lines for the first and second halves
% of poetry, flush right sections, centred sections, narrow sections and
% hanging sections.
%
% The package could be used for typesetting an entire Bible, but it is mainly
% envisioned that it will be used for producing Scripture quotations. The
% passage reference can be included on the last line if there is space or
% failing that on the following line.
%
% \subsection{Bug reports and feature requests}
%
% Bug reports and feature requests can be made at the \pkg{scripture} package
% GitHub repository. See \url{https://github.com/dcpurton/scripture}.
%
% \subsection{Limitations}
%
% The \pkg{scripture} package makes extensive use of \LaTeX{} \env{list}
% environments and the \cs{parshape} command. This means there are some
% limitations. In particular, you should not:
% \begin{itemize}
% \item Nest the \env{scripture} environment or any of its internal
% environments.
% \item Modify the \cs{parshape} within a \env{scripture} environment.
% \item Include any other \env{list} based environment within a
% \env{scripture} environment.
% \end{itemize}
%
% The \env{poetry} environment uses \cs{obeylines}. This means that it can not
% be placed in the argument of a macro.
%
% Some attempt is made to encourage appropriate page breaks, especially just
% before a reference is added to a quotation, but this can still sometimes
% fail and a reference will end up on the following page. Usually a little
% more stretchable space on the page before the incorrect break is enough to
% obtain acceptable output.
%
% At least version 2022-06-01 of the \LaTeX\ format is required.
%
% \section{Documentation}
%
% \subsection{Basic usage}
%
% Scripture quotations must be set within a \env{scripture} environment. A
% simple quotation might be produced as follows:
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Isaiah 56:1--2][version=NIVUK]
% \ch{56}This is what the \name{Lord} says:
% \begin{poetry}
% `Maintain justice
% and do what is right,
%
% for my salvation is close at hand
% and my righteousness will soon be revealed.
%
% \vs{2}Blessed is the one who does this---
% the person who holds it fast,
%
% who keeps the Sabbath without desecrating it,
% and keeps their hands from doing any evil.'
% \end{poetry}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Isaiah 56:1--2][version=NIVUK]
% \ch{56}This is what the \name{Lord} says:
% \begin{poetry}
% `Maintain justice
% and do what is right,
%
% for my salvation is close at hand
% and my righteousness will soon be revealed.
%
% \vs{2}Blessed is the one who does this---
% the person who holds it fast,
%
% who keeps the Sabbath without desecrating it,
% and keeps their hands from doing any evil.'
% \end{poetry}
% \end{scripture}
% \end{scriptureexample}
%
% \subsection{Macros for typesetting scripture quotations}
%
% \subsubsection{Functions}
%
% \begin{function}{\ch, \ch*}
% \begin{syntax}
% |\ch|\marg{chapter number}
% |\ch*|\marg{chapter number}
% \end{syntax}
% Format a chapter number. By default these are formatted using drop text
% taking up two lines and the text is separated from the chapter number by a
% horizontal space of 0.5\,em.
%
% If the \opt{dropchap} option is \val{true} (default), then this function
% attempts to add sufficient space for the dropped chapter when its
% paragraph contains only one line. The starred version suppresses this
% behaviour.
% \end{function}
%
% \begin{scriptureexample}[lefthand ratio=0.55]
% \textbf{\sffamily|\cs{ch}| example}
%
% \begin{verbatim}
% \begin{scripture}[Exodus 20:1--2]
% \ch{20}And God spoke all these words:
% \begin{hanging}
% \noindent\vs{2}`I am the \name{Lord}
% your God, who brought you out of Egypt,
% out of the land of slavery.
% \end{hanging}
% \end{scripture}
% \end{verbatim}
%
% \medskip
%
% \textbf{\sffamily|\cs{ch*}| example}
%
% \begin{verbatim}
% \begin{scripture}[Exodus 20:1--2]
% \ch*{20}And God spoke all these words:
% \begin{hanging}
% \nohang\vs{2}`I am the \name{Lord} your
% God, who brought you out of Egypt, out of
% the land of slavery.
% \end{hanging}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \textbf{\sffamily|\cs{ch}| example}
%
% \medskip
%
% \begin{scripture}[Exodus 20:1--2]
% \ch{20}And God spoke all these words:
% \begin{hanging}
% \noindent\vs{2}`I am the \name{Lord}
% your God, who brought you out of Egypt,
% out of the land of slavery.
% \end{hanging}
% \end{scripture}
%
% \bigskip
%
% \textbf{\sffamily|\cs{ch*}| example}
%
% \medskip
%
% \begin{scripture}[Exodus 20:1--2]
% \ch*{20}And God spoke all these words:
% \begin{hanging}
% \nohang\vs{2}`I am the \name{Lord} your
% God, who brought you out of Egypt, out of
% the land of slavery.
% \end{hanging}
% \end{scripture}
% \end{scriptureexample}
%
% \begin{function}{\extraskip}
% \begin{syntax}
% |\extraskip|
% \end{syntax}
% Add a small vertical space of \opt{extraskip} between a paragraph. This
% function attempts to add additional space to avoid a clash with a drop
% chapter if required.
% \end{function}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Colossians 1:2]
% \vs{2}To God's holy people in Colossae, the
% faithful brothers and sisters in Christ:
%
% \extraskip
%
% Grace and peace to you from God our Father.
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Colossians 1:2]
% \vs{2}To God's holy people in Colossae, the
% faithful brothers and sisters in Christ:
%
% \extraskip
%
% Grace and peace to you from God our Father.
% \end{scripture}
% \end{scriptureexample}
%
% \changes{v1.3}{2022/11/15}{Add feature to highlight translator added words}
% \begin{function}[added=2022-11-15]{\added}
% \begin{syntax}
% |\added|\marg{words}
% \end{syntax}
% Some Bible translations mark out words added for clarity not found in the
% original language (e.g., in italics). This can be done using the \cs{added}
% function. The font and format can be set using the \opt{added/font} and
% \opt{added/format} options.
% \end{function}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[John 1:18][verse/font=\bfseries,
% verse/format=#1, verse/sep=0.5em, version=KJV]
% \vs{18}No man hath seen God at any time, the
% only begotten Son, which is in the bosom of the
% Father, he hath declared \added{him}.
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[John 1:18][verse/font=\bfseries,
% verse/format=#1, verse/sep=0.5em, version=KJV]
% \vs{18}No man hath seen God at any time, the
% only begotten Son, which is in the bosom of the
% Father, he hath declared \added{him}.
% \end{scripture}
% \end{scriptureexample}
%
% \changes{v1.2}{2022/09/01}{Add divine name feature}
% \begin{function}[added=2022-09-01]{\name, \LORD, \GOD}
% \begin{syntax}
% |\name|\marg{divine name}
% |\LORD|
% |\GOD|
% \end{syntax}
% Modern Bible translations frequently represent God's personal divine name
% using a small capitals typeface. This can be done using the \cs{name}
% function. The font and format can be set using the \opt{name/font} and
% \opt{name/format} options. The \cs{LORD} and \cs{GOD} macros equivalent to
% \cs{name}|{Lord}| and \cs{name}|{God}| respectively.
%
% \textbf{Note:} Watch out that trailing spaces are not eaten by \cs{LORD}
% and \cs{GOD}. Using \cs{name} is safer and semantically better.
% \end{function}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Genesis 15:1--2][version=ESV]
% \ch{15}After these things the word of the
% \name{Lord} came to Abram in a vision: ``Fear
% not, Abram, I am your shield; your reward shall
% be very great.'' \vs{2}But Abram said, ``O Lord
% \name{God}, what will you give me, for I
% continue childless, and the heir of my house is
% Eliezer of Damascus?''
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Genesis 15:1--2][version=ESV]
% \ch{15}After these things the word of the
% \name{Lord} came to Abram in a vision: ``Fear
% not, Abram, I am your shield; your reward shall
% be very great.'' \vs{2}But Abram said, ``O Lord
% \name{God}, what will you give me, for I
% continue childless, and the heir of my house is
% Eliezer of Damascus?''
% \end{scripture}
% \end{scriptureexample}
%
% \changes{v1.3}{2022/11/13}{Add \cs{nofirstverse} function}
% \begin{function}[added=2022-11-13]{\nofirstverse}
% \begin{syntax}
% |\nofirstverse|
% \end{syntax}
% When \opt{verse/first} is |true|, this causes the next \cs{vs} to print
% normally, rather than using the format specified by
% \opt{verse/firstformat}. You might do this if your quote begins half way
% through a paragraph and the first verse should be printed normally.
% \end{function}
%
% \begin{function}{\nohang}
% \begin{syntax}
% |\nohang|
% \end{syntax}
% In a \env{hanging} environment, this function indents the first line of
% the paragraph a length of \opt{hanging/hang} $+$ \opt{parindent}.
% Remaining lines continue to be indented by a length of \opt{hanging/hang}.
% \end{function}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Genesis 1:10--11]
% \begin{hanging}
% \noindent\vs{10}God called the dry ground
% `land', and the gathered waters he called
% `seas'. And God saw that it was good.
%
% \nohang\vs{11}Then God said, `Let the land
% produce vegetation: seed-bearing plants and
% trees on the land that bear fruit with seed
% in it, according to their various kinds.'
% And it was so.
% \end{hanging}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Genesis 1:10--11]
% \begin{hanging}
% \noindent\vs{10}God called the dry ground
% `land', and the gathered waters he called
% `seas'. And God saw that it was good.
%
% \nohang\vs{11}Then God said, `Let the land
% produce vegetation: seed-bearing plants and
% trees on the land that bear fruit with seed
% in it, according to their various kinds.'
% And it was so.
% \end{hanging}
% \end{scripture}
% \end{scriptureexample}
%
% \changes{v1.2}{2022/08/31}{Add red letter feature}
% \begin{function}[added=2022-08-31]{\redletteron, \redletteroff}
% \begin{syntax}
% |\redletteron|
% |\redletteroff|
% \end{syntax}
% Use \cs{redletteron} and \cs{redletteroff} to mark the beginning and end
% of sections of text that should be attributed to Jesus speaking. Some
% attempt is made to ensure that the correct colour continues after an inner
% environment if \cs{redletteron} or \cs{redletteroff} occurs inside the
% inner environment. If you experience problems with unexpected colour, try
% to ensure that matching \cs{redletteron} and \cs{redletteroff} marks occur
% at the same group level. The colour of the text can be set using the
% \opt{redletter/colour} option. These commands only have an effect when the
% \opt{redletter} option is \val{true}.
% \end{function}
%
% \begin{scriptureexample}[lefthand ratio=0.67]
% \begin{verbatim}
% \begin{scripture}[Matthew 21:16--17][redletter]
% \vs{16}`Do you hear what these children are saying?'
% they asked him.
%
% \redletteron `Yes,' \redletteroff replied Jesus,
% \redletteron `have you
% never read,
% \begin{poetry}
% `\thinspace ``From the lips of children and infants
% you, Lord, have called forth your praise''?'
% \end{poetry}\redletteroff
%
% \vs{17}And he left them and went out of the city to
% Bethany, where he spent the night.
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Matthew 21:16--17][redletter]
% \vs{16}`Do you hear what these children are saying?'
% they asked him.
%
% \redletteron `Yes,' \redletteroff replied Jesus,
% \redletteron `have you
% never read,
% \begin{poetry}
% `\thinspace ``From the lips of children and infants
% you, Lord, have called forth your praise''?'
% \end{poetry}\redletteroff
%
% \vs{17}And he left them and went out of the city to
% Bethany, where he spent the night.
% \end{scripture}
% \end{scriptureexample}
%
% \begin{function}{\scripturesetup}
% \begin{syntax}
% |\scripturesetup|\marg{options}
% \end{syntax}
% Set default format for quotations. See section \ref{options} for
% supported formatting \meta{|options|}.
% \end{function}
%
% \changes{v1.1}{2022/08/07}{Add \cs{scripturecurrentchapter} and
% \cs{scripturecurrentverse} variables}
% \begin{function}[added=2022-08-07]{\scripturecurrentchapter,
% \scripturecurrentverse}
% \begin{syntax}
% |\scripturecurrentchapter|
% |\scripturecurrentverse|
% \end{syntax}
% \cs{scripturecurrentcapter} and \cs{scripturecurrentverse} globally hold
% the most recent values parsed to \cs{ch} and \cs{vs}. They can initialised
% with \cs{renewcommand*} if required and could be used in hooks, for
% example.
% \end{function}
%
% \changes{v1.1}{2022/07/29}{Add \cs{selah} function}
% \begin{function}[added=2022-07-29]{\selah}
% \begin{syntax}
% |\selah|
% \end{syntax}
% In a \env{poetry} environment, this function inserts \emph{Selah} at the
% end of the current line or the end of the following line if there is
% insufficient room. See options \opt{selah/font}, \opt{selah/format},
% \opt{selah/sep} and \opt{selah/text} for options controlling the output.
% \end{function}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Psalm 3:2][version=NIV84]
% \begin{poetry}
% \vs{2}Many are saying of me,
% ``God will not deliver him.''\selah
% \end{poetry}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Psalm 3:2][version=NIV84]
% \begin{poetry}
% \vs{2}Many are saying of me,
% ``God will not deliver him.''\selah
% \end{poetry}
% \end{scripture}
% \end{scriptureexample}
%
% \begin{function}{\scripturesetup}
% \begin{syntax}
% |\scripturesetup|\marg{options}
% \end{syntax}
% Set default format for quotations. See section \ref{options} for
% supported formatting \meta{|options|}.
% \end{function}
%
% \changes{v1.2}{2022/08/30}{Add \cs{textright} function}
% \begin{function}[added=2022-08-30]{\textright}
% \begin{syntax}
% |\textright|\marg{text}
% \end{syntax}
% This function inserts \meta{|text|} at the end of the current line or the
% end of the following line if there is insufficient room. The
% \opt{textright/sep} option controls the minimum allowed space before the
% \meta{|text|} to be right aligned.
% \end{function}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Jeremiah 2:29]
% \begin{poetry}
% \vs{5}`Why do you bring charges against me?
% You have all rebelled against me,'
% \textright{declares the \name{Lord}.}
% \end{poetry}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Jeremiah 2:29]
% \begin{poetry}
% \vs{5}`Why do you bring charges against me?
% You have all rebelled against me,'
% \textright{declares the \name{Lord}.}
% \end{poetry}
% \end{scripture}
% \end{scriptureexample}
%
% \changes{v1.3}{2023/01/07}{Add \cs{textscripture} function}
% \begin{function}[added=2023-01-07]{\textscripture}
% \begin{syntax}
% |\textscripture|\oarg{reference}\oarg{options}\marg{quotation}
% \end{syntax}
% \cs{textscripture} sets an inline scripture quotation. The quotation is
% surrounded be the values of \opt{inline/begin} and \opt{inline/end} which
% default to |``\,| and |\,''|, respectively. This function also changes the
% defaults of some options as follows:
% \begin{itemize}
% \item \opt{compact} is set
% \item \opt{reference/align} is set to |inline|
% \item \opt{reference/sep} is set to |0.5em|
% \item \opt{reference/format} is set to |(#1)|
% \item \opt{version/format} is set to |#1|
% \end{itemize}
%
% This function is equivalent to using the \env{scripture} environment with
% the \opt{inline} option.
%
% \textbf{Warning:} \cs{par} is redefined to \cs{relax} inside the
% \cs{textscripture} function. If you have anything other than expected
% macros and environments inside your \cs{textscripture} function \TeX{}
% will likely get stuck in an infinite loop.
% \end{function}
%
% \begin{scriptureexample}
% \begin{verbatim}
% A famous verse in the Bible is:
% \textscripture[John 3:16][verse/hide]{\vs{16}For
% God so loved the world that he gave his one and
% only Son, that whoever believes in him shall not
% perish but have eternal life.}.
% \end{verbatim}
%
% \tcblower
%
% A famous verse in the Bible is:
% \textscripture[John 3:16][verse/hide]{\vs{16}For
% God so loved the world that he gave his one and
% only Son, that whoever believes in him shall not
% perish but have eternal life.}.
% \end{scriptureexample}
%
% \begin{function}{\vs}
% \begin{syntax}
% |\vs|\marg{verse number}
% \end{syntax}
% Format a verse number. By default these are formatted using a superscript.
% \end{function}
%
% \subsubsection{Environments}
%
% All scripture quotations must be set within a \env{scripture} environment.
% The rest of the environments documented below are only defined with the
% \env{scripture} environment. In most cases there is a default small
% \meta{\opt{aboveskip}} and \meta{\opt{belowskip}} inserted above and below
% these internal environments, but these are ignored if the environment is at
% the start or end of a \env{scripture} environment.
%
% \begin{environment}{center}
% \begin{syntax}
% |\begin{center}|\oarg{options}
% \quad\meta{centred text}
% |\end{center}|
% \end{syntax}
% \end{environment}
%
% \noindent Environment for typesetting centred sections of scripture
% quotations.
%
% See section \ref{centeroptions} for supported formatting \meta{|options|}.
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Daniel 5:25]
% \vs{25}`This is the inscription that was
% written:
% \begin{center}
% \textsc{mene, mene, tekel, parsin}
% \end{center}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Daniel 5:25]
% \vs{25}`This is the inscription that was
% written:
% \begin{center}
% \textsc{mene, mene, tekel, parsin}
% \end{center}
% \end{scripture}
% \end{scriptureexample}
%
% \begin{environment}{flushright}
% \begin{syntax}
% |\begin{flushright}|\oarg{options}
% \quad\meta{right aligned text}
% |\end{flushright}|
% \end{syntax}
% \end{environment}
%
% \noindent Environment for typesetting right aligned sections of scripture
% quotations.
%
% See section \ref{flushrightoptions} for supported formatting
% \meta{|options|}.
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Isaiah 40:5]
% \begin{poetry}[belowskip = 0pt]
% \vs{5}And the glory of the \name{Lord}\ldots
% and all people will see it together.
% \end{poetry}
%
% \begin{flushright}[aboveskip = 0pt]
% For the mouth of the \name{Lord} \\
% has spoken.'
% \end{flushright}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Isaiah 40:5]
% \begin{poetry}[belowskip = 0pt]
% \vs{5}And the glory of the \name{Lord}\ldots
% and all people will see it together.
% \end{poetry}
%
% \begin{flushright}[aboveskip = 0pt]
% For the mouth of the \name{Lord} \\
% has spoken.'
% \end{flushright}
% \end{scripture}
% \end{scriptureexample}
%
% \begin{environment}{hanging}
% \begin{syntax}
% |\begin{hanging}|\oarg{options}
% \quad\meta{hanging text}
% |\end{hanging}|
% \end{syntax}
% \end{environment}
%
% \noindent Environment for typesetting hanging sections of scripture
% quotations.
%
% See section \ref{hangingoptions} for supported formatting \meta{|options|}.
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Genesis 1:3--5]
% \begin{hanging}
% \vs{3}And God said, `Let there be light,' and
% there was light. \vs{4}God saw that the light
% was good, and he separated the light from the
% darkness. \vs{5}God called the light `day',
% and the darkness he called `night'. And there
% was evening, and there was morn\-ing---the
% first day.
% \end{hanging}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Genesis 1:3--5]
% \begin{hanging}
% \vs{3}And God said, `Let there be light,' and
% there was light. \vs{4}God saw that the light
% was good, and he separated the light from the
% darkness. \vs{5}God called the light `day',
% and the darkness he called `night'. And there
% was evening, and there was morn\-ing---the
% first day.
% \end{hanging}
% \end{scripture}
% \end{scriptureexample}
%
% \begin{environment}{midparachap}
% \begin{syntax}
% |\begin{midparachap}|\oarg{options}
% \quad\meta{text containing a chapter break}
% |\end{midparachap}|
% \end{syntax}
% \end{environment}
%
% \noindent Environment for typesetting paragraph with a chapter break within
% it.
%
% See section \ref{midparachapoptions} for supported formatting
% \meta{|options|}.
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[1 Corinthians 10:31--11:1]
% \begin{midparachap}
% \vs{31}So whether you eat or drink or
% whatever you do, do it all for the glory of
% God. \vs{32}Do not cause anyone to stumble,
% whether Jews, Greeks or the church of
% God---\vs{33}even as I try to please everyone
% in every way. For I am not seeking my own
% good but the good of many, so that they may
% be saved. \ch{11}Follow my example, as I
% follow the example of Christ.
% \end{midparachap}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[1 Corinthians 10:31--11:1]
% \begin{midparachap}
% \vs{31}So whether you eat or drink or
% whatever you do, do it all for the glory of
% God. \vs{32}Do not cause anyone to stumble,
% whether Jews, Greeks or the church of
% God---\vs{33}even as I try to please everyone
% in every way. For I am not seeking my own
% good but the good of many, so that they may
% be saved. \ch{11}Follow my example, as I
% follow the example of Christ.
% \end{midparachap}
% \end{scripture}
% \end{scriptureexample}
%
% \begin{environment}{narrow}
% \begin{syntax}
% |\begin{narrow}|\oarg{options}
% \quad\meta{quotation}
% |\end{narrow}|
% \end{syntax}
% \end{environment}
%
% \noindent Environment for typesetting narrow sections of scripture
% quotations.
%
% See section \ref{narrowoptions} for supported formatting \meta{|options|}.
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[2 Kings 18:18--19]
% \vs{18}They called for the king; and Eliakim
% son of Hilkiah the palace administrator, Shebna
% the secretary, and Joah son of Asaph the
% recorder went out to them.
%
% \vs{19}The field commander said to them, `Tell
% Hezekiah:
% \begin{narrow}
% `\thinspace``This is what the great king, the
% king of Assyria, says: on what are you basing
% this confidence of yours?
% \end{narrow}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[2 Kings 18:18--19]
% \vs{18}They called for the king; and Eliakim
% son of Hilkiah the palace administrator, Shebna
% the secretary, and Joah son of Asaph the
% recorder went out to them.
%
% \vs{19}The field commander said to them, `Tell
% Hezekiah:
% \begin{narrow}
% `\thinspace``This is what the great king, the
% king of Assyria, says: on what are you basing
% this confidence of yours?
% \end{narrow}
% \end{scripture}
% \end{scriptureexample}
%
% \begin{environment}{poetry}
% \begin{syntax}
% |\begin{poetry}|\oarg{options}
% \quad\meta{first half of verse}
% \quad\meta{second half of verse}
% \quad
% \quad\meta{first half of verse}
% \quad\meta{second half of verse}
% |\end{poetry}|
% \end{syntax}
% \end{environment}
%
% \noindent Environment for typesetting poetry sections of scripture
% quotations.
%
% Poetry sections of the Bible often have a first half and a parallel second
% half which is indented a little. These should be set on separate consecutive
% lines. Leaving a blank line indicates that the next line should return to
% the first half indent.
%
% See section \ref{poetryoptions} for supported formatting \meta{|options|}.
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Isaiah 1:2]
% \begin{poetry}
% \vs{2}Hear me, you heavens! Listen, earth!
% For the \name{Lord} has spoken:
%
% `I reared children and brought them up,
% but they have rebelled against me.
% \end{poetry}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Isaiah 1:2]
% \begin{poetry}
% \vs{2}Hear me, you heavens! Listen, earth!
% For the \name{Lord} has spoken:
%
% `I reared children and brought them up,
% but they have rebelled against me.
% \end{poetry}
% \end{scripture}
% \end{scriptureexample}
%
% \begin{environment}{scripture}
% \begin{syntax}
% |\begin{scripture}|\oarg{reference}\oarg{options}
% \quad\meta{quotation}
% |\end{scripture}|
% \end{syntax}
% \end{environment}
%
% \noindent Main environment for typesetting scripture quotations.
%
% The optional \meta{|reference|} is printed at the end of the quotation. See
% section \ref{options} for supported formatting \meta{|options|}.
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[John 3:16][version=NIV]
% \vs{16}For God so loved the world that he gave
% his one and only Son, that whoever believes in
% him shall not perish but have eternal life.
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[John 3:16][version=NIV]
% \vs{16}For God so loved the world that he gave
% his one and only Son, that whoever believes in
% him shall not perish but have eternal life.
% \end{scripture}
% \end{scriptureexample}
%
% \subsection{Provided hooks}
%
% \changes{v1.1}{2022/08/07}{Add before and after hooks for verses and
% chapters}
% \begin{hooks}[added=2022-08-07]{scripture/chap/before, scripture/chap/after,
% scripture/verse/before, scripture/verse/after}
% The following public hooks are available:
%
% \begin{description}
% \item[\hook{scripture/chap/before}] This hook is executed immediately
% before the \opt{chap/font} is set for the chapter.
% \item[\hook{scripture/chap/after}] This hook is executed immediately after
% the \opt{chap/sep} space is inserted.
% \item[\hook{scripture/verse/before}] This hook is executed immediately
% before the \opt{verse/font} is set for the verse.
% \item[\hook{scripture/chap/after}] This hook is executed immediately after
% the \opt{verse/sep} space is inserted.
% \end{description}
% \end{hooks}
%
% The following example illustrates how these hooks could be used to place the
% first and last verse on the page into the header.
%
% \begin{scriptureexample}
% \begin{verbatim}
% \documentclass{article}
% \usepackage{scripture}
% \AddToHook{scripture/chap/after}{%
% \markboth
% {Mark \scripturecurrentchapter
% :\scripturecurrentverse}
% {Mark \scripturecurrentchapter
% :\scripturecurrentverse}}
% \AddToHook{scripture/verse/after}{%
% \markboth
% {Mark \scripturecurrentchapter
% :\scripturecurrentverse}
% {Mark \scripturecurrentchapter
% :\scripturecurrentverse}}
% \renewcommand*{\scripturecurrentchapter}{1}
% \usepackage{fancyhdr}
% \pagestyle{fancy}
% \fancyhf{}
% \lhead{\textbf{\rightmark}}
% \rhead{\textbf{\leftmark} \textbar\ \thepage}
% \begin{document}
% \noindent
% \begin{scripture}
% \vs{45}Instead he went out and began to talk
% freely, spreading the news. As a result, Jesus
% could no longer enter a town openly but stayed
% outside in lonely places. Yet the people still
% came to him from everywhere.
%
% \extraskip
%
% \ch{2}A few days later, when Jesus again
% entered Capernaum, the people heard that he had
% come home.
% \end{scripture}
% \end{document}
% \end{verbatim}
%
% \tcblower
%
% \textbf{Mark 1:45\hfill Mark 2:1} \textbar\ 1
%
% \rule[2mm]{\linewidth}{0.4pt}
%
% \noindent
% \begin{scripture}
% \vs{45}Instead he went out and began to talk
% freely, spreading the news. As a result, Jesus
% could no longer enter a town openly but stayed
% outside in lonely places. Yet the people still
% came to him from everywhere.
%
% \extraskip
%
% \ch{2}A few days later, when Jesus again
% entered Capernaum, the people heard that he had
% come home.
% \end{scripture}
% \end{scriptureexample}
%
% \subsection{Options}
% \label{options}
%
% \changes{v1.3}{2023/01/08}{Remove \opt{reference/delim} option}
%
% Default formatting \meta{|options|} can be set using
% \cs{usepackage}|[|\meta{|options|}|]{scripture}| or
% \cs{scripturesetup}|{|\meta{|options|}|}|. Local formatting \meta{|options|}
% can be set by passing them to the various environments described above.
%
% \textbf{Note:} It's not possible to pass non-expandable macros as key-value
% options to the optional argument of \cs{usepackage}. So if you want to set
% |font=|\cs{bfseries} as the default, you must use
% \cs{scripturesetup}|{font=|\cs{bfseries}|}|. It is not possible to use
% \cs{usepackage}|[font=|\cs{bfseries}|]{scripture}| (you will get a compile
% error).
%
% \begin{option}{aboveskip}
% \begin{syntax}
% aboveskip = \meta{skip} \hfill Default: 0pt
% \end{syntax}
% \meta{|skip|} inserted above the \env{scripture} environment.
% \end{option}
%
% \changes{v1.3}{2022/11/15}{Add \opt{added/font} option}
% \begin{option}[added=2022-11-15]{added/font}
% \begin{syntax}
% added/font = \meta{font} \hfill Default: \emph{Empty}
% \end{syntax}
% \meta{|font|} used for the \cs{added} function.
% \end{option}
%
% \changes{v1.3}{2022/11/15}{Add \opt{added/format} option}
% \begin{option}[added=2022-11-15]{added/format}
% \begin{syntax}
% added/format = \meta{macro} \hfill Default: \cs{emph}\{\#1\}
% \end{syntax}
% \meta{|macro|} used to format the words that should be highlighted as
% added by the translators using the \cs{added} function. |#1| contains the
% text of the argument to \cs{added}.
% \end{option}
%
% \begin{option}{belowskip}
% \begin{syntax}
% belowskip = \meta{skip} \hfill Default: 0pt
% \end{syntax}
% \meta{|skip|} inserted below the \env{scripture} environment.
% \end{option}
%
% \changes{v1.2}{2022/09/07}{Add \opt{chapter/colour} option}
% \begin{option}[added=2022-09-07]{chapter/colour, chapter/color}
% \begin{syntax}
% chapter/colour = \meta{colour expression} \hfill Default: .
% \end{syntax}
% The \pkg{l3color} \meta{|colour expression|} to be used for chapter
% numbers. By default the current colour is inherited. \opt{chapter/color}
% is an alias for \opt{chapter/colour}.
% \end{option}
%
% \begin{option}{chapter/drop}
% \begin{syntax}
% chapter/drop = \meta{boolean} \hfill Default: true
% \end{syntax}
% Whether the chapter should be set as a drop letter taking up two
% lines or as a normal letter taking up one line. The value of
% \meta{|boolean|} is optional and assumed to be \val{true} if not present.
% This option is the opposite of \opt{chapter/nodrop}.
% \end{option}
%
% \begin{option}{chapter/font}
% \begin{syntax}
% chapter/font = \meta{font} \hfill Default: \cs{bfseries}
% \end{syntax}
% \meta{|font|} used for the \cs{ch} function.
% \end{option}
%
% \changes{v1.1}{2022/07/28}{Add \opt{chapter/format} option}
% \begin{option}[added=2022-07-28]{chapter/format}
% \begin{syntax}
% chapter/format = \meta{macro} \hfill Default: \#1
% \end{syntax}
% \meta{|macro|} used to format the \val{chapter} for a \env{scripture}
% quotation. |#1| contains the text of the \val{chapter}.
% \end{option}
%
% \changes{v1.1}{2022/08/15}{Add \opt{chapter/hide} option}
% \begin{option}[added=2022-08-15]{chapter/hide}
% \begin{syntax}
% chapter/hide = \meta{boolean} \hfill Default: false
% \end{syntax}
% Whether chapters should be shown or hidden. The value of \meta{|boolean|}
% is optional and assumed to be \val{true} if not present. This option is
% the opposite of \opt{chapter/show}. Note that the \hook{scripture/chap/before}
% and \hook{scripture/chap/after} hooks are still executed when chapters are
% hidden.
% \end{option}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Romans 5:1--2][chapter/hide]
% \ch{5}Therefore, since we have been justified
% through faith, we have peace with God through
% our Lord Jesus Christ, \vs{2}through whom we
% have gained access by faith into this grace in
% which we now stand. And we boast in the hope of
% the glory of God.
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Romans 5:1--2][chapter/hide]
% \ch{5}Therefore, since we have been justified
% through faith, we have peace with God through
% our Lord Jesus Christ, \vs{2}through whom we
% have gained access by faith into this grace in
% which we now stand. And we boast in the hope of
% the glory of God.
% \end{scripture}
% \end{scriptureexample}
%
% \begin{option}{chapter/nodrop}
% \begin{syntax}
% chapter/nodrop = \meta{boolean} \hfill Default: false
% \end{syntax}
% Whether the chapter should be set as a drop letter taking up two lines or
% as a normal letter taking up one line. The value of \meta{|boolean|} is
% optional and assumed to be \val{true} if not present. This option is the
% opposite of \opt{chapter/drop}.
% \end{option}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[John 1:1--3][chapter/nodrop]
% \ch{1}In the beginning was the Word, and the
% Word was with God, and the Word was God.
% \vs{2}He was with God in the beginning.
% \vs{3}Through him all things were made; without
% him nothing was made that has been made.
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[John 1:1--3][chapter/nodrop]
% \ch{1}In the beginning was the Word, and the
% Word was with God, and the Word was God.
% \vs{2}He was with God in the beginning.
% \vs{3}Through him all things were made; without
% him nothing was made that has been made.
% \end{scripture}
% \end{scriptureexample}
%
% \begin{option}{chapter/sep}
% \begin{syntax}
% chapter/sep = \meta{dimen} \hfill Default: 0.5em
% \end{syntax}
% \meta{|dimen|} used to separate a \cs{ch} from the following text.
% \end{option}
%
% \changes{v1.1}{2022/08/15}{Add \opt{chapter/show} option}
% \begin{option}[added=2022-08-15]{chapter/show}
% \begin{syntax}
% chapter/show = \meta{boolean} \hfill Default: true
% \end{syntax}
% Whether chapters should be shown or hidden. The value of \meta{|boolean|}
% is optional and assumed to be \val{true} if not present. This option is
% the opposite of \opt{chapter/hide}.
% \end{option}
%
% \changes{v1.1}{2022/11/14}{Add \opt{chapter/showverse} option}
% \begin{option}[added=2022-11-14]{chapter/showverse}
% \begin{syntax}
% chapter/showverse = \meta{boolean} \hfill Default: false
% \end{syntax}
% Whether \cs{vs}|\{1\}| should be automatically inserted after \cs{ch}. The
% value of \meta{|boolean|} is optional and assumed to be \val{true} if not
% present. See also \opt{midparachap/showverse} and
% \opt{midparachap/hideverse}. Note that \opt{chapter/showverse} take
% precedence over \opt{midparachap/hideverse}.
% \end{option}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[John 1:1][chapter/showverse]
% \ch{1}In the beginning was the Word, and the
% Word was with God, and the Word was God.
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[John 1:1][chapter/showverse]
% \ch{1}In the beginning was the Word, and the
% Word was with God, and the Word was God.
% \end{scripture}
% \end{scriptureexample}
%
% \changes{v1.2}{2022/08/31}{Add \opt{colour} option}
% \begin{option}[added=2022-08-31]{colour, color}
% \begin{syntax}
% colour = \meta{colour expression} \hfill Default: .
% \end{syntax}
% The \pkg{l3color} \meta{|colour expression|} to be used for the
% \env{scripture} environment. By default the current colour is inherited.
% \opt{color} is an alias for \opt{colour}.
% \end{option}
%
% \changes{v1.1}{2022/08/15}{Add \opt{compact} option}
% \begin{option}[added=2022-08-15]{compact}
% \begin{syntax}
% compact = \meta{boolean} \hfill Default: false
% \end{syntax}
% This option removes all paragraph breaks along with any \cs{extraskip} in
% the quotation so the whole quotation is a single paragraph of running
% prose. This option implies \opt{chapter/nodrop} and all options relating
% to inner environments are ignored.
%
% The value of \meta{|boolean|} is optional and assumed to be \val{true} if
% not present.
%
% \textbf{Warning:} This option redefines \cs{par} to \cs{relax} inside the
% \env{scripture} environment. If you have anything other than expected
% macros and environments inside your \env{scripture} environment \TeX{}
% will likely get stuck in an infinite loop.
% \end{option}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Jonah 1:17--2:2a][compact]
% \begin{midparachap}
% \vs{17}Now the \name{Lord} provided a huge
% fish to swallow Jonah, and Jonah was in the
% belly of the fish three days and three
% nights. \ch{2}From inside the fish Jonah
% prayed to the \name{Lord} his God. \vs{2}He
% said:
% \end{midparachap}
% \begin{poetry}
% `In my distress I called to the Lord,
% and he answered me.
% \end{poetry}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Jonah 1:17--2:2a][compact]
% \begin{midparachap}
% \vs{17}Now the \name{Lord} provided a huge
% fish to swallow Jonah, and Jonah was in the
% belly of the fish three days and three
% nights. \ch{2}From inside the fish Jonah
% prayed to the \name{Lord} his God. \vs{2}He
% said:
% \end{midparachap}
% \begin{poetry}
% `In my distress I called to the Lord,
% and he answered me.
% \end{poetry}
% \end{scripture}
% \end{scriptureexample}
%
% \begin{option}{extraskip}
% \begin{syntax}
% extraskip = \meta{skip} \hfill Default: \cs{medskipamount}
% \end{syntax}
% \meta{|skip|} used for the \cs{extraskip} function.
% \end{option}
%
% \begin{option}{font}
% \begin{syntax}
% font = \meta{font} \hfill Default: \emph{Empty}
% \end{syntax}
% \meta{|font|} used for the \env{scripture} environment.
% \end{option}
%
% \changes{v1.3}{2023/01/07}{Add \opt{inline} option}
% \begin{option}[added=2023-01-07]{inline}
% \begin{syntax}
% inline
% \end{syntax}
% Set the scripture quotation inline. The quotation is surrounded be the
% values of \opt{inline/begin} and \opt{inline/end} which default to |``\,|
% and |\,''|, respectively. This option also changes the defaults of some
% other options as follows:
% \begin{itemize}
% \item \opt{compact} is set
% \item \opt{reference/align} is set to |inline|
% \item \opt{reference/sep} is set to |0.5em|
% \item \opt{reference/format} is set to |(#1)|
% \item \opt{version/format} is set to |#1|
% \end{itemize}
%
% \textbf{Warning:} \cs{par} is redefined to \cs{relax} when the
% \opt{inline} option is set. If you have anything other than expected
% macros and environments inside your quotation \TeX{} will likely get stuck
% in an infinite loop.
% \end{option}
%
% \changes{v1.3}{2023/01/07}{Add \opt{inline/begin} option}
% \begin{option}[added=2023-01-07]{inline/begin}
% \begin{syntax}
% inline/begin = \meta{text} \hfill Default: |``\,|
% \end{syntax}
% Text inserted at the beginning of \cs{textscripture} or a \env{scripture}
% environment with the \opt{inline} option set.
% \end{option}
%
% \changes{v1.3}{2023/01/07}{Add \opt{inline/end} option}
% \begin{option}[added=2023-01-07]{inline/end}
% \begin{syntax}
% inline/end = \meta{text} \hfill Default: |\,''|
% \end{syntax}
% Text inserted between the end of \cs{textscripture} or a \env{scripture}
% environment with the \opt{inline} option set and the \meta{|reference|}
% (if specified).
% \end{option}
%
% \begin{option}{indent}
% \begin{syntax}
% indent = \meta{boolean} \hfill Default: true
% \end{syntax}
% Whether to indent the first line of a \env{scripture} environment or not
% by \opt{parindent}. The value of \meta{|boolean|} is optional and assumed
% to be \val{true} if not present. This option is the opposite of
% \opt{noindent}.
% \end{option}
%
% \changes{v1.2}{2022/11/02}{Add \opt{language} option}
% \begin{option}[added=2022-11-02]{language}
% \begin{syntax}
% language = \meta{language name} \hfill Default: \emph{Empty}
% \end{syntax}
% \pkg{babel} or \pkg{polyglossia} \meta{|language name|} to be used for the
% \env{scripture} environment. This calls
% \cs{selectlanguage}|{|\meta{|language name|}|}| at the start of the
% environment. Make sure you have \pkg{babel} or \pkg{polyglossia} loaded
% and correctly set up for your specified language. If unset the current
% active language is used.
% \end{option}
%
% \changes{v1.2}{2022/11/02}{Add \opt{language/variant} option}
% \begin{option}[added=2022-11-02]{language/variant}
% \begin{syntax}
% language/variant = \meta{language variant name} \hfill Default: \emph{Empty}
% \end{syntax}
% \pkg{polyglossia} \meta{|language variant name|} to be used along with the
% specified \opt{language} for the \env{scripture} environment. This inserts
% \cs{selectlanguage}|[|\meta{|language variant name|}|]{|\meta{language
% name}|}| at the start of the environment. Make sure you have
% \pkg{polyglossia} loaded and correctly set up for your specified language.
% \end{option}
%
% \begin{option}{leftmargin}
% \begin{syntax}
% leftmargin = \meta{dimen} \hfill Default: 0pt
% \end{syntax}
% \meta{|dimen|} used for the left margin of the \env{scripture}
% environment.
% \end{option}
%
% \changes{v1.2}{2022/09/01}{Add \opt{name/font} option}
% \begin{option}[added=2022-09-01]{name/font}
% \begin{syntax}
% name/font = \meta{font} \hfill Default: \cs{scshape}
% \end{syntax}
% \meta{|font|} used for the \cs{name} function.
% \end{option}
%
% \changes{v1.2}{2022/09/01}{Add \opt{name/format} option}
% \begin{option}[added=2022-09-01]{name/format}
% \begin{syntax}
% name/format = \meta{macro} \hfill Default: \#1
% \end{syntax}
% \meta{|macro|} used to format the \val{divine name} using the \cs{name}
% function. |#1| contains the text of the argument to \cs{name}.
% \end{option}
%
% \begin{option}{noindent}
% \begin{syntax}
% noindent = \meta{boolean} \hfill Default: false
% \end{syntax}
% Whether to indent the first line of a \env{scripture} environment or not
% by \opt{parindent}. The value of \meta{|boolean|} is optional and assumed
% to be \val{true} if not present. This option is the opposite of
% \opt{indent}.
% \end{option}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[1 Peter 3:18][noindent]
% \vs{18}For Christ also suffered once for sins,
% the righteous for the unrighteous, to bring you
% to God. He was put to death in the body but
% made alive in the Spirit.
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[1 Peter 3:18][noindent]
% \vs{18}For Christ also suffered once for sins,
% the righteous for the unrighteous, to bring you
% to God. He was put to death in the body but
% made alive in the Spirit.
% \end{scripture}
% \end{scriptureexample}
%
% \begin{option}{parindent}
% \begin{syntax}
% parindent = \meta{dimen} \hfill Default: \cs{parindent}
% \end{syntax}
% \meta{|dimen|} to use when indenting the first line of a paragraph in the
% \env{scripture} environment.
% \end{option}
%
% \begin{option}{parskip}
% \begin{syntax}
% parskip = \meta{skip} \hfill Default: \cs{parskip}
% \end{syntax}
% \meta{|skip|} to use between paragraphs in the \env{scripture} environment.
% \end{option}
%
% \changes{v1.2}{2022/08/31}{Add \opt{redletter} option}
% \begin{option}[added=2022-08-31]{redletter}
% \begin{syntax}
% redletter = \meta{boolean} \hfill Default: false
% \end{syntax}
% Whether to enable highlighting of Jesus' words in red. The value of
% \meta{|boolean|} is option and assumed to be \val{true} if not present.
% The text needs to be marked up with \cs{redletteron} and \cs{redletteroff}
% for this option to have any effect.
% \end{option}
%
% \changes{v1.2}{2022/08/31}{Add \opt{redletter/colour} option}
% \begin{option}[added=2022-08-31]{redletter/colour, redletter/color}
% \begin{syntax}
% redletter/colour = \meta{colour expression} \hfill Default: red!80!black
% \end{syntax}
% The \pkg{l3color} \meta{|colour expression|} to be used for the words of
% Jesus when the \opt{redletter} option is \val{true}. \cs{redletteron} and
% \cs{redletteroff} must be used to mark up the text. \opt{redletter/color}
% is an alias for \opt{redletter/colour}.
% \end{option}
%
% \changes{v1.3}{2023/01/08}{Add \opt{reference/align} option}
% \begin{option}[added=2023-01-08]{reference/align}
% \begin{syntax}
% reference/align = inline \textbar\ left \textbar\ right \hfill Default: right
% \end{syntax}
% Set the alignment of the reference. For |left| and |right| the reference
% will not break across lines, but a line break is permitted for |inline|.
% \end{option}
%
% \changes{v1.2}{2022/09/07}{Add \opt{reference/colour} option}
% \begin{option}[added=2022-09-07]{reference/colour, reference/color}
% \begin{syntax}
% reference/colour = \meta{colour expression} \hfill Default: .
% \end{syntax}
% The \pkg{l3color} \meta{|colour expression|} to be used for the reference
% and version. By default the current colour is inherited.
% \opt{reference/color} is an alias for \opt{reference/colour}.
% \end{option}
%
% \begin{option}{reference/font}
% \begin{syntax}
% reference/font = \meta{font} \hfill Default: \cs{bfseries}
% \end{syntax}
% \meta{|font|} used when printing the \val{reference} for a \env{scripture}
% quotation.
% \end{option}
%
% \begin{option}{reference/format}
% \begin{syntax}
% reference/format = \meta{macro} \hfill Default: \#1
% \end{syntax}
% \meta{|macro|} used to format the \val{reference} for a \env{scripture}
% quotation. |#1| contains the text of the \val{reference} and \val{version}
% (if specified).
% \end{option}
%
% \changes{v1.3}{2023/01/08}{Add \opt{reference/newline} option}
% \begin{option}[added=2023-01-8]{reference/newline}
% \begin{syntax}
% reference/newline
% \end{syntax}
% Always push the \val{reference} to a newline even if there is space for it
% to fit on the last line of the quotation. The option sets
% \opt{reference/sep} to \cs{linewidth} so there is never room for the
% reference on the final line of the quotation.
% \end{option}
%
% \begin{option}{reference/sep}
% \begin{syntax}
% reference/sep = \meta{dimen} \hfill Default: 2em
% \end{syntax}
% The minimum \meta{|dimen|} allowed between the end of a \env{scripture}
% quotation and its \val{reference} before the \val{reference} is pushed to
% the following line.
% \end{option}
%
% \begin{option}{rightmargin}
% \begin{syntax}
% rightmargin = \meta{dimen} \hfill Default: 0pt
% \end{syntax}
% \meta{|dimen|} used for the right margin of the \env{scripture}
% environment.
% \end{option}
%
% \begin{option}{selah/font}
% \begin{syntax}
% selah/font = \meta{font} \hfill Default: \cs{itshape}
% \end{syntax}
% \meta{|font|} used when printing \cs{selah} in a \env{poetry} environment.
% \end{option}
%
% \begin{option}{selah/format}
% \begin{syntax}
% selah/format = \meta{macro} \hfill Default: \#1
% \end{syntax}
% \meta{|macro|} used to format the \cs{selah} in a \env{poetry}
% environment. |#1| contains the value of \opt{selah/text}.
% \end{option}
%
% \begin{option}{selah/sep}
% \begin{syntax}
% selah/sep = \meta{dimen} \hfill Default: 1em
% \end{syntax}
% The minimum \meta{|dimen|} allowed between the end of a poetry line and
% \emph{Selah} before the \emph{Selah} is pushed to the following line.
% \end{option}
%
% \begin{option}{selah/text}
% \begin{syntax}
% selah/text = \meta{text} \hfill Default: Selah
% \end{syntax}
% \meta{|text|} used to for \cs{selah} in a \env{poetry} environment.
% \end{option}
%
% \changes{v1.2}{2022/08/30}{Add \opt{textright/sep} option}
% \begin{option}[added=2022-08-30]{textright/sep}
% \begin{syntax}
% textright/sep = \meta{dimen} \hfill Default: 1em
% \end{syntax}
% The minimum \meta{|dimen|} allowed between the end of a line and text
% aligned to the right with \cs{textright} before the right aligned text is
% pushed to the following line.
% \end{option}
%
% \changes{v1.2}{2022/09/07}{Add \opt{verse/colour} option}
% \begin{option}[added=2022-09-07]{verse/colour, verse/color}
% \begin{syntax}
% verse/colour = \meta{colour expression} \hfill Default: .
% \end{syntax}
% The \pkg{l3color} \meta{|colour expression|} to be used for verse numbers.
% By default the current colour is inherited. \opt{verse/color} is an alias
% for \opt{verse/colour}.
% \end{option}
%
% \changes{v1.3}{2022/11/13}{Add \opt{verse/first} option}
% \begin{option}[added=2022-11-13]{verse/first}
% \begin{syntax}
% verse/first = \meta{boolean} \hfill Default: false
% \end{syntax}
% In prose sections, print the verse number in a different format if it is
% at the start of the paragraph. The format and separation between verse and
% text are controlled with the \opt{verse/firstformat} and
% \opt{verse/firstsep} options. Use \cs{noversefirst} to suppress this at
% the next verse (e.g., if your quote starts mid-way though a paragraph and
% a normal verse should be printed). The value of \meta{|boolean|} is optional
% and assumed to be true if not present.
% \end{option}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Luke 18:25--28][noindent,
% verse/first, version=NRSV]
% \nofirstverse\vs{25}Indeed, it is easier for a
% camel to go through the eye of a needle than for
% someone who is rich to enter the kingdom of
% God.''
%
% \vs{26}Those who heard it said, ``Then who can
% be saved?'' \vs{27}He replied, ``What is
% impossible for mortals is possible for God.''
%
% \vs{28}Then Peter said, ``Look, we have left our
% homes and followed you.''
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Luke 18:25--28][noindent,
% verse/first, version=NRSV]
% \nofirstverse\vs{25}Indeed, it is easier for a
% camel to go through the eye of a needle than for
% someone who is rich to enter the kingdom of
% God.''
%
% \vs{26}Those who heard it said, ``Then who can
% be saved?'' \vs{27}He replied, ``What is
% impossible for mortals is possible for God.''
%
% \vs{28}Then Peter said, ``Look, we have left our
% homes and followed you.''
% \end{scripture}
% \end{scriptureexample}
%
% \changes{v1.3}{2022/11/13}{Add \opt{verse/firstformat} option}
% \begin{option}[added=2022-11-13]{verse/firstformat}
% \begin{syntax}
% verse/firstformat = \meta{macro} \hfill Default: \#1
% \end{syntax}
% \meta{|macro|} used to format the first \cs{vs} in a paragraph. |#1|
% contains the argument of \cs{vs}. Only used if \opt{verse/first} is
% |true|.
% \end{option}
%
% \changes{v1.3}{2022/11/13}{Add \opt{verse/firstsep} option}
% \begin{option}[added=2022-11-13]{verse/firstsep}
% \begin{syntax}
% verse/firstsep = \meta{dimen} \hfill Default: 0.5em
% \end{syntax}
% \meta{|dimen|} used to separate the first \cs{vs} in a paragraph from the
% following text. Only used if \opt{verse/first} is |true|.
% \end{option}
%
% \begin{option}{verse/font}
% \begin{syntax}
% verse/font = \meta{font} \hfill Default: \emph{Empty}
% \end{syntax}
% \meta{|font|} used for the \cs{vs} function.
% \end{option}
%
% \begin{option}{verse/format}
% \begin{syntax}
% verse/format = \meta{macro} \hfill Default: \cs{textsuperscript}\{\#1\}
% \end{syntax}
% \meta{|macro|} used to format the \cs{vs} function. |#1| contains the
% argument of \cs{vs}.
% \end{option}
%
% \changes{v1.1}{2022/08/15}{Add \opt{verse/hide} option}
% \begin{option}[added=2022-08-15]{verse/hide}
% \begin{syntax}
% verse/hide = \meta{boolean} \hfill Default: false
% \end{syntax}
% Whether verses should be shown or hidden. The value of \meta{|boolean|} is
% optional and assumed to be \val{true} if not present. This option is the
% opposite of \opt{verse/show}. Note that the \hook{scripture/verse/before}
% and \hook{scripture/verse/after} hooks are still executed when verses are
% hidden.
% \end{option}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Colossians 1:15--16][verse/hide]
% \vs{15}The Son is the image of the invisible
% God, the firstborn over all creation.
% \vs{16}For in him all things were created:
% things in heaven and on earth, visible and
% invisible, whether thrones or powers or rulers
% or authorities; all things have been created
% through him and for him.
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Colossians 1:15--16][verse/hide]
% \vs{15}The Son is the image of the invisible
% God, the firstborn over all creation.
% \vs{16}For in him all things were created:
% things in heaven and on earth, visible and
% invisible, whether thrones or powers or rulers
% or authorities; all things have been created
% through him and for him.
% \end{scripture}
% \end{scriptureexample}
%
% \changes{v1.1}{2022/07/28}{Add \opt{verse/sep} option with small default}
% \begin{option}[added=2022-07-28]{verse/sep}
% \begin{syntax}
% verse/sep = \meta{dimen} \hfill Default: 0.05 em
% \end{syntax}
% \meta{|dimen|} used to separate a \cs{vs} from the following text.
% \end{option}
%
% \changes{v1.1}{2022/08/15}{Add \opt{verse/show} option}
% \begin{option}[added=2022-08-15]{verse/show}
% \begin{syntax}
% verse/show = \meta{boolean} \hfill Default: true
% \end{syntax}
% Whether verses should be shown or hidden. The value of \meta{|boolean|}
% is optional and assumed to be \val{true} if not present. This option is
% the opposite of \opt{verse/hide}.
% \end{option}
%
% \begin{option}{version}
% \begin{syntax}
% version = \meta{version} \hfill Default: \emph{Empty}
% \end{syntax}
% \meta{|version|} added to the \val{reference} for a \env{scripture}
% quotation.
% \end{option}
%
% \begin{option}{version/delim}
% \begin{syntax}
% version/delim = \meta{delim} \hfill Default: \{\ \}
% \end{syntax}
% \meta{|delim|} to use between the \val{reference} and the \val{version} of a
% \env{scripture} quotation.
% \end{option}
%
% \begin{option}{version/format}
% \begin{syntax}
% version/format = \meta{macro} \hfill Default: (\#1)
% \end{syntax}
% \meta{|macro|} used to format the \val{version} for a \env{scripture}
% quotation. |#1| contains the text of the \val{version}.
% \end{option}
%
% \subsubsection{Options for the \env{center} environment}
% \label{centeroptions}
%
% If these options are passed directly to the \env{center} environment rather
% than to the package, \cs{scripturesetup} or the \env{scripture} environment,
% then the |center/| prefix should be dropped.
%
% \begin{option}{center/aboveskip}
% \begin{syntax}
% center/aboveskip = \meta{skip} \hfill Default: \cs{medskipamount}
% \end{syntax}
% \meta{|skip|} inserted above the \env{center} environment.
% \end{option}
%
% \begin{option}{center/belowskip}
% \begin{syntax}
% center/belowskip = \meta{skip} \hfill Default: \cs{medskipamount}
% \end{syntax}
% \meta{|skip|} inserted below the \env{center} environment.
% \end{option}
%
% \begin{option}{center/leftmargin}
% \begin{syntax}
% center/leftmargin = \meta{dimen} \hfill Default: 0pt
% \end{syntax}
% \meta{|dimen|} used for the left margin of the \env{center} environment.
% \end{option}
%
% \begin{option}{center/rightmargin}
% \begin{syntax}
% center/rightmargin = \meta{dimen} \hfill Default: 0pt
% \end{syntax}
% \meta{|dimen|} used for the right margin of the \env{center} environment.
% \end{option}
%
% \subsubsection{Options for the \env{flushright} environment}
% \label{flushrightoptions}
%
% If these options are passed directly to the \env{flushright} environment rather
% than to the package, \cs{scripturesetup} or the \env{scripture} environment,
% then the |flushright/| prefix should be dropped.
%
% \begin{option}{flushright/aboveskip}
% \begin{syntax}
% flushright/aboveskip = \meta{skip} \hfill Default: \cs{medskipamount}
% \end{syntax}
% \meta{|skip|} inserted above the \env{flushright} environment.
% \end{option}
%
% \begin{option}{flushright/belowskip}
% \begin{syntax}
% flushright/belowskip = \meta{skip} \hfill Default: \cs{medskipamount}
% \end{syntax}
% \meta{|skip|} inserted below the \env{flushright} environment.
% \end{option}
%
% \begin{option}{flushright/leftmargin}
% \begin{syntax}
% flushright/leftmargin = \meta{dimen} \hfill Default: 0pt
% \end{syntax}
% \meta{|dimen|} used for the left margin of the \env{flushright} environment.
% \end{option}
%
% \begin{option}{flushright/rightmargin}
% \begin{syntax}
% flushright/rightmargin = \meta{dimen} \hfill Default: 0pt
% \end{syntax}
% \meta{|dimen|} used for the right margin of the \env{flushright} environment.
% \end{option}
%
% \subsubsection{Options for the \env{hanging} environment}
% \label{hangingoptions}
%
% If these options are passed directly to the \env{hanging} environment rather
% than to the package, \cs{scripturesetup} or the \env{scripture} environment,
% then the |hanging/| prefix should be dropped.
%
% \begin{option}{hanging/aboveskip}
% \begin{syntax}
% hanging/aboveskip = \meta{skip} \hfill Default: \cs{medskipamount}
% \end{syntax}
% \meta{|skip|} inserted above the \env{hanging} environment.
% \end{option}
%
% \begin{option}{hanging/belowskip}
% \begin{syntax}
% hanging/belowskip = \meta{skip} \hfill Default: \cs{medskipamount}
% \end{syntax}
% \meta{|skip|} inserted below the \env{hanging} environment.
% \end{option}
%
% \begin{option}{hanging/hang}
% \begin{syntax}
% hanging/hang = \meta{dimen} \hfill Default: 2em
% \end{syntax}
% \meta{|dimen|} used for the indent of subsequent lines of the
% \env{hanging} environment.
% \end{option}
%
% \begin{option}{hanging/leftmargin}
% \begin{syntax}
% hanging/leftmargin = \meta{dimen} \hfill Default: 1em
% \end{syntax}
% \meta{|dimen|} used for the left margin of the \env{hanging} environment.
% \end{option}
%
% \begin{option}{hanging/rightmargin}
% \begin{syntax}
% hanging/rightmargin = \meta{dimen} \hfill Default: 1em
% \end{syntax}
% \meta{|dimen|} used for the right margin of the \env{hanging} environment.
% \end{option}
%
% \subsubsection{Options for the \env{midparachap} environment}
% \label{midparachapoptions}
%
% If these options are passed directly to the \env{midparachap} environment
% rather than to the package, \cs{scripturesetup} or the \env{scripture}
% environment, then the |midparachap/| prefix should be dropped.
%
% \begin{option}{midparachap/hideverse}
% \begin{syntax}
% midparachap/hideverse = \meta{boolean} \hfill Default: false
% \end{syntax}
% Whether a \cs{vs}|{1}| should automatically be inserted after a \cs{ch}
% when the \cs{ch} occurs mid-paragraph. This also affects \cs{ch} in
% \env{poetry} environments. \cs{extraskip} begins a new paragraph in a
% \env{poetry} environment. The value of \meta{|boolean|} is optional and
% assumed to be \val{true} if not present. This option is the opposite of
% \opt{midparachap/showverse}. See also \opt{chapter/showverse}.
% \end{option}
%
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Hosea 11:12--12:1]%
% [midparachap/hideverse]
% \begin{poetry}
% \vs{12}Ephraim has surrounded me with lies,
% Israel with deceit.
%
% And Judah is unruly against God,
% even against the faithful Holy One.
%
% \ch{12}Ephraim feeds on the wind;
% he pursues the east wind all day
% and multiplies lies and violence.
%
% He makes a treaty with Assyria
% and sends olive oil to Egypt.
% \end{poetry}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Hosea 11:12--12:1]%
% [midparachap/hideverse]
% \begin{poetry}
% \vs{12}Ephraim has surrounded me with lies,
% Israel with deceit.
%
% And Judah is unruly against God,
% even against the faithful Holy One.
%
% \ch{12}Ephraim feeds on the wind;
% he pursues the east wind all day
% and multiplies lies and violence.
%
% He makes a treaty with Assyria
% and sends olive oil to Egypt.
% \end{poetry}
% \end{scripture}
% \end{scriptureexample}
%
% \begin{option}{midparachap/showverse}
% \begin{syntax}
% midparachap/showverse = \meta{boolean} \hfill Default: true
% \end{syntax}
% Whether a \cs{vs}|{1}| should automatically be inserted after a \cs{ch}
% when the \cs{ch} occurs mid-paragraph. This also affects \cs{ch} in
% \env{poetry} environments. \cs{extraskip} begins a new paragraph in a
% \env{poetry} environment. The value of \meta{|boolean|} is optional and
% assumed to be \val{true} if not present. This option is the opposite of
% \opt{midparachap/hideverse}. See also \opt{chapter/showverse}.
% \end{option}
%
% \subsubsection{Options for the \env{narrow} environment}
% \label{narrowoptions}
%
% If these options are passed directly to the \env{narrow} environment rather
% than to the package, \cs{scripturesetup} or the \env{scripture} environment,
% then the |narrow/| prefix should be dropped.
%
% \begin{option}{narrow/aboveskip}
% \begin{syntax}
% narrow/aboveskip = \meta{skip} \hfill Default: \cs{medskipamount}
% \end{syntax}
% \meta{|skip|} inserted above the \env{narrow} environment.
% \end{option}
%
% \begin{option}{narrow/belowskip}
% \begin{syntax}
% narrow/belowskip = \meta{skip} \hfill Default: \cs{medskipamount}
% \end{syntax}
% \meta{|skip|} inserted below the \env{narrow} environment.
% \end{option}
%
% \begin{option}{narrow/leftmargin}
% \begin{syntax}
% narrow/leftmargin = \meta{dimen} \hfill Default: 1em
% \end{syntax}
% \meta{|dimen|} used for the left margin of the \env{narrow} environment.
% \end{option}
%
% \begin{option}{narrow/rightmargin}
% \begin{syntax}
% narrow/rightmargin = \meta{dimen} \hfill Default: 1em
% \end{syntax}
% \meta{|dimen|} used for the right margin of the \env{narrow} environment.
% \end{option}
%
% \subsubsection{Options for the \env{poetry} environment}
% \label{poetryoptions}
%
% If these options are passed directly to the \env{poetry} environment rather
% than to the package, \cs{scripturesetup} or the \env{scripture} environment,
% then the |poetry/| prefix should be dropped.
%
% \begin{option}{poetry/aboveskip}
% \begin{syntax}
% poetry/aboveskip = \meta{skip} \hfill Default: \cs{medskipamount}
% \end{syntax}
% \meta{|skip|} inserted above the \env{poetry} environment.
% \end{option}
%
% \begin{option}{poetry/belowskip}
% \begin{syntax}
% poetry/belowskip = \meta{skip} \hfill Default: \cs{medskipamount}
% \end{syntax}
% \meta{|skip|} inserted below the \env{poetry} environment.
% \end{option}
%
% \begin{option}{poetry/bigindent}
% \begin{syntax}
% poetry/bigindent = \meta{dimen} \hfill Default: 4em
% \end{syntax}
% \meta{|dimen|} used for the indent subsequent lines of a line of poetry in
% a \env{poetry} environment if it needs to flow on to the following line.
% \end{option}
%
% \begin{option}{poetry/indent}
% \begin{syntax}
% poetry/indent = \meta{dimen} \hfill Default: 1em
% \end{syntax}
% \meta{|dimen|} used for the second half of a line of poetry in a
% \env{poetry} environment.
% \end{option}
%
% \begin{option}{poetry/leftmargin}
% \begin{syntax}
% poetry/leftmargin = \meta{dimen} \hfill Default: 1em
% \end{syntax}
% \meta{|dimen|} used for the left margin of the \env{poetry} environment.
% \end{option}
%
% \begin{option}{poetry/rightmargin}
% \begin{syntax}
% poetry/rightmargin = \meta{dimen} \hfill Default: 0pt
% \end{syntax}
% \meta{|dimen|} used for the right margin of the \env{poetry} environment.
% \end{option}
%
% \changes{v1.1}{2022/07/31}{Add \opt{poetry/verse/left} option}
% \begin{option}[added=2022-07-31]{poetry/verse/left}
% \begin{syntax}
% poetry/verse/left = \meta{boolean} \hfill Default: false
% \end{syntax}
% Align verse numbers in \env{poetry} environments at the left margin of the
% \env{scripture} environment. This option is the opposite of
% \opt{poetry/verse/right}.
% \end{option}
%
% \begin{scriptureexample}[lefthand ratio=0.65]
% \begin{verbatim}
% \begin{scripture}[Atcs 15:15--18]%
% [poetry/leftmargin=2em, poetry/verse/left]
% \vs{15}The words of the prophets are in
% agreement with this, as it is written:
% \begin{poetry}
% \vs{16}`\thinspace``After this I will return
% and rebuild David's fallen tent.
%
% Its ruins I will rebuild,
% and I will restore it,
%
% \vs{17}that the rest of mankind may seek the Lord,
% even all the Gentiles who bear my name,
%
% says the Lord, who does these things''---
% \vs{18}things known from long ago.
% \end{poetry}
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Atcs 15:15--18]%
% [poetry/leftmargin=2em, poetry/verse/left]
% \vs{15}The words of the prophets are in
% agreement with this, as it is written:
% \begin{poetry}
% \vs{16}`\thinspace``After this I will return
% and rebuild David's fallen tent.
%
% Its ruins I will rebuild,
% and I will restore it,
%
% \vs{17}that the rest of mankind may seek the Lord,
% even all the Gentiles who bear my name,
%
% says the Lord, who does these things''---
% \vs{18}things known from long ago.
% \end{poetry}
% \end{scripture}
% \end{scriptureexample}
%
% \changes{v1.1}{2022/07/31}{Add \opt{poetry/verse/right} option}
% \begin{option}[added=2022-07-31]{poetry/verse/right}
% \begin{syntax}
% poetry/verse/right = \meta{boolean} \hfill Default: true
% \end{syntax}
% Align verse numbers in \env{poetry} environments at the left margin of the
% poetry environment. The verse numbers overlap to the left. This option is
% the opposite of \opt{poetry/verse/left}.
% \end{option}
%
% \changes{v1.1}{2022/07/31}{Add \opt{poetry/verse/sep} option}
% \begin{option}[added=2022-07-31]{poetry/verse/sep}
% \begin{syntax}
% poetry/verse/sep = \meta{dimen} \hfill Default: 0.05 em
% \end{syntax}
% \meta{|dimen|} used to separate a \cs{vs} from the following text in a
% \env{poetry} environment. This is only used for verses at the start of a
% line.
% \end{option}
%
% \end{documentation}
%
% \begin{implementation}
%
% \section{Implementation}
%
% \begin{macrocode}
%<*package>
%<@@=scripture>
% \end{macrocode}
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplPackage{scripture}{2023/01/08}{1.3}
{Format Scripture Quotations (DCP)}
% \end{macrocode}
%
% \subsection{Messages}
%
% \env{scripture} environments along with all internal environments can not be
% nested.
%
% \begin{macrocode}
\msg_new:nnnn { scripture } { nested-environment }
{ Nesting~of~scripture~environments~not~supported. }
{ You~have~tried~to~nest~a~scripture~environment~or \\
one~of~its~internal~environments,~which~is~not~supported. }
% \end{macrocode}
%
% Make sure \pkg{polyglossia} languages and variants are set up.
%
% \begin{macrocode}
\msg_new:nnnn { scripture } { language-error }
{ Language~`#1'~not~set~up. }
{ Language~`#1'~has~not~been~set~up.~Make~sure~you~set~up~languages~
before~using~the~language~option~of~the~scripture~environment. }
% \end{macrocode}
%
% Warn if a \opt{language} is requested and neither \pkg{babel} nor
% \pkg{polyglossia} is loaded.
%
% \begin{macrocode}
\msg_new:nnnn { scripture } { language-warning }
{ Language~requested~without~support. }
{ You~have~requested~language=#1,~but~neither~babel~nor~polyglossia~
have~been~loaded~and~set~up.~Ignoring~option~language=#1. }
% \end{macrocode}
%
% \subsection{Options}
%
% Key-value settings for the \env{scripture} environment and its inner
% environments.
% \begin{macrocode}
\keys_define:nn { scripture }
{
, aboveskip .tl_set:N = \l_@@_aboveskip_tl
, aboveskip .value_required:n = true
, aboveskip .initial:n = \c_zero_skip
, added / font .tl_set:N = \l_@@_added_font_tl
, added / font .value_required:n = true
, added / font .initial:n =
, added / format .cs_set:Np = \@@_added_format:n #1
, added / format .value_required:n = true
, added / format .initial:n = \emph { #1 }
, belowskip .tl_set:N = \l_@@_belowskip_tl
, belowskip .value_required:n = true
, belowskip .initial:n = \c_zero_skip
, colour .tl_set:N = \l_@@_colour_tl
, colour .value_required:n = true
, colour .initial:n = .
, color .meta:n = { colour = { #1 } }
, compact .bool_set:N = \l_@@_compact_bool
, compact .default:n = true
, compact .initial:n = false
, chapter / font .tl_set:N = \l_@@_chap_font_tl
, chapter / font .value_required:n = true
, chapter / font .initial:n = \bfseries
, chapter / colour .tl_set:N = \l_@@_chapter_colour_tl
, chapter / colour .value_required:n = true
, chapter / colour .initial:n = .
, chapter / color .meta:n = { chapter / colour = { #1 } }
, chapter / drop .bool_set:N = \l_@@_chap_drop_bool
, chapter / drop .default:n = true
, chapter / drop .initial:n = true
, chapter / format .cs_set:Np = \@@_chap_format:n #1
, chapter / format .value_required:n = true
, chapter / format .initial:n = #1
, chapter / hide .bool_set_inverse:N = \l_@@_chap_show_bool
, chapter / hide .default:n = true
, chapter / nodrop .bool_set_inverse:N = \l_@@_chap_drop_bool
, chapter / nodrop .default:n = true
, chapter / sep .tl_set:N = \l_@@_chap_sep_tl
, chapter / sep .value_required:n = true
, chapter / sep .initial:n = 0.5 em
, chapter / show .bool_set:N = \l_@@_chap_show_bool
, chapter / show .default:n = true
, chapter / show .initial:n = true
, chapter / showverse .bool_set:N = \l_@@_chap_show_verse_bool
, chapter / showverse .default:n = true
, chapter / showverse .initial:n = false
, extraskip .tl_set:N = \l_@@_extraskip_tl
, extraskip .value_required:n = true
, extraskip .initial:n = \medskipamount
, font .tl_set:N = \l_@@_font_tl
, font .value_required:n = true
, font .initial:n =
, indent .bool_set:N = \l_@@_indent_bool
, indent .default:n = true
, indent .initial:n = true
, _inline .bool_set:N = \l_@@_inline_bool
, _inline .initial:n = false
, inline .meta:n = {
_inline = true ,
compact ,
reference / format = (##1) ,
reference / align = inline ,
reference / sep = 0.5 em,
version / format = ##1
}
, inline .value_forbidden:n = true
, inline / begin .tl_set:N = \l_@@_inline_begin_tl
, inline / begin .value_required:n = true
, inline / begin .initial:n = ``\,
, inline / end .tl_set:N = \l_@@_inline_end_tl
, inline / end .value_required:n = true
, inline / end .initial:n = \,''
, language .tl_set:N = \l_@@_language_tl
, language .value_required:n = true
, language .initial:n =
, language / variant .tl_set:N = \l_@@_language_variant_tl
, language / variant .value_required:n = true
, language / variant .initial:n =
, leftmargin .tl_set:N = \l_@@_leftmargin_tl
, leftmargin .value_required:n = true
, leftmargin .initial:n = \c_zero_dim
, name / font .tl_set:N = \l_@@_name_font_tl
, name / font .value_required:n = true
, name / font .initial:n = \scshape
, name / format .cs_set:Np = \@@_name_format:n #1
, name / format .value_required:n = true
, name / format .initial:n = #1
, noindent .bool_set_inverse:N = \l_@@_indent_bool
, noindent .default:n = true
, parindent .tl_set:N = \l_@@_parindent_tl
, parindent .value_required:n = true
, parindent .initial:n = \parindent
, parskip .tl_set:N = \l_@@_parskip_tl
, parskip .value_required:n = true
, parskip .initial:n = \parskip
, redletter .bool_set:N = \l_@@_red_letter_bool
, redletter .default:n = true
, redletter .initial:n = false
, redletter / colour .tl_set:N = \l_@@_red_letter_colour_tl
, redletter / colour .value_required:n = true
, redletter / colour .initial:n = red!80!black
, redletter / color .meta:n = { redletter / colour = { #1 } }
, reference / align .choices:nn = { inline, left, right }
{
\tl_if_exist:NF \l_@@_ref_align_tl
{ \tl_new:N \l_@@_ref_align_tl }
\tl_set_eq:NN \l_@@_ref_align_tl \l_keys_choice_tl
}
, reference / align .value_required:n = true
, reference / align .initial:n = right
, reference / colour .tl_set:N = \l_@@_ref_colour_tl
, reference / colour .value_required:n = true
, reference / colour .initial:n = .
, reference / color .meta:n = { reference / colour = { #1 } }
, reference / font .tl_set:N = \l_@@_ref_font_tl
, reference / font .value_required:n = true
, reference / font .initial:n = \bfseries
, reference / format .cs_set:Np = \@@_ref_format:n #1
, reference / format .value_required:n = true
, reference / format .initial:n = #1
, reference / newline .meta:n = { reference / sep = \linewidth }
, reference / newline .value_forbidden:n = true
, reference / sep .tl_set:N = \l_@@_ref_sep_tl
, reference / sep .value_required:n = true
, reference / sep .initial:n = 2 em
, rightmargin .tl_set:N = \l_@@_rightmargin_tl
, rightmargin .value_required:n = true
, rightmargin .initial:n = \c_zero_dim
, selah / text .tl_set:N = \l_@@_selah_text_tl
, selah / text .value_required:n = true
, selah / text .initial:n = Selah
, selah / font .tl_set:N = \l_@@_selah_font_tl
, selah / font .value_required:n = true
, selah / font .initial:n = \itshape
, selah / format .cs_set:Np = \@@_selah_format:n #1
, selah / format .value_required:n = true
, selah / format .initial:n = #1
, selah / sep .tl_set:N = \l_@@_selah_sep_tl
, selah / sep .value_required:n = true
, selah / sep .initial:n = 1 em
, textright / sep .tl_set:N = \l_@@_text_right_sep_tl
, textright / sep .value_required:n = true
, textright / sep .initial:n = 1 em
, verse / colour .tl_set:N = \l_@@_verse_colour_tl
, verse / colour .value_required:n = true
, verse / colour .initial:n = .
, verse / color .meta:n = { verse / colour = { #1 } }
, verse / first .bool_set:N = \l_@@_verse_first_bool
, verse / first .default:n = true
, verse / first .initial:n = false
, verse / firstformat .cs_set:Np = \@@_verse_first_format:n #1
, verse / firstformat .value_required:n = true
, verse / firstformat .initial:n = #1
, verse / firstsep .tl_set:N = \l_@@_verse_first_sep_tl
, verse / firstsep .value_required:n = true
, verse / firstsep .initial:n = 0.5em
, verse / font .tl_set:N = \l_@@_verse_font_tl
, verse / font .value_required:n = true
, verse / font .initial:n =
, verse / format .cs_set:Np = \@@_verse_format:n #1
, verse / format .value_required:n = true
, verse / format .initial:n = \textsuperscript{#1}
, verse / hide .bool_set_inverse:N = \l_@@_verse_show_bool
, verse / hide .default:n = true
, verse / sep .tl_set:N = \l_@@_verse_sep_tl
, verse / sep .value_required:n = true
, verse / sep .initial:n = 0.05 em
, verse / show .bool_set:N = \l_@@_verse_show_bool
, verse / show .default:n = true
, verse / show .initial:n = true
, version .tl_set:N = \l_@@_version_tl
, version .value_required:n = true
, version .initial:n =
, version / delim .tl_set:N = \l_@@_version_delim_tl
, version / delim .value_required:n = true
, version / delim .initial:n = \c_space_tl
, version / format .cs_set:Np = \@@_version_format:n #1
, version / format .value_required:n = true
, version / format .initial:n = (#1)
% \end{macrocode}
% Options for the \env{center} environment.
% \begin{macrocode}
, center / aboveskip .tl_set:N = \l_@@_center_aboveskip_tl
, center / aboveskip .value_required:n = true
, center / aboveskip .initial:n = \medskipamount
, center / belowskip .tl_set:N = \l_@@_center_belowskip_tl
, center / belowskip .value_required:n = true
, center / belowskip .initial:n = \medskipamount
, center / leftmargin .tl_set:N = \l_@@_center_leftmargin_tl
, center / leftmargin .value_required:n = true
, center / leftmargin .initial:n = \c_zero_dim
, center / rightmargin .tl_set:N = \l_@@_center_rightmargin_tl
, center / rightmargin .value_required:n = true
, center / rightmargin .initial:n = \c_zero_dim
% \end{macrocode}
% Options for the \env{flushright} environment.
% \begin{macrocode}
, flushright / aboveskip .tl_set:N = \l_@@_flushright_aboveskip_tl
, flushright / aboveskip .value_required:n = true
, flushright / aboveskip .initial:n = \medskipamount
, flushright / belowskip .tl_set:N = \l_@@_flushright_belowskip_tl
, flushright / belowskip .value_required:n = true
, flushright / belowskip .initial:n = \medskipamount
, flushright / leftmargin .tl_set:N = \l_@@_flushright_leftmargin_tl
, flushright / leftmargin .value_required:n = true
, flushright / leftmargin .initial:n = \c_zero_dim
, flushright / rightmargin .tl_set:N = \l_@@_flushright_rightmargin_tl
, flushright / rightmargin .value_required:n = true
, flushright / rightmargin .initial:n = \c_zero_dim
% \end{macrocode}
% Options for the \env{hanging} environment.
% \begin{macrocode}
, hanging / aboveskip .tl_set:N = \l_@@_hanging_aboveskip_tl
, hanging / aboveskip .value_required:n = true
, hanging / aboveskip .initial:n = \medskipamount
, hanging / belowskip .tl_set:N = \l_@@_hanging_belowskip_tl
, hanging / belowskip .value_required:n = true
, hanging / belowskip .initial:n = \medskipamount
, hanging / hang .tl_set:N = \l_@@_hanging_hang_tl
, hanging / hang .value_required:n = true
, hanging / hang .initial:n = 2 em
, hanging / leftmargin .tl_set:N = \l_@@_hanging_leftmargin_tl
, hanging / leftmargin .value_required:n = true
, hanging / leftmargin .initial:n = 1 em
, hanging / rightmargin .tl_set:N = \l_@@_hanging_rightmargin_tl
, hanging / rightmargin .value_required:n = true
, hanging / rightmargin .initial:n = \c_zero_dim
% \end{macrocode}
% Options for the mid-paragraph chapters (including the \env{midparachap} environment).
% \begin{macrocode}
, midparachap / hideverse .bool_set_inverse:N = \l_@@_midparachap_show_verse_bool
, midparachap / hideverse .default:n = true
, midparachap / showverse .bool_set:N = \l_@@_midparachap_show_verse_bool
, midparachap / showverse .default:n = true
, midparachap / showverse .initial:n = true
% \end{macrocode}
% Options for the \env{narrow} environment.
% \begin{macrocode}
, narrow / aboveskip .tl_set:N = \l_@@_narrow_aboveskip_tl
, narrow / aboveskip .value_required:n = true
, narrow / aboveskip .initial:n = \medskipamount
, narrow / belowskip .tl_set:N = \l_@@_narrow_belowskip_tl
, narrow / belowskip .value_required:n = true
, narrow / belowskip .initial:n = \medskipamount
, narrow / leftmargin .tl_set:N = \l_@@_narrow_leftmargin_tl
, narrow / leftmargin .value_required:n = true
, narrow / leftmargin .initial:n = 1 em
, narrow / rightmargin .tl_set:N = \l_@@_narrow_rightmargin_tl
, narrow / rightmargin .value_required:n = true
, narrow / rightmargin .initial:n = 1 em
% \end{macrocode}
% Options for the \env{poetry} environment.
% \begin{macrocode}
, poetry / aboveskip .tl_set:N = \l_@@_poetry_aboveskip_tl
, poetry / aboveskip .value_required:n = true
, poetry / aboveskip .initial:n = \medskipamount
, poetry / belowskip .tl_set:N = \l_@@_poetry_belowskip_tl
, poetry / belowskip .value_required:n = true
, poetry / belowskip .initial:n = \medskipamount
, poetry / bigindent .tl_set:N = \l_@@_poetry_big_indent_tl
, poetry / bigindent .value_required:n = true
, poetry / bigindent .initial:n = 4 em
, poetry / indent .tl_set:N = \l_@@_poetry_indent_tl
, poetry / indent .value_required:n = true
, poetry / indent .initial:n = 1 em
, poetry / leftmargin .tl_set:N = \l_@@_poetry_leftmargin_tl
, poetry / leftmargin .value_required:n = true
, poetry / leftmargin .initial:n = 1 em
, poetry / rightmargin .tl_set:N = \l_@@_poetry_rightmargin_tl
, poetry / rightmargin .value_required:n = true
, poetry / rightmargin .initial:n = \c_zero_dim
, poetry / verse / left .bool_set_inverse:N = \l_@@_poetry_verse_right_bool
, poetry / verse / left .default:n = true
, poetry / verse / right .bool_set:N = \l_@@_poetry_verse_right_bool
, poetry / verse / right .default:n = true
, poetry / verse / right .initial:n = true
, poetry / verse / sep .tl_set:N = \l_@@_poetry_verse_sep_tl
, poetry / verse / sep .value_required:n = true
, poetry / verse / sep .initial:n = 0.05 em
}
% \end{macrocode}
% Process package options.
% \begin{macrocode}
\ProcessKeyOptions
% \end{macrocode}
%
% \subsection{Hooks}
%
% \begin{hooks}{scripture/chap/before, scripture/chap/after,
% scripture/verse/before, scripture/verse/after}
% Hooks for before and after chapters and verses. The current chapter and
% verse is available in the hooks as \cs{scripturecurrentchapter} and
% \cs{scripturecurrentverse} respectively. These are global.
% \begin{macrocode}
\hook_new_pair:nn { scripture / chap / before } { scripture / chap / after }
\hook_new_pair:nn { scripture / verse / before } { scripture / verse / after }
% \end{macrocode}
% \end{hooks}
%
% \subsection{The main \env{scripture} environment}
%
% \begin{macro}{\l_@@_active_bool, \l_@@_active_inner_bool}
% Flags to ensure that environments are not nested.
% \begin{macrocode}
\bool_new:N \l_@@_active_bool
\bool_new:N \l_@@_active_inner_bool
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_clubpenalty_saved_int}
% Holds saved club penalty so we can change and restore it around chapter
% breaks.
% \begin{macrocode}
\int_new:N \l_@@_clubpenalty_saved_int
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_extra_skip:}
% Insert a little extra vertical space between two paragraphs. This function
% tests if the previous paragraph is only one line in length and began
% with a \cs{ch} function. If this condition is met, more space is added
% if necessary to avoid the following paragraph clashing with the drop
% chapter.
% \begin{macrocode}
\cs_new_protected:Nn \@@_extra_skip:
{
\int_compare:nNnT
\g_@@_chap_par_prevgraf_int = 1
{
\dim_compare:nNnT
{ \parskip + \glueexpr \l_@@_extraskip_tl } < \baselineskip
{
\addvspace { \baselineskip }
}
\int_gzero:N \g_@@_chap_par_prevgraf_int
}
\addvspace { \l_@@_extraskip_tl }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_text_right:nn}
% Align a word to the right and finish a paragraph, pushing to the next line
% if there is not space for the word.
% \begin{macrocode}
\cs_new_protected:Nn \@@_text_right:nn
{
\bool_lazy_or:nnTF
{ \str_if_eq_p:Vn \l_@@_currenvir_str { flushright } }
{ \str_if_eq_p:Vn \l_@@_currenvir_str { center } }
{
\unskip
\break
\strut
\hfill
#2
\para_end:
}
{
{
\unskip
\hfil
\penalty 50
\skip_horizontal:n { #1 }
\hbox:n {}
\nobreak
\hfill
#2
\skip_zero:N \parfillskip
\int_zero:N \finalhyphendemerits
\para_end:
}
}
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Formatting and printing quotation references}
%
% \begin{macro}{\l_@@_ref_box}
% Box to hold the formatted reference.
% \begin{macrocode}
\box_new:N \l_@@_ref_box
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_format_full_ref:n}
% Format a scripture quotation with its reference.
% \begin{macrocode}
\cs_new_protected:Nn \@@_format_full_ref:n
{
\group_begin:
\l_@@_ref_font_tl
\str_if_eq:VnF \l_@@_ref_colour_tl { . }
{ \exp_args:NV \color_select:n \l_@@_ref_colour_tl }
\@@_ref_format:n
{
#1
% \end{macrocode}
% Append a Bible version if it has been specified.
% \begin{macrocode}
\tl_if_empty:NF \l_@@_version_tl
{
\l_@@_version_delim_tl
\@@_version_format:n { \l_@@_version_tl }
}
}
\group_end:
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_reference:n}
% Output the reference for the Scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_reference:n
{
\hbox_set:Nn \l_@@_ref_box
{
\@@_format_full_ref:n { #1 }
}
% \end{macrocode}
% Since the \env{poetry} environment uses \cs{@@_obeylines:} there is always
% an extra \cs{parskip} when a \env{scripture} quotation ends with a
% \env{poetry}
% environment.
% \begin{macrocode}
\bool_if:NT \g_@@_poetry_end_bool
{ \skip_vertical:n { -\parskip } }
\dim_compare:nNnT
{ \box_wd:N \l_@@_ref_box + \g_@@_final_line_dim + \l_@@_ref_sep_tl }
>
\linewidth
{ \skip_vertical:N \baselineskip }
% \end{macrocode}
% If a \env{scripture} quotation ends with an inner environment, there will
% be an extra space of \cs{baselineskip}.
% \begin{macrocode}
\int_compare:nNnT \prevgraf = \c_zero_int
{ \skip_vertical:n { -\baselineskip } }
\tl_if_eq:NnT \l_@@_ref_align_tl { right }
{ \hfill }
\tl_if_eq:NnT \l_@@_ref_align_tl { left }
{
\mode_leave_vertical:
\dim_compare:nNnT
{ \box_wd:N \l_@@_ref_box + \g_@@_final_line_dim + \l_@@_ref_sep_tl }
<
\linewidth
{ \skip_horizontal:n { \g_@@_final_line_dim + \l_@@_ref_sep_tl } }
}
\box_use:N \l_@@_ref_box
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Red lettering}
%
% \begin{macro}{\g_@@_red_letter_active_bool}
% Flag indicating if currently in a red letter block of text.
% \begin{macrocode}
\bool_new:N \g_@@_red_letter_active_bool
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_red_letter_on:}
% Mark the beginning of a section of text attributed to Jesus Christ.
% \begin{macrocode}
\cs_new_protected:Nn \@@_red_letter_on:
{
\bool_if:NT \l_@@_red_letter_bool
{
\bool_gset_true:N \g_@@_red_letter_active_bool
\exp_args:NV \color_select:n \l_@@_red_letter_colour_tl
\str_if_eq:VnF \l_@@_currenvir_str { scripture }
{
\hook_gput_next_code:nn { env / \l_@@_currenvir_str / after }
{
\exp_args:NV \color_select:n \l_@@_red_letter_colour_tl
}
}
}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_red_letter_off:}
% Mark the beginning of a section of text attributed to Jesus Christ.
% \begin{macrocode}
\cs_new_protected:Nn \@@_red_letter_off:
{
\bool_if:NT \l_@@_red_letter_bool
{
\color_select:n { scripture default colour }
\bool_gset_false:N \g_@@_red_letter_active_bool
\str_if_eq:VnF \l_@@_currenvir_str { scripture }
{
\hook_gput_next_code:nn { env / \l_@@_currenvir_str / after }
{
\color_select:n { scripture default colour }
}
}
}
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Selecting language}
%
% \begin{macro}{\@@_select_language:}
% Select specified language if required.
% \begin{macrocode}
\cs_new_protected:Nn \@@_select_language:
{
\tl_if_empty:NF \l_@@_language_tl
{
\@ifpackageloaded { babel }
{
\selectlanguage { \l_@@_language_tl }
}
{
\@ifpackageloaded { polyglossia }
{
\iflanguageloaded { \l_@@_language_tl }
{
\tl_if_empty:NTF \l_@@_language_variant_tl
{
\selectlanguage { \l_@@_language_tl }
}
{
\selectlanguage
[ variant = \l_@@_language_variant_tl ]
{ \l_@@_language_tl }
}
}
{
\msg_error:nnx
{ scripture }
{ language-error }
{ \l_@@_language_tl }
}
}
{
\msg_warning:nnx
{ scripture }
{ language-waning }
{ \l_@@_language_tl }
}
}
}
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Formatting and printing chapter numbers}
%
% \begin{macro}{\l_@@_chap_box, l_@@_chap_tmp_box}
% Boxes use to store and calculate drop chapter.
% \begin{macrocode}
\box_new:N \l_@@_chap_box
\box_new:N \l_@@_chap_tmp_box
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_chap_fontsize_dim}
% Calculated font size of a drop chapter number.
% \begin{macrocode}
\dim_new:N \l_@@_chap_fontsize_dim
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_chap_height_dim}
% Calculated height of a drop chapter number.
% \begin{macrocode}
\dim_new:N \l_@@_chap_height_dim
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_chap_width_dim}
% Calculated width of drop chapter number.
% \begin{macrocode}
\dim_new:N \l_@@_chap_width_dim
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\g_@@_chap_par_prevgraf_int}
% Store the number of lines a chapter paragraph takes up.
% \begin{macrocode}
\int_new:N \g_@@_chap_par_prevgraf_int
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_chap_X_height_dim}
% Calculated height of X at current font size. This is used as the height
% for a drop chapter.
% \begin{macrocode}
\dim_new:N \l_@@_chap_X_height_dim
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_drop_chap_set_up:n}
% Set up chapter drop cap and calculate its various dimensions.
% \begin{macrocode}
\cs_new_protected:Nn \@@_drop_chap_set_up:n
{
\cs_gset_nopar:Npn \scripturecurrentchapter { #1 }
\cs_gset_nopar:Npn \scripturecurrentverse { 1 }
\hbox_set:Nn \l_@@_chap_tmp_box { X }
\dim_set:Nn \l_@@_chap_X_height_dim
{ \box_ht:N \l_@@_chap_tmp_box }
\dim_set:Nn \l_@@_chap_height_dim
{ \baselineskip + \l_@@_chap_X_height_dim }
\dim_set:Nn \l_@@_chap_fontsize_dim
{
\f@size pt *
\dim_ratio:nn
{ \l_@@_chap_height_dim }
{ \l_@@_chap_X_height_dim }
}
\hbox_set:Nn \l_@@_chap_tmp_box
{
\l_@@_chap_font_tl
\fontsize
{ \l_@@_chap_fontsize_dim }
{ \l_@@_chap_fontsize_dim }
\selectfont
\str_if_eq:VnF \l_@@_chapter_colour_tl { . }
{ \exp_args:NV \color_select:n \l_@@_chapter_colour_tl }
\@@_chap_format:n { #1 }
}
\dim_set:Nn \l_@@_chap_width_dim
{ \box_wd:N \l_@@_chap_tmp_box }
% \end{macrocode}
% Avoid breaks in the middle of drop chapters.
% \begin{macrocode}
\int_set_eq:NN \l_@@_clubpenalty_saved_int \clubpenalty
\clubpenalty 10000
\hook_gput_next_code:nn { para / after }
{
\int_gset_eq:NN \g_@@_chap_par_prevgraf_int \prevgraf
\int_compare:nNnT
\g_@@_chap_par_prevgraf_int = 1
{ \penalty 10000 }
\hook_gput_next_code:nn { para / before }
{ \int_set_eq:NN \clubpenalty \l_@@_clubpenalty_saved_int }
}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_drop_chap_output:}
% Output a drop chapter.
% \begin{macrocode}
\cs_new_protected:Nn \@@_drop_chap_output:
{
\noindent
\parshape 3 ~
\dim_eval:n
{ \@totalleftmargin + \l_@@_chap_width_dim + \l_@@_chap_sep_tl } ~
\dim_eval:n
{ \linewidth - \l_@@_chap_width_dim - \l_@@_chap_sep_tl } ~
\dim_eval:n
{ \@totalleftmargin + \l_@@_chap_width_dim + \l_@@_chap_sep_tl } ~
\dim_eval:n
{ \linewidth - \l_@@_chap_width_dim - \l_@@_chap_sep_tl } ~
\@totalleftmargin ~
\linewidth
\group_begin:
\hook_use:n { scripture / chap / before }
\box_use:N \l_@@_chap_box
\hook_use:n { scripture / chap / after }
\group_end:
\bool_if:NT \l_@@_chap_show_verse_bool
{
\@@_verse_output:n { 1 }
}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_nodrop_chap:n}
% Format a non-drop chapter.
% \begin{macrocode}
\cs_new_protected:Nn \@@_nodrop_chap:n
{
\cs_gset_nopar:Npn \scripturecurrentchapter { #1 }
\cs_gset_nopar:Npn \scripturecurrentverse { 1 }
\group_begin:
\bool_if:NTF \l_@@_chap_show_bool
{
\hook_use:n { scripture / chap / before }
\group_begin:
\str_if_eq:VnF \l_@@_chapter_colour_tl { . }
{ \exp_args:NV \color_select:n \l_@@_chapter_colour_tl }
\l_@@_chap_font_tl
\@@_chap_format:n { #1 }
\group_end:
\skip_horizontal:N \l_@@_chap_sep_tl
\hook_use:n { scripture / chap / after }
\bool_if:NT \l_@@_chap_show_verse_bool
{
\@@_verse_output:n { 1 }
}
}
{
\hook_use:n { scripture / chap / before }
\hook_use:n { scripture / chap / after }
\vs { 1 }
}
\group_end:
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_chap:n}
% Position a drop chapter.
% \begin{macrocode}
\cs_new_protected:Nn \@@_chap:n
{
\@@_drop_chap_set_up:n { #1 }
\hbox_set:Nn \l_@@_chap_box
{
\box_move_down:nn
{ \baselineskip }
{
\hbox_overlap_left:n
{
\box_use:N \l_@@_chap_tmp_box
\skip_horizontal:N \l_@@_chap_sep_tl
}
}
}
\box_set_ht:Nn \l_@@_chap_box { \c_zero_dim }
\box_set_dp:Nn \l_@@_chap_box { \c_zero_dim }
\bool_if:NTF \l_@@_mid_para_chap_bool
{ \@@_mid_para_drop_chap_output: }
{
\par
\@@_drop_chap_output:
}
\hook_gput_next_code:nn { para / before }
{
\int_compare:nNnT
\g_@@_chap_par_prevgraf_int = 1
{ \extraskip }
\int_gzero:N \g_@@_chap_par_prevgraf_int
\int_compare:nNnT
\@listdepth > \c_zero_int
{ \parshape 1 ~ \@totalleftmargin ~ \linewidth }
}
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Formatting and printing verse numbers}
%
% \begin{macro}{\l_@@_verse_par_start_bool}
% Flag for whether the current verse is at the start of a paragraph.
% \begin{macrocode}
\bool_new:N \l_@@_verse_par_start_bool
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_no_verse_first_bool}
% Suppress the next verse from formatting differently if it begins a new
% paragraph.
% \begin{macrocode}
\bool_new:N \l_@@_no_verse_first_bool
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_verse_output:n}
% Output a formatted verse.
% \begin{macrocode}
\cs_new_protected:Nn \@@_verse_output:n
{
\cs_gset_nopar:Npn \scripturecurrentverse { #1 }
\legacy_if:nTF { @endpe }
{ \bool_set_false:N \l_@@_verse_par_start_bool }
{ \bool_set_true:N \l_@@_verse_par_start_bool }
\mode_if_vertical:TF
{ \mode_leave_vertical: }
{ \bool_set_false:N \l_@@_verse_par_start_bool }
\bool_if:NT \l_@@_no_verse_first_bool
{
\bool_set_false:N \l_@@_verse_par_start_bool
\bool_set_false:N \l_@@_no_verse_first_bool
}
\group_begin:
\hook_use:n { scripture / verse / before }
\bool_if:NT \l_@@_verse_show_bool
{
\group_begin:
\l_@@_verse_font_tl
\str_if_eq:VnF \l_@@_verse_colour_tl { . }
{ \exp_args:NV \color_select:n \l_@@_verse_colour_tl }
\bool_lazy_all:nTF
{
{ \l_@@_verse_first_bool }
{ \l_@@_verse_par_start_bool }
{ \bool_not_p:n { \str_if_eq_p:Vn \l_@@_currenvir_str { poetry } } }
}
{
\@@_verse_first_format:n { #1 }
\group_end:
\kern \l_@@_verse_first_sep_tl
}
{
\@@_verse_format:n { #1 }
\group_end:
\kern \l_@@_verse_sep_tl
}
}
\hook_use:n { scripture / verse / after }
\group_end:
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Calculating the length of the final line in a paragraph}
%
% \begin{macro}{\g_@@_final_line_dim}
% Store the length of the final line in a paragraph.
% \begin{macrocode}
\dim_new:N \g_@@_final_line_dim
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_calc_final_line_length:}
% Calculate the length of the final line in a paragraph.
% \begin{macrocode}
\cs_new_protected:Nn \@@_calc_final_line_length:
{
\skip_set:Nn \abovedisplayshortskip { -\baselineskip }
\skip_set_eq:NN \abovedisplayskip \abovedisplayshortskip
\skip_zero:N \belowdisplayshortskip
\skip_zero:N \belowdisplayskip
$$
\dim_compare:nNnT \predisplaysize > \c_zero_dim
{
\dim_gset:Nn \g_@@_final_line_dim
{ \predisplaysize - 2 em }
}
\cs_gset_nopar:Nx \@@_reset_spacing:
{
\dim_set:Nn \predisplaysize { \dim_use:N \predisplaysize }
\int_set:Nn \prevgraf { \int_use:N \prevgraf }
}
$$
\@@_reset_spacing:
\dim_compare:nNnT \g_@@_final_line_dim > \linewidth
{
\dim_gset_eq:NN \g_@@_final_line_dim \linewidth
}
\dim_compare:nNnT \g_@@_final_line_dim > { \c_zero_dim - 1 sp }
{
\skip_vertical:n { -\baselineskip - \parskip }
}
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{The \env{scripture} environment}
%
% \begin{macro}{\l_@@_currenvir_str}
% Store the current \pkg{scripture} environment.
% \begin{macrocode}
\str_new:N \l_@@_currenvir_str
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_parskip_correction_skip}
% Correction to ensure consistent \cs{parskip} at start of \env{scripture}
% environment with non-zero \opt{parskip} option.
% \begin{macrocode}
\skip_new:N \l_@@_parskip_correction_skip
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\g_@@_start_bool}
% Flag indicating whether we are currently setting the first paragraph in a
% \env{scripture} environment. If this is \val{true}, any \opt{aboveskip}
% for an inner environment will be ignored.
% \begin{macrocode}
\bool_new:N \g_@@_start_bool
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_begin:n}
% Begin a scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_begin:n
{
\bool_if:NT \l_@@_active_bool
{
\msg_error:nn { scripture } { nested-environment }
}
\bool_set_true:N \l_@@_active_bool
\tl_set:Nn \l_@@_currenvir_str { scripture }
\tl_if_novalue:nF { #1 }
{
\keys_set:nn { scripture } { #1 }
}
\@@_select_language:
% \end{macrocode}
% If the \env{scripture} environment begins immediately after an \cs{item},
% then insert a new paragraph and apply a negative skip. Life is much easier
% if all paragraphs in a \env{scripture} are the same rather than the first
% one being in the first paragraph of an \cs{item}.
% \begin{macrocode}
\legacy_if:nT { @newlist }
{
\strut
\par
\vspace* { \dim_eval:n { -\baselineskip - \parskip } }
}
\mode_if_vertical:T
{
\addvspace { \l_@@_aboveskip_tl }
}
\DeclareDocumentCommand { \ch } { sm }
{
\bool_if:NTF \l_@@_chap_show_bool
{
\bool_if:NTF \l_@@_chap_drop_bool
{
\@@_chap:n { ##2 }
\bool_if:nT { ##1 }
{
\hook_gput_next_code:nn { para / after }
{ \int_gzero:N \g_@@_chap_par_prevgraf_int }
}
}
{ \@@_nodrop_chap:n { ##2 } }
}
{ \@@_nodrop_chap:n { ##2 } }
}
% \end{macrocode}
% Empty \cs{everydisplay} to ensure it isn't interring with spacing.
% \begin{macrocode}
\everydisplay { }
\int_set:Nn \predisplaypenalty { 10000 }
\int_set_eq:NN \postdisplaypenalty \@lowpenalty
\bool_gset_true:N \g_@@_start_bool
\bool_gset_false:N \g_@@_poetry_end_bool
\dim_set_eq:NN \parindent \l_@@_parindent_tl
\cs_set_eq:NN \extraskip \@@_extra_skip:
\cs_set_eq:NN \redletteron \@@_red_letter_on:
\cs_set_eq:NN \redletteroff \@@_red_letter_off:
\cs_set_eq:NN \vs \@@_verse_output:n
\cs_set_protected_nopar:Npn \added ##1
{
\group_begin:
\l_@@_added_font_tl
\@@_added_format:n { ##1 }
\group_end:
}
\cs_set_protected_nopar:Npn \name ##1
{
\group_begin:
\l_@@_name_font_tl
\@@_name_format:n { ##1 }
\group_end:
}
\cs_set_protected_nopar:Npn \nofirstverse
{
\bool_set_true:N \l_@@_no_verse_first_bool
}
\cs_set_protected_nopar:Npn \LORD
{
\name { Lord }
}
\cs_set_protected_nopar:Npn \GOD
{
\name { God }
}
\cs_set_protected_nopar:Npn \textright ##1
{
\@@_text_right:nn { \l_@@_text_right_sep_tl } { ##1 }
}
\hook_gclear_next_code:n { para / before }
\skip_set:Nn \l_@@_parskip_correction_skip { \parskip - \l_@@_parskip_tl }
\mode_if_vertical:T
{
\addvspace { \l_@@_parskip_correction_skip }
}
\skip_set_eq:NN \parskip \l_@@_parskip_tl
\l_@@_font_tl
\exp_args:NnV \color_set:nn { scripture default colour } \l_@@_colour_tl
\str_if_eq:VnF \l_@@_colour_tl { . }
{
\color_select:n { scripture default colour }
}
% \end{macrocode}
% For left and right margins, use \cs{parshape} is already in a list,
% otherwise use \cs{leftskip} and \cs{rightskip}
% \begin{macrocode}
\bool_lazy_or:nnT
{ \dim_compare_p:n { \l_@@_leftmargin_tl > 0pt } }
{ \dim_compare_p:n { \l_@@_rightmargin_tl > 0pt } }
{
\dim_sub:Nn \linewidth
{ \l_@@_leftmargin_tl + \l_@@_rightmargin_tl }
\int_compare:nNnTF
\@listdepth > \c_zero_int
{
\dim_add:Nn \@totalleftmargin \l_@@_leftmargin_tl
\parshape 1 ~ \@totalleftmargin ~ \linewidth
}
{
\dim_add:Nn \leftskip \l_@@_leftmargin_tl
\dim_add:Nn \rightskip \l_@@_rightmargin_tl
}
}
\bool_if:NF \l_@@_indent_bool
{
\hook_gput_next_code:nn { para / begin }
{
\bool_lazy_any:nT
{
{ \str_if_eq_p:Vn \l_@@_currenvir_str { midparachap } }
{ \str_if_eq_p:Vn \l_@@_currenvir_str { narrow } }
{ \str_if_eq_p:Vn \l_@@_currenvir_str { scripture } }
}
{ \para_omit_indent: }
}
}
\bool_if:NT \l_@@_inline_bool
{ \l_@@_inline_begin_tl }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_end:n}
% End a scripture quotation with a reference.
% \begin{macrocode}
\cs_new_protected:Nn \@@_end:n
{
\tl_if_eq:NnTF \l_@@_ref_align_tl { inline }
{
\bool_lazy_or:nnF
{ \tl_if_novalue_p:n { #1 } }
{ \tl_if_empty_p:n { #1 } }
{
\unskip
\@@_red_letter_off:
\bool_if:NT \l_@@_inline_bool
{ \l_@@_inline_end_tl }
\skip_horizontal:N \l_@@_ref_sep_tl
\@@_format_full_ref:n { #1 }
}
}
{
% \end{macrocode}
% Normally \cs{unskip} does not work in vertical mode, but there are some
% situations where it does work. The following condition is true if the
% \env{scripture} environment has ended with one of its internal
% environments. This removes any unwanted \opt{belowskip} if present and
% leaves the previously calculated line length of the final paragraph intact.
% \begin{macrocode}
\mode_if_vertical:TF
{
\unskip
\unskip
}
{
\tl_if_novalue:nTF { #1 }
{ \int_zero:N \postdisplaypenalty }
{ \int_set_eq:NN \postdisplaypenalty \@highpenalty }
\@@_calc_final_line_length:
}
% \end{macrocode}
% Restore left margin by resetting the \cs{parshape} if in a list
% based environment, otherwise the space required for the reference is
% incorrectly calculated.
% \begin{macrocode}
\bool_lazy_or:nnTF
{ \dim_compare_p:n { \l_@@_leftmargin_tl > 0pt } }
{ \dim_compare_p:n { \l_@@_rightmargin_tl > 0pt } }
{
\dim_add:Nn \linewidth \l_@@_leftmargin_tl
\int_compare:nNnT
\@listdepth > \c_zero_int
{
\dim_sub:Nn \@totalleftmargin \l_@@_leftmargin_tl
\parshape 1 ~ \@totalleftmargin ~ \linewidth
}
}
{ \parshape 1 ~ \@totalleftmargin ~ \linewidth }
\@@_red_letter_off:
\bool_lazy_or:nnF
{ \tl_if_novalue_p:n { #1 } }
{ \tl_if_empty_p:n { #1 } }
{ \@@_reference:n { #1 } }
\par
% \end{macrocode}
% Restore right margin by resetting the \cs{parshape} if in a \LaTeX{} list
% based environment, since only the left margin was restored above.
% \begin{macrocode}
\bool_lazy_or:nnT
{ \dim_compare_p:n { \l_@@_leftmargin_tl > 0pt } }
{ \dim_compare_p:n { \l_@@_rightmargin_tl > 0pt } }
{
\int_compare:nNnT
\@listdepth > \c_zero_int
{
\dim_add:Nn \linewidth \l_@@_rightmargin_tl
\parshape 1 ~ \@totalleftmargin ~ \linewidth
}
}
\dim_compare:nNnTF
{ \glueexpr \l_@@_belowskip_tl } > \parskip
{
\addvspace
{
\skip_eval:n { \l_@@_belowskip_tl - \parskip }
}
}
{
\addvspace { \l_@@_belowskip_tl }
}
}
}
% \end{macrocode}
% \end{macro}
%
% \subsection{Scripture internal environments}
%
% \begin{macro}{\l_@@_delta_below_skip}
% Correction to \tn{@topsepadd} for internal environments. This enables a
% different \opt{aboveskip} and \opt{belowskip} which are normally the
% same for \LaTeX{} lists.
% \begin{macrocode}
\skip_new:N \l_@@_delta_below_skip
% \end{macrocode}
% \end{macro}
%
% \subsubsection{The \env{center} environment}
%
% \begin{macro}{\@@_center_begin:n}
% Begin a centred section in a scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_center_begin:n
{
\bool_if:NT \l_@@_active_inner_bool
{
\msg_error:nn { scripture } { nested-environment }
}
\bool_set_true:N \l_@@_active_inner_bool
\tl_set:Nn \l_@@_currenvir_str { center }
\tl_if_novalue:nF { #1 }
{
\keys_set:nn
{ scripture / center }
{ #1 }
}
\mode_if_horizontal:T
{ \par }
\list { }
{
\skip_set_eq:NN \l_@@_delta_below_skip \l_@@_center_belowskip_tl
% \end{macrocode}
% Ignore \opt{aboveskip} if at the beginning of a \env{scripture} environment.
% \begin{macrocode}
\bool_if:NTF \g_@@_start_bool
{
\skip_zero:N \topsep
\skip_sub:Nn \topsep \parskip
\skip_add:Nn \l_@@_delta_below_skip \parskip
\bool_gset_false:N \g_@@_start_bool
}
{
\dim_compare:nTF
{ \parskip >= \glueexpr \l_@@_center_aboveskip_tl > \c_zero_skip }
{
\skip_zero:N \topsep
\skip_zero:N \l_@@_delta_below_skip
}
{
\skip_set_eq:NN \topsep \l_@@_center_aboveskip_tl
\skip_sub:Nn \l_@@_delta_below_skip \l_@@_center_aboveskip_tl
}
\int_compare:nNnT \g_@@_chap_par_prevgraf_int = 1
{ \addvspace { \baselineskip } }
\int_gzero:N \g_@@_chap_par_prevgraf_int
}
\skip_set_eq:NN \parsep \parskip
\skip_zero:N \partopsep
\dim_zero:N \leftmargin
\dim_zero:N \labelsep
}
\centering
\item
\relax
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_center_end:}
% End a centred section in a scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_center_end:
{
\@@_calc_final_line_length:
\skip_add:Nn \@topsepadd \l_@@_delta_below_skip
\int_set_eq:NN \@endparpenalty \@lowpenalty
\endlist
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{The \env{flushright} environment}
%
% \begin{macro}{\@@_flushright_begin:n}
% Begin a flushright section in a scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_flushright_begin:n
{
\bool_if:NT \l_@@_active_inner_bool
{
\msg_error:nn { scripture } { nested-environment }
}
\bool_set_true:N \l_@@_active_inner_bool
\tl_set:Nn \l_@@_currenvir_str { flushright }
\tl_if_novalue:nF { #1 }
{
\keys_set:nn
{ scripture / flushright }
{ #1 }
}
\mode_if_horizontal:T
{ \par }
\list { }
{
\skip_set_eq:NN \l_@@_delta_below_skip \l_@@_flushright_belowskip_tl
% \end{macrocode}
% Ignore \opt{aboveskip} if at the beginning of a \env{scripture} environment.
% \begin{macrocode}
\bool_if:NTF \g_@@_start_bool
{
\skip_zero:N \topsep
\skip_sub:Nn \topsep \parskip
\skip_add:Nn \l_@@_delta_below_skip \parskip
\bool_gset_false:N \g_@@_start_bool
}
{
\dim_compare:nTF
{ \parskip >= \glueexpr \l_@@_flushright_aboveskip_tl > \c_zero_skip }
{
\skip_zero:N \topsep
\skip_zero:N \l_@@_delta_below_skip
}
{
\skip_set_eq:NN \topsep \l_@@_flushright_aboveskip_tl
\skip_sub:Nn \l_@@_delta_below_skip \l_@@_flushright_aboveskip_tl
}
\int_compare:nNnT \g_@@_chap_par_prevgraf_int = 1
{ \addvspace { \baselineskip } }
\int_gzero:N \g_@@_chap_par_prevgraf_int
}
\dim_set_eq:NN \leftmargin \l_@@_flushright_leftmargin_tl
\dim_set_eq:NN \rightmargin \l_@@_flushright_rightmargin_tl
\skip_set_eq:NN \parsep \parskip
\skip_zero:N \partopsep
\dim_zero:N \leftmargin
\dim_zero:N \labelsep
}
\raggedleft
\item
\relax
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_flushright_end:}
% End a flushright section in a scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_flushright_end:
{
\@@_calc_final_line_length:
\skip_add:Nn \@topsepadd \l_@@_delta_below_skip
\int_set_eq:NN \@endparpenalty \@lowpenalty
\endlist
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{The \env{hanging} environment}
%
% \begin{macro}{\l_@@_hanging_parindent_saved_dim}
% Save the \cs{parindent} for later use in \env{hanging} environment.
% \begin{macrocode}
\dim_new:N \l_@@_hanging_parindent_saved_dim
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_hanging_chap:n}
% Position a drop chapter in a \env{hanging} environment.
% \begin{macrocode}
\cs_new_protected:Nn \@@_hanging_chap:n
{
\@@_drop_chap_set_up:n { #1 }
\dim_compare:nNnTF
\l_@@_chap_width_dim < \leftmargin
{
\tl_set:Nx \l_@@_chap_sep_tl
{
\dim_eval:n { \leftmargin - \l_@@_chap_width_dim }
}
}
{
\parshape 3 ~
\dim_eval:n
{
\@totalleftmargin - \leftmargin + \l_@@_chap_width_dim +
\l_@@_chap_sep_tl
} ~
\dim_eval:n
{
\linewidth + \leftmargin - \l_@@_chap_width_dim -
\l_@@_chap_sep_tl
} ~
\dim_eval:n
{
\@totalleftmargin - \leftmargin + \l_@@_chap_width_dim +
\l_@@_chap_sep_tl
} ~
\dim_eval:n
{
\linewidth + \leftmargin - \l_@@_chap_width_dim -
\l_@@_chap_sep_tl
} ~
\@totalleftmargin ~ \linewidth
}
\mode_if_vertical:T
{
\tl_set:Nx \l_@@_chap_sep_tl
{
\dim_eval:n
{
\l_@@_chap_sep_tl + \l_@@_hanging_parindent_saved_dim
}
}
\@@_nohang:
}
\hbox_set:Nn \l_@@_chap_box
{
\box_move_down:nn
{ \baselineskip }
{
\hbox_overlap_left:n
{
\box_use:N \l_@@_chap_tmp_box
\skip_horizontal:N \l_@@_chap_sep_tl
}
}
}
\box_set_ht:Nn \l_@@_chap_box { \c_zero_dim }
\box_set_dp:Nn \l_@@_chap_box { \c_zero_dim }
\group_begin:
\hook_use:n { scripture / chap / before }
\box_use:N \l_@@_chap_box
\hook_use:n { scripture / chap / after }
\group_end:
\bool_if:NT \l_@@_chap_show_verse_bool
{
\@@_verse_output:n { 1 }
}
\hook_gput_next_code:nn { para / begin }
{ \parshape 1 ~ \@totalleftmargin ~ \linewidth }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_hanging_verse:n}
% Position a \cs{vs} in a \env{hanging} environment. The verse is set to
% overlap to the left if at the beginning of a hanging paragraph.
% \begin{macrocode}
\cs_new_protected:Nn \@@_hanging_verse:n
{
\mode_if_vertical:TF
{
\strut
\hbox_overlap_left:n
{
\@@_verse_output:n { #1 }
}
}
{ \@@_verse_output:n { #1 } }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_nohang:}
% Don't hang a paragraph in a \env{hanging} environment. Instead the
% paragraph is indented by \cs{parindent} from its normal hanging position.
% \begin{macrocode}
\cs_new_protected_nopar:Nn \@@_nohang:
{
\para_raw_noindent:
\hbox_to_wd:nn { \l_@@_hanging_parindent_saved_dim } { }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_hanging_begin:n}
% Begin a hanging section in a scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_hanging_begin:n
{
\bool_if:NT \l_@@_active_inner_bool
{
\msg_error:nn { scripture } { nested-environment }
}
\bool_set_true:N \l_@@_active_inner_bool
\tl_set:Nn \l_@@_currenvir_str { hanging }
\tl_if_novalue:nF { #1 }
{
\keys_set:nn
{ scripture / hanging }
{ #1 }
}
\mode_if_horizontal:T
{ \par }
\list { }
{
\skip_set_eq:NN \l_@@_delta_below_skip \l_@@_hanging_belowskip_tl
% \end{macrocode}
% Ignore \opt{aboveskip} if at the beginning of a \env{scripture} environment.
% \begin{macrocode}
\bool_if:NTF \g_@@_start_bool
{
\dim_zero:N \topsep
\skip_sub:Nn \topsep \parskip
\skip_add:Nn \l_@@_delta_below_skip \parskip
\bool_gset_false:N \g_@@_start_bool
}
{
\dim_compare:nTF
{ \parskip >= \glueexpr \l_@@_hanging_aboveskip_tl > \c_zero_skip }
{
\skip_zero:N \topsep
\skip_zero:N \l_@@_delta_below_skip
}
{
\skip_set_eq:NN \topsep \l_@@_hanging_aboveskip_tl
\skip_sub:Nn \l_@@_delta_below_skip \l_@@_hanging_aboveskip_tl
}
\int_compare:nNnT \g_@@_chap_par_prevgraf_int = 1
{ \addvspace { \baselineskip } }
\int_gzero:N \g_@@_chap_par_prevgraf_int
}
\dim_set:Nn \leftmargin
{ \l_@@_hanging_leftmargin_tl + \l_@@_hanging_hang_tl }
\dim_set_eq:NN \rightmargin \l_@@_hanging_rightmargin_tl
\dim_set:Nn \itemindent { -\l_@@_hanging_hang_tl }
\dim_set:Nn \listparindent { -\l_@@_hanging_hang_tl }
\skip_set_eq:NN \parsep \parskip
\skip_zero:N \partopsep
\dim_zero:N \labelsep
\dim_set_eq:NN \l_@@_hanging_parindent_saved_dim \parindent
}
\DeclareDocumentCommand { \ch } { sm }
{
\bool_if:NTF \l_@@_chap_show_bool
{
\bool_if:NTF \l_@@_chap_drop_bool
{ \@@_hanging_chap:n { ##2 } }
{ \@@_nodrop_chap:n { ##2 } }
}
{ \@@_nodrop_chap:n { ##2 } }
}
\cs_set_eq:NN \vs \@@_hanging_verse:n
\cs_set_eq:NN \nohang \@@_nohang:
\item
\relax
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_hanging_end:}
% End a hanging section in a scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_hanging_end:
{
\@@_calc_final_line_length:
\skip_add:Nn \@topsepadd \l_@@_delta_below_skip
\int_set_eq:NN \@endparpenalty \@lowpenalty
\endlist
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{The \env{midparachap} environment}
%
% \begin{macro}{\@@_vbox_set_top:Nw}
% Define missing \cs{vbox_set_top:Nw} function.
% \begin{macrocode}
\cs_new_protected:Npn \@@_vbox_set_top:Nw #1
{
\tex_setbox:D #1 \tex_vtop:D
\c_group_begin_token
\color_group_begin:
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_mid_para_chap_bool}
% Flag if setting a paragraph containing a mid-paragraph chapter.
% \begin{macrocode}
\bool_new:N \l_@@_mid_para_chap_bool
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_mid_para_chap_line_box}
% Store last line before a mid-paragraph chapter.
% \begin{macrocode}
\box_new:N \l_@@_mid_para_chap_line_box
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\g_@@_mid_para_chap_prevdepth_dim}
% Store the \cs{prevdepth} of the final paragraph in a \env{midparachap}
% environment.
% \begin{macrocode}
\dim_new:N \g_@@_mid_para_chap_prevdepth_dim
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\g_@@_mid_para_chap_prevgraf_int}
% Store the \cs{prevgraf} of the final paragraph in a \env{midparachap}
% environment.
% \begin{macrocode}
\int_new:N \g_@@_mid_para_chap_prevgraf_int
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_mid_para_chap_snap_box}
% Store unpacked last line before a mid-paragraph chapter.
% \begin{macrocode}
\box_new:N \l_@@_mid_para_chap_snap_box
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_mid_para_chap_spacefactor_int}
% Store space factor before a mid-paragraph chapter.
% \begin{macrocode}
\int_new:N \l_@@_mid_para_chap_spacefactor_int
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_mid_para_chap_box,
% \l_@@_mid_para_chap_split_box,
% \l_@@_mid_para_chap_split_top_box}
% Boxes containing a paragraph with a chapter break and its split if needed.
% \begin{macrocode}
\box_new:N \l_@@_mid_para_chap_box
\box_new:N \l_@@_mid_para_chap_split_box
\box_new:N \l_@@_mid_para_chap_split_top_box
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_mid_para_drop_chap_output:}
% Output a mid-paragraph drop chapter.
% \begin{macrocode}
\cs_new_protected:Nn \@@_mid_para_drop_chap_output:
{
\unskip
\int_set_eq:NN \l_@@_mid_para_chap_spacefactor_int \spacefactor
\strut
\par
\box_set_to_last:N \l_@@_mid_para_chap_line_box
\hbox_set:Nn \l_@@_mid_para_chap_snap_box
{
\hbox_unpack_drop:N \l_@@_mid_para_chap_line_box
\unskip
\unskip
\unpenalty
}
\nointerlineskip
\dim_compare:nNnTF
{
\box_wd:N \l_@@_mid_para_chap_snap_box +
\l_@@_chap_width_dim +
\l_@@_chap_sep_tl
}
<
{ \linewidth - \leftskip - \rightskip - 3 em }
{
\@@_drop_chap_output:
\hbox_unpack_drop:N \l_@@_mid_para_chap_snap_box
\int_set_eq:NN \spacefactor \l_@@_mid_para_chap_spacefactor_int
\c_space_tl
\@@_verse_output:n { 1 }
}
{
\group_begin:
\noindent
\skip_horizontal:n { -\leftskip }
\hbox_unpack_drop:N \l_@@_mid_para_chap_snap_box
\skip_zero:N \parfillskip
\par
\group_end:
\@@_drop_chap_output:
\bool_if:NT \l_@@_midparachap_show_verse_bool
{
\@@_verse_output:n { 1 }
}
}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_mid_para_chap_begin:n}
% Begin a paragraph containing a mid-paragraph chapter.
% \begin{macrocode}
\cs_new_protected:Nn \@@_mid_para_chap_begin:n
{
\tl_set:Nn \l_@@_currenvir_str { midparachap }
\tl_if_novalue:nF { #1 }
{
\keys_set:nn
{ scripture / midparachap }
{ #1 }
}
\bool_lazy_and:nnT
{ \bool_if_p:n \l_@@_chap_show_verse_bool }
{ \bool_if_p:n \l_@@_chap_drop_bool }
{
\bool_set_true:N \l_@@_midparachap_show_verse_bool
\bool_set_false:N \l_@@_chap_show_verse_bool
}
\par
\bool_set_true:N \l_@@_mid_para_chap_bool
\@@_vbox_set_top:Nw \l_@@_mid_para_chap_box
\skip_zero:N \parskip
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_mid_para_chap_end:}
% End a paragraph containing a mid-paragraph chapter.
% \begin{macrocode}
\cs_new_protected:Nn \@@_mid_para_chap_end:
{
\par
\int_gset_eq:NN \g_@@_mid_para_chap_prevgraf_int \prevgraf
\dim_gset_eq:NN \g_@@_mid_para_chap_prevdepth_dim \prevdepth
\box_set_to_last:N \l_@@_mid_para_chap_line_box
\hbox_set:Nn \l_@@_mid_para_chap_snap_box
{
\hbox_unpack:N \l_@@_mid_para_chap_line_box
\unskip
\unskip
\unpenalty
}
\dim_gset:Nn \g_@@_final_line_dim { \box_wd:N \l_@@_mid_para_chap_snap_box }
\box_clear:N \l_@@_mid_para_chap_snap_box
\nointerlineskip
\int_compare:nNnT
\prevgraf < 3
{
\noindent
\skip_horizontal:n { \l_@@_chap_width_dim + \l_@@_chap_sep_tl }
\dim_gadd:Nn \g_@@_final_line_dim { \l_@@_chap_width_dim + \l_@@_chap_sep_tl }
}
\box_use_drop:N \l_@@_mid_para_chap_line_box
\vbox_set_end:
% \end{macrocode}
% Attempt to allow the mid-paragraph chapter box to break across pages.
% \begin{macrocode}
\mode_if_inner:TF
{
\noindent
\box_use_drop:N \l_@@_mid_para_chap_box
}
{
\dim_compare:nNnTF
{ \box_ht_plus_dp:N \l_@@_mid_para_chap_box }
>
{ \pagegoal - \pagetotal - \baselineskip }
{
\int_set:Nn \vbadness { 10000 }
\vbox_set_split_to_ht:NNn
\l_@@_mid_para_chap_split_box \l_@@_mid_para_chap_box
{ \pagegoal - \pagetotal - \baselineskip }
\vbox_set_top:Nn \l_@@_mid_para_chap_split_top_box
{ \vbox_unpack_drop:N \l_@@_mid_para_chap_split_box }
\noindent
\box_use_drop:N \l_@@_mid_para_chap_split_top_box
\goodbreak
\box_use_drop:N \l_@@_mid_para_chap_box
}
{
\noindent
\box_use_drop:N \l_@@_mid_para_chap_box
}
}
\par
\dim_set_eq:NN \prevdepth \g_@@_mid_para_chap_prevdepth_dim
\int_zero:N \prevgraf
\skip_vertical:n { -\parskip - \baselineskip }
\noindent
\skip_horizontal:N \g_@@_final_line_dim
\int_gset_eq:NN \g_@@_chap_par_prevgraf_int \g_@@_mid_para_chap_prevgraf_int
\hook_gput_next_code:nn { para / before }
{
\int_gzero:N \g_@@_chap_par_prevgraf_int
\int_compare:nNnT
\@listdepth > \c_zero_int
{ \parshape 1 ~ \@totalleftmargin ~ \linewidth }
}
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{The \env{narrow} environment}
%
% \begin{macro}{\@@_narrow_begin:n}
% Begin a narrow section in a scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_narrow_begin:n
{
\bool_if:NT \l_@@_active_inner_bool
{
\msg_error:nn { scripture } { nested-environment }
}
\bool_set_true:N \l_@@_active_inner_bool
\tl_set:Nn \l_@@_currenvir_str { narrow }
\tl_if_novalue:nF { #1 }
{
\keys_set:nn
{ scripture / narrow }
{ #1 }
}
\mode_if_horizontal:T
{ \par }
\list { }
{
\skip_set_eq:NN \l_@@_delta_below_skip \l_@@_narrow_belowskip_tl
% \end{macrocode}
% Ignore \opt{aboveskip} if at the beginning of a \env{scripture} environment.
% \begin{macrocode}
\bool_if:NTF \g_@@_start_bool
{
\skip_zero:N \topsep
\skip_sub:Nn \topsep \parskip
\skip_add:Nn \l_@@_delta_below_skip \parskip
\bool_gset_false:N \g_@@_start_bool
}
{
\dim_compare:nTF
{ \parskip >= \glueexpr \l_@@_narrow_aboveskip_tl > \c_zero_skip }
{
\skip_zero:N \topsep
\skip_zero:N \l_@@_delta_below_skip
}
{
\skip_set_eq:NN \topsep \l_@@_narrow_aboveskip_tl
\skip_sub:Nn \l_@@_delta_below_skip \l_@@_narrow_aboveskip_tl
}
\int_compare:nNnT \g_@@_chap_par_prevgraf_int = 1
{ \addvspace { \baselineskip } }
\int_gzero:N \g_@@_chap_par_prevgraf_int
}
\dim_set_eq:NN \leftmargin \l_@@_narrow_leftmargin_tl
\dim_set_eq:NN \rightmargin \l_@@_narrow_rightmargin_tl
\dim_set_eq:NN \listparindent \parindent
\dim_set_eq:NN \itemindent \parindent
\skip_set_eq:NN \parsep \parskip
\skip_zero:N \partopsep
\dim_zero:N \labelsep
}
\item
\relax
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_narrow_end:}
% End a narrow section in a scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_narrow_end:
{
\@@_calc_final_line_length:
\skip_add:Nn \@topsepadd \l_@@_delta_below_skip
\int_set_eq:NN \@endparpenalty \@lowpenalty
\endlist
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{The \env{poetry} environment}
%
% \begin{hooks}{scripture/poetry/para/after}
% This hook is an internal hook used to adjust the \cs{parshape} within a
% \env{poetry} environment after drop chapter numbers.
% \begin{macrocode}
\hook_new:n { scripture / poetry / para / after }
% \end{macrocode}
% \end{hooks}
%
% \begin{macro}{\g_@@_poetry_end_bool}
% Flag indicating that a \env{poetry} environment just ended.
% \begin{macrocode}
\bool_new:N \g_@@_poetry_end_bool
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\g_@@_poetry_midparachap_show_verse_bool}
% Flag indicating whether the verse number should be printed immediately
% after a \cs{ch} or not in a \env{poetry} environment.
% \begin{macrocode}
\bool_new:N \g_@@_poetry_midparachap_show_verse_bool
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_poetry_chap_indent_dim, \l_@@_poetry_chap_sep_dim}
% Store calculated indent and sep when a drop chapter appears in a
% \env{poetry} environment.
% \begin{macrocode}
\dim_new:N \l_@@_poetry_chap_indent_dim
\dim_new:N \l_@@_poetry_chap_sep_dim
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_poetry_chap_parshape_correction_dim}
% Correction to \cs{parshape} in chapter affected lines in a \env{poetry}
% environment.
% \begin{macrocode}
\dim_new:N \l_@@_poetry_chap_parshape_correction_dim
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\l_@@_poetry_prevgraf_int}
% Store the number of lines a line of poetry takes up.
% \begin{macrocode}
\int_new:N \l_@@_poetry_prevgraf_int
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_poetry_extra_skip:}
% Insert a little extra vertical space between two lines in a \env{poetry}
% environment.
% \begin{macrocode}
\cs_new_protected:Nn \@@_poetry_extra_skip:
{
\skip_vertical:n { \l_@@_extraskip_tl - \baselineskip - \parskip }
\bool_gset_false:N \g_@@_poetry_midparachap_show_verse_bool
\strut
\hook_gput_next_code:nn { para / after }
{
\hook_gput_next_code:nn { para / after }
{
\bool_gset_eq:NN
\g_@@_poetry_midparachap_show_verse_bool
\l_@@_midparachap_show_verse_bool
}
}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_poetry_text_right:nn}
% Align a word to the right and finish a paragraph, pushing to the next line
% if there is not space for the word.
% \begin{macrocode}
\cs_new_protected:Nn \@@_poetry_text_right:nn
{
{
\unskip
\hfil
\penalty 50
\skip_horizontal:n { #1 }
\hbox:n {}
\nobreak
\hfill
#2
\skip_zero:N \parfillskip
\int_zero:N \finalhyphendemerits
}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_selah_output:}
% Output Selah at the end of a line.
% \begin{macrocode}
\cs_new_protected:Nn \@@_selah_output:
{
\group_begin:
\l_@@_selah_font_tl
\@@_poetry_text_right:nn
{ \l_@@_selah_sep_tl }
{ \@@_selah_format:n { \l_@@_selah_text_tl } }
\group_end:
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_poetry_chap:n}
% Position a chapter in a \env{poetry} environment.
% \begin{macrocode}
\cs_new_protected:Nn \@@_poetry_chap:n
{
\@@_drop_chap_set_up:n { #1 }
\mode_if_vertical:TF
{
\dim_set_eq:NN \l_@@_poetry_chap_indent_dim \l_@@_poetry_indent_tl
\mode_leave_vertical:
}
{ \dim_zero:N \l_@@_poetry_chap_indent_dim }
\dim_set_eq:NN \l_@@_poetry_chap_sep_dim \l_@@_chap_sep_tl
\dim_compare:nNnT
{ \l_@@_chap_width_dim + \l_@@_chap_sep_tl }
<
{ \l_@@_poetry_leftmargin_tl + \l_@@_poetry_chap_indent_dim }
{
\dim_set:Nn \l_@@_poetry_chap_sep_dim
{
\l_@@_poetry_leftmargin_tl + \l_@@_poetry_chap_indent_dim -
\l_@@_chap_width_dim
}
}
\hbox_set:Nn \l_@@_chap_box
{
\box_move_down:nn
{ \baselineskip }
{
\hbox_overlap_left:n
{
\box_use:N \l_@@_chap_tmp_box
\skip_horizontal:N \l_@@_poetry_chap_sep_dim
}
}
}
\box_set_ht:Nn \l_@@_chap_box { \c_zero_dim }
\box_set_dp:Nn \l_@@_chap_box { \c_zero_dim }
\dim_set:Nn \l_@@_poetry_chap_parshape_correction_dim
{
\l_@@_chap_width_dim + \l_@@_poetry_chap_sep_dim -
\l_@@_poetry_leftmargin_tl - \l_@@_poetry_chap_indent_dim
}
\parshape 2 ~
\dim_eval:n
{ \@totalleftmargin + \l_@@_poetry_chap_parshape_correction_dim } ~
\dim_eval:n
{ \linewidth - \l_@@_poetry_chap_parshape_correction_dim } ~
\dim_eval:n
{ \@totalleftmargin + \l_@@_poetry_big_indent_tl } ~
\dim_eval:n
{ \linewidth - \l_@@_poetry_big_indent_tl }
% \end{macrocode}
% Because of interactions with \LaTeX{} \env{list} environments and
% \cs{@@_obeylines:}, \cs{@@_poetry_par:} setting the \cs{parshape} for the
% second line after a drop chapter number is more difficult than it should
% be. There's probably a better way.
% \begin{macrocode}
\dim_compare:nNnT
{ \l_@@_chap_width_dim + \l_@@_poetry_chap_sep_dim }
>
\l_@@_poetry_leftmargin_tl
{
\hook_gput_next_code:nn { scripture / poetry / para / after }
{
\int_compare:nNnT \l_@@_poetry_prevgraf_int = 1
{
% \end{macrocode}
% This \cs{parshape} is in effect when the next line is the second half of a
% poetry verse.
% \begin{macrocode}
\dim_compare:nNnTF
{ \l_@@_chap_width_dim + \l_@@_chap_sep_tl }
<
{ \l_@@_poetry_leftmargin_tl + \l_@@_poetry_indent_tl }
{ \dim_zero:N \l_@@_poetry_chap_parshape_correction_dim }
{
\dim_set:Nn \l_@@_poetry_chap_parshape_correction_dim
{
\l_@@_chap_width_dim + \l_@@_chap_sep_tl -
\l_@@_poetry_leftmargin_tl - \l_@@_poetry_indent_tl
}
}
\parshape 2 ~
\dim_eval:n
{ \@totalleftmargin + \l_@@_poetry_chap_parshape_correction_dim } ~
\dim_eval:n
{ \linewidth - \l_@@_poetry_chap_parshape_correction_dim } ~
\dim_eval:n
{ \@totalleftmargin + \l_@@_poetry_big_indent_tl } ~
\dim_eval:n
{ \linewidth - \l_@@_poetry_big_indent_tl }
\hook_gput_next_code:nn { para / after }
{
\hook_gclear_next_code:n { scripture / poetry / para / after }
}
\hook_gput_next_code:nn { scripture / poetry / para / after }
{
% \end{macrocode}
% This \cs{parshape} is in effect when the next line is the first half of a
% poetry verse.
% \begin{macrocode}
\dim_compare:nNnTF
{ \l_@@_chap_width_dim + \l_@@_chap_sep_tl }
<
\l_@@_poetry_leftmargin_tl
{ \dim_zero:N \l_@@_poetry_chap_parshape_correction_dim }
{
\dim_set:Nn \l_@@_poetry_chap_parshape_correction_dim
{
\l_@@_chap_width_dim + \l_@@_chap_sep_tl -
\l_@@_poetry_leftmargin_tl
}
}
\parshape 2 ~
\dim_eval:n
{ \@totalleftmargin + \l_@@_poetry_chap_parshape_correction_dim } ~
\dim_eval:n
{ \linewidth - \l_@@_poetry_chap_parshape_correction_dim } ~
\dim_eval:n
{ \@totalleftmargin + \l_@@_poetry_big_indent_tl } ~
\dim_eval:n
{ \linewidth - \l_@@_poetry_big_indent_tl }
}
}
}
}
\group_begin:
\hook_use:n { scripture / chap / before }
\box_use:N \l_@@_chap_box
\hook_use:n { scripture / chap / after }
\group_end:
\bool_lazy_or:nnT
{ \bool_if_p:n \l_@@_chap_show_verse_bool }
{ \bool_if_p:n \g_@@_poetry_midparachap_show_verse_bool }
{
\@@_verse_output:n { 1 }
}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_poetry_nodrop_chap:n}
% Format a non-drop chapter for \env{poetry} environment in a
% \env{scripture} quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_poetry_nodrop_chap:n
{
\cs_gset_nopar:Npn \scripturecurrentchapter { #1 }
\cs_gset_nopar:Npn \scripturecurrentverse { 1 }
\group_begin:
\bool_if:NTF \l_@@_chap_show_bool
{
\hbox_overlap_left:n
{
\hook_use:n { scripture / chap / before }
\group_begin:
\l_@@_chap_font_tl
\str_if_eq:VnF \l_@@_chapter_colour_tl { . }
{ \exp_args:NV \color_select:n \l_@@_chapter_colour_tl }
\@@_chap_format:n { #1 }
\group_end:
\skip_horizontal:N \l_@@_chap_sep_tl
\hook_use:n { scripture / chap / after }
}
\bool_lazy_or:nnT
{ \bool_if_p:n \l_@@_chap_show_verse_bool }
{ \bool_if_p:n \g_@@_poetry_midparachap_show_verse_bool }
{
\@@_verse_output:n { 1 }
}
}
{
\hook_use:n { scripture / chap / before }
\hook_use:n { scripture / chap / after }
\vs { 1 }
}
\group_end:
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@@_poetry_mode_vertical_verse:n}
% Format a verse for poetry scripture quotations in vertical and horizontal
% mode.
% \begin{macrocode}
\cs_new_protected:Nn \@@_poetry_mode_vertical_verse:n
{
\group_begin:
\tl_set_eq:NN \l_@@_verse_sep_tl \l_@@_poetry_verse_sep_tl
\strut
\bool_if:NTF \l_@@_poetry_verse_right_bool
{
\hbox_overlap_left:n
{
\@@_verse_output:n { #1 }
}
}
{
\hbox_overlap_left:n
{
\hbox_overlap_right:n
{
\@@_verse_output:n { #1 }
}
\skip_horizontal:N \l_@@_poetry_leftmargin_tl
}
}
\group_end:
}
\cs_new_protected:Nn \@@_poetry_mode_horizontal_verse:n
{
\group_begin:
\tl_set_eq:NN \l_@@_verse_sep_tl \l_@@_poetry_verse_sep_tl
\skip_horizontal:n { -\listparindent }
\@@_poetry_mode_vertical_verse:n { #1 }
\skip_horizontal:N \listparindent
\group_end:
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_poetry_par:}
% par macro for poetry sections
% \begin{macrocode}
\cs_new_protected:Nn \@@_poetry_par:
{
\mode_if_vertical:TF
{
\cs_set_eq:NN \vs \@@_poetry_mode_vertical_verse:n
\noindent
}
{
\cs_set_eq:NN \vs \@@_poetry_mode_horizontal_verse:n
\@@_tmp_para_end:
\int_set_eq:NN \l_@@_poetry_prevgraf_int \prevgraf
}
\parshape 2 ~
\@totalleftmargin ~
\linewidth ~
\dim_eval:n
{ \@totalleftmargin + \l_@@_poetry_big_indent_tl } ~
\dim_eval:n
{ \linewidth - \l_@@_poetry_big_indent_tl }
\hook_use:n { scripture / poetry / para / after }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_obeylines:}
% Special version of obeylines which doesn't insert par at end of
% environment.
% \begin{macrocode}
\group_begin:
\char_set_catcode_active:N \^^M
\cs_gset_protected_nopar:Nn \@@_obeylines: %
{%
\char_set_catcode_active:N \^^M%
\cs_set_eq:NN ^^M \@@_obeylines_end:%
}%
\group_end:
\cs_new_protected:Nn \@@_obeylines_end:
{
\peek_meaning:NF \end
{
\par
\int_set:Nn \l_@@_poetry_prevgraf_int { \int_use:N \prevgraf }
}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_poetry_begin:}
% Begin a poetry section in a scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_poetry_begin:
{
\bool_if:NT \l_@@_active_inner_bool
{
\msg_error:nn { scripture } { nested-environment }
}
\bool_set_true:N \l_@@_active_inner_bool
\tl_set:Nn \l_@@_currenvir_str { poetry }
\mode_if_horizontal:T
{ \par }
\list { }
{
\skip_set_eq:NN \l_@@_delta_below_skip \l_@@_poetry_belowskip_tl
\bool_if:NTF \g_@@_start_bool
{
\skip_zero:N \topsep
\skip_sub:Nn \topsep \parskip
\skip_add:Nn \l_@@_delta_below_skip \parskip
\bool_gset_false:N \g_@@_start_bool
}
{
\dim_compare:nTF
{ \parskip >= \glueexpr \l_@@_poetry_aboveskip_tl > \c_zero_skip }
{
\skip_zero:N \topsep
\skip_zero:N \l_@@_delta_below_skip
}
{
\skip_set_eq:NN \topsep \l_@@_poetry_aboveskip_tl
\skip_sub:Nn \l_@@_delta_below_skip \l_@@_poetry_aboveskip_tl
}
\int_compare:nNnT \g_@@_chap_par_prevgraf_int = 1
{ \addvspace { \baselineskip } }
\int_gzero:N \g_@@_chap_par_prevgraf_int
}
\dim_set_eq:NN \leftmargin \l_@@_poetry_leftmargin_tl
\dim_set_eq:NN \rightmargin \l_@@_poetry_rightmargin_tl
\dim_set_eq:NN \itemindent \l_@@_poetry_indent_tl
\dim_set_eq:NN \listparindent \l_@@_poetry_indent_tl
\skip_zero:N \parsep
\skip_zero:N \partopsep
\dim_zero:N \labelsep
}
\raggedright
\dim_set_eq:NN \listparindent \l_@@_poetry_indent_tl
\dim_set_eq:NN \parindent \l_@@_poetry_indent_tl
\bool_gset_false:N \g_@@_poetry_midparachap_show_verse_bool
\DeclareDocumentCommand { \ch } { sm }
{
\bool_if:NTF \l_@@_chap_show_bool
{
\bool_if:NTF \l_@@_chap_drop_bool
{ \@@_poetry_chap:n { ##2 } }
{ \@@_poetry_nodrop_chap:n { ##2 } }
}
{ \@@_poetry_nodrop_chap:n { ##2 } }
}
\cs_set_eq:NN \vs \@@_poetry_mode_vertical_verse:n
\cs_set_eq:NN \extraskip \@@_poetry_extra_skip:
\cs_set_eq:NN \selah \@@_selah_output:
\cs_set_protected_nopar:Npn \textright ##1
{
\@@_poetry_text_right:nn { \l_@@_text_right_sep_tl } { ##1 }
}
\item
\relax
\cs_set_eq:NN \@@_tmp_para_end: \par
\cs_set_eq:NN \par \@@_poetry_par:
\hook_gput_next_code:nn { para / after }
{ \bool_gset_eq:NN \g_@@_poetry_midparachap_show_verse_bool \l_@@_midparachap_show_verse_bool }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_poetry_end:}
% End a poetry section in a scripture quotation.
% \begin{macrocode}
\cs_new_protected:Nn \@@_poetry_end:
{
\@@_calc_final_line_length:
\skip_add:Nn \@topsepadd \l_@@_delta_below_skip
\int_set_eq:NN \@endparpenalty \@lowpenalty
\endlist
\bool_gset_true:N \g_@@_poetry_end_bool
\hook_gput_next_code:nn { para / begin }
{ \bool_gset_false:N \g_@@_poetry_end_bool }
}
% \end{macrocode}
% \end{macro}
%
%
% \subsection{Public \LaTeX{} Interface}
%
% \begin{macro}{\scripturecurrentchapter, \scripturecurrentverse}
% Globally stores the most recent argument of \cs{ch} and \cs{vs}. These
% could be used in hooks, for example.
% \begin{macrocode}
\cs_set_nopar:Npn \scripturecurrentchapter { }
\cs_set_nopar:Npn \scripturecurrentverse { }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\scripturesetup}
% \begin{arguments}
% \item \meta{|options|} to set.
% \end{arguments}
% Set key-value settings.
% \begin{macrocode}
\NewDocumentCommand { \scripturesetup } { m }
{
\keys_set:nn { scripture } { #1 }
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\textscripture}
% \begin{arguments}
% \item \meta{|reference|} of quotation.
% \item \meta{|options|} to set.
% \item \meta{|quotation|} text.
% \end{arguments}
% Set an inline quotation. This is equivalent to calling the
% \env{scripture} environment with the \opt{inline} option set.
% \begin{macrocode}
\NewDocumentCommand { \textscripture } { oo+m }
{
\tl_if_novalue:nTF { #2 }
{
\begin { scripture } [ #1 ] [ inline ]
}
{
\begin { scripture } [ #1 ] [ inline, #2 ]
}
#3
\end { scripture }
}
% \end{macrocode}
% \end{macro}
%
% \begin{envmacro}{scripture}
% \begin{arguments}
% \item \meta{|reference|} of quotation.
% \item \meta{|options|} to set.
% \end{arguments}
% Format a scripture quotation with optional reference.
% \begin{macrocode}
\NewDocumentEnvironment { scripture } { oo }
{
\@@_begin:n { #2 }
% \end{macrocode}
% \begin{envmacro}{center}
% \begin{arguments}
% \item \meta{|options|} to set.
% \end{arguments}
% \begin{macrocode}
\DeclareDocumentEnvironment { center } { o }
{
\@@_center_begin:n { ##1 }
\ignorespaces
}
{ \@@_center_end: }
% \end{macrocode}
% \end{envmacro}
% \begin{envmacro}{flushright}
% \begin{arguments}
% \item \meta{|options|} to set.
% \end{arguments}
% \begin{macrocode}
\DeclareDocumentEnvironment { flushright } { o }
{
\@@_flushright_begin:n { ##1 }
\ignorespaces
}
{ \@@_flushright_end: }
% \end{macrocode}
% \end{envmacro}
% \begin{envmacro}{hanging}
% \begin{arguments}
% \item \meta{|options|} to set.
% \end{arguments}
% \begin{macrocode}
\DeclareDocumentEnvironment { hanging } { o }
{
\@@_hanging_begin:n { ##1 }
\ignorespaces
}
{ \@@_hanging_end: }
% \end{macrocode}
% \end{envmacro}
% \vspace{-2\baselineskip}
% \begin{envmacro}{midparachap}
% \begin{macrocode}
\DeclareDocumentEnvironment { midparachap } { o }
{
\@@_mid_para_chap_begin:n { ##1 }
\ignorespaces
}
{ \@@_mid_para_chap_end: }
% \end{macrocode}
% \end{envmacro}
% \begin{envmacro}{narrow}
% \begin{arguments}
% \item \meta{|options|} to set.
% \end{arguments}
% \begin{macrocode}
\DeclareDocumentEnvironment { narrow } { o }
{
\@@_narrow_begin:n { ##1 }
\ignorespaces
}
{ \@@_narrow_end: }
% \end{macrocode}
% \end{envmacro}
% \begin{envmacro}{poetry}
% \begin{arguments}
% \item \meta{|options|} to set.
% \end{arguments}
% The \env{poetryaux} environment is required because \cs{@@_obeylines:}
% breaks the reading of optional arguments.
% \begin{macrocode}
\DeclareDocumentEnvironment { poetryaux } { o }
{
\tl_if_novalue:nF { ##1 }
{
\keys_set:nn
{ scripture / poetry }
{ ##1 }
}
\@@_poetry_begin:
\ignorespaces
}
{ \@@_poetry_end: }
\DeclareDocumentEnvironment { poetry } { }
{
\@@_obeylines:
\poetryaux
}
{ \endpoetryaux }
% \end{macrocode}
% \end{envmacro}
% \begin{macrocode}
\bool_if:NT \l_@@_inline_bool
{
\tl_set:Nn \l_@@_aboveskip_tl { 0pt }
\tl_set:Nn \l_@@_belowskip_tl { 0pt }
\tl_set:Nn \l_@@_leftmargin_tl { 0pt }
\tl_set:Nn \l_@@_rightmargin_tl { 0pt }
}
\bool_if:NT \l_@@_compact_bool
{
\scripturesetup { chapter / nodrop }
\RenewDocumentEnvironment { center } { o } { \ignorespaces } { \unskip }
\RenewDocumentEnvironment { flushright } { o } { \ignorespaces } { \unskip }
\RenewDocumentEnvironment { hanging } { o } { \ignorespaces } { \unskip }
\RenewDocumentEnvironment { midparachap } { o } { \ignorespaces } { \unskip }
\RenewDocumentEnvironment { narrow } { o } { \ignorespaces } { \unskip }
\RenewDocumentEnvironment { poetry } { o } { \ignorespaces } { \unskip }
\cs_set_eq:NN \\ \unskip
\cs_set_eq:NN \par \relax
\cs_set_eq:NN \extraskip \relax
\cs_set_eq:NN \nohang \relax
\cs_set:Npn \selah
{
\group_begin:
\l_@@_selah_font_tl
\c_space_tl
\@@_selah_format:n { \l_@@_selah_text_tl }
\c_space_tl
\group_end:
}
\cs_set_protected_nopar:Npn \textright ##1
{
\unskip
\c_space_tl
##1
}
\mode_leave_vertical:
}
\peek_remove_spaces:n
{
\peek_meaning:NF \begin
{ \bool_gset_false:N \g_@@_start_bool }
}
}
{
\bool_if:NT \l_@@_compact_bool
{ \cs_set_eq:NN \par \endgraf }
\@@_end:n { #1 }
}
% \end{macrocode}
% \end{envmacro}
% \begin{macrocode}
%</package>
% \end{macrocode}
% \end{implementation}
%
% \PrintChanges
%
% \PrintIndex
|