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
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
|
%\CheckSum{3732}
%
%\iffalse
% Tell the LaTeX system who we are and write an entry on the
% transcript.
%<*dtx>
\ProvidesFile{frenchb.dtx}
%</dtx>
%<acadian>\ProvidesLanguage{acadian}
%<canadien>\ProvidesLanguage{canadien}
%<francais>\ProvidesLanguage{francais}
%<french>\ProvidesLanguage{french}
%<frenchb>\ProvidesLanguage{frenchb}
%<lua>--[[
%<lua> File `frenchb.lua’ generated from frenchb.dtx
[2021/07/20 v3.5m French support from the babel system]
%<*internal>
\iffalse
%</internal>
%<*lua>
Copyright © 2014-2021 Daniel Flipo
<daniel (dot) flipo (at) free (dot) fr>
License LPPL: see french.ldf.
--]]
%</lua>
%<*internal>
\fi
%</internal>
%<*dtx>
%% File `frenchb.dtx’
%</dtx>
%<*dtx|french>
%%
%% Babel package for LaTeX version 2e
%% Copyright © 1996-2021
%% by Daniel Flipo <daniel (dot) flipo (at) free (dot) fr>
%%
%</dtx|french>
%<*dtx>
%% This file is part of the babel system, it provides the source
%% code for the French language definition file.
%%
%</dtx>
%<*filedriver>
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{pdfstandard=A-2b, lang=en-US}
\documentclass[a4paper]{ltxdoc}
\usepackage[left=38mm,right=38mm,top=30mm,bottom=50mm]{geometry}
\usepackage[dvipsnames]{xcolor}
\usepackage[no-math]{fontspec}
\usepackage{realscripts}
\setmainfont{Vera.ttf}[
ItalicFont = VeraIt.ttf,
BoldFont = VeraBd.ttf,
BoldItalicFont = VeraBI.ttf,
Scale = 0.92
]
\setmonofont{VeraMono.ttf}[
ItalicFont = VeraMoIt.ttf,
BoldFont = VeraMoBd.ttf,
BoldItalicFont = VeraMoBI.ttf,
Scale = MatchLowercase,
]
%
\def\PrintMacroName#1{%
\strut\MacroFont\color{Sepia}\normalsize\string#1}
\def\ColorArg{\color{Sepia}}
\usepackage[verbose=silent]{microtype}
\usepackage{array,url}
\usepackage[numbered]{hypdoc}
\hypersetup{colorlinks,urlcolor=Blue,linkcolor=Blue}
\newcommand*{\hlabel}[1]{\phantomsection\label{#1}}
\newcommand*\babel{\texttt{Babel}}
\newcommand*\frenchb{\texttt{babel-french}}
\newcommand*\file[1]{\texttt{#1}}
\newcommand*\cls[1]{\texttt{#1}}
\newcommand*\pkg[1]{\texttt{#1}}
\newcommand*\opt[1]{\texttt{#1}}
\newcommand*\env[1]{\texttt{#1}}
\newcommand*\exe[1]{\texttt{#1}}
\newcommand*\fbo[1]{\texttt{\ColorArg #1}}
\newcommand*\fbsetup[1]{\cs{frenchsetup\{\fbo{#1}\}}}
\renewcommand\meta[1]{\textit{<#1>}} % no math mode (see doc.sty)
\let\Module\meta % no math mode (see doc.sty)
\renewcommand*\descriptionlabel[1]{%
\hspace{\labelsep}\normalfont \fbo{#1}}
\let\up\textsuperscript
\newcommand*{\FRguillspace}{\penalty 10000
\hskip.8\fontdimen2\font
plus.3\fontdimen3\font
minus.8\fontdimen4\font}
\hyphenation{Lua-TeX Lua-LaTeX Xe-LaTeX}
\lefthyphenmin=2 \righthyphenmin=3
\RecordChanges
\AtEndDocument{%
\clearpage
\section{Change History}%
\GlossaryPrologue{}%
Changes are listed in reverse order (latest first) and limited to
\frenchb{}~v3.
\PrintChanges
}
\begin{document}
\setlength{\parindent}{0pt}
\GetFileInfo{frenchb.dtx}
\begin{center}
\textbf{\Large A Babel language definition file for French}\\[2mm]^^A\]
\textbf{\large frenchb.dtx \fileversion, \filedate}\\[3mm]^^A\]
Daniel Flipo\\
\texttt{daniel.flipo@free.fr}
\end{center}
\vspace{2\baselineskip}
\thispagestyle{empty}
\tableofcontents
\clearpage
\DocInput{frenchb.dtx}
\end{document}
%</filedriver>
%\fi
%
% \section{The French language}
%
% The file \file{\filename}\footnote{The file described in this
% section has version number \fileversion\ and was last revised on
% \filedate.}, defines all the language definition macros for the
% French language.
%
% Customisation for the French language is achieved following the
% book ``Lexique des règles typographiques en usage à
% l’Imprimerie Nationale’’ troisième édition (1994),
% ISBN-2-11-081075-0.
%
% First version released: 1.1 (May 1996) as part of
% \babel-3.6beta. Version~2.0a was released in February 2007 and
% version~3.0a in February 2014.
%
% \frenchb{} has been improved using helpful suggestions from many
% people, mainly from Jacques André, Michel Bovani, Thierry Bouche,
% Vincent Jalby, Denis Bitouzé, Ulrike Fisher and Marcel Krüger.
% Thanks to all of them!
%
% LaTeX-2.09 is no longer supported.
% This new version (3.x) has been designed to be used only with
% LaTeX2e and Plain formats based on TeX, pdfTeX, LuaTeX or XeTeX
% engines.
%
% Changes between version 3.0 and \fileversion{} are listed in
% subsection~\ref{ssec-changes} p.~\pageref{ssec-changes}.
%
% An extensive documentation in French (file \file{frenchb-doc.pdf}) is
% now included in \frenchb.
%
% \subsection{Basic interface}
%
% In a multilingual document, some typographic rules are language
% dependent, i.e.\ spaces before `high punctuation’ (|:| |;| |!|
% |?|) in French, others modify the general layout (i.e.\ layout of
% lists, footnotes, indentation of first paragraphs of sections) and
% should apply to the whole document.
%
% The French language can be loaded with \babel{} by a command like:
% \\ |\usepackage[german,spanish,french,british]{babel}|%
% \footnote{\emph{Always} use \opt{french} as option name for the
% French language, former aliases \opt{frenchb} or \opt{francais}
% are \emph{depreciated}; expect them to be removed sooner or later!}
%
% A variant \opt{acadian} of \opt{french} is provided; it is
% originally identical to \opt{french} but can be customised
% independently in terms of patterns, punctuation spacing, captions,
% etc. Both variants can be used together inside the same document.
%
% \frenchb{} takes account of \babel’s \emph{main language} defined
% as the \emph{last} option at \babel’s loading. When French is
% not \babel’s main language, \frenchb{} does not alter the general
% layout of the document (even in parts where French is the current
% language): the layout of lists, footnotes, indentation of first
% paragraphs of sections are not customised by \frenchb.
%
% When French is loaded as the last option of \babel, \frenchb{}
% makes the following changes to the global layout, \emph{both in
% French and in all other languages}\footnote{%
% For each item, hooks are provided to reset standard
% LaTeX settings or to emulate the behavior of former versions
% of \frenchb{} (see command \fbsetup{},
% section~\ref{ssec-custom} p.~\pageref{ssec-custom}).}:
% \begin{enumerate}
% \item the first paragraph of each section is indented
% (LaTeX only);
% \item the default items in itemize environment are set to `---’
% instead of `\textbullet’, and all vertical spacing and glue
% is deleted; it is possible to change `---’ to something else
% (`--’ for instance) using \fbsetup{} (see
% section~\ref{ssec-custom} p.~\pageref{ssec-custom});
% \item vertical spacing in general LaTeX lists is
% shortened;
% \item footnotes are displayed ``à la française’’.
% \item the separator following the table or figure number in
% captions is printed as `~--~’ instead of `:~’;
% for changing this see~\ref{sssec-captions-fig}
% p.~\pageref{sssec-captions-fig}.
% \end{enumerate}
%
% Regarding local typography, the command |\selectlanguage{french}|
% switches to the French language\footnote{%
% \cs{selectlanguage\{francais\}} and
% \cs{selectlanguage\{frenchb\}} are no longer supported.},
% with the following effects:
% \begin{enumerate}
% \item French hyphenation patterns are made active;
% \item `high punctuation’ characters (|:| |;| |!| |?|)
% automatically add correct spacing%
% \footnote{Well, the automatic insertion may add unwanted
% spaces in some cases, for correction see
% \fbo{AutoSpacePunctuation} option and \cs{NoAutoSpacing}
% command p.~\pageref{autospacepunctuation}.}
% in French; this is achieved using callbacks in Lua(La)TeX
% or `XeTeXinterchar’ mechanism in Xe(La)TeX; with TeX’82 and
% pdf(La)TeX these four characters are made active in the
% whole document;
% \item |\today| prints the date in French;
% \item the caption names are translated into French
% (LaTeX only). For customisation of caption names see
% section~\ref{sssec-captions-name}
% p.~\pageref{sssec-captions-name}.
% \item the space after |\dots| is removed in French.
% \end{enumerate}
%
% Some commands are provided by \frenchb{} to make typesetting
% easier:
% \begin{enumerate}
% \item French quotation marks can be entered using the commands
% |\og| and |\fg| which work in LaTeX2e and PlainTeX,
% their appearance depending on what is available to draw
% them; even if you use LaTeX2e \emph{and} |T1|-encoding,
% you should refrain from entering them as
% |<<~French quotation~>>|: |\og| and |\fg| provide
% better horizontal spacing (controlled by |\FBguillspace|).
% If French quote characters are available on your keyboard,
% you can use them, to get proper spacing in LaTeX2e see
% option \fbo{og=«, fg=»} p.~\pageref{option-og-fg}.
%
% |\og| and |\fg| can be used outside French, they typeset
% then English quotes `` and ’’.
%
% A new command |\frquote{}| has been added in version~3.1 to
% enter French quotations. |\frquote{|\textit{texte}|}| is
% equivalent to |\og| \textit{texte} |\fg{}| for short
% quotations.\hlabel{frquote}
% For quotations spreading over more than one paragraph,
% |\frquote| will add at the beginning of every paragraph of
% the quotation either an opening French guillemet («), or
% a closing one (») or nothing depending on option
% \fbo{EveryParGuill=open} or \fbo{=close} or \fbo{=none},
% see p.~\pageref{everyparguill}.
% Command |\NoEveryParQuote| is provided to locally suppress
% unwanted guillemets (typically when lists are embedded in
% |\frquote{}|), it is meant to be used inside an environment
% or a group.
%
% |\frquote| is recommended to enter embedded quotations ``à la
% française’’, several variants are provided through options.
% \begin{itemize}
% \item with all engines: the inner quotation
% is surrounded by double quotes (``\textit{texte}’’)
% unless option \fbo{InnerGuillSingle=true}, then
% a) the inner quotation is printed as
% \guilsinglleft\FRguillspace\textit{texte}\FRguillspace
% \guilsinglright{} and b) if the inner quotation
% spreads over more than one paragraph, every paragraph
% included in the inner quotation starts with
% a \guilsinglleft{} or a \guilsinglright{} or nothing,
% depending on option \fbo{EveryParGuill=open} (default)
% or \fbo{=close} or \fbo{=none}.
% \item with LuaTeX based engines, it is possible to add a
% French opening or closing guillemet (« or ») at the
% beginning of every line of the inner quotation using
% option \fbo{EveryLineGuill=open} or \fbo{=close}; note
% that with any of these options, the inner quotation is
% surrounded by French guillemets (« and ») regardless
% option \fbo{InnerGuillSingle};
% the default is \fbo{EveryLineGuill=none} so that
% |\frquote{}| behaves as with non-LuaTeX engines.
% \end{itemize}
% A starred variant |\frquote*| is meant for inner quotations
% which end together with the outer one: using |\frquote*| for
% the inner quotation will print only one closing quote
% character (the outer one) as recommended by the French
% `Imprimerie Nationale’.
%
% \item |\frenchdate|\marg{year}\marg{month}\marg{day} helps
% typesetting dates in French: |\frenchdate{2001}{01}{01}|
% will print 1\up{er} janvier 2001 in a box without any
% linebreak.\label{frenchdate}
%
% \item A command |\up| is provided to typeset superscripts like
% |M\up{me}| (abbreviation for ``Madame’’), |1\up{er}| (for
% ``premier’’). Other commands are also provided for
% ordinals: |\ier|, |\iere|, |\iers|, |\ieres|, |\ieme|,
% |\iemes| (|3\iemes| prints 3\up{es}).
% All these commands take advantage of real superscript
% letters when they are available in the current font.
%
% \item Family names should be typeset in small capitals and never
% be hyphenated, the macro |\bsc| (boxed small caps) does
% this, e.g., |L.~\bsc{Lamport}| will print the same as
% |L.~\mbox{\textsc{Lamport}}|. Note that composed names
% (such as Dupont-Durant) may now be hyphenated on explicit
% hyphens, this differs from \frenchb~v.~1.x.
%
% \item Commands |\primo|, |\secundo|, |\tertio| and |\quarto|
% print 1\up{o}, 2\up{o}, 3\up{o}, 4\up{o}.
% |\FrenchEnumerate{6}| prints 6\up{o}.
% \item Abbreviations for ``Numéro(s)’’ and ``numéro(s)’’
% (N\up{o} N\up{os} n\up{o} and n\up{os}~) are obtained
% via the commands |\No|, |\Nos|, |\no|, |\nos|.
%
% \item Two commands are provided to typeset the symbol for
% ``degré’’: |\degre| prints the raw character and
% |\degres| should be used to typeset temperatures (e.g.,
% ``|20~\degres C|’’ with a non-breaking space), or for
% alcohols’’ strengths (e.g., ``|45\degres|’’ with \emph{no}
% space in French) or for angles in math mode.
%
% \item In math mode the comma has to be surrounded with
% braces to avoid a spurious space being inserted after it,
% in decimal numbers for instance (see the \TeX{}book p.~134).
% The command |\DecimalMathComma| makes the comma behave as an
% ordinary character \emph{when the current language is French}
% (no space added);
% as a counterpart, if |\DecimalMathComma| is active, an
% explicit space has to be added in lists and intervals:
% |$[0,\ 1]$|, |$(x,\ y)$|. |\StandardMathComma| switches
% back to the standard behaviour of the comma in French.
%
% The \pkg{icomma} package is an alternative workaround.
%
% \item A command |\nombre| was provided in 1.x versions to easily
% format numbers in slices of three digits separated either
% by a comma in English or with a space in French; |\nombre|
% is now mapped to |\numprint| from \file{numprint.sty}, which
% should be loaded \emph{after} \babel, see \file{numprint.pdf}
% for more information.
%
% \item \frenchb{} has been designed to take advantage of the
% \pkg{xspace} package if present: adding
% |\usepackage{xspace}| in the preamble will force macros
% like |\fg|, |\ier|, |\ieme|, |\dots|, …, to respect
% the spaces you type after them, for instance typing
% `|1\ier juin|’ will print `1\up{er} juin’
% (no need for a forced space after |1\ier|).
% \end{enumerate}
%
% \subsection{Customisation}
% \label{ssec-custom}
%
% Customisation of \frenchb{} relies on command \fbsetup{}
% (formerly called |\frenchbsetup{}|, the latter name will be kept
% for ever to ensure backwards compatibility), options are entered
% using the \file{keyval} syntax.
% The command \fbsetup{} is to appear in the preamble only
% (after loading \babel).
%
% \subsubsection[\textbackslash frenchsetup{}]
% {\fbsetup{options}}
% \label{sssec-frenchbsetup}
%
% \vspace{.5\baselineskip}
% |\frenchsetup{}| and |\frenchbsetup{}| are synonymous;
% the latter should be preferred as the language name for
% French in \babel{} is no longer |frenchb| but |french|.
%
% \fbsetup{ShowOptions} prints all available options to
% the \file{.log} file, it is just meant as a remainder of the
% list of offered options. As usual with \file{keyval} syntax,
% boolean options (as \fbo{ShowOptions}) can be entered as
% \fbo{ShowOptions=true} or just \fbo{ShowOptions}, the
% \fbo{=true} part can be omitted.
%
% \vspace{.5\baselineskip}
% The other options are listed below. Their default value is
% shown between braces, sometimes followed be a `\texttt{*}’.
% The `\texttt{*}’ means that the default shown applies when
% \frenchb{} is loaded as the \emph{last} option of \babel{}
% ---\babel’s \emph{main language}---, and is toggled otherwise.
% \begin{description}
% \setlength{\labelsep}{0.1666em}
% \item [StandardLayout=true (false*)] forces \frenchb{} not to
% interfere with the layout: no action on any kind of lists,
% first paragraphs of sections are not indented (as in English),
% no action on footnotes; it useless unless French is the main
% language. This option can be used to avoid conflicts with
% classes or packages which customise lists or footnotes.
%
% \item [GlobalLayoutFrench=false (true*)] can only be used when
% French is the main language; setting it to \fbo{false} will
% emulate what prior versions of \frenchb{} (pre-2.2) did:
% lists, and first paragraphs of sections will be displayed
% the standard way in other languages than French, and ``à la
% française’’ in French (changing the layout inside a document
% is a bad practice imho). Note that the layout of footnotes is
% language independent anyway (see below \fbo{FrenchFootnotes}
% and \fbo{AutoSpaceFootnotes}).
%
% \item [IndentFirst=false (true*)]; set this option to \fbo{false}
% if you do not want \frenchb{} to force indentation of the
% first paragraph of sections. When French is the main language,
% this option applies to all languages.
%
% \item [PartNameFull=false (true)]; when true, \frenchb{} numbers
% the title of |\part{}| commands as ``Première partie’’,
% ``Deuxième partie’’ and so on. With some classes which
% change the |\part{}| command (AMS classes do so), you could
% get ``Première partie~1’’, ``Deuxième partie~2’’ in the toc;
% when this occurs, this option should be set to
% \fbo{false}, part titles will then be printed as ``Partie I’’,
% ``Partie II’’.
%
% \item [ListItemsAsPar=true (false)] setting this option to
% \fbo{true} is recommended: list items will be displayed as
% paragraphs with indented labels (in the ``Imprimerie Nationale’’
% way) instead of having labels hanging into the left margin.
% How these two layouts differ is shown below:\\[.5\baselineskip]
% \fbox{\parbox[t]{.4\textwidth}{\raggedright
% \parindent=1.5em
% \def\FBlabel{\textemdash}%
% \settowidth{\labelwidth}{\FBlabel}%
% Text starting at `parindent’ \\
% \noindent<= Leftmargin\par
% \textemdash{} first item running on two
% \hspace*{\parindent}\hspace*{\labelwidth}
% lines or more…\par
% \hspace*{\labelwidth} \textemdash{} first second level
% item \hspace*{\parindent}\hspace*{\labelwidth}%
% \hspace*{\labelwidth} on two lines…\par
% \hspace*{\labelwidth} \textemdash{} next one…\par
% \textemdash{} second item…
% }}
% \hfill \hlabel{ListAsPar}%
% \fbox{\parbox[t]{.4\textwidth}{\raggedright
% \parindent=1.5em
% \def\FBlabel{\textemdash}%
% \settowidth{\labelwidth}{\FBlabel}%
% Text starting at `parindent’ \\
% \noindent<= Leftmargin\par
% \textemdash{} first item running on two
% lines or more…\par
% \hspace*{\labelwidth} \textemdash{} first second level
% item \hspace*{\parindent}on two lines…\par
% \hspace*{\labelwidth} \textemdash{} next one…\par
% \textemdash{} second item…
% }}\par
% \hspace*{3em} Default French layout%
% \hspace{\fill}With \fbo{ListItemsAsPar=true} \hspace*{1em}
%
% \item [StandardListSpacing=true (false*)]%
% \footnote{This option should be used instead of former option
% \fbo{ReduceListSpacing} (kept for backward compatibility) which
% could be misleading: with some classes (smfart, smfbook f.i.)
% you had to set \fbo{ReduceListSpacing=false} to revert to the
% class settings which actually reduce list’s spacings even more
% than \frenchb! \fbo{StandardListSpacing=true} replaces
% \fbo{ReduceListSpacing=false}.}; \frenchb{} customises
% the vertical spaces in the \env{list} environment, this affects
% all lists, including \env{itemize} \env{enumerate},
% \env{description}, but also \env{abstract}, \env{quote},
% \env{quotation}, \env{verse}, etc. which are based on \env{list}.
% Setting this option to \fbo{true} reverts to the standard
% settings of the \env{list} environment as defined by the document
% class.
%
% \item [StandardItemizeEnv=true (false*)]; \frenchb{} redefines
% the \env{itemize} environment to suppress any vertical space
% between items of \env{itemize} lists in French and customises
% left margins. Setting this option to \fbo{true} reverts to
% the standard definition of \env{itemize}.
%
% \item [StandardEnumerateEnv=true (false*)]; \frenchb{} redefines
% \env{enumerate} and \env{description} environments to make
% left margins match those of the French version of \env{itemize}
% lists. Setting this option to \fbo{true} reverts to the standard
% definition of \env{enumerate} and \env{description}.
%
% \item [StandardItemLabels=true (false*)] when set to \fbo{true}
% this option prevents \frenchb{} from changing the labels in
% \env{itemize} lists in French.
%
% \item [ItemLabels=\cs{textbullet}, \cs{textendash},
% \cs{ding\{43\}}, (\cs{textemdash}*)]; \\
% when \fbo{StandardItemLabels=false} (the default), this option
% enables to choose the label used in French \env{itemize} lists
% for all levels. The next four options do the same but each
% one for a specific level only. Note that \fbo{\cs{ding\{43\}}}
% requires loading the \pkg{pifont} package.
%
% \item [ItemLabeli=\cs{textbullet}, \cs{textendash},
% \cs{ding\{43\}} (\cs{textemdash}*)]
%
% \item [ItemLabelii=\cs{textbullet}, \cs{textendash},
% \cs{ding\{43\}} (\cs{textemdash}*)]
%
% \item [ItemLabeliii=\cs{textbullet},
% \cs{textendash}, \cs{ding\{43\}} (\cs{textemdash}*)]
%
% \item [ItemLabeliv=\cs{textbullet}, \cs{textendash},
% \cs{ding\{43\}} (\cs{textemdash}*)]\hfill
%
% \item [StandardLists=true (false*)] forbids \frenchb{} to
% customise any kind of list. Try the option \fbo{StandardLists}
% in case of conflicts with classes or packages that customise
% lists too. This option is just a shorthand setting all four
% options \fbo{StandardListSpacing=true},
% \fbo{StandardItemizeEnv=true}, \fbo{StandardEnumerateEnv=true}
% and \fbo{StandardItemLabels=true}.
%
% \item [ListOldLayout=true (false)]; starting with version~2.6a,
% the layout of lists has changed regarding leftmargins’ sizes
% and default itemize label (`---’ instead of `--’ up to~2.5k).
% This option, provided for backward compatibility, displays
% lists as they were up to version~2.5k.
%
% \item [FrenchFootnotes=false (true*)] reverts to the standard
% layout of footnotes. By default \frenchb{} typesets leading
% numbers as `1.\hspace{.5em}’ instead of `\up{1}’, but
% has no effect on footnotes numbered with symbols (as in the
% |\thanks| command). Two commands |\StandardFootnotes|
% and |\FrenchFootnotes| are available to change the layout of
% footnotes locally; |\StandardFootnotes| can help when some
% footnotes are numbered with letters (inside minipages for
% instance).
%
% \item [AutoSpaceFootnotes=false (true*)]; by default \frenchb{}
% adds a thin space in the running text before the number or
% symbol calling the footnote. Making this option \fbo{false}
% reverts to the standard setting (no space added).
%
% \item [AutoSpacePunctuation=false (true)]; in French, the user
% \hlabel{autospacepunctuation}
% \emph{should} input a space before the four characters `|:;!?|’
% but as many people forget about it (even among native French
% writers!), the default behaviour of \frenchb{} is to
% automatically typeset non-breaking spaces the width of which is
% either |\FBthinspace| (defauts to a thin space) before `|;|’
% `|!|’ `|?|’ or |\FBcolonspace| (defauts to |\space|) before
% `|:|’; the defaults follow the French `Imprimerie Nationale’s
% recommendations. This is convenient in most cases but can lead
% to addition of spurious spaces in URLs, in MS-DOS paths or in
% timetables (10:55) ---this no longer occurs with LuaTeX---,
% except if they are typed in |\texttt| or verbatim mode.
% When the current font is a monospaced (typewriter) font,
% no spurious space is added in that case%
% \footnote{Unless option \fbo{OriginalTypewriter} is set,
% \cs{ttfamily} is redefined in French to switch off space
% tuning, see below.},
% so the default behaviour of of \frenchb{} in that area should
% be fine in most circumstances.
%
% Choosing \fbo{AutoSpacePunctuation=false} will ensure that
% a proper space is added before `|:;!?|’ \emph{if and only if}
% a (normal) space has been typed in. This option gives full
% control on space insertion before `|:;!?|’. Those who are
% unsure about their typing in this area should stick to the
% default option and use the provided |\NoAutoSpacing| command
% inside a group in case an unwanted space is added by \frenchb{}
% (i.e.\ |{\NoAutoSpacing http://mysite}|%
% \footnote{Actually, this is needed only with the XeTeX and
% pdfTeX engines. LuaTeX no longer inserts any space in strings
% like http://mysite, C:\textbackslash Foo, 10:55…}
% or |{\NoAutoSpacing ???}| (needed for pdfTeX only).
%
% \item [ThinColonSpace=true (false)] changes the
% non-breaking space added before the colon `:’ to a thin space,
% so that the same amount of space is added before any of the
% four `high punctuation’ characters. The default setting is
% supported by the French `Imprimerie Nationale’.
%
% \item [OriginalTypewriter=true (false)] prevents any
% customisation of |\ttfamily| and |\texttt{}| in French.
% This option should only be used to ensure backward compatibility.
% The current default behaviour is to switch off any addition of
% space before high punctuation with typewriter fonts
% (\textit{e.g.} verbatim).
%
% \item [UnicodeNoBreakSpaces=true (false)];\hlabel{ucs-nbsp}
% (experimental) this option should be set to \fbo{true}
% \emph{only while converting LuaLaTeX files} to HTML.
% It ensures that non-breaking spaces added by \frenchb{} are
% inserted in the PDF file as U+A0 or U+202F (thin) instead of
% penalties and glues.
% Note that \exe{lwarp} (v.~0.37 and up) is fully compatible with
% \frenchb{} for translating PDFLaTeX or XeLaTeX files to HTML.
%
% \item [og=«, fg=»]; when guillemets characters are available on
% the keyboard (through a compose key for instance), it is nice
% to use them instead of typing |\og| and |\fg|. This option
% tells \frenchb{} which characters are opening and closing
% French guillemets (they depend on the input encoding), then
% you can type either \hlabel{option-og-fg}
% \texttt{« guillemets »} or \texttt{«guillemets»} (with or
% without spaces) to get properly typeset French quotes.
% This option works with LuaLaTeX and XeLaTeX; with pdfLaTeX it
% requires \file{inputenc} to be loaded with a proper encoding:
% 8-bits encoding (latin1, latin9, ansinew, applemac,…) or
% multi-byte encoding (utf8, utf8x).
%
% \item [INGuillSpace=true (false)] resets the dimensions of spaces
% after opening French quotes and before closing French quotes to
% the French `Imprimerie Nationale’ standards (inter-word space).
% \frenchb’s default setting produces slightly narrower spaces
% with less stretchability.
%
% \item [EveryParGuill=open, close, none (open)]; sets whether
% an opening quote (\texttt{«}) or a closing one (\texttt{»}) or
% nothing should be printed by |\frquote{}| at the beginning of
% every parapraph included in a level 1 (outer) quotation.
% This option is also considered for level 2 (inner) quotations
% to decide between \texttt{\guilsinglleft} and
% \texttt{\guilsinglright} when \fbo{InnerGuillSingle=true}
% (see below). \hlabel{everyparguill}
% \item [EveryLineGuill=open, close, none (none)]; with LuaTeX
% based engines \emph{only}, it is possible to set this option
% to \fbo{open} [resp. \fbo{close}]; this ensures that a `«’
% [resp. `»’] followed by a proper space will be inserted at the
% beginning of every line of embedded (inner) quotations
% spreading over more than one line (provided that both outer
% and inner quotations are entered with |\frquote{}|). When
% \fbo{EveryLineGuill=open} or \fbo{=close} the inner quotation is
% always surrounded by « and », the next option is ineffective.
%
% \item [InnerGuillSingle=true (false)];
% if \fbo{InnerGuillSingle=false} (default), inner quotations
% entered with |\frquote{}| start with~\texttt{``} and end
% with~\texttt{’’}.
% If \fbo{InnerGuillSingle=true}, \texttt{\guilsinglleft} and
% \texttt{\guilsinglright} are used instead of British double
% quotes; moreover if option \fbo{EveryParGuill=open} (or
% \fbo{close}) is set, a \texttt{\guilsinglleft} (or
% \texttt{\guilsinglright}) is added at the beginning of every
% parapraph included in the inner quotation.
%
% \item [ThinSpaceInFrenchNumbers=true (false)]; if \pkg{numprint}
% has been loaded with the \opt{autolanguage} option, while
% typesetting numbers with the |\numprint{}| command,
% |\npthousandsep| is defined as a non-breaking space (|~|)%
% \footnote{Actually without stretch nor shrink.} in French;
% when set to true, this option redefines |\npthousandsep|
% as a thin space (|\,|).
%
% \item [SmallCapsFigTabCaptions=false (true*)]; when set to
% \fbo{false}, |\figurename| and |\tablename| will be printed in
% French captions as ``Figure’’ and ``Table’’ instead of being
% printed in small caps (the default). The same result can be
% achieved by defining |\FBfigtabshape| as |\relax| before
% loading \frenchb{} (in a document class f.i.).
%
% \item [CustomiseFigTabCaptions=false (true*)]; when \fbo{false}
% the default separator (colon) is used instead of
% |\CaptionSeparator|. Anyway, \frenchb{} tries hard to insert
% a proper space before it in French and warns if it fails to do
% so.
%
% \item [OldFigTabCaptions=true (false)] is to be used \emph{only}
% when figures’ and tables’ captions must be typeset as with
% pre~3.0 versions of \frenchb{} (with |\CaptionSeparator| in
% French and colon otherwise).
% Intended for standard LaTeX classes only.
%
% \item [FrenchSuperscripts=false (true)]; then
% |\up=\textsuperscript|. % (option added in version 2.1).
% Should only be made \fbo{false} to recompile documents written
% before 2008 without changes: by default |\up| now relies on
% |\fup| designed to produce better looking superscripts.
%
% \item [LowercaseSuperscripts=false (true)]; by default \frenchb{}
% inhibits the uppercasing of superscripts (for instance when
% they are moved to page headers). Making this option
% \fbo{false} will disable this behaviour (not recommended).
%
% \item [SuppressWarning=true (false)]; can be turned to \fbo{true}
% if you are bored with \frenchb’s warnings; use this option as
% \emph{first} option of \fbsetup{} to cancel warnings launched
% by other options.
% \end{description}
%
% \textbf{Options’ order} -- Please remember that options are read
% in the order they appear in the \fbsetup{} command.
% Someone wishing that \frenchb{} leaves the layout of lists
% and footnotes untouched but caring for indentation of first
% paragraph of sections should choose\\
% \fbsetup{StandardLayout,IndentFirst} to get the expected
% layout. The reverse order
% \fbsetup{IndentFirst,StandardLayout} would lead to option
% \fbo{IndentFirst} being overwritten by \fbo{StandardLayout}.
%
% \subsubsection{Caption names}
% \label{sssec-captions-name}
%
% All caption names can easily be customised in French using the
% simplified syntax introduced by \babel~3.9, for instance
% |\def\frenchproofname{Preuve}| or
% |\def\acadianproofname{Preuve}| for the \opt{acadian} dialect.
% The older syntax |\addto\captionsfrench{\def\proofname{Preuve}}|
% still works. Keep in mind that \emph{only} |french| can be used
% to redefine captions, even if \babel{}’s option was entered as
% |frenchb| or |francais|.
%
% \subsubsection{Figure and table captions}
% \label{sssec-captions-fig}
%
% \enlargethispage{-\baselineskip}
% In French, captions in figures and tables should never be printed
% as ‘Figure~1: ’ which is the default in standard LaTeX2e
% classes (a space should \emph{always} preceed a colon in French),
% anyway ‘Figure 1 -- ’ is preferred.
%
% When French is the main language, the default behaviour of
% \frenchb{} is to change the separator (colon) used in figures’ and
% tables’ captions \emph{for all languages} to |\CaptionSeparator|
% which defaults to ` -- ’ and can be redefined in the preamble with
% |\renewcommand*{\CaptionSeparator}{...}|.
% This works for the standard LaTeX2e classes, for the \cls{memoir}
% koma-script and beamer classes.
% In case this procedure fails a warning is issued.
%
% When French is not the main language, the colon is preserved for
% all languages including French but \frenchb{} tries hard to insert
% a proper space before it and warns if it fails to do so.
%
% Three options are provided to customise figure and table captions:
% \begin{itemize}
% \item \fbo{CustomiseFigTabCaptions} is set to \fbo{true} when
% French is the main language (hence separator = ` -- ’) and to
% \fbo{false} otherwise (hence separator = `: ’ with a proper
% space before the colon in French if possible); toogle this option
% if needed;
% \item the second option, \fbo{OldFigTabCaptions}, can be set to
% \fbo{true} to print figures’ and tables’ captions as they were
% with versions pre~3.0 of \frenchb{} (using |\CaptionSeparator|
% in French and colon in other languages); this option only makes
% sense with the standard LaTeX classes \cls{article},
% \cls{report} and \cls{book};
% \item the last option, \fbo{SmallCapsFigTabCaptions}, can be set
% to \fbo{false} to typeset |\figurename| and |\tablename| in
% French as ``Figure’’ and ``Table’’ rather than in small caps
% (the default).
% \end{itemize}
%
% \subsection{Hyphenation checks}
% \label{ssec-hyphen}
%
% Once you have built your format, a good precaution would be to
% perform some basic tests about hyphenation in French.
% For LaTeX2e I suggest this:
% \begin{itemize}
% \item run |pdfLaTeX| on the following file:\\[3mm]^^A\]
% |%%% Test file for French hyphenation.|\\
% |\documentclass[french]{article}|\\
% |\usepackage[utf8]{inputenc} % utf8, what else?|\\
% |\usepackage[T1]{fontenc} % mandatory for French|\\
% |\usepackage{lmodern} % or erewhon, palatino…|\\
% |\usepackage{babel}|\\
% |\begin{document}|\\
% |\showhyphens{signal container \'ev\'enement alg\`ebre}|\\
% |\showhyphens{signal container événement algèbre}|\\
% |\end{document}|
% \item check the hyphenations proposed by \TeX{} in your log-file;
% in French you should get with both 7-bit and 8-bit encodings\\
% \texttt{si-gnal contai-ner évé-ne-ment al-gèbre}.\\
% Do not care about how accented characters are displayed in the
% log-file, what matters is the position of the `|-|’ hyphen
% signs \emph{only}.
% \end{itemize}
% If they are all correct, your installation (probably) works fine,
% if one (or more) is (are) wrong, ask a local wizard to see what’s
% going wrong and perform the test again (or e-mail me about what
% happens).\\
% Frequent mismatches:
% \begin{itemize}
% \item you get |sig-nal con-tainer|, this probably means that the
% hyphenation patterns you are using are for US-English, not for
% French;
% \item you get no hyphen at all in \texttt{évé-ne-ment}, this
% probably means that you are using CM fonts and the macro
% |\accent| to produce accented characters.
% Using 8-bits fonts with built-in accented characters avoids
% this kind of mismatch.
% \end{itemize}
%
% \subsection{Changes}
% \label{ssec-changes}
%
% \subsubsection*{What’s new in version 3.5?}
%
% Version 3.5a offers a new option \fbo{ListItemsAsPar}. The default
% layout of lists is unchanged (for backward compatibility), but
% users should try this new option which ensures a layout of lists
% closer to French typographic standards: see f.i.\ how lists are
% typeset in the book ``Lexique des règles typographiques en usage
% à l’Imprimerie Nationale’’.
%
% Version 3.5b fixes a bug due to wrong |\everypar|’s management in
% |\frquote{}|; it showed up when |\frquote{}| immediately followed
% a sectionning command.
%
% Starting with version 3.5d, a new option \fbo{StandardListSpacing}
% has been added to supersede \fbo{ReduceListSpacing}.
%
% A new command |\NoEveryParQuote| has been added in version 3.5e:
% it is meant to be used inside a group or environment to suppress
% unwanted guillemets (typically when lists are embedded in
% |\frquote{}|).
%
% Version 3.5g fixes a long standing bug affecting LuaTeX: legacy
% kerning was disabled for Type1 fonts since v3.1g (2015).
%
% Version 3.5j also fixes a long standing bug affecting koma-script,
% \cls{memoir} et \cls{beamer} classes: redefintions of the caption
% separator (commands |\captionformat|, |\captiondelim|, etc.) are
% now taken into account properly.
%
% Version 3.5k is a cleanup release:
% \begin{itemize}
% \item the translations in French of |\figurename| and |\tablename|
% no longer hold font changing commands (switch to small caps), the
% font switch has been moved to |\fnum@figure| and |\fnum@table| as
% suggested by Axel Sommerfeldt.
% \item Package \pkg{caption} can now be loaded whether before
% or after \pkg{babel}, indifferently.
% \item |\pdfstringdefDisableCommands| is no longer used: as
% suggested by the LaTeX3 team, all commands requiring special care
% in \pkg{hyperref}’s bookmarks are now defined using
% |\textorpdfstring{}{}|.
% \end{itemize}
%
% \subsubsection*{What’s new in version 3.4?}
%
% Version 3.4a adds a new command |\frenchdate| (see
% p.~\pageref{frenchdate}) and slightly changes number formatting:
% |\FBthousandsep| is now a \textit{kern} instead of a rubber
% length. |\renewcommand*{\FBthousandsep}{~}| will switch back
% to the former (wrong) behaviour.
%
% Both options \opt{french} and \opt{acadian} can now be used
% simultaneously in a document; currently \opt{french} and
% \opt{acadian} are identical, it is up to the user to customise
% \opt{acadian} in terms of hyphenation patterns, captionnames,
% date format or high punctuation and quotes spacing if he/she
% needs a variant for French.
%
% A new command |\FBsetspaces| has been added for easy customising of
% spacing before high punctuation and inside quotes independently for
% \opt{french} and \opt{acadian}, see p.~\pageref{FBsetspaces}.
%
% Version 3.4 requires eTeX and LuaTeX 1.0.4 or newer.
%
% \subsubsection*{What’s new in version 3.3?}
%
% In version~3.3d the automatic insertion of non-breaking spaces
% before the colon character has been improved \emph{with engine
% LuaTeX only}: a spurious space is no longer inserted in strings
% like http://mysite, C:\textbackslash Program Files or 10:55.
% Unfortunately, my attempts to do the same with XeTeX or pdfTeX
% were unsuccessful.
%
% A few internal changes have been made in version~3.3c to improve
% the convertion into HTML of non-breaking spaces added by \frenchb.
% Usage of \exe{lwarp} (v.0.37 and up) is recommended for HTML
% output, it works fine on files compiled with XeLaTeX or pdfLaTeX
% formats.
% A new experimental option \fbo{UnicodeNoBreakSpaces} has been
% added for LuaLaTeX in version~3.3c, see p.~\pageref{ucs-nbsp}.
%
% According to current \babel’s standards, every dialect should
% have it’s own \file{.ldf} file; starting with version~3.3b,
% the main support for French is in \file{french.ldf}, portmanteau
% files \file{frenchb.ldf},\file{francais.ldf}, \file{acadian.ldf}
% and \file{canadien.ldf} have been added. Recommended options are
% \opt{french} or \opt{acadian}, all other are deprecated.
% BTW, options \opt{french} and \opt{acadian} are currently
% strictly identical.
%
% Release 3.3a is compatible with LuaTeX v.~0.95 (TL2016) and up.
% Former skips |\FBcolonskip|, |\FBthinskip| and |\FBguillskip|
% controlling punctuation spacings in LuaTeX have been removed;
% all three engines now rely on the same commands |\FBcolonspace|,
% |\FBthinspace| and |\FBguillspace|.
%
% An alias |\frenchsetup{}| for |\frenchbsetup{}| has been added
% in version 3.3a, it might appear more relevant in the future as
% the language name |frenchb| should vanish.
%
% Further customisation of the |\part{}| command is provided via
% three new commands |\frenchpartfirst|, |\frenchpartsecond| and
% |\frenchpartnameord|.
%
% \subsubsection*{What’s new in version 3.2?}
%
% Version 3.2g changes the default behaviour of |\frquote{}|
% with LuaTeX based engines, the output is now the same with
% all engines; to recover the former behaviour, add option
% \fbo{EveryLineGuill=open}.
%
% The handling of footnotes has been redesigned for the
% \cls{beamer}, \cls{memoir} and koma-script classes.
% The layout of footnotes ``à la française’’ should be unchanged
% but footnotes’ customisations offered by these classes
% (i.e.\ font or color changes) are now available even when option
% \fbo{FrenchFootnotes} is \fbo{true}.
%
% A long standing bug regarding the \pkg{xspace} package has been
% fixed: |\xspace| has been moved up from the internal command
% |\FB@fg| to |\fg|; |\frquote{}| now works properly when the
% \pkg{xspace} package is loaded.
%
% Version 3.2b is the first one designed to work with LuaTeX
% v.~0.95 as included in TeXLive 2016 (LuaTeX’s new glue node
% structure is not compatible with previous versions).
%
% \textbf{Warning to Lua(La)TeX users:} starting with version~3.2b
% the lua code included in \file{frenchb.lua} will \emph{not work}
% on older installations (TL2015 f.i.), so \frenchb{} reverts to
% active characters while handling high punctuation with LuaTeX
% engines older than 0.95!
% The best way to go is to upgrade to TL2016 or equivalent asap.
% Xe(La)TeX and pdf(La)TeX users can safely use \frenchb{} v.~3.2b
% and later on older installations too.
% \enlargethispage*{.5\baselineskip}
%
% Tne internals of commands |\NoAutoSpacing|, |\ttfamilyFB|,
% |\rmfamilyFB| and |\sffamilyFB| have been completely redesigned
% in version~3.2c, they behave now consistently with all engines.
%
% \subsubsection*{What’s new in version 3.1?}
%
% New command |\frquote{}| meant to enter French quotations,
% especially long ones (spreading over several paragraphs) and/or
% embedded ones. see p.~\pageref{frquote} for details.
%
% \subsubsection*{What’s new in version 3.0?}
%
% Many deep changes lead me to step \frenchb’s version number
% to~3.0a:
% \begin{itemize}
% \item \babel{}~3.9 is required now to process
% \file{frenchb.ldf}, this change allows for cleaner definitions
% of dates and captions for the Unicode engines LuaTeX and
% XeTeX and also provides a simpler syntax for end-users, see
% section~\ref{sssec-captions-name}
% p.\pageref{sssec-captions-name}.
% \item \fbsetup{} options management has been completely
% reworked; two new options added.
% \item Canadian French didn’t work as a normal \babel’s dialect,
% it should now; btw. the French language should now be loaded
% as \opt{french}, \emph{not as} \opt{frenchb} or
% \opt{francais} and preferably as a \emph{global} option of
% |\documentclass|. Some tolerance still exists in v3.0, but
% do not rely on it.
% \item \frenchb{} no longer loads \file{frenchb.cfg}:
% customisation should definitely be done using \fbsetup{}
% options.
% \item Description lists labels are now indented; try setting
% |\descindentFB=0pt| (or |\listindentFB=0pt| for all lists)
% in the preamble if you don’t like it.
% \item The last but not least change affects the (recent)
% LuaTeX-based engines, (this means version 0.76 as included in
% TL2013 and up): active characters are no longer used in French
% for `high punctuation’%
% \footnote{The current \frenchb{} version requires LuaTeX
% v.~1.0.4 as included in TL2017, see above.}.
% Functionalities and user interface are unchanged.
%
% Many thanks to Paul Isambert who provided the basis for the
% lua code (see his presentation at GUT’2010) and kindly
% reviewed my first drafts suggesting significant improvements.
%
% \end{itemize}
%
% Starting with version~3.0c, \frenchb{} no longer customises
% lists with the \cls{beamer} class and offers a new option
% (\fbo{INGuillSpace}) to follow French `Imprimerie Nationale’
% recommendations regarding quotes’ spacing.
%
% \StopEventually{}
%
% \changes{v2.6c}{2013/05/20}{Dummy file frenchb.cfg is no longer
% generated from frenchb.dtx.}
%
% \clearpage
% \newgeometry{left=50mm,right=23mm}
%
% \section{The code}
%
% \subsection{Initial setup}
%
% \changes{v2.1d}{2008/05/02}{Argument of \cs{ProvidesLanguage} changed
% above from `french’ to `frenchb’ (otherwise \cs{listfiles} prints
% no date/version information). The real name of current language
% (french) as to be corrected before calling \cs{LdfInit}.}
%
% \changes{v3.0a}{2014/02/28}{Support for options frenchb, francais,
% canadien, acadian changed.}
%
% \changes{v3.0a}{2014/02/19}{\cs{LdfInit} checks \cs{captionsfrench}
% instead of \cs{datefrench} to avoid a conflict with papertex.cls
% which loads datetime.sty.}
%
% \changes{v3.4a}{2018/01/14}{\cs{LdfInit} checks \cs{FBclean@on@exit}
% instead of \cs{captionsfrench} (undefined in PLain).
% Prevents loading french.ldf again with acadian option.}
%
% The macro |\LdfInit| takes care of preventing that this file is
% loaded more than once (even if both options \opt{french} and
% \opt{acadian} are used in the same document), checking the
% category code of the \texttt{@} sign, etc.
%
% \begin{macrocode}
%<*french>
\LdfInit\CurrentOption{FBclean@on@exit}
% \end{macrocode}
%
% \changes{v3.0a}{2014/02/15}{In Plain, provide a substitute for
% \cs{PackageWarning} and \cs{PackageInfo}.}
%
% Let’s provide a substitute for |\PackageError|, |\PackageWarning|
% and |\PackageInfo| not defined in Plain:
% \begin{macrocode}
\def\fb@error#1#2{%
\begingroup
\newlinechar=`\^^J
\def\\{^^J(french.ldf) }%
\errhelp{#2}\errmessage{\\#1^^J}%
\endgroup}
\def\fb@warning#1{%
\begingroup
\newlinechar=`\^^J
\def\\{^^J(french.ldf) }%
\message{\\#1^^J}%
\endgroup}
\def\fb@info#1{%
\begingroup
\newlinechar=`\^^J
\def\\{^^J}%
\wlog{#1}%
\endgroup}
% \end{macrocode}
%
% \changes{v3.4a}{2018/01/04}{babel-french now requires eTeX.}
%
% Quit if eTeX is not available.
% \begin{macrocode}
\let\bbl@tempa\relax
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname eTeXversion\endcsname\relax
\let\bbl@tempa\endinput
\fb@error{babel-french requires eTeX.\\
Aborting here}
{Orignal PlainTeX is not supported,\\
please use LuaTeX or XeTeX engines.}
\fi
\bbl@tempa
% \end{macrocode}
%
% \changes{v3.0c}{2014/03/30}{babel-french requires babel-3.9i.}
%
% Quit if \babel’s version is less than 3.9i.
% \begin{macrocode}
\let\bbl@tempa\relax
\ifdefined\babeltags
\else
\let\bbl@tempa\endinput
\ifdefined\PackageError
\PackageError{french.ldf}
{babel-french requires babel v.3.16.\MessageBreak
Aborting here}
{Please upgrade Babel!}
\else
\fb@error{babel-french requires babel v.3.16.\\
Aborting here}
{Please upgrade Babel!}
\fi
\fi
\bbl@tempa
% \end{macrocode}
%
% \changes{v3.0c}{2014/03/30}{No need to define \cs{l@french} as
% \cs{lang@french}, babel.def (3.9j) takes care for this.}
%
% Make sure that |\l@french| is defined (fallbacks are
% |\l@nohyphenation| if available or~0).
% \file{babel.def} (3.9i and up) defines |\l@<languagename>| also for
% eTeX, LuaTeX and XeTeX formats which set |\lang@<languagename>|.
% \begin{macrocode}
\def\FB@nopatterns{%
\ifdefined\l@nohyphenation
\adddialect\l@french\l@nohyphenation
\edef\bbl@nulllanguage{\string\language=nohyphenation}%
\else
\edef\bbl@nulllanguage{\string\language=0}%
\adddialect\l@french0
\fi
\@nopatterns{French}}
\ifdefined\l@french \else \FB@nopatterns \fi
% \end{macrocode}
%
% Babel’s French language can be loaded with option \opt{acadian}
% which stands for Canadian French.
% If no specific hyphenation patterns are available, Canadian French
% will use the French ones.
%
% \changes{v3.5f}{2019/09/04}{\cs{l@canadien} was defined too early
% in file `canadien.ldf': \cs{l@acadian} might not be defined.}
%
% \begin{macrocode}
\ifdefined\l@acadian
\adddialect\l@canadien\l@acadian
\else
\adddialect\l@acadian\l@french
\adddialect\l@canadien\l@french
\fi
% \end{macrocode}
%
% French uses the standard values of |\lefthyphenmin| (2)
% and |\righthyphenmin| (3); let’s provide their values though,
% as required by \babel.
%
% \begin{macrocode}
\providehyphenmins{french}{\tw@\thr@@}
\providehyphenmins{acadian}{\tw@\thr@@}
% \end{macrocode}
%
%\changes{v2.1d}{2008/05/04}{Avoid warning `\cs{end} occurred
% when \cs{ifx} ... incomplete’ with LaTeX-2.09.}
%
% \begin{macro}{\ifLaTeXe}
% No support is provided for late LaTeX-2.09: issue a warning
% and exit if LaTeX-2.09 is in use. Plain is still supported.
% \begin{macrocode}
\newif\ifLaTeXe
\let\bbl@tempa\relax
\ifdefined\magnification
\else
\ifdefined\@compatibilitytrue
\LaTeXetrue
\else
\PackageError{french.ldf}
{LaTeX-2.09 format is no longer supported.\MessageBreak
Aborting here}
{Please upgrade to LaTeX2e!}
\let\bbl@tempa\endinput
\fi
\fi
\bbl@tempa
% \end{macrocode}
% \end{macro}
%
%\begin{macro}{\ifFBunicode}
% \begin{macro}{\ifFBLuaTeX}
% \begin{macro}{\ifFBXeTeX}
% French hyphenation patterns are now coded in Unicode, see file
% \file{hyph-fr.tex}. XeTeX and LuaTeX engines require some extra
% code to deal with the French ``apostrophe’’.
% Let’s define three new `if’: |\ifFBLuaTeX|, |\ifFBXeTeX| and
% |\ifFBunicode| which will be true for XeTeX and LuaTeX engines
% and false for 8-bits engines.
%
% \changes{v2.4a}{2009/11/23}{Added a new `if’ \cs{FBunicode} and
% some \cs{lccode} definitions to \cs{extrasfrench} and
% \cs{noextrasfrench}.}
%
% \changes{v2.5d}{2011/01/17}{Added two new `if’ \cs{FBXeTeX} and
% \cs{FBLuaTeX} as XeTeX and behave differently regarding the status
% of the French `apostrophe’.}
%
% \changes{v2.6g}{2013/12/15}{lccode values for the French
% `apostrophe’ are now the same for XeTeX and LuaTeX.}
%
% \changes{v3.4c}{2018/02/16}{Reverting to former test, beware of
% \cs{XeTeXrevision} left as \cs{relax} by careless testing.}
%
% \begin{macrocode}
\newif\ifFBunicode
\newif\ifFBLuaTeX
\newif\ifFBXeTeX
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname luatexversion\endcsname\relax
\else
\FBunicodetrue \FBLuaTeXtrue
\fi
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname XeTeXrevision\endcsname\relax
\else
\FBunicodetrue \FBXeTeXtrue
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \changes{v3.3b}{2017/07/08}{New `if’ \cs{ifFBfrench} to replace
% \cs{iflanguage} test which is based on patterns.}
%
% \begin{macro}{\ifFBfrench}
% True when the current language is French or any of its dialects;
% will be set to true by |\extrasfrench| and to false by
% |\noextrasfrench|. Used in |\DecimalMathComma| and
% |frenchsetup{og=«, fg=»}|.
% \begin{macrocode}
\newif\ifFBfrench
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\extrasfrench}
% \changes{v3.0a}{2014/02/18}{Take advantage of babel’s
% \cs{babel@savevariable} to handle apostrophe’s \cs{lccode}.}
%
% \changes{v3.4a}{2018/01/06}{Change \cs{(no)extras}\cs{CurrentOption}
% to \cs{(no)extrasfrench}. \cs{(no)extrasacadian} will be defined
% as \cs{(no)extrasfrench} in file acadian.ldf.}
%
% \begin{macro}{\noextrasfrench}
% The macro |\extrasfrench| will perform all the extra
% definitions needed for the French language.
% The macro |\noextrasfrench| is used to cancel the actions of
% |\extrasfrench|.
%
% In French, character ``apostrophe’’ (U+27 or U+2019) is a letter in
% expressions like |l’ambulance| (French hyphenation patterns provide
% entries for this kind of words). This means that the |\lccode| of
% ``apostrophe’’ has to be non null in French for proper hyphenation
% of those expressions, and has to be reset to null when exiting
% French.
%
% The following code ensures correct hyphenation of words like
% |d’aventure|, |l’utopie|, with all TeX engines (XeTeX, LuaTeX,
% pdfTeX) using \file{hyph-fr.tex} patterns.
%
% \changes{v3.5c}{2018/09/11}{\cs{lccode} of quote 0x27 changed from
% 0x2019 to 0x27 for Unicode engines.}
%
% \begin{macrocode}
\def\extrasfrench{%
\FBfrenchtrue
\babel@savevariable{\lccode"27}%
\lccode"27="27
\ifFBunicode
\babel@savevariable{\lccode"2019}%
\lccode"2019="2019
\fi
}
\def\noextrasfrench{\FBfrenchfalse}
% \end{macrocode}
%
% One more thing |\extrasfrench| needs to do is to make sure that
% ``Frenchspacing’’ is in effect. |\noextrasfrench| will switch
% ``Frenchspacing’’ off again if necessary.
% \begin{macrocode}
\addto\extrasfrench{\bbl@frenchspacing}
\addto\noextrasfrench{\bbl@nonfrenchspacing}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Punctuation}
% \label{ssec-punct}
%
% \changes{v2.5a}{2010/08/10}{Punctation is no longer made active
% with XeTeX-based engines.}
%
% As long as no better solution is available, the `high
% punctuation’ characters (|;| |!| |?| and |:|) have to be made
% |\active| for an automatic control of the amount of space to be
% inserted before them. Both XeTeX and LuaTeX provide an
% alternative to active characters (`XeTeXinterchar’ mechanism and
% LuaTeX’s callbacks).
%
% \changes{v3.0a}{2014/01/10}{New flag \cs{ifFB@luatex@punct} for
% `high punctuation’ management with LuaTeX engines.}
%
% \begin{macro}{\ifFB@active@punct}
% Three internal flags are needed for the three different techniques
% used for `high punctuation’ management.
% \begin{macrocode}
\newif\ifFB@active@punct \FB@active@puncttrue
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ifFB@luatex@punct}
% With LuaTeX, starting with version 1.0.4, callbacks are used to
% get rid of active punctuation. With previous versions, `high
% punctuation’ characters remain active (see below).
% \begin{macrocode}
\newif\ifFB@luatex@punct
\ifFBLuaTeX
\ifnum\luatexversion<100
\ifx\PackageWarning\@undefined
\fb@warning{Please upgrade LuaTeX to version 1.0.4 or above!\\%
babel-french will make high punctuation characters (;:!?)\\%
active with LuaTeX < 1.0.4.}%
\else
\PackageWarning{french.ldf}{Please upgrade LuaTeX
to version 1.0.4 or above!\MessageBreak
babel-french will make high punctuation characters%
\MessageBreak (;:!?) active with LuaTeX < 1.0.4;%
\MessageBreak reported}%
\fi
\else
\FB@luatex@puncttrue\FB@active@punctfalse
\fi
\fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ifFB@xetex@punct}
% For XeTeX, the availability of |\XeTeXinterchartokenstate|
% decides whether the `high punctuation’ characters (|;| |!| |?|
% and |:|) have to be made |\active| or not.
%
% \changes{v3.2b}{2016/04/18}{New counter \cs{FB@nonchar} needed for
% non characters: it’s value will be 4095 for new engines and 255
% for older ones.}
%
% The number of available character classes has been increased from
% 256 to 4096 in XeTeX v.~0.99994, the class for non-characters is
% now 4095 instead of 255.
% \begin{macrocode}
\newcount\FB@nonchar
\newif\ifFB@xetex@punct
\ifdefined\XeTeXinterchartokenstate
\FB@xetex@puncttrue\FB@active@punctfalse
\ifdim\the\XeTeXversion\XeTeXrevision pt<0.99994pt
\FB@nonchar=255 \relax
\else
\FB@nonchar=4095 \relax
\fi
\fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FBguillspace}
% \begin{macro}{\FBcolonspace}
% \begin{macro}{\FBthinspace}
% \changes{v2.5a}{2010/08/10}{Define \cs{FBthinspace} for those who want
% to customise the width of the space before ; and co.}
%
% \changes{v2.6d}{2013/06/19}{Rename \cs{Fthinspace} to
% \cs{FBthinspace} and \cs{Fcolonspace} to \cs{FBcolonspace} to avoid
% a conflict with fournier.sty.}
%
% \changes{v3.1f}{2015/05/31}{\cs{FBthinspace} is no longer a kern but
% a skip (babel-french adds a nobreak penalty before it).}
%
% \changes{v3.2c}{2016/05/14}{Change .16667em to
% .5\cs{fontdimen2}\cs{font} to get in XeTeX and pdfTeX
% the same spacing as in LuaTeX.}
%
% \changes{v3.3a}{2016/04/30}{Skips \cs{FBcolonskip} and
% \cs{FBthinskip} replaced by toks \cs{FBcolonsp} and
% \cs{FBthinsp}.}
%
% These three commands are meant for basic French. Other French
% dialects can use different settings, see below.
% According to the I.N.\ specifications, the `:’ requires an
% inter-word space before it, the other three require just a thin
% space. We define |\FBcolonspace| as |\space| (inter-word space)
% and |\FBthinspace| as an half inter-word space with no shrink nor
% stretch.
% |\FBguillspace| is defined btw. as spacing for French quotes is
% handled together with high punctuation for LuaTeX and XeTeX.
% |\FBguillspace| has been fine tuned by Thierry Bouche to 80\% of an
% inter-word space with reduced stretchability.
% All three are user customisable in the preamble, best using the
% |\FBsetspaces| command described below.
% A penalty will be added before these spaces to prevent line
% breaking.
% \begin{macrocode}
\newcommand*{\FBguillspace}{\hskip .8\fontdimen2\font
plus .3\fontdimen3\font
minus .8\fontdimen4\font \relax}
\newcommand*{\FBcolonspace}{\space}
\newcommand*{\FBthinspace}{\hskip .5\fontdimen2\font \relax}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \changes{v3.3a}{2016/04/30}{Skip \cs{FBguillskip} for LuaTeX
% replaced by toks \cs{FBguillsp}.}
%
% \changes{v3.4a}{2018/01/15}{Toks \cs{FBcolonsp}, \cs{FBthinsp} and
% \cs{FBguillsp} removed.}
%
% \changes{v3.4a}{2018/01/26}{New command \cs{FBsetspaces} to fine tune
% spacing independently in French and in French dialects.}
%
% \begin{macro}{\FBsetspaces}
% This command makes it easy to fine tune |\FBguillspace|,
% |\FBcolonspace| and |\FBthinspace| in French (defaut) or
% independently in a French dialect using the optional argument.
% They are meant for LaTeX2e \emph{only} and can only be used
% in the preamble.
% Four mandatory arguments are expected besides the optional one:
% the first one is a \textit{string} either "guill", "colon", or
% "thin", the last four are decimal numbers specifying
% \textit{width}, \textit{stretch} and \textit{shrink} relative to
% \textit{fontdimens}.\hlabel{FBsetspaces}
% For instance |\FBsetspaces[acadian]{colon}{0.5}{0}{0}| defines
% |\acadianFBcolonspace| as a thinspace which will be used for
% the Acadian dialect only. When used without optional argument or
% with argument `french’, the same command would tune the basic
% |\FBcolonspace| command.
% \begin{macrocode}
\ifLaTeXe
\newcommand*{\FBsetspaces}[5][french]{%
\def\bbl@tempa{french}\def\bbl@tempb{#1}%
\ifx\bbl@tempa\bbl@tempb \def\bbl@tempb{}\fi
\@namedef{\bbl@tempb FB#2space}{\hskip #3\fontdimen2\font
plus #4\fontdimen3\font
minus #5\fontdimen4\font \relax}%
% \end{macrocode}
% With option "acadian", fill the corresponding LuaTeX table.
% All unset values in the "acadian" subtables will be filled
% `AtBeginDocument’ by |\set@glue@table| with the value available
% for "french".
% \begin{macrocode}
\ifFB@luatex@punct
\ifx\bbl@tempb\FB@acadian
\directlua{
FBsp.#2.gl.ac[1] = #3
FBsp.#2.gl.ac[2] = #4
FBsp.#2.gl.ac[3] = #5
if #3 > 0.6 then
FBsp.#2.ch.ac = 0xA0
elseif #3 > 0.2 then
FBsp.#2.ch.ac = 0x202F
else
FBsp.#2.ch.ac = 0x200B
end
}%
\fi
\fi
}
\@onlypreamble\FBsetspaces
\fi
% \end{macrocode}
% \end{macro}
%
% Remember that the \emph{same} |\extrasfrench| command is executed
% when switching to French or to a French dialect (Acadian).
% Acadian and French may share the same patterns (or not), and may
% use different spacing for high punctuation and/or quotes.
% Basically, for pdfLaTeX and XeLaTeX, the spacing is set for French,
% then potentially tuned differently for Acadian.
% LuaTeX relies on an attribute |\FB@dialect| to decide what spacing
% is needed for French or Acadian (see LuaTeX table |FBsp|).
% \hlabel{extrapunct}
% As a rough test on |\languagename| would be unreliable to set the
% value of |\FB@dialect| (see \file{babel.pdf}), we use a trick
% based on |\detokenize|; another option would be to use the
% |\IfLanguageName| command from Oberdiek’s package \file{iflang}.
% \begin{macrocode}
\ifLaTeXe
\addto\extrasfrench{%
\ifFB@luatex@punct
\edef\bbl@tempa{\detokenize\expandafter{\languagename}}%
\edef\bbl@tempb{\detokenize{french}}%
\ifx\bbl@tempa\bbl@tempb \FB@dialect=0 \relax
\else \FB@dialect=1 \relax
\fi
% \end{macrocode}
% When first entering French, we must set the LuaTeX
% tables for French (|\FB@dialect=0|) \emph{before} any dialect
% redefines any |\FB...space| command. Doing this `AtBeginDocument’
% would be too late: if French or a French dialect is the main
% language, |\extrasfrench| has been executed before!
% \begin{macrocode}
\ifdefined\FB@once\else
\set@glue@table{colon}%
\set@glue@table{thin}%
\set@glue@table{guill}%
\def\FB@once{}%
\fi
\fi
% \end{macrocode}
% Any dialect dependent customisation done using
% |\FBsetspaces[|\textit{dialect}|]| command or alike is now
% taken into account: the value of |\FBthinspace| (meant for French,
% i.e.|\FB@dialect=0|) is first saved then changed (for Acadian).
% \begin{macrocode}
\ifcsname\languagename FBthinspace\endcsname
\babel@save\FBthinspace
\renewcommand*{\FBthinspace}{%
\csname\languagename FBthinspace\endcsname}%
\fi
% \end{macrocode}
% Same for |\FBcolonspace|:
% \begin{macrocode}
\ifcsname\languagename FBcolonspace\endcsname
\babel@save\FBcolonspace
\renewcommand*{\FBcolonspace}{%
\csname\languagename FBcolonspace\endcsname}%
\fi
% \end{macrocode}
% And for |\FBguillspace|:
% \begin{macrocode}
\ifcsname\languagename FBguillspace\endcsname
\babel@save\FBguillspace
\renewcommand*{\FBguillspace}{%
\csname\languagename FBguillspace\endcsname}%
\fi
}
\fi
% \end{macrocode}
%
% \changes{v3.2c}{2016/05/14}{Newif \cs{ifFB@spacing} and new commands
% \cs{FB@spacingon}, \cs{FB@spacingoff} to control space tuning in
% French.}
%
% The conditional |\ifFB@spacing| will be used by pdfTeX and XeTeX
% engines to switch on or off space tuning before high punctuation
% and inside French quotes.
% A matching attribute will be defined later for LuaTeX.
% \begin{macrocode}
\newif\ifFB@spacing \FB@spacingtrue
% \end{macrocode}
%
% \begin{macro}{\FB@spacing@off}
% \begin{macro}{\FB@spacing@on}
% Two internal commands to switch on and off all space tuning
% for all six characters `;:!?«»’.
% They will be triggered by user command |\NoAutoSpacing| and by
% font family switching commands |\ttfamilyFB| |\rmfamilyFB| and
% |\sffamilyFB|. These four commands will now behave the same with
% any engine (up to version 3.2b, results were engine dependent).
% \begin{macrocode}
\newcommand*{\FB@spacing@on}{%
\ifFB@luatex@punct
\FB@spacing=1 \relax
\else
\FB@spacingtrue
\fi}
\newcommand*{\FB@spacing@off}{%
\ifFB@luatex@punct
\FB@spacing=0 \relax
\else
\FB@spacingfalse
\fi}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsubsection{Punctuation with LuaTeX}
% \label{sssec-punct-luatex}
%
% \changes{v3.0a}{2014/01/10}{New handling of `high punctuation’
% through callbacks with LuaTeX engines.}
%
% The following part holds specific code for punctuation with modern
% LuaTeX engines, i.e. version 1.0.4 (included in TL2017) or newer.
%
% \changes{v3.0b}{2014/02/13}{Require luatexbase with LaTeX2e in case
% fontspec has not been loaded before babel.}
%
% \changes{v3.0c}{2014/03/26}{Just load luatexbase.sty instead of
% luaotfload.sty with plain formats.}
%
% \changes{v3.1a}{2014/05/30}{Misplaced \cs{fi} for plain formats.}
%
% \changes{v3.1j}{2015/10/16}{Loading luatexbase.sty is no longer
% needed with LaTeX release 2015/10/01 or later.}
%
% \changes{v3.2b}{2016/04/18}{Load ltluatex.tex for plain LuaTeX to
% ensure \cs{newattribute} is defined.}
%
% \changes{v3.2c}{2016/05/14}{New LuaTeX attribute \cs{FB@spacing}.}
%
% \changes{v3.3a}{2017/04/30}{Compatibility code for pre
% 2015/10/01 LaTeX release removed, see ltnews23.tex.}
%
% \changes{v3.4a}{2018/01/15}{New attribute \cs{FB@dialect} for the
% French dialect acadian.}
%
% \begin{macrocode}
\ifFB@luatex@punct
\ifdefined\newluafunction\else
% \end{macrocode}
% This code is for Plain: load \file{ltluatex.tex} if it hasn’t been
% loaded before \babel.
% \begin{macrocode}
\input ltluatex.tex
\fi
% \end{macrocode}
% We define five LuaTeX attributes to control spacing in French
% and/or Acadian for `high punctuation’ and quotes, making sure
% that |\newattribute| is defined.
%
% |\FB@spacing=0| switches off any space tuning both before high
% punctuation characters and inside French quotes (i.e.\ function
% |french_punctuation| doesn’t alter the node list at all).
%
% |\FB@addDPspace=0| switches off automatic insertion of spaces
% before high punctuation characters (but typed spaces are still
% turned into non-breaking thin- or word-spaces).
%
% |\FB@addGUILspace| will be set to~1 by option \fbo{og=«, fg=»},
% thus enabling automatic insertion of proper spaces after `«’ and
% before `»’.
%
% |\FB@ucsNBSP| triggers the replacement of glues by characters, it
% is controlled by option \fbo{UnicodeNoBreakSpaces}.
%
% |\FB@dialect| is 0 for French and 1 for Acadian; its value controls
% which parts of the glue table (|.fr| or |.ac|) are taken into
% account.
% \begin{macrocode}
\newattribute\FB@spacing \FB@spacing=1 \relax
\newattribute\FB@addDPspace \FB@addDPspace=1 \relax
\newattribute\FB@addGUILspace \FB@addGUILspace=0 \relax
\newattribute\FB@ucsNBSP \FB@ucsNBSP=0 \relax
\newattribute\FB@dialect \FB@dialect=0 \relax
\ifLaTeXe
\PackageInfo{french.ldf}{No need for active punctuation
characters\MessageBreak with this version
of LuaTeX!\MessageBreak reported}
\else
\fb@info{No need for active punctuation characters\\
with this version of LuaTeX!}
\fi
% \end{macrocode}
% The next command will be used in the first call of |\extrasfrench|
% to convert |\FBcolonspace|, |\FBthinspace| and |\FBguillspace|
% into a table usable by LuaTeX. This way, any customisation done
% in the preamble (by \fbsetup{}, redefinitions or |\FBsetspaces|
% commands) are taken into account. Values not explicitly set for
% Acadian by |\FBsetspaces[|\textit{acadian}|]| commands are copied
% from the French ones.
% In case parsing by the Lua function |FBget_glue| (defined in file
% \file{frenchb.lua}) fails due to unexpected syntax in |\FB...space|
% the table remains unchanged and a warning is issued.
% The matching space characters for option \fbo{UnicodeNoBreakSpaces}
% are set as word space, thin space or null space according to the
% \textit{width} parameter.
%
% \changes{v3.4a}{2018/01/30}{Lua function token.get\_meaning requires
% LuaTeX 1.0.}
%
% \begin{macrocode}
\newcommand*{\set@glue@table}[1]{%
\directlua {
local s = token.get_meaning("FB#1space")
local t = FBget_glue(s)
if t then
FBsp.#1.gl.fr = t
if not FBsp.#1.gl.ac[1] then
FBsp.#1.gl.ac = t
end
if FBsp.#1.gl.fr[1] > 0.6 then
FBsp.#1.ch.fr = 0xA0
elseif FBsp.#1.gl.fr[1] > 0.2 then
FBsp.#1.ch.fr = 0x202F
else
FBsp.#1.ch.fr = 0x200B
end
if not FBsp.#1.ch.ac then
FBsp.#1.ch.ac = FBsp.#1.ch.fr
end
else
texio.write_nl('term and log', '')
texio.write_nl('term and log',
'*** french.ldf warning: Unexpected syntax in FB#1space,')
texio.write_nl('term and log',
'*** french.ldf warning: LuaTeX table FBsp unchanged.')
texio.write_nl('term and log',
'*** french.ldf warning: Consider using FBsetspaces to ')
texio.write('term and log', 'customise FB#1space.')
texio.write_nl('term and log', '')
end
}%
}
\fi
%</french>
% \end{macrocode}
%
% \begin{macro}{frenchb.lua}
% This is \file{frenchb.lua}. It holds Lua code to deal with `high
% punctuation’ and quotes. This code is based on suggestions from
% Paul Isambert.
%
% First we define two flags to control spacing before French `high
% punctuation’ (thin space or inter-word space).
%
% \changes{v3.1a}{2014/06/16}{Codes 0x13 and 0x14 added for French
% quotes in T1-encoding.}
%
% \changes{v3.3c}{2017/09/07}{Function `get\_glue’ robustified.
% `french\_punctuation’ can insert Unicode characters instead
% of glues.}
%
% \begin{macrocode}
%<*lua>
local FB_punct_thin =
{[string.byte("!")] = true,
[string.byte("?")] = true,
[string.byte(";")] = true}
local FB_punct_thick =
{[string.byte(":")] = true}
% \end{macrocode}
% Managing spacing after `«’ (U+00AB) and before `»’ (U+00BB) can be
% done by the way; we define two flags, |FB_punct_left| for
% characters requiring some space before them and |FB_punct_right|
% for `«’ which must be followed by some space.
% In case LuaTeX is used to output T1-encoded fonts instead of
% OpenType fonts, codes \texttt{0x13} and \texttt{0x14} have to be
% added for `«’ and `»’.
% \begin{macrocode}
local FB_punct_left =
{[string.byte("!")] = true,
[string.byte("?")] = true,
[string.byte(";")] = true,
[string.byte(":")] = true,
[0x14] = true,
[0xBB] = true}
local FB_punct_right =
{[0x13] = true,
[0xAB] = true}
% \end{macrocode}
% Two more flags will be needed to avoid spurious spaces in
% strings like !! ?? or (?)
% \begin{macrocode}
local FB_punct_null =
{[string.byte("!")] = true,
[string.byte("?")] = true,
[string.byte("[")] = true,
[string.byte("(")] = true,
% \end{macrocode}
% or if the user has typed a non-breaking space U+00A0 or U+202F
% (thin) before a `high punctuation’ character: no space
% should be added by \frenchb. Same is true inside French quotes.
% \begin{macrocode}
[0xA0] = true,
[0x202F] = true}
local FB_guil_null =
{[0xA0] = true,
[0x202F] = true}
% \end{macrocode}
% \changes{v3.1g}{2015/06/17}{Node HLIST added; node TEMP added
% for the first node of \cs{hbox}es.}
%
% Local definitions for nodes:
% \begin{macrocode}
local new_node = node.new
local copy_node = node.copy
local node_id = node.id
local HLIST = node_id("hlist")
local TEMP = node_id("temp")
local KERN = node_id("kern")
local GLUE = node_id("glue")
local GLYPH = node_id("glyph")
local PENALTY = node_id("penalty")
local nobreak = new_node(PENALTY)
nobreak.penalty = 10000
local nbspace = new_node(GLYPH)
local insert_node_before = node.insert_before
local insert_node_after = node.insert_after
local remove_node = node.remove
% \end{macrocode}
%
%\changes{v3.4a}{2018/01/26}{Global `FBsp’ table added; local function
% `get\_glue’ changed into global `FBget\_glue’.}
%
% Commands |\FBthinspace|, |\FBcolonspace| and |\FBguillspace| are
% converted `AtBeginDocument’ by the next function |FBget_glue| into
% tables of three values which are fractions of |\fontdimen2|,
% |\fontdimen3| and |\fontdimen4|. \hlabel{lua-scaling}
% If parsing fails due to unexpected syntax, the function returns
% \textit{nil} instead of a table.
% \begin{macrocode}
function FBget_glue(toks)
local t = nil
local f = string.match(toks,
"[^%w]hskip%s*([%d%.]*)%s*[^%w]fontdimen 2")
if f == "" then f = 1 end
if tonumber(f) then
t = {tonumber(f), 0, 0}
f = string.match(toks, "plus%s*([%d%.]*)%s*[^%w]fontdimen 3")
if f == "" then f = 1 end
if tonumber(f) then
t[2] = tonumber(f)
f = string.match(toks, "minus%s*([%d%.]*)%s*[^%w]fontdimen 4")
if f == "" then f = 1 end
if tonumber(f) then
t[3] = tonumber(f)
end
end
elseif string.match(toks, "[^%w]F?B?thinspace") then
t = {0.5, 0, 0}
elseif string.match(toks, "[^%w]space") then
t = {1, 1, 1}
end
return t
end
% \end{macrocode}
% Let’s initialize the global LuaTeX table |FBsp|: it holds the
% characteristics of the glues used in French and Acadian for
% high punctuation and quotes and the corresponding no-breaking
% space characters for option \fbo{UnicodeNoBreakSpaces}.
% \begin{macrocode}
FBsp = {}
FBsp.thin = {}
FBsp.thin.gl = {}
FBsp.thin.gl.fr = {.5, 0, 0} ; FBsp.thin.gl.ac = {}
FBsp.thin.ch = {}
FBsp.thin.ch.fr = 0x202F ; FBsp.thin.ch.ac = nil
FBsp.colon = {}
FBsp.colon.gl = {}
FBsp.colon.gl.fr = { 1, 1, 1} ; FBsp.colon.gl.ac = {}
FBsp.colon.ch = {}
FBsp.colon.ch.fr = 0xA0 ; FBsp.colon.ch.ac = nil
FBsp.guill = {}
FBsp.guill.gl = {}
FBsp.guill.gl.fr = {.8, .3, .8} ; FBsp.guill.gl.ac = {}
FBsp.guill.ch = {}
FBsp.guill.ch.fr = 0xA0 ; FBsp.guill.ch.ac = nil
% \end{macrocode}
% The next function converts the glue table returned by function
% |FBget_glue| into sp for the current font; beware of null values
% for fid, see |\nullfont| in TikZ, and of special fonts like
% lcircle1.pfb for which |font.getfont(fid)| does not return a proper
% font table, in such cases the function returns |nil|.
%
% \changes{v3.1l}{2016/02/13}{font.getfont(fid) possibly
% returns nil even for a positive fid (i.e. AMS lcircle1.pfb).
% Reported by François Legendre.}
%
% \changes{v3.1m}{2016/02/16}{new\_glue\_scaled returns
% nil in case of invalid font table (i.e. lcircle1.pfb). In such
% cases babel-french leaves the node list unchanged.}
%
% \changes{v3.2b}{2016/04/18}{glue\_spec removed;
% starting with LuaTeX 0.95, glue specifications fit in glue.}
%
% \begin{macrocode}
local font_table = {}
local function new_glue_scaled (fid,table)
if fid > 0 and table[1] then
local fp = font_table[fid]
if not fp then
local ft = font.getfont(fid)
if ft then
font_table[fid] = ft.parameters
fp = font_table[fid]
end
end
local gl = new_node(GLUE,0)
if fp then
node.setglue(gl, table[1]*fp.space,
table[2]*fp.space_stretch,
table[3]*fp.space_shrink)
return gl
else
return nil
end
else
return nil
end
end
% \end{macrocode}
% Let’s catch LuaTeX attributes |\FB@spacing|, |\FB@addDPspace|
% and |\FB@addGUILspace|.
% \begin{macrocode}
local FBspacing = luatexbase.attributes['FB@spacing']
local addDPspace = luatexbase.attributes['FB@addDPspace']
local addGUILspace = luatexbase.attributes['FB@addGUILspace']
local FBucsNBSP = luatexbase.attributes['FB@ucsNBSP']
local FBdialect = luatexbase.attributes['FB@dialect']
local has_attribute = node.has_attribute
% \end{macrocode}
% The following function will be added to |kerning| callback.
% It catches all nodes of type |GLYPH| in the list starting at
% |head| and checks the language attributes of the current glyph:
% nothing is done if the current language is not French and only
% specific punctuation characters (those for which |FB_punct_left|
% or |FB_punct_right| is true) need a special treatment.
% In French, local variables are defined to hold the properties of
% the current glyph (|item|) and of the previous one (|prev|) or the
% next one (|next|). Constants |FR_fr| (french) and |FR_ca|
% (acadian) are defined by command |\activate@luatexpunct|.
%
% \changes{v3.1b}{2014/09/16}{Add a check for null fid
% in french\_punctuation (Tikz \cs{nullfont}).
% Bug pointed out by Paul Gaborit.}
%
% \changes{v3.5g}{2020/01/30}{The kerning callback is a bit specific:
% adding code with add\_to\_callback actually deletes the legacy
% kerning as pointed out by Marcel Krüger on SE.}
%
% \changes{v3.5h}{2020/03/28}{Added glues and penalties should inherit
% attributes from the related punctuation character; this is
% mandatory for Lua-UL to underline and highlight them.
% Thanks to Marcel Krüger for providing the fix.}
%
% \changes{v3.5h}{2020/04/10}{Code reorganised for better efficiency.}
%
% \begin{macrocode}
-- Main function (to be added to the kerning callback).
local function french_punctuation (head)
% \end{macrocode}
% Restore the built-in kerning for 8-bits fonts.
% \begin{macrocode}
node.kerning(head)
for item in node.traverse_id(GLYPH, head) do
local lang = item.lang
local char = item.char
% \end{macrocode}
% Skip glyphs not concerned by French kernings.
% \begin{macrocode}
if (lang == FR_fr or lang == FR_ca) and
(FB_punct_left[char] or FB_punct_right[char]) then
local fid = item.font
local attr = item.attr
local FRspacing = has_attribute(item, FBspacing)
FRspacing = FRspacing and FRspacing > 0
local FRucsNBSP = has_attribute(item, FBucsNBSP)
FRucsNBSP = FRucsNBSP and FRucsNBSP > 0
local FRdialect = has_attribute(item, FBdialect)
FRdialect = FRdialect and FRdialect > 0
local SIG = has_attribute(item, addGUILspace)
SIG = SIG and SIG >0
if FRspacing and fid > 0 then
if FB_punct_left[char] then
local prev = item.prev
local prev_id, prev_subtype, prev_char
if prev then
prev_id = prev.id
prev_subtype = prev.subtype
if prev_id == GLYPH then
prev_char = prev.char
end
end
% \end{macrocode}
%
% \changes{v3.0c}{2014/04/18}{Null glues should not trigger space
% insertion before high ponctuation. Bug pointed out by Benoit
% Rivet for the `lstlisting’ environment of the listings package.}
%
% \changes{v3.1c}{2014/10/25}{Previous bug fix for null glues
% (v3.0c) did not work properly. Fixed now (I hope!).
% Pointed out by Jacques André.}
%
% If the previous node is a glue, check its natural width, only
% positive glues (actually glues > 1 sp, for tabular `l’
% columns) are to be replaced by a non-breaking space.
% \begin{macrocode}
local is_glue = prev_id == GLUE
local glue_wd
if is_glue then
glue_wd = prev.width
end
local realglue = is_glue and glue_wd > 1
% \end{macrocode}
%
% \changes{v3.3d}{2017/10/17}{In default mode, for `:’ only, check
% if next node is a glyph or not. If it is, turn the `auto’ flag
% to false (avoids spurious spaces in URLs, MSDOS paths or 10:35).}
%
% For characters for which |FB_punct_thin| or |FB_punct_thick| is
% \emph{true}, the amount of spacing to be typeset before them
% is controlled by commands |\FBthinspace| and |\FBcolonspace|
% respectively.
% Two options: if a space has been typed in before (turned into
% \emph{glue} in the node list), we remove the \emph{glue} and add a
% nobreak penalty and the required \emph{glue}.
% Otherwise (|auto| option), the penalty and the required
% \emph{glue} are inserted if attribute |\FB@addDPspace| is set,
% unless any of these four conditions is met:
% a) node is `:’ and the next one is of type GLYPH (avoids spurious
% spaces in http://mysite, C:\textbackslash{} or 10:35);
% b) the previous character is part of type |FB_punct_null|
% (avoids spurious spaces in strings like |(!)| or |??|);
% c) a null glue (actually <= 1 sp for tabulars, possibly < 0)
% preceeds the punctuation character (for tabulars and listings);
% d) the punctuation character starts a paragraph or an |\hbox{}|.
%
% When option \fbo{UnicodeNoBreakSpaces} is set to \fbo{true},
% a Unicode character U+00A0 or U+202F is inserted instead of
% penalty and glue.
% \begin{macrocode}
if FB_punct_thin[char] or FB_punct_thick[char] then
local SBDP = has_attribute(item, addDPspace)
local auto = SBDP and SBDP > 0
if FB_punct_thick[char] and auto then
local next = item.next
local next_id
if next then
next_id = next.id
end
if next_id and next_id == GLYPH then
auto = false
end
end
if auto then
if (prev_char and FB_punct_null[prev_char]) or
(is_glue and glue_wd <= 1) or
(prev_id == HLIST and prev_subtype == 3) or
(prev_id == TEMP) then
auto = false
end
end
local fbglue
local t
if FB_punct_thick[char] then
if FRdialect then
t = FBsp.colon.gl.ac
nbspace.char = FBsp.colon.ch.ac
else
t = FBsp.colon.gl.fr
nbspace.char = FBsp.colon.ch.fr
end
else
if FRdialect then
t = FBsp.thin.gl.ac
nbspace.char = FBsp.thin.ch.ac
else
t = FBsp.thin.gl.fr
nbspace.char = FBsp.thin.ch.fr
end
end
fbglue = new_glue_scaled(fid, t)
% \end{macrocode}
% In case |new_glue_scaled| fails (returns |nil|) the node list
% remains unchanged.
% \begin{macrocode}
if (realglue or auto) and fbglue then
if realglue then
head = remove_node(head,prev,true)
end
if (FRucsNBSP) then
nbspace.font = fid
nbspace.attr = attr
insert_node_before(head,item,copy_node(nbspace))
else
nobreak.attr = attr
fbglue.attr = attr
insert_node_before(head,item,copy_node(nobreak))
insert_node_before(head,item,copy_node(fbglue))
end
end
% \end{macrocode}
% Let’s consider `»’ now (the only remaining glyph of
% |FB_punct_left| class): we just have to remove any \emph{glue}
% possibly preceeding `»’, then to insert the nobreak penalty and
% the proper \emph{glue} (controlled by |\FBguillspace|).
% This is done only if French quotes have been `activated’ by
% options \fbo{og=«, fg=»} in \fbsetup{} and can be denied locally
% with |\NoAutoSpacing| (this is controlled by the |SIG| flag).
% If either a) the preceding glyph is member of |FB_guil_null|, or
% b) `»’ is the first glyph of an |\hbox{}| or a paragraph, nothing
% is done, this is controlled by the |addgl| flag.
%
% \changes{v3.1a}{2014/06/18}{Added flag addgl which must also be true
% when prev or next is not a char (i.e. \cs{kern}0 in
% «\cs{texttt}\{a\}»).}
%
% \changes{v3.1g}{2015/06/26}{flag addgl set to false for `»’
% at the beginning of an \cs{hbox} or a paragraph or a tabular
% `l’ and `c’ columns.}
%
% \begin{macrocode}
elseif SIG then
local addgl = (prev_char and
not FB_guil_null[prev_char])
or
(not prev_char and
prev_id ~= TEMP and
not (prev_id == HLIST and
prev_subtype == 3)
)
% \end{macrocode}
% Correction for tabular `c’ (glue 0 plus 1 fil) and `l’ (glue 1sp)
% columns:
% \begin{macrocode}
if is_glue and glue_wd <= 1 then
addgl = false
end
local t = FBsp.guill.gl.fr
nbspace.char = FBsp.guill.ch.fr
if FRdialect then
t = FBsp.guill.gl.ac
nbspace.char = FBsp.guill.ch.ac
end
local fbglue = new_glue_scaled(fid, t)
if addgl and fbglue then
if is_glue then
head = remove_node(head,prev,true)
end
if (FRucsNBSP) then
nbspace.font = fid
nbspace.attr = attr
insert_node_before(head,item,copy_node(nbspace))
else
nobreak.attr = attr
fbglue.attr = attr
insert_node_before(head,item,copy_node(nobreak))
insert_node_before(head,item,copy_node(fbglue))
end
end
end
% \end{macrocode}
% Similarly, for `«’ (unique member of the |FB_punct_right| class):
% unless either a) the next glyph is member of |FB_guil_null|, or
% b) `«’ is the last glyph of an |\hbox{}| or a paragraph (then the
% |addgl| flag is false, nothing is done), we remove any \emph{glue}
% possibly following it and insert first the proper \emph{glue} then
% a nobreak penalty so that finally the penalty preceeds the
% \emph{glue}.
%
% \changes{v3.1a}{2014/06/18}{Look ahead when next is a kern
% (i.e. in « \cs{texttt}\{a\} »).}
%
% \changes{v3.1g}{2015/06/26}{Flag addgl set to false for
% `«’ at the end of an \cs{hbox} or a paragraph or when followed by
% a null glue (i.e. springs).}
%
% \begin{macrocode}
elseif SIG then
local next = item.next
local next_id, next_subtype, next_char, nextnext, kern_wd
if next then
next_id = next.id
next_subtype = next.subtype
if next_id == GLYPH then
next_char = next.char
% \end{macrocode}
% A |kern0| might hide a |glue|, so look ahead if |next| is a kern
% (this occurs with |« \texttt{a} »|):
% \begin{macrocode}
elseif next_id == KERN then
kern_wd = next.kern
if kern_wd == 0 then
nextnext = next.next
if nextnext then
next = nextnext
next_id = nextnext.id
next_subtype = nextnext.subtype
if next_id == GLYPH then
next_char = nextnext.char
end
end
end
end
end
local is_glue = next_id == GLUE
if is_glue then
glue_wd = next.width
end
local addgl = (next_char and not FB_guil_null[next_char])
or (next and not next_char)
% \end{macrocode}
% Correction for tabular `c’ columns. For `r’ columns, a final
% `«’ character needs to be coded as |\mbox{«}| for proper spacing
% (|\NoAutoSpacing| is another option).
% \begin{macrocode}
if is_glue and glue_wd == 0 then
addgl = false
end
local fid = item.font
local t = FBsp.guill.gl.fr
nbspace.char = FBsp.guill.ch.fr
if FRdialect then
t = FBsp.guill.gl.ac
nbspace.char = FBsp.guill.ch.ac
end
local fbglue = new_glue_scaled(fid, t)
if addgl and fbglue then
if is_glue then
head = remove_node(head,next,true)
end
if (FRucsNBSP) then
nbspace.font = fid
nbspace.attr = attr
insert_node_after(head, item, copy_node(nbspace))
else
nobreak.attr = attr
fbglue.attr = attr
insert_node_after(head, item, copy_node(fbglue))
insert_node_after(head, item, copy_node(nobreak))
end
end
end
end
end
end
return head
end
return french_punctuation
%</lua>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FB@luatex@punct@french}
% As a language tag is part of glyph nodes in LuaTeX, no more
% switching has to be done in |\extrasfrench|, setting the dialect
% attribute has already be done (see above, p.~\pageref{extrapunct}).
% We will just redefine |\shorthandoff| and |\shorthandon| in French
% to issue a warning reminding the user that active characters are no
% longer used in French with recent LuaTeX engines.
%
% \changes{v3.1l}{2016/02/07}{Use \cs{babel@save} to save and restore
% \cs{shorthandon} and \cs{shorthandoff}.}
%
% \begin{macrocode}
%<*french>
\ifFB@luatex@punct
\newcommand*{\FB@luatex@punct@french}{%
\babel@save\shorthandon
\babel@save\shorthandoff
\def\shorthandoff##1{%
\ifx\PackageWarning\@undefined
\fb@warning{\noexpand\shorthandoff{;:!?} is helpless with
LuaTeX,\\ use \noexpand\NoAutoSpacing
*inside a group* instead.}%
\else
\PackageWarning{french.ldf}{\protect\shorthandoff{;:!?}
is helpless with LuaTeX,\MessageBreak
use \protect\NoAutoSpacing \space *inside a group*
instead;\MessageBreak reported}%
\fi}%
\def\shorthandon##1{}%
}
\addto\extrasfrench{\FB@luatex@punct@french}
% \end{macrocode}
% \end{macro}
%
% \changes{v3.0b}{2014/02/13}{frenchb.lua was not found by
% Lua function dofile (not kpathsea aware).
% Call function kpse.find\_file first, as suggested by Paul Gaborit.}
%
% \changes{v3.1g}{2015/06/17}{Lua function french\_punctuation is now
% inserted at the end of the `kerning’ callback (no priority)
% instead of `hpack\_filter’ and `pre\_linebreak\_filter’.}
%
% The next definition will be used to activate Lua punctuation: it
% loads \file{frenchb.lua} and adds function |french_punctuation|
% to the |kerning| callback; "adding" anything actually disables
% the built-in kerning for Type1 fonts (which is now added to
% |french_punctuation|).
% \begin{macrocode}
\def\activate@luatexpunct{%
\directlua{%
FR_fr = \the\l@french ; FR_ca = \the\l@acadian ;
local path = kpse.find_file("frenchb.lua", "lua")
if path then
local f = dofile(path)
luatexbase.add_to_callback("kerning",
f, "frenchb.french_punctuation")
else
texio.write_nl('')
texio.write_nl('*****************************')
texio.write_nl('Error: frenchb.lua not found.')
texio.write_nl('*****************************')
texio.write_nl('')
end
}%
}
\fi
% \end{macrocode}
% End of specific code for punctuation with LuaTeX engines.
%
% \subsubsection{Punctuation with XeTeX}
% \label{sssec-punct-xetex}
%
% If |\XeTeXinterchartokenstate| is available, we use the
% ``inter char’’ mechanism to provide correct spacing in French
% before the four characters |;| |!| |?| and |:|. The basis of the
% following code was borrowed from the \pkg{polyglossia} package,
% see \file{gloss-french.ldf}. We use the same mechanism for French
% quotes (\texttt{«} and \texttt{»}), when automatic spacing for
% quotes is required by options \fbo{og=«} and \fbo{fg=»} in
% \fbsetup{} (see section~\ref{ssec-keyval}).
%
% The default value for |\XeTeXcharclass| is 0 for characters tokens
% and |\FB@nonchar| for all other tokens (glues, kerns, math and box
% boundaries, etc.).
% These defaults should not be changed otherwise the spacing before
% the `high punctuation’ characters and inside quotes might not be
% correct.
%
% We switch |\XeTeXinterchartokenstate| to 1 and change the
% |\XeTeXcharclass| values of |;| |!| |?| |:| |(| |]|
% \texttt{«} and \texttt{»} when
% entering French. Special care is taken to restore them to their
% inital values when leaving French.
%
% \changes{v2.5d}{2011/01/19}{Moved the \cs{newcount} command outside
% \cs{ifFB@xetex@punct} ... \cs{fi} (it broke Plain formats).}
%
% \changes{v3.1g}{2015/06/14}{Use Babel defined loops \cs{bbl@for}
% instead of \cs{@for} borrowed from file ltcntrl.dtx
% (\cs{@for} is undefined in Plain).}
%
% The following part holds specific code for punctuation with XeTeX
% engines.
%
% \begin{macrocode}
\ifFB@xetex@punct
\ifLaTeXe
\PackageInfo{french.ldf}{No need for active punctuation
characters\MessageBreak with this
version of XeTeX!\MessageBreak reported}
\else
\fb@info{No need for active punctuation characters\\
with this version of XeTeX!}
\fi
% \end{macrocode}
%
% \changes{v2.5i}{2012/04/20}{Temporary fix: as long as
% \file{xeCJK.sty} will not use \cs{newXeTeXintercharclass} to
% allocate its classes, we will have to define 3 fake classes.}
%
% \changes{v2.5j}{2012/05/08}{Previous fix removed: bug fixed in
% \file{xeCJK.sty} version 3.0.4 (06-May-2012).}
%
% \changes{v2.6g}{2013/12/09}{U+00A0 (Unicode nobreakspace) and U+202F
% (Unicode nobreakthinspace) added to class \cs{FB@punctnul}
% to prevent frenchb from adding it’s own space before `high
% punctuation’ characters.}
%
% \changes{v2.6h}{2014/01/03}{New class \cs{FB@guilnul} for characters
% U+00A0 (Unicode nobreakspace) and U+202F (Unicode
% nobreakthinspace), to prevent frenchb from adding spurious spaces
% inside quotes.}
%
% Six new character classes are defined for \frenchb.
% \begin{macrocode}
\newXeTeXintercharclass\FB@punctthick
\newXeTeXintercharclass\FB@punctthin
\newXeTeXintercharclass\FB@punctnul
\newXeTeXintercharclass\FB@guilo
\newXeTeXintercharclass\FB@guilf
\newXeTeXintercharclass\FB@guilnul
% \end{macrocode}
%
% \changes{v3.1l}{2016/02/07}{Add a variant of \cs{babel@savevariable}
% to save \cs{XeTeXcharclass}(es) in a loop.}
%
% As |\babel@savevariable| doesn’t work inside a |\bbl@for| loop,
% we define a variant to save the |\XeTeXcharclass| values which
% will be modified in French.
% \begin{macrocode}
\def\FBsavevariable@loop#1#2{\begingroup
\toks@\expandafter{\originalTeX #1}%
\edef\x{\endgroup
\def\noexpand\originalTeX{\the\toks@ #2=\the#1#2\relax}}%
\x}
% \end{macrocode}
% |\FB@charlist| holds the all list of characters which have their
% |\XeTeXcharclass| value modified in French: the first set includes
% high punctuation, French quotes, opening delimiters and no-break
% spaces \\[5pt]
% \begin{tabular}{*{10}{|c}|}\hline
% "21 &"3A &"3B &"3F &"AB &"BB &"28 &"5B &"A0 &"202F
% \\ \hline
% \char"21 &\char"3A &\char"3B &\char"3F & « & »
% &\char"28 &\char"5B & & \\ \hline
% \end{tabular}\\[5pt]
% the second one holds those which need resetting in French when
% \file{xeCJK.sty} is in use\\[5pt]
% \begin{tabular}{*{12}{|c}|}\hline
% "29 &"5D &"7B &"7D &"2C &"2D &"2E &"22 &"25 &"27 &"60 &"2019
% \\ \hline
% \char"29 &\char"5D &\char"7B &\char"7D &\char"2C &\char"2D
% &\char"2E &\char"22 &\char"25 &\textquotesingle &\char"60
% &\char"27 \\ \hline
% \end{tabular}
%
% \begin{macrocode}
\def\FB@charlist{"21,"3A,"3B,"3F,"AB,"BB,"28,"5B,"A0,"202F,%
"29,"5D,"7B,"7D,"2C,"2D,"2E,"22,"25,"27,"60,"2019}
% \end{macrocode}
%
% \begin{macro}{\FB@xetex@punct@french}
% The following command will be executed when entering French, it
% first saves the values to be modified, then fits them to our
% needs. It also redefines |\shorthandoff| and |\shorthandon|
% (locally) to avoid error messages with XeTeX-based engines.
%
% \changes{v2.5g}{2011/12/31}{XeTeXcharclass(es) for French quotes will
% be set to \cs{FB@guilo} and \cs{FB@guilf} by options
% `og’ and `fg’ in \cs{frenchbsetup}. French quotes should behave
% as normal characters by default in XeLaTeX as in LaTeX.}
%
% \changes{v2.5i}{2012/04/20}{\file{xeCJK.sty} changes the
% \cs{XeTeXcharclass} of ASCII chars `-’ `,’ `.’ `)’ `]’ `\}’
% `\{’ `\%’ opening and closing single and double quotes.
% We set their class to 0 in French and reset their class
% to their original value when leaving French. See
% \cs{FB@xetex@punct@nonfrench} below.}
%
% \changes{v3.1k}{2015/12/05}{Thin glues (less than 1sp) should not
% trigger space insertion before high ponctuation. Add a check on
% \cs{lastkip}.}
%
% \changes{v3.1l}{2016/02/07}{Save and restore
% \cs{XeTeXinterchartokenstate}, \cs{shorthandon}, \cs{shorthandoff}
% using \cs{babel@savevariable} and \cs{babel@save},
% \cs{XeTeXcharclass}(es) using \cs{FB@savevariable@loop}.}
%
% \changes{v3.2c}{2016/05/14}{Switch \cs{ifFB@spacing} added to all
% \cs{XeTeXinterchartoks} commands.}
%
% \begin{macrocode}
\newcommand*{\FB@xetex@punct@french}{%
\babel@savevariable{\XeTeXinterchartokenstate}%
\babel@save{\shorthandon}%
\babel@save{\shorthandoff}%
\bbl@for\FB@char\FB@charlist
{\FBsavevariable@loop{\XeTeXcharclass}{\FB@char}}%
\def\shorthandoff##1{%
\ifx\PackageWarning\@undefined
\fb@warning{\noexpand\shorthandoff{;:!?} is helpless with
XeTeX,\\ use \noexpand\NoAutoSpacing
*inside a group* instead.}%
\else
\PackageWarning{french.ldf}{\protect\shorthandoff{;:!?}
is helpless with XeTeX,\MessageBreak
use \protect\NoAutoSpacing\space *inside a group*
instead;\MessageBreak reported}%
\fi}%
\def\shorthandon##1{}%
% \end{macrocode}
% Let’s now set the classes and interactions between classes.
% When false, the flag |\ifFB@spacing| switches off any interaction
% between classes (this flag is controlled by user-level command
% |\NoAutoSpacing|; this flag is also set to false when the current
% font is a typewriter font).
% \begin{macrocode}
\XeTeXinterchartokenstate=1
\XeTeXcharclass `\: = \FB@punctthick
\XeTeXinterchartoks \z@ \FB@punctthick = {%
\ifFB@spacing\ifhmode\FDP@colonspace\fi\fi}%
\XeTeXinterchartoks \FB@guilf \FB@punctthick = {%
\ifFB@spacing\FDP@colonspace\fi}%
% \end{macrocode}
% Small glues such as ``glue 1sp’’ in tabular `l’ columns or ``glue
% 0 plus 1 fil’’ in tabular `c’ columns or \env{lstlisting}
% environment should not trigger any extra space; they will still do
% when \fbo{AutoSpacePunctuation} is true:
% |\XeTeXcharclass=\FB@nonchar| isn’t specific to glue tokens (this
% class includes box and math boundaries f.i.), so the |\else| part
% cannot be omitted.
% \begin{macrocode}
\XeTeXinterchartoks \FB@nonchar \FB@punctthick = {%
\ifFB@spacing
\ifhmode
\ifdim\lastskip>1sp
\unskip\penalty\@M\FBcolonspace
\else
\FDP@colonspace
\fi
\fi
\fi}%
\bbl@for\FB@char
{`\;,`\!,`\?}%
{\XeTeXcharclass\FB@char=\FB@punctthin}%
\XeTeXinterchartoks \z@ \FB@punctthin = {%
\ifFB@spacing\ifhmode\FDP@thinspace\fi\fi}%
\XeTeXinterchartoks \FB@guilf \FB@punctthin = {%
\ifFB@spacing\FDP@thinspace\fi}%
\XeTeXinterchartoks \FB@nonchar \FB@punctthin = {%
\ifFB@spacing
\ifhmode
\ifdim\lastskip>1sp
\unskip\penalty\@M\FBthinspace
\else
\FDP@thinspace
\fi
\fi
\fi}%
\XeTeXinterchartoks \FB@guilo \z@ = {%
\ifFB@spacing\FB@guillspace\fi}%
\XeTeXinterchartoks \FB@guilo \FB@nonchar = {%
\ifFB@spacing\FB@guillspace\ignorespaces\fi}%
\XeTeXinterchartoks \z@ \FB@guilf = {%
\ifFB@spacing\FB@guillspace\fi}%
\XeTeXinterchartoks \FB@punctthin \FB@guilf = {%
\ifFB@spacing\FB@guillspace\fi}%
\XeTeXinterchartoks \FB@nonchar \FB@guilf = {%
\ifFB@spacing\unskip\FB@guillspace\fi}%
% \end{macrocode}
% This will avoid spurious spaces in (!), [?] and with Unicode
% non-breaking spaces (U+00A0, U+202F):
% \begin{macrocode}
\bbl@for\FB@char
{`\[,`\(,"A0,"202F}%
{\XeTeXcharclass\FB@char=\FB@punctnul}%
% \end{macrocode}
% These characters have their class changed by \file{xeCJK.sty},
% let’s reset them to 0 in French.
% \begin{macrocode}
\bbl@for\FB@char
{`\{,`\,,`\.,`\-,`\),`\],`\},`\%,"22,"27,"60,"2019}%
{\XeTeXcharclass\FB@char=\z@}%
}
\addto\extrasfrench{\FB@xetex@punct@french}
% \end{macrocode}
% \end{macro}
%
% End of specific code for punctuation with modern XeTeX engines.
% \begin{macrocode}
\fi
% \end{macrocode}
%
% \subsubsection{Punctuation with standard (pdf)TeX}
% \label{sssec-punct-tex}
%
% \changes{v3.5j}{2020/07/02}{For memoir, koma-script and beamer
% captions, \cs{FB@std@sep} has to be defined before activating
% the colon.}
%
% In standard (pdf)TeX we need to make the four characters |;| |!| |?|
% and |:| `active’ and provide their definitions. \hlabel{ifFB@koma}
% Before doing so, we have to save some definitions involving |:|.
% \begin{macrocode}
\newif\ifFB@koma
\ifLaTeXe
\@ifclassloaded{scrartcl}{\FB@komatrue}{}
\@ifclassloaded{scrbook}{\FB@komatrue}{}
\@ifclassloaded{scrreprt}{\FB@komatrue}{}
\ifFB@koma\def\FB@std@capsep{:\ }\fi
\@ifclassloaded{beamer}{\def\FB@std@capsep{:\ }}{}
\@ifclassloaded{memoir}{\def\FB@std@capsep{: }}{}
\fi
% \end{macrocode}
% \begin{macrocode}
\ifFB@active@punct
\initiate@active@char{:}%
\initiate@active@char{;}%
\initiate@active@char{!}%
\initiate@active@char{?}%
% \end{macrocode}
% We first tune the amount of space before \texttt{;}
% \texttt{!} \texttt{?} and \texttt{:}. This should only happen
% in horizontal mode, hence the test |\ifhmode|.
%
% In horizontal mode, if a space has been typed before `;’ we
% remove it and put a non-breaking |\FBthinspace| instead.
% If no space has been typed, we add |\FDP@thinspace| which will be
% defined, up to the user’s wishes, as a non-breaking |\FBthinspace|
% or as |\@empty|.
%
% \changes{v3.1k}{2015/12/05}{(pdfTeX shorthands) test on \cs{lastskip}
% changed from 0pt to 1sp for active punctuation for consistency
% with XeTeX and LuaTeX.}
%
% \changes{v3.2c}{2016/05/14}{Switch \cs{ifFB@spacing} added to the
% four French shorthands.}
%
% \begin{macrocode}
\declare@shorthand{french}{;}{%
\ifFB@spacing
\ifhmode
\ifdim\lastskip>1sp
\unskip\penalty\@M\FBthinspace
\else
\FDP@thinspace
\fi
\fi
\fi
% \end{macrocode}
% Now we can insert a |;| character.
% \begin{macrocode}
\string;}
% \end{macrocode}
% The next three definitions are very similar.
% \begin{macrocode}
\declare@shorthand{french}{!}{%
\ifFB@spacing
\ifhmode
\ifdim\lastskip>1sp
\unskip\penalty\@M\FBthinspace
\else
\FDP@thinspace
\fi
\fi
\fi
\string!}
\declare@shorthand{french}{?}{%
\ifFB@spacing
\ifhmode
\ifdim\lastskip>1sp
\unskip\penalty\@M\FBthinspace
\else
\FDP@thinspace
\fi
\fi
\fi
\string?}
\declare@shorthand{french}{:}{%
\ifFB@spacing
\ifhmode
\ifdim\lastskip>1sp
\unskip\penalty\@M\FBcolonspace
\else
\FDP@colonspace
\fi
\fi
\fi
\string:}
% \end{macrocode}
% When the active characters appear in an environment where their
% French behaviour is not wanted they should give an `expected’
% result. Therefore we define shorthands at system level as well.
% \begin{macrocode}
\declare@shorthand{system}{:}{\string:}
\declare@shorthand{system}{!}{\string!}
\declare@shorthand{system}{?}{\string?}
\declare@shorthand{system}{;}{\string;}
% \end{macrocode}
% We specify that the French group of shorthands should be used when
% switching to French.
% \begin{macrocode}
\addto\extrasfrench{\languageshorthands{french}%
% \end{macrocode}
% These characters are `turned on’ once, later their definition may
% vary. Don’t misunderstand the following code: they keep being
% active all along the document, even when leaving French.
% \begin{macrocode}
\bbl@activate{:}\bbl@activate{;}%
\bbl@activate{!}\bbl@activate{?}%
}
\addto\noextrasfrench{%
\bbl@deactivate{:}\bbl@deactivate{;}%
\bbl@deactivate{!}\bbl@deactivate{?}%
}
\fi
% \end{macrocode}
%
% \subsubsection{Punctuation switches common to all engines}
% \label{sssec-punct-switches}
%
% A new `if’ |\ifFBAutoSpacePunctuation| needs to be defined now to
% control the two possible ways of dealing with `high punctuation’.
% it’s default value is true, but it can be set to false by
% \fbsetup{AutoSpacePunctuation=false} for finer control.
% \begin{macrocode}
\newif\ifFBAutoSpacePunctuation \FBAutoSpacePunctuationtrue
% \end{macrocode}
%
% \begin{macro}{\AutoSpaceBeforeFDP}
% \begin{macro}{\NoAutoSpaceBeforeFDP}
%
% \changes{v2.3a}{2008/10/10}{\cs{NoAutoSpaceBeforeFDP} and
% \cs{AutoSpaceBeforeFDP} now set the flag
% \cs{ifFBAutoSpacePunctuation} accordingly (LaTeX only).}
%
% \changes{v2.3e}{2009/10/10}{Execute \cs{AutoSpaceBeforeFDP}
% also in LaTeX to define \cs{FDP@colonspace}: needed for
% tex4ht, pointed out by MPG.}
%
% {\sloppypar |\autospace@beforeFDP| and |\noautospace@beforeFDP| are
% internal commands. |\autospace@beforeFDP| defines |\FDP@thinspace|
% and |\FDP@colonspace| as non-breaking spaces and sets LuaTeX
% attribute |\FB@addDPspace| to 1 (true), while
% |\noautospace@beforeFDP| lets these spaces empty and sets flag
% |\FB@addDPspace| to 0 (false). User commands |\AutoSpaceBeforeFDP|
% and |\NoAutoSpaceBeforeFDP| do the same and take care of the flag
% |\ifFBAutoSpacePunctuation| in \LaTeX{}.\par}
%
% Set the default now for Plain (done later for LaTeX).
% \begin{macrocode}
\def\autospace@beforeFDP{%
\ifFB@luatex@punct\FB@addDPspace=1 \fi
\def\FDP@thinspace{\penalty\@M\FBthinspace}%
\def\FDP@colonspace{\penalty\@M\FBcolonspace}}
\def\noautospace@beforeFDP{%
\ifFB@luatex@punct\FB@addDPspace=0 \fi
\let\FDP@thinspace\@empty
\let\FDP@colonspace\@empty}
\ifLaTeXe
\def\AutoSpaceBeforeFDP{\autospace@beforeFDP
\FBAutoSpacePunctuationtrue}
\def\NoAutoSpaceBeforeFDP{\noautospace@beforeFDP
\FBAutoSpacePunctuationfalse}
\AtEndOfPackage{\AutoSpaceBeforeFDP}
\else
\let\AutoSpaceBeforeFDP\autospace@beforeFDP
\let\NoAutoSpaceBeforeFDP\noautospace@beforeFDP
\AutoSpaceBeforeFDP
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \changes{v2.3a}{2008/10/10}{In LaTeX, frenchb no longer adds spaces
% before `high punctuation’ characters in computer code.
% Suggested by Yannis Haralambous.}
%
% \begin{macro}{\rmfamilyFB}
% \begin{macro}{\sffamilyFB}
% \begin{macro}{\ttfamilyFB}
%
% \changes{v2.3c}{2009/02/07}{Commands \cs{ttfamily}, \cs{rmfamily}
% and \cs{sffamily} have to be robust. Bug introduced in 2.3a,
% pointed out by Manuel Pégourié-Gonnard.}
%
% In LaTeX2e |\ttfamily| (and hence |\texttt|) will be redefined
% `AtBeginDocument’ as |\ttfamilyFB| so that no space
% is added before the four |; : ! ?| characters, even if
% \fbo{AutoSpacePunctuation} is \fbo{true}. When
% \fbo{AutoSpacePunctuation} is \fbo{false}, the eventually typed
% spaces are left unchanged (not turned into thin spaces, no penalty
% added). |\rmfamily| and |\sffamily| need to be redefined also
% (|\ttfamily| is not always used inside a group, its effect can be
% cancelled by |\rmfamily| or |\sffamily|).
%
% These redefinitions can be canceled if necessary, for instance to
% recompile older documents, see option \fbo{OriginalTypewriter}
% below.
%
% \changes{v2.4c}{2010/05/23}{In \cs{ttfamilyFB}, also cancel
% automatic spaces inside French guillemets entered as characters
% (see \cs{frenchbsetup}).}
%
% \changes{v3.2c}{2016/05/14}{New definitions of \cs{ttfamilyFB} and
% co, common to all engines, based on \cs{FB@spacing@off}
% and\cs{FB@spacing@on}.}
%
% To be consistent with what is done for the |; : ! ?|
% characters, |\ttfamilyFB| also switches off insertion of spaces
% inside French guillemets \emph{when they are typed in as
% characters} with the `og’/`fg’ options in \fbsetup{}.
% This is also a workaround for the weird behaviour of these
% characters in verbatim mode.
%
% \begin{macrocode}
\ifLaTeXe
\DeclareRobustCommand\ttfamilyFB{\FB@spacing@off \ttfamilyORI}
\DeclareRobustCommand\rmfamilyFB{\FB@spacing@on \rmfamilyORI}
\DeclareRobustCommand\sffamilyFB{\FB@spacing@on \sffamilyORI}
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \changes{v2.5a}{2010/08/14}{New command \cs{NoAutoSpacing},
% suggested by MPG.}
%
% \begin{macro}{\NoAutoSpacing}
% The following command disables automatic spacing for high
% punctuation and French quote characters; it also switches off
% active punctuation characters (if any).
% It is engine independent (works for TeX, LuaTeX and
% XeTeX based engines) and is meant to be used inside a group.
%
% \changes{v3.2b}{2016/04/18}{\cs{NoAutoSpacing} made robust.}
%
% \changes{v3.2c}{2016/05/14}{New definition based on
% \cs{FB@spacing@off} common to all engines.}
%
% \begin{macrocode}
\DeclareRobustCommand*{\NoAutoSpacing}{%
\FB@spacing@off
\ifFB@active@punct\shorthandoff{;:!?}\fi
}
% \end{macrocode}
% \end{macro}
%
% \subsection{Commands for French quotation marks}
% \label{ssec-quotes}
%
% \begin{macro}{\guillemotleft}
% \begin{macro}{\guillemotright}
% \begin{macro}{\textquoteddblleft}
% \begin{macro}{\textquoteddblright}
% pdfLaTeX users are supposed to use 8-bit output
% encodings (T1, LY1,…) to typeset French, those who still
% stick to OT1 should load \pkg{aeguill} or a similar package.
% In both cases the commands |\guillemotleft| and |\guillemotright|
% will print the French opening and closing quote characters from
% the output font.
% For XeLaTeX and LuaLaTeX, |\guillemotleft| and |\guillemotright|
% are defined by package \pkg{fontspec} (v.~2.5d and up).
%
% \changes{v2.5a}{2010/08/20}{Change \cs{guillemotleft} and
% \cs{guillemotright} definitions for Unicode anf provide
% definitions for \cs{textquotedblleft} and
% \cs{textquotedbright}. Insures correct printing of quotes
% by \cs{og} and \cs{fg} in French and outside.}
%
% We provide the following definitions for non-LaTeX users only as
% fall-back, they are welcome to change them for anything better.
% \begin{macrocode}
\ifLaTeXe
\else
\ifFBunicode
\def\guillemotleft{{\char"00AB}}
\def\guillemotright{{\char"00BB}}
\def\textquotedblleft{{\char"201C}}
\def\textquotedblright{{\char"201D}}
\else
\def\guillemotleft{\leavevmode\raise0.25ex
\hbox{$\scriptscriptstyle\ll$}}
\def\guillemotright{\raise0.25ex
\hbox{$\scriptscriptstyle\gg$}}
\def\textquotedblleft{``}
\def\textquotedblright{''}
\fi
\let\xspace\relax
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \changes{v3.4a}{2018/01/18}{New \cs{FBgspchar} to customise the
% space character to be used for \cs{og} and\cs{fg} with the
% UnicodeNoBreakSpaces option.}
%
% \begin{macro}{\FBgspchar}
% \begin{macro}{\FB@og}
% \begin{macro}{\FB@fg}
% The next step is to provide correct spacing after `«’ and before
% `»’; no line break is allowed neither \emph{after} the opening
% one, nor \emph{before} the closing one.
% French quotes (including spacing) are printed by |\FB@og| and
% |\FB@fg|, the expansion of the top level commands |\og| and |\fg|
% is different in and outside French.
%
% \changes{v3.5k}{2020/07/17}{\cs{FB@og} and \cs{FB@fg} now rely
% on \cs{texorpdfstring} to be safe in bookmarks.}
%
% |\FB@og| and |\FB@fg| are now designed to work in bookmarks.
% \begin{macrocode}
\providecommand\texorpdfstring[2]{#1}
\newcommand*{\FB@og}{\texorpdfstring{\@FB@og}{\guillemotleft\space}}
\newcommand*{\FB@fg}{\texorpdfstring{\@FB@fg}{\space\guillemotright}}
% \end{macrocode}
%
%\changes{v3.0a}{2014/01/10}{Definitions of \cs{FB@og} and \cs{FB@fg}
% now depend on punctuation handling (LuaTeX / XeTeX / active).}
%
% The internal definitions |\@FB@og| and |\@FB@fg| need some
% engine-dependent tuning: for LuaTeX, |\FB@spacing| is set to~0
% locally to prevent the quotes characters from adding space when
% option \fbo{og=«, fg=»} is set.
% \begin{macrocode}
\newcommand*{\FB@guillspace}{\penalty\@M\FBguillspace}
\newcommand*{\FBgspchar}{\char"A0\relax}
\newif\ifFBucsNBSP
\ifFB@luatex@punct
\DeclareRobustCommand*{\@FB@og}{\leavevmode
\bgroup\FB@spacing=0 \guillemotleft\egroup
\ifFBucsNBSP\FBgspchar\else\FB@guillspace\fi}
\DeclareRobustCommand*{\@FB@fg}{\ifdim\lastskip>\z@\unskip\fi
\ifFBucsNBSP\FBgspchar\else\FB@guillspace\fi
\bgroup\FB@spacing=0 \guillemotright\egroup}
\fi
% \end{macrocode}
% With XeTeX, |\ifFB@spacing| is set to |false| locally for the
% same reason.
% \begin{macrocode}
\ifFB@xetex@punct
\DeclareRobustCommand*{\@FB@og}{\leavevmode
\bgroup\FB@spacingfalse\guillemotleft\egroup
\FB@guillspace}
\DeclareRobustCommand*{\@FB@fg}{\ifdim\lastskip>\z@\unskip\fi
\FB@guillspace
\bgroup\FB@spacingfalse\guillemotright\egroup}
\fi
\ifFB@active@punct
\DeclareRobustCommand*{\@FB@og}{\leavevmode
\guillemotleft
\FB@guillspace}
\DeclareRobustCommand*{\@FB@fg}{\ifdim\lastskip>\z@\unskip\fi
\FB@guillspace
\guillemotright}
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\og}
% \begin{macro}{\fg}
%
% The user level macros for quotation marks are named |\og|
% (``\underline{o}uvrez \underline{g}uillemets’’) and |\fg|
% (``\underline{f}ermez \underline{g}uillemets’’).
% Another option for typesetting quotes in French is to use the
% command |\frquote| (see below).
% Dummy definition of |\og| and |\fg| just to ensure that this
% commands are not yet defined.
% \begin{macrocode}
\newcommand*{\og}{\@empty}
\newcommand*{\fg}{\@empty}
% \end{macrocode}
%
% The definitions of |\og| and |\fg| for quotation marks are
% switched on and off through the |\extrasfrench| |\noextrasfrench|
% mechanism. Outside French, |\og| and |\fg| will typeset standard
% English opening and closing double quotes.
% We’ll try to be smart to users of David~Carlisle’s \pkg{xspace}
% package: if this package is loaded there will be no need for |{}|
% or |\ | to get a space after |\fg|, otherwise |\xspace| will be
% defined as |\relax| (done at the end of this file).
%
% \changes{v2.5a}{2010/08/20}{\cs{og} and \cs{fg} do not print
% correctly in English when using XeTeX or LuaTeX, fixed by using
% \cs{textquotedblleft} and \cs{textquotedblright} defined above.}
%
% \changes{v3.2a}{2016/03/18}{\cs{xspace} moved from \cs{FB@fg} to
% \cs{fg}: \cs{xspace} messes up \cs{frquote}, pointed out by Sonia
% Labetoulle. As a side effect \cs{xspace} is now active in \cs{fg}
% in and outside French.}
%
% \begin{macrocode}
\ifLaTeXe
\def\bbl@frenchguillemets{%
\renewcommand*{\og}{\FB@og}%
\renewcommand*{\fg}{\FB@fg\xspace}}
\renewcommand*{\og}{\textquotedblleft}
\renewcommand*{\fg}{\ifdim\lastskip>\z@\unskip\fi
\textquotedblright\xspace}
\else
\def\bbl@frenchguillemets{\let\og\FB@og
\let\fg\FB@fg}
\def\og{\textquotedblleft}
\def\fg{\ifdim\lastskip>\z@\unskip\fi\textquotedblright}
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \changes{v3.0a}{2014/01/10}{\cs{bbl@nonfrenchguillemets} deleted,
% use \cs{babel@save} instead.}
%
% \begin{macrocode}
\addto\extrasfrench{\babel@save\og \babel@save\fg
\bbl@frenchguillemets}
% \end{macrocode}
%
% \changes{v3.1a}{2014/05/20}{New command \cs{frquote} for imbedded or
% long French quotations.}
%
% \begin{macro}{\frquote}
% Another way of entering French quotes relies on |\frquote{}|
% with supports up to two levels of quotes.
% Let’s define the default quote characters to be used for level one
% or two of quotes…
% \begin{macrocode}
\newcommand*{\ogi}{\FB@og}
\newcommand*{\fgi}{\FB@fg}
\newcommand*{\@ogi}{\ifmmode\hbox{\ogi}\else\ogi\fi}
\newcommand*{\@fgi}{\ifmmode\hbox{\fgi}\else\fgi\fi}
\newcommand*{\ogii}{\textquotedblleft}
\newcommand*{\fgii}{\textquotedblright}
\newcommand*{\@ogii}{\ifmmode\hbox{\ogii}\else\ogii\fi}
\newcommand*{\@fgii}{\ifmmode\hbox{\fgii}\else\fgii\fi}
% \end{macrocode}
% and the needed technical stuff to handle options:
%
% \changes{v3.2g}{2017/01/30}{Default options of \cs{frquote} are no
% longer engine-dependent.}
%
% \changes{v3.5b}{2018/07/15}{New command \cs{FB@addquote@everypar} to
% manage \cs{everypar}: \cs{frquote} failed when used immediately
% after a sectionning command.}
%
% \begin{macrocode}
\newcount\FBguill@level
\newtoks\FBold@everypar
% \end{macrocode}
% |\FB@addquote@everypar| was borrowed from \file{csquotes.sty}.
% \begin{macrocode}
\def\FB@addquote@everypar{%
\let\FBnew@everypar\everypar
\FBold@everypar=\expandafter{\the\everypar}%
\FBnew@everypar={\the\FBold@everypar\FBeverypar@quote}%
\let\everypar\FBold@everypar
\let\FB@addquote@everypar\relax
}
\newif\ifFBcloseguill \FBcloseguilltrue
\newif\ifFBInnerGuillSingle
\def\FBguillopen{\bgroup\NoAutoSpacing\guillemotleft\egroup}
\def\FBguillclose{\bgroup\NoAutoSpacing\guillemotright\egroup}
\let\FBguillnone\empty
\let\FBeveryparguill\FBguillopen
\let\FBeverylineguill\FBguillnone
\let\FBeverypar@quote\relax
\let\FBeveryline@quote\empty
% \end{macrocode}
%
% \changes{v3.5k}{2020/07/18}{\cs{frquote} now relies on
% \cs{texorpdfstring} to be safe in bookmarks.}
%
% The main command |\frquote| accepts (in LaTeX2e only) a starred
% version which suppresses the closing quote; it is meant to be used
% for inner quotations which end together with the outer one, then
% only one closing guillemet (the outer one) should be printed.
% |\frquote| (without star) is now designed to work in bookmarks too.
% \begin{macrocode}
\ifLaTeXe
\DeclareRobustCommand\frquote{%
\texorpdfstring{\@ifstar{\FBcloseguillfalse\fr@quote}%
{\FBcloseguilltrue \fr@quote}}%
{\bm@fr@quote}%
}
\newcommand{\bm@fr@quote}[1]{%
\guillemotleft\space #1\space\guillemotright}
\else
\newcommand\frquote[1]{\fr@quote{#1}}
\fi
% \end{macrocode}
%
% \changes{v3.1j}{2015/11/25}{\cs{fr@quote} completely rewritten:
% \cs{leavevmode} added and explicitly save/retore \cs{everypar} and
% \cs{localleftbox} instead of using a group in order to ensure
% compatibility with package wrapfig.}
%
% \changes{v3.1j}{2015/11/21}{\cs{PackageWarning} is undefined in
% Plain, use \cs{fb@warning} instead.}
%
% \changes{v3.3a}{2017/04/30}{\cs{FB@quotespace} (kern), changed
% into \cs{FB@guillspace}.}
%
% The internal command |\fr@quote| takes one (long) argument: the
% quotation text.
% \begin{macrocode}
\newcommand{\fr@quote}[1]{%
\leavevmode
\advance\FBguill@level by \@ne
\ifcase\FBguill@level
\or
% \end{macrocode}
% This for level 1 (outer) quotations: set |\FBeverypar@quote|
% for level 1 quotations and add it to |\everypar| using
% |\FB@addquote@everypar|, then print the quotation:
% \begin{macrocode}
\ifx\FBeveryparguill\FBguillnone
\else
\def\FBeverypar@quote{\FBeveryparguill\FB@guillspace}%
\FB@addquote@everypar
\fi
\@ogi #1\@fgi
\or
% \end{macrocode}
% This for level 2 (inner) quotations: Omega’s command
% |\localleftbox| included in LuaTeX, is convenient for repeating
% guillemets at the beginning of every line.\hlabel{cs:localleftbox}
%
% \changes{v3.1i}{2015/10/04}{\cs{luatexlocalleftbox} changed to
% \cs{localleftbox} by new LaTeX release 2015/10/01.}
%
% \changes{v3.5c}{2018/09/14}{\cs{FBeverypar@quote}’s value now properly
% reset across level changes.}
%
% \changes{v3.5e}{2019/03/23}{reset \cs{FB@addGUILspace} attribute
% inside \cs{localleftbox} (LuaTeX).}
%
% \begin{macrocode}
\ifx\FBeverylineguill\FBguillopen
\def\FBeveryline@quote{\FB@addGUILspace=0 \guillemotleft
\FB@guillspace}%
\localleftbox{\FBeveryline@quote}%
\let\FBeverypar@quote\relax
\@ogi #1\ifFBcloseguill\@fgi\fi
\else
\ifx\FBeverylineguill\FBguillclose
\def\FBeveryline@quote{\FB@addGUILspace=0 \guillemotright
\FB@guillspace}%
\localleftbox{\FBeveryline@quote}%
\let\FBeverypar@quote\relax
\@ogi #1\ifFBcloseguill\@fgi\fi
\else
% \end{macrocode}
% otherwise we need to redefine |\FBeverypar@quote| (and eventually
% |\ogii|, |\fgii|) for level 2 quotations:
% \begin{macrocode}
\let\FBeverypar@quote\relax
\ifFBInnerGuillSingle
\def\ogii{\leavevmode
\guilsinglleft\FB@guillspace}%
\def\fgii{\ifdim\lastskip>\z@\unskip\fi
\FB@guillspace\guilsinglright}%
\ifx\FBeveryparguill\FBguillopen
\def\FBeverypar@quote{\guilsinglleft\FB@guillspace}%
\fi
\ifx\FBeveryparguill\FBguillclose
\def\FBeverypar@quote{\guilsinglright\FB@guillspace}%
\fi
\fi
\@ogii #1\ifFBcloseguill \@fgii \fi
\fi
\fi
\else
% \end{macrocode}
% Warn if |\FBguill@level| >~2:
% \begin{macrocode}
\ifx\PackageWarning\@undefined
\fb@warning{\noexpand\frquote\space handles up to
two levels.\\ Quotation not printed.}%
\else
\PackageWarning{french.ldf}{%
\protect\frquote\space handles up to two levels.
\MessageBreak Quotation not printed. Reported}
\fi
\fi
% \end{macrocode}
%
% \changes{v3.5e}{2019/03/14}{Make resettings global on exit.}
%
% Closing: step down |\FBguill@level| and clean on exit.
% Changes made global in case |\frquote{}| ends inside an
% environment.
% \begin{macrocode}
\global\advance\FBguill@level by \m@ne
\ifcase\FBguill@level \global\let\FBeverypar@quote\relax
\or \gdef\FBeverypar@quote{\FBeveryparguill\FB@guillspace}%
\global\let\FBeveryline@quote\empty
\ifx\FBeverylineguill\FBguillnone\else\localleftbox{}\fi
\fi
}
% \end{macrocode}
% \changes{v3.5e}{2019/03/14}{new command \cs{NoEveryParQuote}.}
%
% The next command is intended to be used in list environments to
% suppress quotes which might be added by |\FBeverypar@quote| after
% items for instance.
% \begin{macrocode}
\newcommand*{\NoEveryParQuote}{\let\FBeveryparguill\FBguillnone}
% \end{macrocode}
% \end{macro}
%
% \subsection{Date in French}
% \label{sssec-date}
%
% \begin{macro}{\frenchtoday}
% \begin{macro}{\frenchdate}
% \begin{macro}{\datefrench}
% The following code creates a macro |\datefrench| which in turn
% defines command |\frenchtoday| (|\today| is defined as
% |\frenchtoday| in French).
% The corresponding commands for the French dialect, |\dateacadian|
% and |\acadiantoday| are also created btw.
% This new implementation relies on commands |\SetString| and
% |\SetStringLoop|, therefore requires \babel~3.10 or newer.
%
% \changes{v2.0}{2006/11/06}{2 `\cs{relax}’ added in
% \cs{today}’s definition.}
%
% \changes{v2.1a}{2008/03/25}{\cs{today} changed (correction in 2.0
% was wrong: \cs{today} was printed without spaces in toc).}
%
% \changes{v3.0a}{2014/02/18}{Take advantage of babel’s \cs{SetString}
% commands for \cs{datefrench}. Doesn’t work with Plain (yet?).}
%
% \changes{v3.4a}{2018/01/04}{Specific code for Plain finally removed
% (babel bug reported).}
%
% \changes{v3.4b}{2018/02/04}{Do not redefine \cs{date} as
% \cs{frenchdate} in French.}
%
% Explicitly defining |\BabelLanguages| as the list of all French
% dialects defines \emph{both} |\datefrench| and |\dateacadian|;
% this is required as \file{french.ldf} is read only once even if
% both language options \opt{french} and \opt{acadian} are supplied
% to \babel. Coding |\StartBabelCommands*{french,acadian}|
% would \emph{only} define |\date\CurrentOption|,
% leaving the second language undefined in \babel’s sens.
%
% \begin{macrocode}
\def\BabelLanguages{french,acadian}
\StartBabelCommands*{\BabelLanguages}{date}
[unicode, fontenc=TU EU1 EU2, charset=utf8]
\SetString\monthiiname{février}
\SetString\monthviiiname{août}
\SetString\monthxiiname{décembre}
\StartBabelCommands*{\BabelLanguages}{date}
\SetStringLoop{month#1name}{%
janvier,f\'evrier,mars,avril,mai,juin,juillet,%
ao\^ut,septembre,octobre,novembre,d\'ecembre}
\SetString\today{\FB@date{\year}{\month}{\day}}
\EndBabelCommands
% \end{macrocode}
% |\frenchdate| (which produces an unbreakable string) and
% |\frenchtoday| (breakable) both rely on |\FB@date|, the inner
% group is needed for |\hbox|.
% \begin{macrocode}
\newcommand*{\FB@date}[3]{%
{{\number#3}\ifnum1=#3{\ier}\fi\FBdatespace
\csname month\romannumeral#2name\endcsname
\ifx#1\@empty\else\FBdatespace\number#1\fi}}
\newcommand*{\FBdatebox}{\hbox}
\newcommand*{\FBdatespace}{\space}
\newcommand*{\frenchdate}{\FBdatebox\FB@date}
\newcommand*{\acadiandate}{\FBdatebox\FB@date}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Extra utilities}
%
% Let’s provide the French user with some extra utilities.
%
% \changes{v2.1a}{2008/03/24}{Command \cs{fup} added to produce
% better superscripts than \cs{textsuperscript}.}
%
% \begin{macro}{\up}
%
% \changes{v2.1c}{2008/04/29}{Provide a temporary definition
% (hyperref safe) of \cs{up} in case it has to be expanded in
% the preamble (by beamer’s \cs{title} command for instance).}
%
% \changes{v2.4d}{2010/07/28}{Command \cs{up} defined with
% \cs{providecommand} instead of \cs{newcommand} as \cs{up} may be
% defined elsewhere (catalan.ldf).
% Bug pointed out by Felip Manyé i Ballester.}
%
% \begin{macro}{\fup}
%
% \changes{v2.1b}{2008/04/02}{Command \cs{fup} changed to use
% real superscripts from fourier v.~1.6.}
%
% \changes{v2.2a}{2008/05/08}{\cs{newif} and \cs{newdimen} moved
% before \cs{ifLaTeXe} to avoid an error with plainTeX.}
%
% \changes{v2.3a}{2008/09/30}{\cs{lowercase} changed to
% \cs{MakeLowercase} as the former doesn’t work for non ASCII
% characters in encodings like applemac, utf-8,…}
%
% \changes{v3.5k}{2020/07/18}{\cs{up} and \cs{fup} now rely on
% \cs{texorpdfstring} to be safe in bookmarks.}
%
% |\up| eases the typesetting of superscripts like
% `1\up{er}’. Up to version 2.0 of \frenchb{} |\up| was just a
% shortcut for |\textsuperscript| in LaTeX2e, but several users
% complained that |\textsuperscript| typesets superscripts
% too high and too big, so we now define |\fup| as an attempt to
% produce better looking superscripts. |\up| is defined as |\fup|
% but \fbsetup{FrenchSuperscripts=false} redefines |\up|
% as |\textsuperscript| for compatibility with previous versions.
%
% When a font has built-in superscripts, the best thing to do is
% to just use them, otherwise |\fup| has to simulate superscripts
% by scaling and raising ordinary letters. Scaling is done using
% package \pkg{scalefnt} which will be loaded at the end of
% \babel’s loading (\frenchb{} being an option of \babel, it cannot
% load a package while being read).
%
% \begin{macrocode}
\newif\ifFB@poorman
\newdimen\FB@Mht
\ifLaTeXe
\AtEndOfPackage{\RequirePackage{scalefnt}}
% \end{macrocode}
% |\FB@up@fake| holds the definition of fake superscripts.
% The scaling ratio is 0.65, raising is computed to put the top of
% lower case letters (like `m’) just under the top of upper case
% letters (like `M’), precisely 12\% down. The chosen settings
% look correct for most fonts, but can be tuned by the end-user
% if necessary by changing |\FBsupR| and |\FBsupS| commands.
%
% |\FB@lc| is defined as |\MakeLowercase| to inhibit the uppercasing
% of superscripts (this may happen in page headers with the standard
% classes but is wrong); |\FB@lc| can be redefined to do nothing
% by option \fbo{LowercaseSuperscripts=false} of \fbsetup{}.
% \begin{macrocode}
\newcommand*{\FBsupR}{-0.12}
\newcommand*{\FBsupS}{0.65}
\newcommand*{\FB@lc}[1]{\MakeLowercase{#1}}
\DeclareRobustCommand*{\FB@up@fake}[1]{%
\settoheight{\FB@Mht}{M}%
\addtolength{\FB@Mht}{\FBsupR \FB@Mht}%
\addtolength{\FB@Mht}{-\FBsupS ex}%
\raisebox{\FB@Mht}{\scalefont{\FBsupS}{\FB@lc{#1}}}%
}
% \end{macrocode}
% The only packages I currently know to take advantage of real
% superscripts are a) \pkg{realscripts} used in conjunction with
% XeLaTeX or LuaLaTeX and OpenType fonts having the font feature
% `VerticalPosition=Superior’ and b) \pkg{fourier}
% (from version 1.6) when Expert Utopia fonts are available.
%
% |\FB@up| checks whether the current font is a Type1 `Expert’
% (or `Pro’) font with real superscripts or not (the code works
% currently only with \file{fourier-1.6} but could work with any
% Expert Type1 font with built-in superscripts, see below), and
% decides to use real or fake superscripts.
% It works as follows: the content of |\f@family| (family name of
% the current font) is split by |\FB@split| into two pieces, the
% first three characters (`|fut|’ for Fourier, `|ppl|’ for Adobe’s
% Palatino, …) stored in |\FB@firstthree| and the rest stored
% in |\FB@suffix| which is expected to be `|x|’ or `|j|’ for expert
% fonts.
% \begin{macrocode}
\def\FB@split#1#2#3#4\@nil{\def\FB@firstthree{#1#2#3}%
\def\FB@suffix{#4}}
\def\FB@x{x}
\def\FB@j{j}
\DeclareRobustCommand*{\FB@up}[1]{%
\bgroup \FB@poormantrue
\expandafter\FB@split\f@family\@nil
% \end{macrocode}
% Then |\FB@up| looks for a \file{.fd} file named \file{t1fut-sup.fd}
% (Fourier) or \file{t1ppl-sup.fd} (Palatino), etc.\ supposed to
% define the subfamily (|fut-sup| or |ppl-sup|, etc.) giving access
% to the built-in superscripts. If the \file{.fd} file is not found
% by |\IfFileExists|, |\FB@up| falls back on fake superscripts,
% otherwise |\FB@suffix| is checked to decide whether to use fake or
% real superscripts.
% \begin{macrocode}
\edef\reserved@a{\lowercase{%
\noexpand\IfFileExists{\f@encoding\FB@firstthree -sup.fd}}}%
\reserved@a
{\ifx\FB@suffix\FB@x \FB@poormanfalse\fi
\ifx\FB@suffix\FB@j \FB@poormanfalse\fi
\ifFB@poorman \FB@up@fake{#1}%
\else \FB@up@real{#1}%
\fi}%
{\FB@up@fake{#1}}%
\egroup}
% \end{macrocode}
% |\FB@up@real| just picks up the superscripts from the subfamily
% (and forces lowercase).
% \begin{macrocode}
\newcommand*{\FB@up@real}[1]{\bgroup
\fontfamily{\FB@firstthree -sup}\selectfont \FB@lc{#1}\egroup}
% \end{macrocode}
% |\fup| is defined as |\FB@up| unless |\realsuperscript| is
% defined by \file{realscripts.sty}. |\fup| just prints its argument
% in bookmarks.
% \begin{macrocode}
\DeclareRobustCommand*{\fup}[1]{%
\texorpdfstring{\ifx\realsuperscript\@undefined
\FB@up{#1}%
\else
\bgroup\let\fakesuperscript\FB@up@fake
\realsuperscript{\FB@lc{#1}}\egroup
\fi
}{#1}%
}
% \end{macrocode}
% Let’s provide a temporary definition for |\up| (redefined
% `AtBeginDocument’ as |\fup| or |\textsuperscript| according to
% \fbsetup{} options).
% \begin{macrocode}
\providecommand*{\up}{\fup}
% \end{macrocode}
% Poor man’s definition of |\up| for Plain.
% \begin{macrocode}
\else
\providecommand*{\up}[1]{\leavevmode\raise1ex\hbox{\sevenrm #1}}
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ieme}
% \begin{macro}{\ier}
% \begin{macro}{\iere}
% \begin{macro}{\iemes}
% \begin{macro}{\iers}
% \begin{macro}{\ieres}
% \changes{v3.1b}{2014/06/23}{Removed \cs{lowercase} from definitions
% of \cs{ieme} and co: \cs{up} already does the conversion.}
%
% Some handy macros for those who don’t know how to abbreviate
% ordinals:
% \begin{macrocode}
\def\ieme{\up{e}\xspace}
\def\iemes{\up{es}\xspace}
\def\ier{\up{er}\xspace}
\def\iers{\up{ers}\xspace}
\def\iere{\up{re}\xspace}
\def\ieres{\up{res}\xspace}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \changes{v3.3c}{2017/07/23}{New configurable kerns \cs{FBmedkern},
% and \cs{FBthickkern} suitable for HTML translation.}
%
% \begin{macro}{\FBmedkern}
% \begin{macro}{\FBthickkern}
% \begin{macrocode}
\newcommand*{\FBmedkern}{\kern+.2em}
\newcommand*{\FBthickkern}{\kern+.3em}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \changes{v2.1c}{2008/04/29}{Added commands \cs{Nos} and \cs{nos}.}
%
% \begin{macro}{\primo}
% \begin{macro}{\fprimo)}
% \begin{macro}{\nos}
% \begin{macro}{\Nos}
% \begin{macro}{\No}
% \begin{macro}{\no}
% \changes{v3.1b}{2014/06/23}{Removed \cs{lowercase} from definitions
% of \cs{FrenchEnumerate}, … \cs{No} and co: \cs{up} already
% does the conversion.}
%
% \changes{v3.5k}{2020/07/18}{\cs{no}, \cs{nos}, \cs{No}, \cs{Nos},
% \cs{primo}, \cs{fprimo}, now rely on \cs{texorpdfstring} to be
% safe in bookmarks.}
%
% Some support macros relying on |\up| for numbering,
% \begin{macrocode}
\newcommand*{\FrenchEnumerate}[1]{%
#1\texorpdfstring{\up{o}\FBthickkern}{\textdegree\space}}
\newcommand*{\FrenchPopularEnumerate}[1]{%
#1\texorpdfstring{\up{o})\FBthickkern}{\textdegree\space}}
% \end{macrocode}
%
% Typing |\primo| should result in `\up{o}\kern+.3em’ (except in
% bookmarks where |\textdegree| is used instead of o-superior),
% \begin{macrocode}
\def\primo{\FrenchEnumerate1}
\def\secundo{\FrenchEnumerate2}
\def\tertio{\FrenchEnumerate3}
\def\quarto{\FrenchEnumerate4}
% \end{macrocode}
% while typing |\fprimo)| gives `\up{o})\kern+.3em (except in
% bookmarks where |\textdegree| is used instead),.
% \begin{macrocode}
\def\fprimo){\FrenchPopularEnumerate1}
\def\fsecundo){\FrenchPopularEnumerate2}
\def\ftertio){\FrenchPopularEnumerate3}
\def\fquarto){\FrenchPopularEnumerate4}
% \end{macrocode}
%
% Let’s provide four macros for the common abbreviations
% of ``Numéro’’. In bookmarks ° is used instead of o-superior.
% \begin{macrocode}
\DeclareRobustCommand*{\No}{%
\texorpdfstring{N\up{o}\FBmedkern}{N\textdegree\space}}
\DeclareRobustCommand*{\no}{%
\texorpdfstring{n\up{o}\FBmedkern}{n\textdegree\space}}
\DeclareRobustCommand*{\Nos}{%
\texorpdfstring{N\up{os}\FBmedkern}{N\textdegree\space}}
\DeclareRobustCommand*{\nos}{%
\texorpdfstring{n\up{os}\FBmedkern}{n\textdegree\space}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\bsc}
% As family names should be written in small capitals and never be
% hyphenated, we provide a command (its name comes from Boxed Small
% Caps) to input them easily. Note that this command has changed
% with version~2 of \frenchb: a |\kern0pt| is used instead of |\hbox|
% because |\hbox| would break microtype’s font expansion; as a
% (positive?) side effect, composed names (such as Dupont-Durand)
% can now be hyphenated on explicit hyphens.
% Usage: |Jean~\bsc{Duchemin}|.
%
% \changes{v2.0}{2006/11/06}{\cs{hbox} dropped, replaced by
% \cs{kern0pt}.}
%
% \changes{v3.5k}{2020/07/18}{\cs{bsc} now relies on
% \cs{texorpdfstring} to be safe in bookmarks.}
%
% \begin{macrocode}
\ifLaTeXe
\DeclareRobustCommand*{\bsc}[1]{%
\texorpdfstring{\leavevmode\begingroup\kern0pt \scshape #1\endgroup}%
{\textsc{#1}}%
}
\else
\newcommand*{\bsc}[1]{\leavevmode\begingroup\kern0pt #1\endgroup}
\fi
% \end{macrocode}
% \end{macro}
%
% Some definitions for special characters. We won’t define |\tilde|
% as a Text Symbol not to conflict with the macro |\tilde| for math
% mode and use the name |\tild| instead. Note that |\boi| may
% \emph{not} be used in math mode, its name in math mode is
% |\backslash|. |\degre| can be accessed by the command |\r{}|
% for ring accent.
%
% \changes{v2.5f}{2011/07/18}{Changed definitions of \cs{at},
% \cs{circonflexe}, \cs{tild}, \cs{boi} and \cs{degre} for
% Unicode based engines.}
%
% \changes{v3.2g}{2017/01/24}{Changed Unicode definition of \cs{boi}.}
%
% \changes{v3.5k}{2020/07/30}{\cs{degre}, \cs{degres}, \cs{circonflexe},
% \cs{tild}, \cs{boi} and \cs{at} are now safe in bookmarks.}
%
% \begin{macrocode}
\ifFBunicode
\providecommand*{\textbackslash}{{\char"005C}}
\providecommand*{\textasciicircum}{{\char"005E}}
\providecommand*{\textasciitilde}{{\char"007E}}
\newcommand*{\FB@degre}{°}
\else
\ifLaTeXe
\newcommand*{\FB@degre}{\r{}}
\fi
\fi
\DeclareRobustCommand*{\boi}{\textbackslash}
\DeclareRobustCommand*{\circonflexe}{\textasciicircum}
\DeclareRobustCommand*{\tild}{\textasciitilde}
\DeclareRobustCommand*{\degre}{%
\texorpdfstring{\FB@degre}{\textdegree}}
\newcommand*{\at}{@}
% \end{macrocode}
%
% \begin{macro}{\degres}
% We now define a macro |\degres| for typesetting the abbreviation
% for `degrees’ (as in `degrees Celsius’). As the bounding box of
% the character `degree’ has \emph{very} different widths in CM/EC
% and PostScript fonts, we fix the width of the bounding box of
% |\degres| to 0.3\,em, this lets the symbol `degree’ stick to the
% preceding (e.g., |45\degres|) or following character
% (e.g., |20~\degres C|). |\degres| works in math-mode (angles).
%
% \changes{v2.6e}{2013/07/06}{Refrain from redefining \cs{textdegree}
% from latin1.def, applemac.def, etc. as \cs{degres} because it
% loops in hyperref’s bookmarks. Pointed out by Eddy Flas on fctt.}
%
% If \TeX{} Companion fonts are available (\file{textcomp.sty}),
% we pick up |\textdegree| from them instead of emulating `degrees’
% from the |\r{}| accent. Otherwise we advise the user (once only)
% to use TS1-encoding.
%
% \changes{v2.1c}{2008/04/29}{Provide a temporary definition (hyperref
% safe) of \cs{degres} in case it has to be expanded in the preamble
% (by beamer’s \cs{title} command for instance).}
%
% \begin{macrocode}
\DeclareRobustCommand*{\degres}{\degre}
\ifLaTeXe
\AtBeginDocument{%
\@ifpackageloaded{fontspec}{}{%
\ifdefined\DeclareEncodingSubset
\DeclareRobustCommand*{\degres}{%
\texorpdfstring{\hbox{\UseTextSymbol{TS1}{\textdegree}}}%
{\textdegree}}%
\else
\def\Warning@degree@TSone{\FBWarning
{Degrees would look better in TS1-encoding:%
\MessageBreak add \protect
\usepackage{textcomp} to the preamble.%
\MessageBreak Degrees used}}
\DeclareRobustCommand*{\degres}{%
\texorpdfstring{\hbox to 0.3em{\hss\degre\hss}%
\Warning@degree@TSone
\global\let\Warning@degree@TSone\relax}%
{\textdegree}}%
\fi
}%
}
\fi
% \end{macrocode}
% \end{macro}
%
% \subsection{Formatting numbers}
% \label{ssec-numbers}
%
% \begin{macro}{\StandardMathComma}
% \begin{macro}{\DecimalMathComma}
% As mentioned in the \TeX{}book p.~134, the comma is of type
% |\mathpunct| in math mode: it is automatically followed by a
% thin space. This is convenient in lists and intervals but
% unpleasant when the comma is used as a decimal separator
% in French: it has to be entered as |{,}|.
% |\DecimalMathComma| makes the comma be an ordinary character
% (of type |\mathord|) in French (or Acadian) \emph{only}
% (no space added); |\StandardMathComma| switches back to the
% standard behaviour of the comma.
%
% \changes{v3.2e}{2017/01/09}{\cs{DecimalMathComma} didn’t work
% with LuaTeX. Fixed now.}
%
% \changes{v3.2f}{2017/01/15}{Fixed conflict with the icomma
% package.}
%
% \changes{v3.5f}{2019/09/07}{Fixed bug with the acadian language.
% Warning added if used with the icomma package.}
%
% Unfortunately, |\newcount| inside |\if| breaks Plain formats.
% \begin{macrocode}
\newif\ifFB@icomma
\newcount\mc@charclass
\newcount\mc@charfam
\newcount\mc@charslot
\newcount\std@mcc
\newcount\dec@mcc
\ifFBLuaTeX
\mc@charclass=\Umathcharclass`\,
\newcommand*{\dec@math@comma}{%
\mc@charfam=\Umathcharfam`\,
\mc@charslot=\Umathcharslot`\,
\Umathcode`\,= 0 \mc@charfam \mc@charslot
}
\newcommand*{\std@math@comma}{%
\mc@charfam=\Umathcharfam`\,
\mc@charslot=\Umathcharslot`\,
\Umathcode`\,= \mc@charclass \mc@charfam \mc@charslot
}
\else
\std@mcc=\mathcode`\,
\dec@mcc=\std@mcc
\@tempcnta=\std@mcc
\divide\@tempcnta by "1000
\multiply\@tempcnta by "1000
\advance\dec@mcc by -\@tempcnta
\newcommand*{\dec@math@comma}{\mathcode`\,=\dec@mcc}
\newcommand*{\std@math@comma}{\mathcode`\,=\std@mcc}
\fi
% \end{macrocode}
% |\DecimalMathComma| operates in French or Acadian independently.
% \begin{macrocode}
\newcommand*{\DecimalMathComma}{%
\ifFB@icomma
\PackageWarning{french.ldf}{%
icomma package loaded, \protect\DecimalMathComma\MessageBreak
does nothing. Reported}%
\else
\ifFBfrench
\dec@math@comma
\expandafter\addto\csname extras\languagename\endcsname
{\dec@math@comma}%
\fi
\fi
}
\newcommand*{\StandardMathComma}{%
\ifFB@icomma
\PackageWarning{french.ldf}{%
icomma package loaded, \protect\StandardMathComma\MessageBreak
does nothing. Reported}%
\else
\std@math@comma
\expandafter\addto\csname extras\languagename\endcsname
{\std@math@comma}%
\fi
}
\ifLaTeXe
\AtBeginDocument{\@ifpackageloaded{icomma}%
{\FB@icommatrue}%
{\addto\noextrasfrench{\std@math@comma}%
\ifdefined\noextrasacadian
\addto\noextrasacadian{\std@math@comma}%
\fi
}%
}
\else
\addto\noextrasfrench{\std@math@comma}
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\nombre}
%
% \changes{v2.0}{2006/11/06}{\cs{nombre} now requires numprint.sty.}
%
% The command |\nombre| is now borrowed from \file{numprint.sty} for
% LaTeX2e. There is no point to maintain the former tricky code
% when a package is dedicated to do the same job and more.
% For Plain based formats, |\nombre| no longer formats numbers,
% it prints them as is and issues a warning about the change.
%
% Fake command |\nombre| for Plain based formats, warning users of
% \frenchb{} v.~1.x.\ about the change:
% \begin{macrocode}
\newcommand*{\nombre}[1]{{#1}\fb@warning{*** \noexpand\nombre
no longer formats numbers\string! ***}}
% \end{macrocode}
% \end{macro}
%
% Let’s activate LuaTeX punctuation if necessary (LaTeX or Plain)
% so that |\FBsetspaces| commands can be used in the preamble,
% then cleanup and exit without loading any \file{.cfg} file
% in case of Plain formats.
%
% \begin{macrocode}
\ifFB@luatex@punct
\activate@luatexpunct
\fi
\let\FBstop@here\relax
\def\FBclean@on@exit{%
\let\ifLaTeXe\undefined
\let\LaTeXetrue\undefined
\let\LaTeXefalse\undefined
\let\FB@llc\loadlocalcfg
\let\loadlocalcfg\@gobble}
\ifx\magnification\@undefined
\else
\def\FBstop@here{%
\FBclean@on@exit
\ldf@finish\CurrentOption
\let\loadlocalcfg\FB@llc
\endinput}
\fi
\FBstop@here
% \end{macrocode}
%
% What follows is for LaTeX2e \emph{only}.
% We redefine |\nombre| for LaTeX2e. A warning is issued
% at the first call of |\nombre| if |\numprint| is not
% defined, suggesting what to do. The package \pkg{numprint}
% is \emph{not} loaded automatically by \frenchb{} because of
% possible options conflict.
%
% \changes{v3.1i}{2015/10/03}{\cs{nombre} command changed when
% numprint.sty is not loaded: only one warning, no error.}
%
% \begin{macrocode}
\renewcommand*{\nombre}[1]{\Warning@nombre{#1}}
\newcommand*{\Warning@nombre}[1]{%
\ifdefined\numprint
\numprint{#1}%
\else
\PackageWarning{french.ldf}{%
\protect\nombre\space now relies on package numprint.sty,%
\MessageBreak add \protect
\usepackage[autolanguage]{numprint},\MessageBreak
see file numprint.pdf for more options.\MessageBreak
\protect\nombre\space called}%
\global\let\Warning@nombre\relax
{#1}%
\fi
}
% \end{macrocode}
%
% \changes{v3.3c}{2017/08/10}{New command \cs{FBthousandsep} to
% customise numprint.}
%
% \changes{v3.4a}{2017/12/29}{Shrink/stretch removed in
% \cs{FBthousandsep}.}
%
% \begin{macrocode}
\newcommand*{\FBthousandsep}{\kern \fontdimen2\font \relax}
% \end{macrocode}
%
% \changes{v2.0c}{2007/06/25}{There is no need to define here
% numprint’s command \cs{npstylefrench}, it will be redefined
% `AtBeginDocument’ by \cs{FBprocess@options}.}
%
% \subsection{Caption names}
% \label{ssec-captions-name}
%
% The next step consists in defining the French equivalents for
% the LaTeX caption names.
%
% \begin{macro}{\captionsfrench}
% Let’s first define |\captionsfrench| which sets all strings used
% in the four standard document classes provided with LaTeX.
%
% \changes{v2.0}{2006/11/06}{`Fig.’ changed to `Figure’ and
% `Tab.’ to `Table’.}
%
% \changes{v2.5a}{2010/08/16}{\cs{emph} deleted in \cs{seename}
% and \cs{alsoname} to match what is done for the other languages.
% Suggested by Marc Baudoin.}
%
% \changes{v3.0a}{2014/02/18}{Take advantage of babel’s \cs{SetString}
% commands for captionnames.}
%
% \changes{v3.1b}{2014/09/15}{Change \cs{scshape} to customisable
% \cs{FBfigtabshape} for \cs{figurename} and \cs{tablename}.}
%
% \changes{v3.1g}{2015/05/10}{\cs{partname}’s definition depends now on
% flag PartNameFull. No need to redefine it in \cs{frenchbsetup}.}
%
% \changes{v3.3a}{2017/04/30}{Commands \cs{frenchpartfirst},
% \cs{frenchpartsecond} and \cs{frenchpartnameord} added.}
%
% \changes{v3.5k}{2020/09/09}{Small caps removed in \cs{figurename} and
% \cs{tablename}, use \cs{fnum@figure} and \cs{fnum@table} instead.}
%
% \changes{v3.5l}{2020/10/08}{Redefine \cs{fnum@figure} and
% \cs{fnum@table} separately.}
%
% |\figurename| and |\tablename| are printed in small caps in French,
% unless either \fbo{SmallCapsFigTabCaptions} is set to \fbo{false}
% or a class or package loaded before \frenchb{} defines
% |\FBfigtabshape| as |\relax|.
% \begin{macrocode}
\providecommand*{\FBfigtabshape}{\scshape}
% \end{macrocode}
%
% New implementation for caption names( requires \babel’s~3.10 or
% newer).
% \begin{macrocode}
\StartBabelCommands*{\BabelLanguages}{captions}
[unicode, fontenc=TU EU1 EU2, charset=utf8]
\SetString{\refname}{Références}
\SetString{\abstractname}{Résumé}
\SetString{\prefacename}{Préface}
\SetString{\contentsname}{Table des matières}
\SetString{\ccname}{Copie à }
\SetString{\proofname}{Démonstration}
\SetString{\partfirst}{Première}
\SetString{\partsecond}{Deuxième}
\SetStringLoop{ordinal#1}{%
\frenchpartfirst,\frenchpartsecond,Troisième,Quatrième,%
Cinquième,Sixième,Septième,Huitième,Neuvième,Dixième,Onzième,%
Douzième,Treizième,Quatorzième,Quinzième,Seizième,%
Dix-septième,Dix-huitième,Dix-neuvième,Vingtième}
\StartBabelCommands*{\BabelLanguages}{captions}
\SetString{\refname}{R\'ef\'erences}
\SetString{\abstractname}{R\'esum\'e}
\SetString{\bibname}{Bibliographie}
\SetString{\prefacename}{Pr\'eface}
\SetString{\chaptername}{Chapitre}
\SetString{\appendixname}{Annexe}
\SetString{\contentsname}{Table des mati\`eres}
\SetString{\listfigurename}{Table des figures}
\SetString{\listtablename}{Liste des tableaux}
\SetString{\indexname}{Index}
\SetString{\figurename}{Figure}
\SetString{\tablename}{Table}
\SetString{\pagename}{page}
\SetString{\seename}{voir}
\SetString{\alsoname}{voir aussi}
\SetString{\enclname}{P.~J. }
\SetString{\ccname}{Copie \`a }
\SetString{\headtoname}{}
\SetString{\proofname}{D\'emonstration}
\SetString{\glossaryname}{Glossaire}
% \end{macrocode}
% When \fbo{PartNameFull=true} (default), |\part{}| is printed in
% French as ``Première partie’’ instead of ``Partie I’’.
% As logic is prohibited inside |\SetString|, let’s hide the test
% about \fbo{PartNameFull} in |\FB@partname|.
% \begin{macrocode}
\SetString{\partfirst}{Premi\`ere}
\SetString{\partsecond}{Deuxi\`eme}
\SetString{\partnameord}{partie}
\SetStringLoop{ordinal#1}{%
\partfirst,\partsecond,Troisi\`eme,Quatri\`eme, Cinqui\`eme,%
Sixi\`eme,Septi\`eme,Huiti\`eme,Neuvi\`eme,Dixi\`eme,%
Onzi\`eme,Douzi\`eme,Treizi\`eme,Quatorzi\`eme,Quinzi\`eme,%
Seizi\`eme,Dix-septi\`eme,Dix-huiti\`eme,Dix-neuvi\`eme,%
Vingti\`eme}
\AfterBabelCommands{%
\DeclareRobustCommand*{\FB@emptypart}{\def\thepart{\unskip}}%
\DeclareRobustCommand*{\FB@partname}{%
\ifFBPartNameFull
\csname ordinal\romannumeral\value{part}\endcsname\space
\partnameord\FB@emptypart
\else
Partie%
\fi}%
}
\SetString{\partname}{\FB@partname}
\EndBabelCommands
% \end{macrocode}
% |\figurename| and |\tablename| no longer include font commmands;
% to print them in small caps in French (the default), we now
% customise |\fnum@figure| and |\fnum@table| when available (not in
% beamer.cls f.i.).
% \begin{macrocode}
\AtBeginDocument{%
\ifx\FBfigtabshape\relax
\else
\ifdefined\fnum@figure
\let\fnum@figureORI\fnum@figure
\renewcommand{\fnum@figure}{{\ifFBfrench\FBfigtabshape\fi
\fnum@figureORI}}%
\fi
\ifdefined\fnum@table
\let\fnum@tableORI\fnum@table
\renewcommand{\fnum@table}{{\ifFBfrench\FBfigtabshape\fi
\fnum@tableORI}}%
\fi
\fi
}
% \end{macrocode}
% \end{macro}
%
% \changes{v3.0a}{2014/02/28}{Merging of \cs{captionsfrenchb},
% \cs{captionsfrancais} with \cs{captionsfrench} deleted in favor
% of new babel 3.9 syntax.}
%
% \subsection{Figure and table captions}
% \label{ssec-captions-fig}
%
% \changes{v2.4a}{2009/11/23}{\cs{PackageWarning} changed to
% \cs{FBWarning} (in case \cs{@makecaption} has been customised).
% \cs{FBWarning} is defined as \cs{PackageWarning} by default but
% can be made silent using \cs{frenchbsetup}, (suggested by MPG).}
%
% \begin{macro}{\FBWarning}
% |\FBWarning| is an alias of |\PackageWarning{french.ldf}| which
% can be made silent by option \fbo{SuppressWarning}.
% \begin{macrocode}
\newcommand{\FBWarning}[1]{\PackageWarning{french.ldf}{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\CaptionSeparator}
% Let’s consider now captions in figures and tables.
% In French, captions in figures and tables should never be printed
% as `Figure 1:~’ which is the default in standard LaTeX2e classes
% (a space should preceed the colon in French). This flaw may occur
% with pdfLaTeX as `:’ is made active too late.
% With LuaLaTeX and XeLaTeX, this glitch doesn’t occur, you get
% `Figure 1~:~’ which is correct in French. With pdfLaTeX \frenchb{}
% provides the following workaround.
%
% The standard definition of |\@makecaption| (e.g., the one provided
% in article.cls, report.cls, book.cls which is frozen for LaTeX2e
% according to Frank Mittelbach), is saved in |\STD@makecaption|.
% `AtBeginDocument’ we compare it to its current definition (some
% classes like \cls{memoir}, koma-script classes, AMS classes,
% ua-thesis.cls… change it).
% If they are identical, \frenchb{} just adds a hook called
% |\FBCaption@Separator| to |\@makecaption|; |\FBCaption@Separator|
% defaults to `:~’ as in the standard |\@makecaption| and will be
% changed to `~:~’ in French `AtBeginDocument’; it can be also set to
% |\CaptionSeparator| (` -- ’) using \fbo{CustomiseFigTabCaptions}.
%
% \changes{v2.6c}{2013/05/18}{Former \cs{CaptionSeparator}
% has been renamed as \cs{FBCaption@Separator};
% Newif \cs{if@FBwarning@capsep} added.}
%
% \changes{v2.6h}{2014/01/03}{No active catcodes in
% \cs{STD@makecaption}’s definition.}
%
% \changes{v3.0a}{2014/02/28}{Remove \cs{FBCaption@SeparatorORI}, use
% \cs{babel@save} instead.}
%
% While saving the standard definition of |\@makecaption| we have to
% make sure that characters `:’ and `|>|’ have |\catcode| 12
% (\frenchb{} makes `:’ active and \file{spanish.ldf} makes `|>|’
% active).
% \begin{macrocode}
\bgroup
\catcode`:=12 \catcode`>=12 \relax
\long\gdef\STD@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{#1: #2}%
\ifdim \wd\@tempboxa >\hsize
#1: #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\egroup
% \end{macrocode}
%
% No warning is issued for SMF and AMS classes as their layout
% of captions is compatible with French typographic standards.
%
% With \cls{memoir} and koma-script classes, \frenchb{} customises
% |\captiondelim| or |\captionformat| in French (unless option
% \fbo{CustomiseFigTabCaptions} is set to \fbo{false}) and issues
% no warning.
%
% When |\@makecaption| has been changed by another class
% or package, a warning is printed in the .log file.
%
% Enable the standard warning only if high punctuation is active.
% \begin{macrocode}
\newif\if@FBwarning@capsep
\ifFB@active@punct\@FBwarning@capseptrue\fi
\newcommand*{\CaptionSeparator}{\space\textendash\space}
\def\FBCaption@Separator{: }
\long\def\FB@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{#1\FBCaption@Separator #2}%
\ifdim \wd\@tempboxa >\hsize
#1\FBCaption@Separator #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
% \end{macrocode}
% \end{macro}
%
% \changes{v2.6c}{2013/05/18}{No warning about \cs{@makecaption} for
% AMS classes.}
%
% \changes{v3.0a}{2014/02/20}{No warning about \cs{@makecaption} for
% SMF classes.}
%
% Disable the standard warning with AMS and SMF classes.
% \begin{macrocode}
\@ifclassloaded{amsart}{\@FBwarning@capsepfalse}{}
\@ifclassloaded{amsbook}{\@FBwarning@capsepfalse}{}
\@ifclassloaded{amsdtx}{\@FBwarning@capsepfalse}{}
\@ifclassloaded{amsldoc}{\@FBwarning@capsepfalse}{}
\@ifclassloaded{amproc}{\@FBwarning@capsepfalse}{}
\@ifclassloaded{smfart}{\@FBwarning@capsepfalse}{}
\@ifclassloaded{smfbook}{\@FBwarning@capsepfalse}{}
% \end{macrocode}
%
% \changes{v3.5l}{2020/10/01}{No warning about \cs{@makecaption} for
% more classes.}
%
% Disable the standard warning for some classes that do not use
% `:’ as caption separator.
% \begin{macrocode}
\@ifclassloaded{IEEEconf}{\@FBwarning@capsepfalse}{}
\@ifclassloaded{IEEEtran}{\@FBwarning@capsepfalse}{}
\@ifclassloaded{revtex4-2}{\@FBwarning@capsepfalse}{}
\@ifclassloaded{svjour3}{\@FBwarning@capsepfalse}{}
% \end{macrocode}
%
% \changes{v2.6c}{2013/05/18}{No warning about \cs{@makecaption} for
% koma-script classes. \cs{captionformat} customised in French.}
%
% \changes{v2.6h}{2014/01/05}{If \cs{@makecaption} is undefined, no
% warning.}
%
% No warning with \cls{memoir} or koma-script classes: they change
% |\@makecaption| but we will manage to customise them in French
% later on (see below after executing |\FBprocess@options|)
% \begin{macrocode}
\@ifclassloaded{memoir}{\@FBwarning@capsepfalse}{}
\ifFB@koma \@FBwarning@capsepfalse \fi
% \end{macrocode}
% No warning with the \cls{beamer} class which defines
% |\beamer@makecaption| (customised below) instead of
% |\@makecaption|. No warning either if |\@makecaption| is
% undefined (i.e.\ \cls{letter}).
% \begin{macrocode}
\@ifclassloaded{beamer}{\@FBwarning@capsepfalse}{}
\ifdefined\@makecaption\else\@FBwarning@capsepfalse\fi
% \end{macrocode}
%
% \changes{v2.6c}{2013/05/18}{Warning added when the caption
% or floatrow package is loaded before babel/french.}
%
% \changes{v3.2b}{2016/03/30}{Warning added when the subcaption
% package is loaded before babel/french.}
%
% \changes{v3.3c}{2017/08/16}{Reorganise warnings when the caption,
% subcaption or floatrow packages are loaded before babel/french.}
%
% \changes{v3.5k}{2020/09/06}{Reorganise warnings about `:’ in captions,
% according to enhancements in caption.sty v3.5a.}
%
% \changes{v3.0a}{2014/02/20}{More informative, less TeXnical warning
% about \cs{@makecaption}.}
%
% First check the definition of |\@makecaption|, change it or issue
% a warning in case it has been changed by a class or package not
% (yet) compatible with \frenchb; then change the definition of
% |\FBCaption@Separator|, taking care that the colon is typeset
% correctly in French (\emph{not} `Figure~1: légende’).
%
% \changes{v3.1f}{2015/05/31}{\cs{FBCaption@Separator} changed when
% option CustomiseFigTabCaptions is set to false.}
%
% \begin{macrocode}
\AtBeginDocument{%
\ifx\@makecaption\STD@makecaption
\global\let\@makecaption\FB@makecaption
% \end{macrocode}
% If \fbo{OldFigTabCaptions=true}, do not overwrite
% |\FBCaption@Separator| (already saved as `: ’ for other languages
% and set to |\CaptionSeparator| by |\extrasfrench| when French is
% the main language); otherwise locally force |\autospace@beforeFDP|
% in case \fbo{AutoSpacePunctuation=false}.
% \begin{macrocode}
\ifFBOldFigTabCaptions
\else
\def\FBCaption@Separator{{\autospace@beforeFDP : }}%
\ifFBCustomiseFigTabCaptions
\ifFB@mainlanguage@FR
\def\FBCaption@Separator{\CaptionSeparator}%
\fi
\fi
\fi
\@FBwarning@capsepfalse
\fi
% \end{macrocode}
% No Warning if \file{caption.sty} or \file{caption-light.sty}
% has been loaded.
% \begin{macrocode}
\@ifpackageloaded{caption}{\@FBwarning@capsepfalse}{}%
\@ifpackageloaded{caption-light}{\@FBwarning@capsepfalse}{}%
% \end{macrocode}
% Final warning if relevant:
% \begin{macrocode}
\if@FBwarning@capsep
\FBWarning
{Figures' and tables' captions might look like\MessageBreak
`Figure 1:' in French instead of `Figure 1 :'.\MessageBreak
If this happens, to fix this issue\MessageBreak
switch to LuaLaTeX or XeLaTeX or\MessageBreak
try to add \protect\usepackage{caption} or\MessageBreak
... leave it as it is; reported}%
\fi
\let\FB@makecaption\relax
\let\STD@makecaption\relax
}
% \end{macrocode}
%
% \subsection{Dots…}
% \label{ssec-dots}
%
% \begin{macro}{\FBtextellipsis}
% Unless a ready-made character is available in the current font,
% LaTeX’s default definition of |\textellipsis| includes a |\kern| at
% the end; this space is not wanted in some cases (before a closing
% brace for instance) and |\kern| breaks hyphenation of the next
% word. We define |\FBtextellipsis| for French (in LaTeX only) the
% same way but without the last |\kern|.
%
% LY1 has a ready made character for |\textellipsis|, it should be
% used in French. The same is true for Unicode fonts in use
% with XeTeX and LuaTeX.
%
% \changes{v2.0}{2006/11/06}{Added special case for LY1 encoding,
% see bug report from Bruno Voisin (2004/05/18).}
%
% \changes{v2.5f}{2011/06/18}{Unicode fonts also provide a ready made
% character for \cs{textellipsis}, let’s just use it!
% (reported by Maxime Chupin, 2011/06/04).}
%
% \changes{v3.5m}{2021/07/19}{No longer redefine \cs{dots}, only
% \cs{textellipsis}’s default definition is changed in French.}
%
% \begin{macrocode}
\ifFBunicode
\else
\DeclareTextSymbol{\FBtextellipsis}{LY1}{133}
\DeclareTextCommand{\FBtextellipsis}{PU}{\9040\046}
\DeclareTextCommand{\FBtextellipsis}{PD1}{\203}
\DeclareTextCommandDefault{\FBtextellipsis}{%
.\kern\fontdimen3\font.\kern\fontdimen3\font.\xspace}%
\def\bbl@frenchdots{\babel@save\textellipsis
\let\textellipsis\FBtextellipsis}
\addto\extrasfrench{\bbl@frenchdots}
\fi
% \end{macrocode}
% \end{macro}
%
% \subsection{More checks about packages’ loading order}
% \label{ssec-loading-order}
%
% \changes{v3.1d}{2015/04/06}{New section: issue warnings if packages
% listings, numprint and natbib are loaded too early or too late
% vs babel.}
%
% \changes{v3.1i}{2015/10/03}{Remove restriction about loading
% numprint.sty after babel.}
%
% Like packages \file{captions} and \file{floatrow} (see
% section~\ref{ssec-captions-fig}), package \file{listings} should
% be loaded after \frenchb{} due to active characters issues
% (pdfLaTeX only).
%
% \begin{macrocode}
\ifFB@active@punct
\@ifpackageloaded{listings}
{\AtBeginDocument{%
\FBWarning{Please load the "listings" package\MessageBreak
AFTER babel/french; reported}}%
}{}
\fi
% \end{macrocode}
%
% Package \file{natbib} should be loaded before \frenchb{}
% due to active characters issues (pdfLaTeX only).
%
% \begin{macrocode}
\newif\if@FBwarning@natbib
\ifFB@active@punct
\@ifpackageloaded{natbib}{}{\@FBwarning@natbibtrue}
\fi
\AtBeginDocument{%
\if@FBwarning@natbib
\@ifpackageloaded{natbib}{}{\@FBwarning@natbibfalse}%
\fi
\if@FBwarning@natbib
\FBWarning{Please load the "natbib" package\MessageBreak
BEFORE babel/french; reported}%
\fi
}
% \end{macrocode}
%
% \changes{v3.2g}{2017/01/30}{Issue a warning if beamerarticle.sty
% is loaded after babel.}
%
% Package \pkg{beamerarticle} should be loaded before \frenchb{}
% to avoid list’s conflicts, see p.~\pageref{beamerarticle}.
%
% \begin{macrocode}
\newif\if@FBwarning@beamerarticle
\@ifpackageloaded{beamerarticle}{}{\@FBwarning@beamerarticletrue}
\AtBeginDocument{%
\if@FBwarning@beamerarticle
\@ifpackageloaded{beamerarticle}{}%
{\@FBwarning@beamerarticlefalse}%
\fi
\if@FBwarning@beamerarticle
\FBWarning{Please load the "beamerarticle" package\MessageBreak
BEFORE babel/french; reported}%
\fi
}
% \end{macrocode}
%
% \subsection{Setup options: keyval stuff}
% \label{ssec-keyval}
%
% \changes{v2.0}{2006/11/06}{New command \cs{frenchbsetup} added
% for global customisation.}
%
% \changes{v3.0a}{2014/02/24}{Options processing completely
% reorganised, now \cs{babel@save} and\cs{babel@savevariable} are
% usable for French.}
%
% All setup options are handled by command \fbsetup{} using the
% keyval syntax. A list of flags is defined and set to a default
% value which will possibly be changed `AtEndOfPackage’ if French is
% the main language. After this, \fbsetup{} eventually modifies the
% preset values of these flags.
%
% {\sloppypar Option processing can occur either in \fbsetup{}, but
% \emph{only for options explicitly set} by \fbsetup{}, or
% `AtBeginDocument’; any option affecting |\extrasfrench{}|
% \emph{must} be processed by \fbsetup{}: when French is the main
% language, |\extrasfrench{}| is executed by \babel{} when it
% switches the main language and this occurs \emph{before} reading
% the stuff postponed by \frenchb{} `AtBeginDocument’. Reexecuting
% |\extrasfrench{}| is an option which was used up to v2.6h, it has
% been dropped in v3.0a because of its side-effects (f.i.\
% |\babel@save| and |\babel@savevariable| did not work for
% French).\par}
%
% \begin{macro}{\frenchsetup}
% Let’s now define this command which reads and sets the options
% to be processed either immediately (i.e.\ just after setting the
% key) or later (at |\begin{document}|) by |\FBprocess@options|.
% \fbsetup{} can only be called in the preamble.
%
% \changes{v2.0c}{2007/06/25}{Option ThinSpaceInFrenchNumbers added.}
%
% \changes{v2.0d}{2007/07/15}{Options og and fg changed: limit
% the definition to French so that quote characters can be used
% in German.}
%
% \changes{v2.0e}{2007/10/05}{New option: StandardLists.}
%
% \changes{v2.0f}{2008/03/23}{Two typos corrected in
% option StandardLists.}
%
% \changes{v2.0f}{2008/03/23}{StandardLayout option had no
% effect on lists. Test moved to \cs{FBprocess@options}.}
%
% \changes{v2.0g}{2008/03/23}{Revert previous change to
% StandardLayout. This option must set the three flags
% \cs{FBReduceListSpacingfalse}, \cs{FBCompactItemizefalse},
% and \cs{FBStandardItemLabeltrue} instead of
% \cs{FBStandardListstrue}, so that later options can still
% change their value before executing \cs{FBprocess@options}.
% Same thing for option StandardLists.}
%
% \changes{v2.1a}{2008/03/24}{New option: FrenchSuperscripts
% to define \cs{up} as \cs{fup} or as \cs{textsuperscript}.}
%
% \changes{v2.1a}{2008/03/30}{New option: LowercaseSuperscripts.}
%
% \changes{v2.2a}{2008/05/08}{The global layout of the document is
% no longer changed when frenchb is not the last option of babel
% (\cs{bbl@main@language}). Suggested by Ulrike Fischer.}
%
% \changes{v2.2a}{2008/05/08}{Default values of flags changed:
% default now means `StandardLayout’, they will be changed to
% `FrenchLayout’ AtEndOfPackage only if french is
% \cs{bbl@main@language}.}
%
% \changes{v2.2a}{2008/05/08}{When frenchb is babel’s last option,
% French becomes the document’s main language, so
% GlobalLayoutFrench applies.}
%
% \changes{v2.4a}{2009/11/23}{New option SuppressWarning.}
%
% \changes{v2.6a}{2013/01/30}{New options ListOldLayout,
% StandardItemizeEnv and StandardEnumerateEnv (CompactItemize is
% deprecated).}
%
% \changes{v3.0a}{2014/02/28}{New options OldFigTabCaptions and
% CustomiseFigTabCaptions.}
%
% \changes{v3.0c}{2014/04/18}{New option INGuillSpace.}
%
% \changes{v3.1a}{2014/05/20}{New options InnerGuillSingle,
% EveryParGuill and EveryLineGuill to control \cs{frquote}.}
%
% \changes{v3.1b}{2014/09/15}{New option SmallCapsFigTabCaptions.}
%
% \changes{v3.1e}{2015/04/10}{Corrected typo: SmallCapsFigTabcaptions
% instead of SmallCapsFigTabCaptions. Pointed out by Céline
% Chevalier.}
%
% \changes{v3.1g}{2015/05/10}{PartNameFull now just sets the flag,
% nothing to add to \cs{captionsfrench} when false.}
%
% \changes{v3.3a}{2017/04/30}{\cs{frenchbsetup} is now an alias for
% \cs{frenchsetup}.}
%
% \changes{v3.3a}{2017/04/30}{Options INGuillSpace, ThinColonSpace no
% longer delayed AtBeginDocument.}
%
% \changes{v3.5a}{2018/07/04}{New option ListItemsAsPar for displaying
% lists’ items ``as paragraphs’’.}
%
% \changes{v3.5d}{2019/01/24}{ReduceListSpacing option depreciated: see
% StandardListSpacing.}
%
% \begin{macrocode}
\newcommand*{\frenchsetup}[1]{%
\setkeys{FB}{#1}%
}%
\@onlypreamble\frenchsetup
% \end{macrocode}
% Keep the former name |\frenchbsetup| working for compatibility.
% \begin{macrocode}
\let\frenchbsetup\frenchsetup
\@onlypreamble\frenchbsetup
% \end{macrocode}
%
% We define a collection of conditionals with their defaults
% (true or false).
%
% \begin{macrocode}
\newif\ifFBShowOptions
\newif\ifFBStandardLayout \FBStandardLayouttrue
\newif\ifFBGlobalLayoutFrench \FBGlobalLayoutFrenchtrue
\newif\ifFBReduceListSpacing
\newif\ifFBStandardListSpacing \FBStandardListSpacingtrue
\newif\ifFBListOldLayout
\newif\ifFBListItemsAsPar
\newif\ifFBCompactItemize
\newif\ifFBStandardItemizeEnv \FBStandardItemizeEnvtrue
\newif\ifFBStandardEnumerateEnv \FBStandardEnumerateEnvtrue
\newif\ifFBStandardItemLabels \FBStandardItemLabelstrue
\newif\ifFBStandardLists \FBStandardListstrue
\newif\ifFBIndentFirst
\newif\ifFBFrenchFootnotes
\newif\ifFBAutoSpaceFootnotes
\newif\ifFBOriginalTypewriter
\newif\ifFBThinColonSpace
\newif\ifFBThinSpaceInFrenchNumbers
\newif\ifFBFrenchSuperscripts \FBFrenchSuperscriptstrue
\newif\ifFBLowercaseSuperscripts \FBLowercaseSuperscriptstrue
\newif\ifFBPartNameFull \FBPartNameFulltrue
\newif\ifFBCustomiseFigTabCaptions
\newif\ifFBOldFigTabCaptions
\newif\ifFBSmallCapsFigTabCaptions \FBSmallCapsFigTabCaptionstrue
\newif\ifFBSuppressWarning
\newif\ifFBINGuillSpace
% \end{macrocode}
%
% The defaults values of these flags have been choosen so that
% \frenchb{} does not change anything regarding the global layout.
% |\bbl@main@language|, set by the last option of \babel, controls
% the global layout of the document. `AtEndOfPackage’ we check the
% main language in |\bbl@main@language|; if it is French (or a
% French dialect) the values of some flags have to be changed to
% ensure a French looking layout for the whole document (even in
% parts written in languages other than French); the end-user will
% then be able to customise the values of all these flags with
% \fbsetup{}.
%
% \changes{v2.5b}{2010/10/30}{Do not use the
% test \cs{iflanguage}\{french\} to check whether French is the
% main language or not, as it might be be erroneously positive
% when English is the main language and no hyphenation patterns
% are available for French.
% In this case \cs{l@french} and \cs{l@english} are 0.
% Pointed out by Günter Milde.}
%
% \changes{v3.1g}{2015/05/10}{Bug fix for koma-scripts classes:
% a spurious dot was added by the \cs{partformat} command.}
%
% \changes{v3.4a}{2018/01/07}{Patch for koma-script classes moved here,
% after \cs{ifFBPartNameFull} is defined, so that it applies to
% \cs{extrasacadian} too: \cs{AtEndOfPackage} is too late.}
%
% The following patch is for koma-script classes: the |\partformat|
% command, defined as |\partname~\thepart\autodot|, is incompatible
% with our redefinition of |\partname|.
% \begin{macrocode}
\ifFB@koma
\ifdefined\partformat
\def\FB@partformat@fix{%
\ifFBPartNameFull
\babel@save\partformat
\renewcommand*{\partformat}{\partname}%
\fi}
\addto\extrasfrench{\FB@partformat@fix}%
\fi
\fi
% \end{macrocode}
%
% \changes{v3.0c}{2014/03/30}{No list customisation when beamer
% class is loaded.}
%
% \changes{v3.2g}{2017/01/30}{Minimal list customisation when
% beamerarticle.sty is loaded.}
%
% \changes{v3.2h}{2017/04/11}{Option GlobalLayoutFrench skipped
% when French is not the main language.}
%
% \changes{v3.5e}{2019/03/14}{StandardLayout and GlobalLayoutFrench
% options can no longer be toggled when French is not the main
% language.}
%
% Our list customisation conflicts with the \cls{beamer} class and
% with the \pkg{beamerarticle} package. The patch provided in
% \pkg{beamerbasecompatibility} solves the conflict except in case
% of language changes, so we provide our own patch.
% When the \cls{beamer} is loaded, lists are not customised at all
% to ensure compatibility.\hlabel{beamerarticle}
% The \pkg{beamerarticle} package needs to be loaded \emph{before}
% \babel, a warning is issued otherwise, see
% section~\ref{ssec-loading-order}; a light customisation is
% compatible with the \pkg{beamerarticle} package.
%
% \begin{macrocode}
\def\FB@french{french}
\def\FB@acadian{acadian}
\newif\ifFB@mainlanguage@FR
\AtEndOfPackage{%
\ifx\bbl@main@language\FB@french \FB@mainlanguage@FRtrue
\else \ifx\bbl@main@language\FB@acadian \FB@mainlanguage@FRtrue \fi
\fi
\ifFB@mainlanguage@FR
\FBGlobalLayoutFrenchtrue
\@ifclassloaded{beamer}%
{\PackageInfo{french.ldf}{%
No list customisation for the beamer class,%
\MessageBreak reported}}%
{\@ifpackageloaded{beamerarticle}%
{\FBStandardItemLabelsfalse
\FBStandardListSpacingfalse
\PackageInfo{french.ldf}{%
Minimal list customisation for the beamerarticle%
\MessageBreak package; reported}}%
% \end{macrocode}
% Otherwise customise lists ``à la française’’:
% \begin{macrocode}
{\FBStandardListSpacingfalse
\FBStandardItemizeEnvfalse
\FBStandardEnumerateEnvfalse
\FBStandardItemLabelsfalse}%
}
\FBIndentFirsttrue
\FBFrenchFootnotestrue
\FBAutoSpaceFootnotestrue
\FBCustomiseFigTabCaptionstrue
\else
\FBGlobalLayoutFrenchfalse
\fi
% \end{macrocode}
% \frenchb{} being an option of \babel, it cannot load a package
% (\pkg{keyval}) while \file{french.ldf} is read, so we defer the
% loading of \file{keyval} and the options setup at the end of
% \babel’s loading.
% \begin{macrocode}
\RequirePackage{keyval}%
\define@key{FB}{ShowOptions}[true]%
{\csname FBShowOptions#1\endcsname}%
% \end{macrocode}
% The next two keys can only be toggled when French is the main
% language.
% \begin{macrocode}
\define@key{FB}{StandardLayout}[true]%
{\ifFB@mainlanguage@FR
\csname FBStandardLayout#1\endcsname
\else
\PackageWarning{french.ldf}%
{Option `StandardlLayout' skipped:\MessageBreak
French is *not* babel's last option.\MessageBreak
Reported}%
\fi
\ifFBStandardLayout
\FBStandardListSpacingtrue
\FBStandardItemizeEnvtrue
\FBStandardItemLabelstrue
\FBStandardEnumerateEnvtrue
\FBIndentFirstfalse
\FBFrenchFootnotesfalse
\FBAutoSpaceFootnotesfalse
\FBGlobalLayoutFrenchfalse
\else
\FBStandardListSpacingfalse
\FBStandardItemizeEnvfalse
\FBStandardItemLabelsfalse
\FBStandardEnumerateEnvfalse
\FBIndentFirsttrue
\FBFrenchFootnotestrue
\FBAutoSpaceFootnotestrue
\fi}%
\define@key{FB}{GlobalLayoutFrench}[true]%
{\ifFB@mainlanguage@FR
\csname FBGlobalLayoutFrench#1\endcsname
\else
\PackageWarning{french.ldf}%
{Option `GlobalLayoutFrench' skipped:\MessageBreak
French is *not* babel's last option.\MessageBreak
Reported}%
\fi}%
% \end{macrocode}
% If this key is set to \fbo{true} when French is the main language,
% nothing to do: all flags keep their default value.
% If this key is set to \fbo{false}, nothing to do either:
% |\babel@save| will do the job.
% \begin{macrocode}
\define@key{FB}{ReduceListSpacing}[true]%
{\csname FBReduceListSpacing#1\endcsname
\ifFBReduceListSpacing \FBStandardListSpacingfalse
\else \FBStandardListSpacingtrue\fi
}%
\define@key{FB}{StandardListSpacing}[true]%
{\csname FBStandardListSpacing#1\endcsname}%
\define@key{FB}{ListOldLayout}[true]%
{\csname FBListOldLayout#1\endcsname
\ifFBListOldLayout
\FBStandardEnumerateEnvtrue
\renewcommand*{\FrenchLabelItem}{\textendash}%
\fi}%
\define@key{FB}{CompactItemize}[true]%
{\csname FBCompactItemize#1\endcsname
\ifFBCompactItemize
\FBStandardItemizeEnvfalse
\FBStandardEnumerateEnvfalse
\else
\FBStandardItemizeEnvtrue
\FBStandardEnumerateEnvtrue
\fi}%
\define@key{FB}{StandardItemizeEnv}[true]%
{\csname FBStandardItemizeEnv#1\endcsname}%
\define@key{FB}{StandardEnumerateEnv}[true]%
{\csname FBStandardEnumerateEnv#1\endcsname}%
\define@key{FB}{StandardItemLabels}[true]%
{\csname FBStandardItemLabels#1\endcsname}%
\define@key{FB}{ItemLabels}%
{\renewcommand*{\FrenchLabelItem}{#1}}%
\define@key{FB}{ItemLabeli}%
{\renewcommand*{\Frlabelitemi}{#1}}%
\define@key{FB}{ItemLabelii}%
{\renewcommand*{\Frlabelitemii}{#1}}%
\define@key{FB}{ItemLabeliii}%
{\renewcommand*{\Frlabelitemiii}{#1}}%
\define@key{FB}{ItemLabeliv}%
{\renewcommand*{\Frlabelitemiv}{#1}}%
\define@key{FB}{StandardLists}[true]%
{\csname FBStandardLists#1\endcsname
\ifFBStandardLists
\FBStandardListSpacingtrue
\FBStandardItemizeEnvtrue
\FBStandardEnumerateEnvtrue
\FBStandardItemLabelstrue
\else
\FBStandardListSpacingfalse
\FBStandardItemizeEnvfalse
\FBStandardEnumerateEnvfalse
\FBStandardItemLabelsfalse
\fi}%
\define@key{FB}{ListItemsAsPar}[true]%
{\csname FBListItemsAsPar#1\endcsname}
\define@key{FB}{IndentFirst}[true]%
{\csname FBIndentFirst#1\endcsname}%
\define@key{FB}{FrenchFootnotes}[true]%
{\csname FBFrenchFootnotes#1\endcsname}%
\define@key{FB}{AutoSpaceFootnotes}[true]%
{\csname FBAutoSpaceFootnotes#1\endcsname}%
\define@key{FB}{AutoSpacePunctuation}[true]%
{\csname FBAutoSpacePunctuation#1\endcsname}%
\define@key{FB}{OriginalTypewriter}[true]%
{\csname FBOriginalTypewriter#1\endcsname}%
\define@key{FB}{ThinColonSpace}[true]%
{\csname FBThinColonSpace#1\endcsname
\ifFBThinColonSpace
\renewcommand*{\FBcolonspace}{\FBthinspace}%
\fi}%
\define@key{FB}{ThinSpaceInFrenchNumbers}[true]%
{\csname FBThinSpaceInFrenchNumbers#1\endcsname}%
\define@key{FB}{FrenchSuperscripts}[true]%
{\csname FBFrenchSuperscripts#1\endcsname}
\define@key{FB}{LowercaseSuperscripts}[true]%
{\csname FBLowercaseSuperscripts#1\endcsname}
\define@key{FB}{PartNameFull}[true]%
{\csname FBPartNameFull#1\endcsname}%
\define@key{FB}{CustomiseFigTabCaptions}[true]%
{\csname FBCustomiseFigTabCaptions#1\endcsname}%
\define@key{FB}{OldFigTabCaptions}[true]%
{\csname FBOldFigTabCaptions#1\endcsname
\ifFBOldFigTabCaptions
\def\FB@capsep@fix{\babel@save\FBCaption@Separator
\def\FBCaption@Separator{\CaptionSeparator}}%
\addto\extrasfrench{\FB@capsep@fix}%
\ifdefined\extrasacadian
\addto\extrasacadian{\FB@capsep@fix}%
\fi
\fi}%
\define@key{FB}{SmallCapsFigTabCaptions}[true]%
{\csname FBSmallCapsFigTabCaptions#1\endcsname
\ifFBSmallCapsFigTabCaptions
\else \let\FBfigtabshape\relax \fi}%
\define@key{FB}{SuppressWarning}[true]%
{\csname FBSuppressWarning#1\endcsname
\ifFBSuppressWarning
\renewcommand{\FBWarning}[1]{}%
\fi}%
% \end{macrocode}
% Here are the options controlling French guillemets spacing
% and the output of |\frquote{}|.
%
% \changes{v3.2g}{2017/01/30}{Warn when wrong values are provided to
% options EveryParGuill or EveryLineGuill.}
%
% \begin{macrocode}
\define@key{FB}{INGuillSpace}[true]%
{\csname FBINGuillSpace#1\endcsname
\ifFBINGuillSpace
\renewcommand*{\FBguillspace}{\space}%
\fi}%
\define@key{FB}{InnerGuillSingle}[true]%
{\csname FBInnerGuillSingle#1\endcsname}%
\define@key{FB}{EveryParGuill}[open]%
{\expandafter\let\expandafter
\FBeveryparguill\csname FBguill#1\endcsname
\ifx\FBeveryparguill\FBguillopen
\else\ifx\FBeveryparguill\FBguillclose
\else\ifx\FBeveryparguill\FBguillnone
\else
\let\FBeveryparguill\FBguillopen
\FBWarning{Wrong value for `EveryParGuill':
try `open',\MessageBreak
`close' or `none'. Reported}%
\fi
\fi
\fi}%
\define@key{FB}{EveryLineGuill}[open]%
{\ifFB@luatex@punct
\expandafter\let\expandafter
\FBeverylineguill\csname FBguill#1\endcsname
\ifx\FBeverylineguill\FBguillopen
\else\ifx\FBeverylineguill\FBguillclose
\else\ifx\FBeverylineguill\FBguillnone
\else
\let\FBeverylineguill\FBguillnone
\FBWarning{Wrong value for `EveryLineGuill':
try `open',\MessageBreak
`close' or `none'. Reported}%
\fi
\fi
\fi
\else
\FBWarning{Option `EveryLineGuill' skipped:%
\MessageBreak this option is for
LuaTeX *only*.\MessageBreak Reported}%
\fi}%
% \end{macrocode}
%
% \changes{v3.3c}{2017/07/23}{New option `UnicodeNoBreakSpaces’ for
% html translators (LuaLaTeX only).}
%
% Option \fbo{UnicodeNoBreakSpaces} (LuaLaTeX only) is meant for
% HTML translators: when true, all non-breaking spaces added by
% \frenchb{} are coded in the PDF file as Unicode characters, namely
% U+A0 or U+202F, instead of penalties and glues.
% \begin{macrocode}
\define@key{FB}{UnicodeNoBreakSpaces}[true]%
{\ifFB@luatex@punct
\csname FBucsNBSP#1\endcsname
\ifFBucsNBSP \FB@ucsNBSP=1 \fi
\else
\FBWarning{Option `UnicodeNoBreakSpaces' skipped:%
\MessageBreak this option is for
LuaTeX *only*.\MessageBreak Reported}%
\fi
}%
% \end{macrocode}
% Inputing French quotes as \emph{single characters} when they are
% available on the keyboard (through a compose key for instance)
% is more comfortable than typing |\og| and |\fg|.
%
% Life is simple here with modern LuaTeX or XeTeX engines: we just
% have to activate the |\FB@addGUILspace| attribute for LuaTeX or
% set |\XeTeXcharclass| of quotes to the proper value for XeTeX.
%
%\changes{v2.4c}{2010/05/23}{In \cs{ttfamilyFB}, also cancel
% automatic spaces inside French guillemets coded as characters
% (see \cs{frenchbsetup}).}
%
% \changes{v2.5g}{2011/12/31}{When \cs{ifFB@xetex@punct} is true,
% `og’ and `fg’ options now set XeTeXcharclasses of these characters
% to \cs{FB@guilo} and \cs{FB@guilf}. Otherwise French
% quotes behave as normal characters (their XeTeXcharclass is 0).}
%
% \changes{v2.6h}{2014/01/03}{\cs{FG@og} and \cs{FG@fg} changed:
% former clumsy code removed.}
%
% \changes{v3.1a}{2014/06/16}{Codes 0x13 and 0x14 added for French
% quotes in T1-encoding. Support for older versions of LuaTeX and
% XeTeX dropped.}
%
% \changes{v3.2c}{2016/05/03}{Add a warning about options og/fg for old
% XeTeX or LuaTeX engines requiring active characters.}
%
% \changes{v3.4d}{2018/04/11}{New test for deciding about utf8 encoding
% for keys og and fg (the former one fails with LaTeX 2018 release).}
%
% With pdfTeX (or old LuaTeX and XeTeX engines), quote characters
% are made active and expand to |\og\ignorespaces| and |{\fg}|
% respectively if the current language is French, and to
% |\guillemotleft| and |\guillemotright| otherwise (think of German
% quotes), this is done by |\FB@@og| and |\FB@@fg|; thus correct
% non-breaking spaces will be added automatically to French quotes.
% The quote characters typed in depend on the input encoding,
% it can be single-byte (latin1, latin9, applemac,…) or
% multi-bytes (utf-8, utf8x); the next command is meant for checking
% whether a character is single-byte (|\FB@second| is empty) or not.
% \begin{macrocode}
\def\FB@parse#1#2\endparse{\def\FB@second{#2}}%
% \end{macrocode}
%
% \begin{macrocode}
\define@key{FB}{og}%
{\ifFBunicode
% \end{macrocode}
% LuaTeX or XeTeX in use, first try modern LuaTeX: we just need
% to set LuaTeX’s attribute |\FB@addGUILspace| to 1,
% \begin{macrocode}
\ifFB@luatex@punct
\FB@addGUILspace=1 \relax
\fi
% \end{macrocode}
% then with XeTeX it is a bit more tricky:
% \begin{macrocode}
\ifFB@xetex@punct
% \end{macrocode}
% |\XeTeXinterchartokenstate| is defined, we just need to set
% |\XeTeXcharclass| to |\FB@guilo| for the French opening quote
% in T1 and Unicode encoding (see subsection~\ref{ssec-punct}).
% \begin{macrocode}
\XeTeXcharclass"13 = \FB@guilo
\XeTeXcharclass"AB = \FB@guilo
\XeTeXcharclass"A0 = \FB@guilnul
\XeTeXcharclass"202F = \FB@guilnul
\fi
% \end{macrocode}
% Issue a warning with older Unicode engines requiring active
% characters.
% \begin{macrocode}
\ifFB@active@punct
\FBWarning{Option og=« not supported with this version
of\MessageBreak LuaTeX/XeTeX; reported}%
\fi
\else
% \end{macrocode}
% This is for conventional TeX engines:
% \begin{macrocode}
\newcommand*{\FB@@og}{%
\ifFBfrench
\ifFB@spacing\FB@og\ignorespaces
\else\guillemotleft
\fi
\else\guillemotleft\fi}%
\AtBeginDocument{%
\ifdefined\uc@dclc
% \end{macrocode}
% Package \pkg{inputenc} with utf8x (ucs) encoding loaded,
% use |\uc@dclc|:
% \begin{macrocode}
\uc@dclc{171}{default}{\FB@@og}%
\else
% \end{macrocode}
% if encoding is not utf8x, check if the argument of |og|
% is a single-byte character:
% \begin{macrocode}
\FB@parse#1\endparse
\ifx\FB@second\@empty
% \end{macrocode}
% This means 8-bit character encoding.
% Package \pkg{MULEenc} (from CJK) defines |\mule@def|
% to map characters to control sequences.
% \begin{macrocode}
\ifdefined\mule@def
\mule@def{11}{\FB@@og}%
\else
\ifdefined\DeclareInputText
\@tempcnta`#1\relax
\DeclareInputText{\the\@tempcnta}{\FB@@og}%
\else
% \end{macrocode}
% Package \pkg{inputenc} not loaded, no way…
% \begin{macrocode}
\FBWarning{Option `og' requires package
inputenc;\MessageBreak reported}%
\fi
\fi
\else
% \end{macrocode}
% This means multi-byte character encoding, we assume UTF-8
% \begin{macrocode}
\DeclareUnicodeCharacter{00AB}{\FB@@og}%
\fi
\fi}%
\fi
}%
% \end{macrocode}
%
% Same code for the closing quote.
% \begin{macrocode}
\define@key{FB}{fg}%
{\ifFBunicode
\ifFB@luatex@punct
\FB@addGUILspace=1 \relax
\fi
\ifFB@xetex@punct
\XeTeXcharclass"14 = \FB@guilf
\XeTeXcharclass"BB = \FB@guilf
\XeTeXcharclass"A0 = \FB@guilnul
\XeTeXcharclass"202F = \FB@guilnul
\fi
\ifFB@active@punct
\FBWarning{Option fg=» not supported with this version
of\MessageBreak LuaTeX/XeTeX; reported}%
\fi
\else
\newcommand*{\FB@@fg}{%
\ifFBfrench
\ifFB@spacing\FB@fg
\else\guillemotright
\fi
\else\guillemotright\fi}%
\AtBeginDocument{%
\ifdefined\uc@dclc
\uc@dclc{187}{default}{\FB@@fg}%
\else
\FB@parse#1\endparse
\ifx\FB@second\@empty
\ifdefined\mule@def
\mule@def{27}{{\FB@@fg}}%
\else
\ifdefined\DeclareInputText
\@tempcnta`#1\relax
\DeclareInputText{\the\@tempcnta}{\FB@@fg}%
\else
\FBWarning{Option `fg' requires package
inputenc;\MessageBreak reported}%
\fi
\fi
\else
\DeclareUnicodeCharacter{00BB}{\FB@@fg}%
\fi
\fi}%
\fi
}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FBprocess@options}
% |\FBprocess@options| will be executed at |\begin{document}|:
% it first checks about packages loaded in the preamble (possibly
% after \babel) which customise lists: currently \pkg{enumitem},
% \pkg{paralist} and \pkg{enumerate}; then it processes the options
% as set by \fbsetup{} or forced for compatibility with packages
% loaded in the preamble.
%
% When French is the main language, |\extrasfrench| and
% |\captionsfrench| \emph{have already been processed} by \babel{}
% at |\begin{document}| \emph{before} |\FBprocess@options|.
% \begin{macrocode}
\newcommand*{\FBprocess@options}{%
% \end{macrocode}
% Update flags if a package customising lists has been loaded,
% currently: \pkg{enumitem}, \pkg{paralist}, \pkg{enumerate}.
% \begin{macrocode}
\@ifpackageloaded{enumitem}{%
\ifFBStandardItemizeEnv
\else
\FBStandardItemizeEnvtrue
\PackageInfo{french.ldf}%
{Setting StandardItemizeEnv=true for\MessageBreak
compatibility with enumitem package,\MessageBreak
reported}%
\fi
\ifFBStandardEnumerateEnv
\else
\FBStandardEnumerateEnvtrue
\PackageInfo{french.ldf}%
{Setting StandardEnumerateEnv=true for\MessageBreak
compatibility with enumitem package,\MessageBreak
reported}%
\fi}{}%
\@ifpackageloaded{paralist}{%
\ifFBStandardItemizeEnv
\else
\FBStandardItemizeEnvtrue
\PackageInfo{french.ldf}%
{Setting StandardItemizeEnv=true for\MessageBreak
compatibility with paralist package,\MessageBreak
reported}%
\fi
\ifFBStandardEnumerateEnv
\else
\FBStandardEnumerateEnvtrue
\PackageInfo{french.ldf}%
{Setting StandardEnumerateEnv=true for\MessageBreak
compatibility with paralist package,\MessageBreak
reported}%
\fi}{}%
\@ifpackageloaded{enumerate}{%
\ifFBStandardEnumerateEnv
\else
\FBStandardEnumerateEnvtrue
\PackageInfo{french.ldf}%
{Setting StandardEnumerateEnv=true for\MessageBreak
compatibility with enumerate package,\MessageBreak
reported}%
\fi}{}%
% \end{macrocode}
% Reset |\FB@ufl|’s normal meaning and update lists’ settings
% now in case French is the main language: \hlabel{FB@ufl}
% \begin{macrocode}
\def\FB@ufl{\update@frenchlists}
\ifFB@mainlanguage@FR
\update@frenchlists
\fi
% \end{macrocode}
% The layout of footnotes is handled at the |\begin{document}|
% depending on the values of flags \fbo{FrenchFootnotes}
% and \fbo{AutoSpaceFootnotes} (see section~\ref{ssec-footnotes}),
% nothing has to be done here for footnotes.
%
% \fbo{AutoSpacePunctuation} adds a non-breaking space (in French
% only) before the four active characters (:;!?) even if none has
% been typed before them.
% \begin{macrocode}
\ifFBAutoSpacePunctuation
\autospace@beforeFDP
\else
\noautospace@beforeFDP
\fi
% \end{macrocode}
% When \fbo{OriginalTypewriter} is set to \fbo{false} (the default),
% |\ttfamily|, |\rmfamily| and |\sffamily| are redefined as
% |\ttfamilyFB|, |\rmfamilyFB| and |\sffamilyFB| respectively
% to prevent addition of automatic spaces before the four active
% characters in computer code.
% \begin{macrocode}
\ifFBOriginalTypewriter
\else
\let\ttfamilyORI\ttfamily
\let\rmfamilyORI\rmfamily
\let\sffamilyORI\sffamily
\let\ttfamily\ttfamilyFB
\let\rmfamily\rmfamilyFB
\let\sffamily\sffamilyFB
\fi
% \end{macrocode}
%
% When package \pkg{numprint} is loaded with option
% \opt{autolanguage}, \pkg{numprint}’s command |\npstylefrench| has
% to be redefined differently according to the value of flag
% \fbo{ThinSpaceInFrenchNumbers}.
% As |\npstylefrench| was undefined in old versions of
% \pkg{numprint}, we provide this command.
% \begin{macrocode}
\@ifpackageloaded{numprint}%
{\ifnprt@autolanguage
\providecommand*{\npstylefrench}{}%
\ifFBThinSpaceInFrenchNumbers
\renewcommand*{\FBthousandsep}{\,}%
\fi
\g@addto@macro\npstylefrench{\npthousandsep{\FBthousandsep}}%
\fi
}{}%
% \end{macrocode}
% \fbo{FrenchSuperscripts}: if \fbo{true} |\up=\fup|, else
% |\up=\textsuperscript|. Anyway |\up*=\FB@up@fake|. The star-form
% |\up*{}| is provided for fonts that lack some superior letters:
% Adobe Jenson Pro and Utopia Expert have no ``g superior’’ for
% instance.
% \begin{macrocode}
\ifFBFrenchSuperscripts
\DeclareRobustCommand*{\up}{%
\texorpdfstring{\@ifstar{\FB@up@fake}{\fup}}{}%
}
\else
\DeclareRobustCommand*{\up}{%
\texorpdfstring{\@ifstar{\FB@up@fake}{\textsuperscript}}{}%
}
\fi
% \end{macrocode}
% \fbo{LowercaseSuperscripts}: if \fbo{false} |\FB@lc| is redefined
% to do nothing.
% \begin{macrocode}
\ifFBLowercaseSuperscripts
\else
\renewcommand*{\FB@lc}[1]{##1}%
\fi
% \end{macrocode}
%
% \changes{v3.0a}{2014/02/20}{With koma-script and memoir class,
% customise \cs{captionformat} and \cs{captiondelim}.}
%
% \changes{v3.1f}{2015/05/31}{Definition of \cs{captionformat} and
% \cs{captiondelim} changed when option CustomiseFigTabCaptions
% is set to false.}
%
% \changes{v3.1f}{2015/05/31}{Bug fix for the beamer class:
% figure and table captions are now consistent with babel-french’s
% documentation. Pointed out by Denis Bitouzé.}
%
% \changes{v3.5i}{2020/06/29}{For memoir, koma-script and beamer
% classes, leave caption delimiter unchanged if it has been user
% customised.}
%
% This is for koma-script, \cls{memoir} and \cls{beamer} classes.
% If the caption delimiter has been user customised, leave it
% unchanged. Otherwise, force the colon to behave properly in French
% (add locally |\autospace@beforeFDP| in case of
% \fbo{AutoSpacePunctuation=false}) and change the caption delimiter
% to |\CaptionSeparator| if \fbo{CustomiseFigTabCaptions} has been
% set to \fbo{true}.
% \begin{macrocode}
\ifFB@koma
\ifx\captionformat\FB@std@capsep
\ifFBCustomiseFigTabCaptions
\renewcommand*{\captionformat}{\CaptionSeparator}%
\else
\renewcommand*{\captionformat}{{\autospace@beforeFDP :\ }}%
\fi
\fi
\fi
\@ifclassloaded{memoir}%
{\ifx\@contdelim\FB@std@capsep
\ifFBCustomiseFigTabCaptions
\captiondelim{\CaptionSeparator}%
\else
\captiondelim{{\autospace@beforeFDP : }}%
\fi
\fi}{}%
\@ifclassloaded{beamer}%
{\protected@edef\FB@capsep{%
\csname beamer@@tmpl@caption label separator\endcsname}%
\ifx\FB@capsep\FB@std@capsep
\ifFBCustomiseFigTabCaptions
\defbeamertemplate{caption label separator}{FBcustom}{%
\CaptionSeparator}%
\setbeamertemplate{caption label separator}[FBcustom]%
\else
\defbeamertemplate{caption label separator}{FBcolon}{%
{\autospace@beforeFDP : }}%
\setbeamertemplate{caption label separator}[FBcolon]%
\fi
\fi}{}%
% \end{macrocode}
% \fbo{ShowOptions}: if \fbo{true}, print the list of all options
% to the \file{.log} file.
% \begin{macrocode}
\ifFBShowOptions
\GenericWarning{* }{%
*** List of possible options for babel-french ***\MessageBreak
[Default values between brackets when french is loaded *LAST*]%
\MessageBreak
ShowOptions [false]\MessageBreak
StandardLayout [false]\MessageBreak
GlobalLayoutFrench [true]\MessageBreak
PartNameFull [true]\MessageBreak
IndentFirst [true]\MessageBreak
ListItemsAsPar [false]\MessageBreak
StandardListSpacing [false]\MessageBreak
StandardItemizeEnv [false]\MessageBreak
StandardEnumerateEnv [false]\MessageBreak
StandardItemLabels [false]\MessageBreak
ItemLabels=\textemdash, \textbullet,
\protect\ding{43},... [\textendash]\MessageBreak
ItemLabeli=\textemdash, \textbullet,
\protect\ding{43},... [\textendash]\MessageBreak
ItemLabelii=\textemdash, \textbullet,
\protect\ding{43},... [\textendash]\MessageBreak
ItemLabeliii=\textemdash, \textbullet,
\protect\ding{43},... [\textendash]\MessageBreak
ItemLabeliv=\textemdash, \textbullet,
\protect\ding{43},... [\textendash]\MessageBreak
StandardLists [false]\MessageBreak
ListOldLayout [false]\MessageBreak
FrenchFootnotes [true]\MessageBreak
AutoSpaceFootnotes [true]\MessageBreak
AutoSpacePunctuation [true]\MessageBreak
ThinColonSpace [false]\MessageBreak
OriginalTypewriter [false]\MessageBreak
UnicodeNoBreakSpaces [false]\MessageBreak
og= <left quote character>, fg= <right quote character>%
INGuillSpace [false]\MessageBreak
EveryParGuill=open, close, none [open]\MessageBreak
EveryLineGuill=open, close, none
[open in LuaTeX, none otherwise]\MessageBreak
InnerGuillSingle [false]\MessageBreak
ThinSpaceInFrenchNumbers [false]\MessageBreak
SmallCapsFigTabCaptions [true]\MessageBreak
CustomiseFigTabCaptions [true]\MessageBreak
OldFigTabCaptions [false]\MessageBreak
FrenchSuperscripts [true]\MessageBreak
LowercaseSuperscripts [true]\MessageBreak
SuppressWarning [false]\MessageBreak
\MessageBreak
*********************************************%
\MessageBreak\protect\frenchsetup{ShowOptions}}
\fi
}
% \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2006/12/06}{Added warning for OT1 encoding.}
%
% \changes{v2.1b}{2008/04/07}{Disable some commands in bookmarks.}
%
% \changes{v2.5e}{2011/04/03}{\cs{pdfstringdefDisableCommands} should
% redefine \cs{FB@og} and \cs{FB@fg} instead of \cs{og} and \cs{fg}
% so that it works also when quotes are entered as characters.
% Reported by Sébastien Gouezel.}
%
% At |\begin{document}|, we have to provide an |\xspace| command
% in case the \pkg{xspace} package is not loaded, do some setup for
% \file{hyperref}’s bookmarks, execute |\FBprocess@options|, switch
% LuaTeX punctuation on and issue some warnings if necessary.
% \begin{macrocode}
\AtBeginDocument{%
\providecommand*{\xspace}{\relax}%
% \end{macrocode}
%
% \changes{v3.5k}{2020/07/30}{\cs{pdfstringdefDisableCommands}
% dropped.}
%
% Let’s now process the remaining options, either not explicitly
% set by \fbsetup{} or possibly modified by packages loaded after
% \frenchb.
% \begin{macrocode}
\FBprocess@options
% \end{macrocode}
% When option \fbo{UnicodeNoBreakSpaces} is \fbo{true}
% (LuaLaTeX only) we need to redefine |\FBmedkern|, |\FBthickkern|
% and |\FBthousandsep| as Unicode characters.
% \begin{macrocode}
\ifFBucsNBSP
\renewcommand*{\FBmedkern}{\char"202F\relax}%
\renewcommand*{\FBthickkern}{\char"A0\relax}%
\ifFBThinSpaceInFrenchNumbers
\renewcommand*{\FBthousandsep}{\char"202F\relax}%
\else
\renewcommand*{\FBthousandsep}{\char"A0\relax}%
\fi
\fi
% \end{macrocode}
%
% \changes{v3.0a}{2014/01/28}{Test \cs{ifXeTeX} changed to
% \cs{ifFBunicode} and `xltxtra’ changed to `fontspec’.}
%
% \changes{v3.1a}{2014/06/14}{fontspec is not required for T1 fonts
% used with the luainputenc.sty package.}
%
% \changes{v3.2g}{2017/01/24}{fontspec defines TU encoding now and
% no longer loads xunicode.sty. Test changed.}
%
% \changes{v3.3c}{2017/09/06}{LaTeX 2017-04-15 defines TU encoding
% for Unicode engines, fontspec is no longer required.}
%
% Finally, with pdfLaTeX, when OT1 encoding is in use at the
% |\begin{document}| a warning is issued; |\encodingdefault|
% being defined as `long’, the test would fail if |\FBOTone| was
% defined with |\newcommand*|!
% \begin{macrocode}
\begingroup
\newcommand{\FBOTone}{OT1}%
\ifx\encodingdefault\FBOTone
\FBWarning{OT1 encoding should not be used for French.%
\MessageBreak
Add \protect\usepackage[T1]{fontenc} to the
preamble\MessageBreak of your document; reported}%
\fi
\endgroup
}
% \end{macrocode}
%
% \subsection{French lists}
% \label{ssec-lists}
%
% \changes{v2.6a}{2013/01/30}{Bug correction: changing \cs{leftmargin}
% cannot be done only for itemize-lists: it messes up
% embedded enumerate lists. Pointed out by Denis Bitouzé.
% Lists have been completely redesigned in frenchb v.~2.6a.
% An option for backward compatibility is provided.}
%
% \begin{macro}{\listFB}
% \begin{macro}{\listORI}
% \begin{macro}{\FB@listVsettings}
% Vertical spacing in lists should be shorter in French texts than
% the defaults provided by LaTeX.
% Note that the easy way, just changing values of vertical spacing
% parameters when entering French and restoring them to their
% defaults on exit would not work; so we define the command
% |\FB@listVsettings| to hold the settings to be used by
% the French variant |\listFB| of |\list|. Note that switching
% to |\listFB| reduces vertical spacing in \emph{all} environments
% built on |\list|: |itemize|, |enumerate|, |description|, but also
% |abstract|, |quotation|, |quote| and |verse|…
%
% The amount of vertical space before and after a list is given by
% |\topsep| + |\parskip| (+ |\partopsep| if the list starts a new
% paragraph). IMHO, |\parskip| should be added \emph{only} when
% the list starts a new paragraph, so I subtract |\parskip| from
% |\topsep| and add it back to |\partopsep|; this will normally
% make no difference because |\parskip|’s default value is 0pt, but
% will be noticeable when |\parskip| is \emph{not} null.
%
% \begin{macrocode}
\let\listORI\list
\let\endlistORI\endlist
\def\FB@listVsettings{%
\setlength{\itemsep}{0.4ex plus 0.2ex minus 0.2ex}%
\setlength{\parsep}{0.4ex plus 0.2ex minus 0.2ex}%
\setlength{\topsep}{0.8ex plus 0.4ex minus 0.4ex}%
\setlength{\partopsep}{0.4ex plus 0.2ex minus 0.2ex}%
% \end{macrocode}
% |\parskip| is of type `skip’, its mean value only (\emph{not
% the glue}) should be subtracted from |\topsep| and added to
% |\partopsep|, so convert |\parskip| to a `dimen’ using
% |\@tempdima|.
% \begin{macrocode}
\@tempdima=\parskip
\addtolength{\topsep}{-\@tempdima}%
\addtolength{\partopsep}{\@tempdima}%
}
\def\listFB#1#2{\listORI{#1}{\FB@listVsettings #2}}
\let\endlistFB\endlist
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% Let’s now consider French itemize-lists. They differ from those
% provided by the standard LaTeX classes:
% \begin{itemize}
% \item The `\textbullet’ is never used in French itemize-lists,
% an emdash `---’ or an endash `--’ is preferred for all
% levels. The item label to be used in French, stored in
% |\FrenchLabelItem}|, defaults to `---’ and can be changed
% using \fbsetup{} (see section~\ref{ssec-keyval}).
% \item Vertical spacing between items, before and after
% the list, should be \emph{null} with \emph{no glue} added;
% \item In French the labels of itemize-lists are vertically
% aligned as shown p.~\pageref{ListAsPar}.
% \end{itemize}
%
% \begin{macro}{\FrenchLabelItem}
% \changes{v2.6a}{2013/01/30}{default changed from \cs{textendash} to
% \cs{textemdash}.}
% \begin{macro}{\Frlabelitemi}
% \begin{macro}{\Frlabelitemii}
% \begin{macro}{\Frlabelitemiii}
% \begin{macro}{\Frlabelitemiv}
% Default labels for French itemize-lists (same label for all levels):
% \begin{macrocode}
\newcommand*{\FrenchLabelItem}{\textemdash}
\newcommand*{\Frlabelitemi}{\FrenchLabelItem}
\newcommand*{\Frlabelitemii}{\FrenchLabelItem}
\newcommand*{\Frlabelitemiii}{\FrenchLabelItem}
\newcommand*{\Frlabelitemiv}{\FrenchLabelItem}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\listindentFB}
% \begin{macro}{\descindentFB}
% \begin{macro}{\labelindentFB}
% \begin{macro}{\labelwidthFB}
% Let’s define four dimens |\listindentFB|, |\descindentFB|,
% |\labelindentFB| and |\labelwidthFB| to customise lists’ horizontal
% indentations.
% They are given silly negative values here in order to eventually
% enable their customisation in the preamble. They will get
% reasonnable defaults later when entering French (see
% |\setlabelitemsFB| and |\setlistindentFB|) unless they have been
% customised.
% \begin{macrocode}
\newdimen\listindentFB
\setlength{\listindentFB}{-1pt}
\newdimen\descindentFB
\setlength{\descindentFB}{-1pt}
\newdimen\labelindentFB
\setlength{\labelindentFB}{-1pt}
\newdimen\labelwidthFB
\setlength{\labelwidthFB}{-1pt}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \changes{v3.2e}{2016/10/28}{Add missing redefinitions for
% \cs{leftmarginv}, \cs{leftmarginvi}. Suggested by J.F. Burnol.}
%
% \changes{v3.5a}{2018/07/04}{New optional layout for lists:
% lists’ items can be typeset as paragraphs with indented labels
% while the default leaves the labels hanging into the left margin.}
%
% \begin{macro}{\leftmarginFB}
% \begin{macro}{\FB@listHsettings}
% |\FB@listHsettings| holds the new horizontal settings chosen for
% French lists \env{itemize}, \env{enumerate} and \env{description}
% (two possible layouts).
% \begin{macrocode}
\newdimen\leftmarginFB
\def\FB@listHsettings{%
\ifFBListItemsAsPar
% \end{macrocode}
% Optional layout: lists’ items are typeset as paragraphs with
% indented labels.
% \begin{macrocode}
\itemindent=\labelindentFB
\advance\itemindent by \labelwidthFB
\advance\itemindent by \labelsep
\leftmargini\z@
\bbl@for\FB@dp {2, 3, 4, 5, 6}%
{\csname leftmargin\romannumeral\FB@dp\endcsname =
\labelindentFB}%
\else
% \end{macrocode}
% Default layout: labels hanging into the left margin.
% \begin{macrocode}
\leftmarginFB=\labelwidthFB
\advance\leftmarginFB by \labelsep
\bbl@for\FB@dp {1, 2, 3, 4, 5, 6}%
{\csname leftmargin\romannumeral\FB@dp\endcsname =
\leftmarginFB}%
\advance\leftmargini by \listindentFB
\fi
\leftmargin=\csname leftmargin%
\ifnum\@listdepth=\@ne i\else ii\fi\endcsname
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\itemizeFB}
% \begin{macro}{\FB@itemizesettings}
%
% \changes{v2.6f}{2013/11/25}{\cs{labelwidth} must be reset, f.i. when
% an itemize list occurs inside environments based on trivlist which
% set \cs{labelwidth} to 0 (see proof environment in amsthm.sty).
% Bug pointed out by Julien Hauseux.}
%
% \changes{v2.6g}{2013/12/30}{Suppress all vertical spaces only if
% ReduceListSpacing is true. Pointed out by Pierre Willaime.}
%
% New environment for French itemize-lists.\\ |\FB@itemizesettings|
% does two things: first suppress all vertical spaces including glue
% unless option \fbo{StandardListSpacing} is set, then set horizontal
% indentations according to |\FB@listHsettings| unless option
% \fbo{ListOldLayout} is \fbo{true} (compatibility with lists
% up to v.~2.5k).
% \begin{macrocode}
\def\FB@itemizesettings{%
\ifFBStandardListSpacing
\else
\setlength{\itemsep}{\z@}%
\setlength{\parsep}{\z@}%
\setlength{\topsep}{\z@}%
\setlength{\partopsep}{\z@}%
\@tempdima=\parskip
\addtolength{\topsep}{-\@tempdima}%
\addtolength{\partopsep}{\@tempdima}%
\fi
\settowidth{\labelwidth}{\csname\@itemitem\endcsname}%
\ifFBListOldLayout
\setlength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}%
\addtolength{\leftmargin}{\parindent}%
\else
\FB@listHsettings
\fi
}
% \end{macrocode}
% The definition of |\itemizeFB| follows the one of |\itemize|
% in standard LaTeX classes (see \file{ltlists.dtx}),
% spaces are customised by |\FB@itemizesettings|.
%
% \begin{macrocode}
\def\itemizeFB{%
\ifnum \@itemdepth >\thr@@\@toodeep\else
\advance\@itemdepth by \@ne
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
\expandafter
\listORI
\csname\@itemitem\endcsname
\FB@itemizesettings
\fi
}
\let\enditemizeFB\endlistORI
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macrocode}
\def\setlabelitemsFB{%
\let\labelitemi\Frlabelitemi
\let\labelitemii\Frlabelitemii
\let\labelitemiii\Frlabelitemiii
\let\labelitemiv\Frlabelitemiv
\ifdim\labelwidthFB<\z@
\settowidth{\labelwidthFB}{\FrenchLabelItem}%
\fi
}
\def\setlistindentFB{%
\ifdim\labelindentFB<\z@
\ifdim\parindent=\z@
\setlength{\labelindentFB}{1.5em}%
\else
\setlength{\labelindentFB}{\parindent}%
\fi
\fi
\ifdim\listindentFB<\z@
\ifdim\parindent=\z@
\setlength{\listindentFB}{1.5em}%
\else
\setlength{\listindentFB}{\parindent}%
\fi
\fi
\ifdim\descindentFB<\z@
\ifFBListItemsAsPar
\setlength{\descindentFB}{\labelindentFB}%
\else
\setlength{\descindentFB}{\listindentFB}%
\fi
\fi
}
% \end{macrocode}
%
% \begin{macro}{\enumerateFB}
% The definition of |\enumerateFB|, new to version~2.6a, follows
% the one of |\enumerate| in standard LaTeX classes (see
% \file{ltlists.dtx}), vertical spaces are customised (or not)
% via |\list| (=|\listFB| or |\listORI|) and horizontal spaces
% (leftmargins) are borrowed from |itemize| lists via
% |\FB@listHsettings|.
%
% \begin{macrocode}
\def\enumerateFB{%
\ifnum \@enumdepth >\thr@@\@toodeep\else
\advance\@enumdepth by \@ne
\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
\expandafter
\list
\csname label\@enumctr\endcsname
{\FB@listHsettings
\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}%
\fi
}
\let\endenumerateFB\endlistORI
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\descriptionFB}
% \changes{v2.6b}{2013/02/10}{Settings of \cs{FB@listHsettings} should
% apply to description lists too.}
%
% \changes{v3.0a}{2014/02/28}{Added \cs{listindentFB} to
% \cs{itemindent}. Suggested by Denis Bitouzé.}
%
% \changes{v3.2d}{2014/07/01}{Changed \cs{listindentFB} to
% \cs{descindentFB} which defaults to \cs{listindentFB}.
% \cs{leftmargini} reduced when \cs{descindentFB} is null.}
%
% \changes{v3.5a}{2018/07/04}{ListItemsAsPar option taken into account
% for description lists.}
%
% Same tuning for the \env{description} environment (see
% \file{classes.dtx} for the original definition).
% Customisable dimen |\descindentFB|, which defaults to
% |\listindentFB|, is added to |\itemindent| (first level only).
% When |\descindentFB=0pt| (1rst level labels start at the left
% margin), |\leftmargini| is reduced to |\listindentFB| instead
% of |\listindentFB| + |\leftmarginFB|.
%
% When option \fbo{ListItemsAsPar} is turned to \fbo{true}, the
% \env{description} items are also displayed as paragraphs;
% |\descindentFB=0pt| can be used to push labels to the left margin.
% \begin{macrocode}
\def\descriptionFB{%
\list{}{\FB@listHsettings
\labelwidth=\z@
\ifFBListItemsAsPar
\itemindent=\descindentFB
\else
\itemindent=-\leftmargin
\ifnum\@listdepth=1
\ifdim\descindentFB=\z@
\ifdim\listindentFB>\z@
\leftmargini=\listindentFB
\leftmargin=\leftmargini
\itemindent=-\leftmargin
\fi
\else
\advance\itemindent by \descindentFB
\fi
\fi
\fi
\let\makelabel\descriptionlabel}%
}
\let\enddescriptionFB\endlistORI
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\update@frenchlists}
% \begin{macro}{\bbl@frenchlistlayout}
% |\update@frenchlists| will set up lists according to the final
% options (default or part of \fbsetup{} eventually overruled in
% |\FBprocess@options|).
% \begin{macrocode}
\def\update@frenchlists{%
\setlistindentFB
\ifFBStandardListSpacing
\else \let\list\listFB \fi
\ifFBStandardItemizeEnv
\else \let\itemize\itemizeFB \fi
\ifFBStandardItemLabels
\else \setlabelitemsFB \fi
\ifFBStandardEnumerateEnv
\else \let\enumerate\enumerateFB \let\description\descriptionFB \fi
}
% \end{macrocode}
%
% \changes{v3.2h}{2017/02/03}{Execute \cs{update@frenchlists} only
% if GlobalLayoutFrench is false.
% Delete stuff for lists in \cs{noextrasfrench}.}
%
% If \fbo{GlobalLayoutFrench=true}, nothing has to be done at
% language’s switches regarding lists. Otherwise, |\extrasfrench|
% saves the standard settings for lists and then executes
% |\update@frenchlists|. In both cases, there is nothing to do for
% lists in |\noextrasfrench|.
%
% In order to ensure compatibility with packages customising lists,
% the command |\update@frenchlists| should not be included in the
% first call to |\extrasfrench| which occurs \emph{before} the
% relevant flags are finally set, so we define |\FB@ufl| as
% |\relax|, it will be redefined later `AtBeginDocument’ by
% |\FBprocess@options| as |\update@frenchlists|,
% see p.~\pageref{FB@ufl}.
% \begin{macrocode}
\def\FB@ufl{\relax}
\def\bbl@frenchlistlayout{%
\ifFBGlobalLayoutFrench
\else
\babel@save\list \babel@save\itemize
\babel@save\enumerate \babel@save\description
\babel@save\labelitemi \babel@save\labelitemii
\babel@save\labelitemiii \babel@save\labelitemiv
\FB@ufl
\fi
}
\addto\extrasfrench{\bbl@frenchlistlayout}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{French indentation of sections}
% \label{ssec-indent}
%
% \begin{macro}{\bbl@frenchindent}
% \begin{macro}{\bbl@nonfrenchindent}
% In French the first paragraph of each section should be indented,
% this is another difference with US-English. This is controlled
% by the flag |\if@afterindent|.
%
% \changes{v2.3d}{2009/03/16}{Bug correction: previous versions of
% frenchb set the flag \cs{if@afterindent} to false outside
% French which is correct for English but wrong for some languages
% like Spanish. Pointed out by Juan José Torrens.}
%
% We will need to save the value of the flag |\if@afterindent|
% `AtBeginDocument’ before eventually changing its value.
%
% \begin{macrocode}
\def\bbl@frenchindent{%
\ifFBGlobalLayoutFrench
\else
\babel@save\@afterindentfalse
\fi
\ifFBIndentFirst
\let\@afterindentfalse\@afterindenttrue
\@afterindenttrue
\fi}
\def\bbl@nonfrenchindent{%
\ifFBGlobalLayoutFrench
\ifFBIndentFirst
\@afterindenttrue
\fi
\fi}
\addto\extrasfrench{\bbl@frenchindent}
\addto\noextrasfrench{\bbl@nonfrenchindent}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Formatting footnotes}
% \label{ssec-footnotes}
%
% \changes{v2.0}{2006/11/06}{Footnotes are now printed
% by default `à la française’ for the whole document.}
%
% \changes{v2.0b}{2007/04/18}{Footnotes: Just do nothing
% (except warning) when the bigfoot package is loaded.}
%
% The \pkg{bigfoot} package deeply changes the way footnotes are
% handled. When \file{bigfoot} is loaded, we just warn the user
% that \frenchb{} will drop the customisation of footnotes.
%
% The layout of footnotes is controlled by two flags
% |\ifFBAutoSpaceFootnotes| and |\ifFBFrenchFootnotes| which are
% set by options of \fbsetup{} (see section~\ref{ssec-keyval}).
% The layout of footnotes \emph{does not depend} on the current
% language (just think of two footnotes on the same page looking
% different because one was called in a French part, the other one
% in English!).
%
% We save the original definition of |\@footnotemark| at the
% |\begin{document}| in order to include any customisation that
% packages might have done; we define a variant |\@footnotemarkFB|
% which just adds a thin space before the number or symbol calling
% a footnote (any space typed in is removed first). The choice
% between the two definitions (valid for the whole document) is
% controlled by flag |\ifFBAutoSpaceFootnotes|.
%
% \changes{v2.4a}{2009/11/23}{\cs{PackageWarning} changed to
% \cs{PackageInfo} (when bigfoot package in use).}
%
% \begin{macrocode}
\AtBeginDocument{\@ifpackageloaded{bigfoot}%
{\PackageInfo{french.ldf}%
{bigfoot package in use.\MessageBreak
babel-french will NOT customise footnotes;%
\MessageBreak reported}}%
{\let\@footnotemarkORI\@footnotemark
\def\@footnotemarkFB{\leavevmode\unskip\unkern
\,\@footnotemarkORI}%
\ifFBAutoSpaceFootnotes
\let\@footnotemark\@footnotemarkFB
\fi}%
}
% \end{macrocode}
%
% \begin{macro}{\@makefntextFB}
% We then define |\@makefntextFB|, a variant of |\@makefntext|
% which is responsible for the layout of footnotes, to match the
% specifications of the French `Imprimerie Nationale’: footnotes
% will be indented by |\parindentFFN|, numbers (if any) typeset on
% the baseline (instead of superscripts), right aligned on
% |\parindentFFN| and followed by a dot and an half quad kern.
% Whenever symbols are used to number footnotes (as in |\thanks|
% for instance), we switch back to the standard layout (the French
% layout of footnotes is meant for footnotes numbered by arabic or
% roman digits).
%
% \changes{v2.0}{2006/11/06}{\cs{parindentFFN} not changed if
% already defined (required by JA for cah-gut.cls).}
%
% \changes{v2.3b}{2008/12/06}{New commands \cs{dotFFN} and
% \cs{kernFFN} for more flexibility (suggested by JA).}
%
% \changes{v3.2a}{2016/03/14}{beamer.cls requires a specific
% definition of \cs{@makefntextFB} (pointed out by DB).
% The same is true for memoir and koma-script classes (done).}
%
% The value of |\parindentFFN| will be redefined at the
% |\begin{document}|, as the maximum of |\parindent| and 1.5em
% \emph{unless} it has been set in the preamble (the weird value
% 10in is just for testing whether |\parindentFFN| has been set
% or not).
% \begin{macrocode}
\newdimen\parindentFFN
\parindentFFN=10in
% \end{macrocode}
% |\FBfnindent| will be set `AtBeginDocument’ to the width of
% the box holding the footnote mark, |\dotFFN| and |\kernFFN|
% (flushed right). It is used by \cls{memoir} and koma-script
% classes.
% \begin{macrocode}
\newcommand*{\dotFFN}{.}
\newcommand*{\kernFFN}{\kern .5em}
\newdimen\FBfnindent
% \end{macrocode}
% |\@makefntextFB|’s definition is now tuned according to the
% document’s class for better compatibility.
%
% Koma-script classes provide |\deffootnote|, a handy command
% to customise the footnotes’ layout (see English manual
% \file{scrguien.pdf}); it redefines |\@makefntext| and
% |\@@makefnmark|. First, save the original definitions.
% \begin{macrocode}
\ifFB@koma
\let\@makefntextORI\@makefntext
\let\@@makefnmarkORI\@@makefnmark
% \end{macrocode}
% |\@makefntextFB| and |\@@makefnmarkFB| are used when option
% \fbo{FrenchFootnotes} is \fbo{true}.
% \begin{macrocode}
\deffootnote[\FBfnindent]{0pt}{\parindentFFN}%
{\thefootnotemark\dotFFN\kernFFN}
\let\@makefntextFB\@makefntext
\let\@@makefnmarkFB\@@makefnmark
% \end{macrocode}
% |\@makefntextTH| and |\@@makefnmarkTH| are meant for the
% |\thanks| command used by |\maketitle| when \fbo{FrenchFootnotes}
% is \fbo{true}.
% \begin{macrocode}
\deffootnote[\parindentFFN]{0pt}{\parindentFFN}%
{\textsuperscript{\thefootnotemark}}
\let\@makefntextTH\@makefntext
\let\@@makefnmarkTH\@@makefnmark
% \end{macrocode}
% Restore the original definitions.
% \begin{macrocode}
\let\@makefntext\@makefntextORI
\let\@@makefnmark\@@makefnmarkORI
\fi
% \end{macrocode}
% Definitions for the \cls{memoir} class:
% \begin{macrocode}
\@ifclassloaded{memoir}
% \end{macrocode}
% (see original definition in \file{memman.pdf})
% \begin{macrocode}
{\newcommand{\@makefntextFB}[1]{%
\def\footscript##1{##1\dotFFN\kernFFN}%
\setlength{\footmarkwidth}{\FBfnindent}%
\setlength{\footmarksep}{-\footmarkwidth}%
\setlength{\footparindent}{\parindentFFN}%
\makefootmark #1}%
}{}
% \end{macrocode}
% Definitions for the \cls{beamer} class:
% \begin{macrocode}
\@ifclassloaded{beamer}
% \end{macrocode}
% (see original definition in \file{beamerbaseframecomponents.sty}),
% note that for the \cls{beamer} class footnotes are LR-boxes, not
% paragraphs, so |\parindentFFN| is irrelevant.
% class.
%
% \changes{v3.2h}{2016/04/09}{With beamer.cls, add \cs{llap} to
% \cs{@thefnmark} for notes numbered over 99.}
%
% \begin{macrocode}
{\def\@makefntextFB#1{%
\def\insertfootnotetext{#1}%
\def\insertfootnotemark{\insertfootnotemarkFB}%
\usebeamertemplate***{footnote}}%
\def\insertfootnotemarkFB{%
\usebeamercolor[fg]{footnote mark}%
\usebeamerfont*{footnote mark}%
\llap{\@thefnmark}\dotFFN\kernFFN}%
}{}
% \end{macrocode}
% Now the default definition of |\@makefntextFB| for standard LaTeX
% and AMS classes.
%
% The next command prints the footnote mark according to the
% specifications of the French `Imprimerie Nationale’.
% Keep in mind that |\@thefnmark| might be empty (i.e.\ in
% AMS classes’ titles)!
% \begin{macrocode}
\providecommand*{\insertfootnotemarkFB}{%
\parindent=\parindentFFN
\rule\z@\footnotesep
\setbox\@tempboxa\hbox{\@thefnmark}%
\ifdim\wd\@tempboxa>\z@
\llap{\@thefnmark}\dotFFN\kernFFN
\fi}
\providecommand\@makefntextFB[1]{\insertfootnotemarkFB #1}
% \end{macrocode}
% \end{macro}
%
% The rest of |\@makefntext|’s customisation is done at the
% |\begin{document}|. We save the original definition of
% |\@makefntext|, and then redefine |\@makefntext| according
% to the value of flag |\ifFBFrenchFootnotes| (true or false).
% Koma-script classes require a special treatment.
%
% \changes{v3.3c}{2017/07/28}{Reset \cs{localleftbox} locally
% inside \cs{@makefntext}. Needed by \cs{frquote} with LuaTeX.}
%
% \changes{v3.5b}{2018/07/17}{Reset \cs{FBeverypar@quote} locally
% inside \cs{@makefntext}. Needed by \cs{frquote}.}
%
% \changes{v3.5c}{2018/09/13}{Remove grouping inside \cs{@makefntext},
% \cs{localleftbox} and \cs{FBeverypar@quote} saved and restored
% instead.}
%
% The LuaTeX command |\localleftbox| and |\FBeverypar@quote| used
% by |\frquote{}| have to be reset inside footnotes; done for LaTeX
% based formats only.
% \begin{macrocode}
\providecommand\localleftbox[1]{}
\AtBeginDocument{%
\@ifpackageloaded{bigfoot}{}%
{\ifdim\parindentFFN<10in
\else
\parindentFFN=\parindent
\ifdim\parindentFFN<1.5em \parindentFFN=1.5em \fi
\fi
\settowidth{\FBfnindent}{\dotFFN\kernFFN}%
\addtolength{\FBfnindent}{\parindentFFN}%
\let\@makefntextORI\@makefntext
\ifFB@koma
% \end{macrocode}
% Definition of |\@makefntext| for koma-script classes: running
% \@makefntextORI inside a group to reset |\localleftbox{}| and
% |\FBeverypar@quote| would mess up the layout of footnotes whenever
% the first manadatory argument of |\deffootnote{}| (used as
% |\leftskip|) is non-nil (default is 1em, 0pt in French).
% \begin{macrocode}
\let\@@makefnmarkORI\@@makefnmark
\long\def\@makefntext#1{%
\localleftbox{}%
\let\FBeverypar@save\FBeverypar@quote
\let\FBeverypar@quote\relax
\ifFBFrenchFootnotes
\ifx\footnote\thanks
\let\@@makefnmark\@@makefnmarkTH
\@makefntextTH{#1}
\else
\let\@@makefnmark\@@makefnmarkFB
\@makefntextFB{#1}
\fi
\else
\let\@@makefnmark\@@makefnmarkORI
\@makefntextORI{#1}%
\fi
\let\FBeverypar@quote\FBeverypar@save
\localleftbox{\FBeveryline@quote}}%
\else
% \end{macrocode}
% Special add-on for the \cls{memoir} class: |\@makefntext| is
% redefined as |\makethanksmark| by |\maketitle|, hence these
% settings to match the other notes’ vertical alignment.
% \begin{macrocode}
\@ifclassloaded{memoir}%
{\ifFBFrenchFootnotes
\setlength{\thanksmarkwidth}{\parindentFFN}%
\setlength{\thanksmarksep}{-\thanksmarkwidth}%
\fi
}{}%
% \end{macrocode}
% Special add-on for the \cls{beamer} class: issue a warning
% in case |\parindentFFN| has been changed.
% \begin{macrocode}
\@ifclassloaded{beamer}%
{\ifFBFrenchFootnotes
\ifdim\parindentFFN=1.5em\else
\FBWarning{%
\protect\parindentFFN\space is ineffective%
\MessageBreak within the beamer class.%
\MessageBreak Reported}%
\fi
\fi
}{}%
% \end{macrocode}
% Definition of |\@makefntext| for all other classes:
% \begin{macrocode}
\long\def\@makefntext#1{%
\localleftbox{}%
\let\FBeverypar@save\FBeverypar@quote
\let\FBeverypar@quote\relax
\ifFBFrenchFootnotes
\@makefntextFB{#1}%
\else
\@makefntextORI{#1}%
\fi
\let\FBeverypar@quote\FBeverypar@save
\localleftbox{\FBeveryline@quote}}%
\fi
}%
}
% \end{macrocode}
%
% For compatibility reasons, we provide definitions for the commands
% dealing with the layout of footnotes in \frenchb{} version~1.6.
% \fbsetup{} (see in section \ref{ssec-keyval}) should be
% preferred for setting these options. |\StandardFootnotes| may
% still be used locally (in minipages for instance), that’s why the
% test |\ifFBFrenchFootnotes| is done inside |\@makefntext|.
% \begin{macrocode}
\newcommand*{\AddThinSpaceBeforeFootnotes}{\FBAutoSpaceFootnotestrue}
\newcommand*{\FrenchFootnotes}{\FBFrenchFootnotestrue}
\newcommand*{\StandardFootnotes}{\FBFrenchFootnotesfalse}
% \end{macrocode}
%
% \subsection{Clean up and exit}
%
% \changes{v3.0a}{2014/02/20}{french.cfg will be loaded (if found)
% instead of frenchb.cfg. NO NEED for .cfg files in French anyway.}
%
% \changes{v3.1h}{2015/08/19}{french.cfg from e-french conflicts with
% babel-french. Do NOT load it (no need for .cfg files with
% babel-french anyway).}
%
% Final cleaning.
% The macro |\ldf@finish| takes care for setting the main language
% to be switched on at |\begin{document}| and resetting the
% category code of \texttt{@} to its original value. |\loadlocalcfg|
% is redefined locally in order not to load any \file{.cfg} file for
% French.
% \begin{macrocode}
\FBclean@on@exit
\ldf@finish\CurrentOption
\let\loadlocalcfg\FB@llc
%</french>
% \end{macrocode}
%
% \subsection[Files \file{frenchb.ldf}, \file{francais.ldf},
% \file{canadien.ldf} and \file{acadian.ldf}]%
% {Files \file{frenchb.ldf}, \file{francais.ldf},
% \file{canadien.ldf} and\\ \file{acadian.ldf}}
%
% \changes{v3.3b}{2017/06/28}{Generate portmanteau files
% \file{acadian.ldf}, \file{canadien.ldf}, \file{frenchb.ldf},
% and \file{francais.ldf} and warn about deprecated options.}
%
% Babel now expects a \file{\meta{lang}.ldf} file for each
% \meta{lang}.
% So we create portmanteau \file{.ldf} files for options
% \texttt{canadien}, \texttt{francais}, \texttt{frenchb} and
% \texttt{acadian}. These files themselves only load
% \file{french.ldf} which does the real work.
% Warn users about options \opt{canadien}, \opt{frenchb} and
% \opt{francais} being deprecated and force recommended options
% \opt{acadian} or \opt{french}.
% \begin{macrocode}
%<*acadian>
\PackageInfo{acadian.ldf}%
{`acadian' dialect is currently\MessageBreak
*absolutely identical* to the\MessageBreak
`french' language; reported}
%</acadian>
%<*canadien>
\PackageWarning{canadien.ldf}%
{Option `canadien' for Babel is *deprecated*,\MessageBreak
it might be removed sooner or later. Please\MessageBreak
use `acadian' instead; reported}%
\def\CurrentOption{acadian}
% \end{macrocode}
% \changes{v3.5f}{2019/09/04}{\cs{selectlanguage}\{canadien\}
% allowed again only for backward compatibility (deprecated).}
% \begin{macrocode}
\def\datecanadien{\dateacadian}
\def\captionscanadien{\captionsacadian}
\def\extrascanadien{\extrasacadian}
\def\noextrascanadien{\noextrasacadian}
%</canadien>
%<*francais>
\PackageWarning{francais.ldf}%
{Option `francais' for Babel is *deprecated*,\MessageBreak
it might be removed sooner or later. Please\MessageBreak
use `french' instead; reported}%
\chardef\l@francais\l@french
\def\CurrentOption{french}
%</francais>
% \end{macrocode}
% Compatibility code for \babel{} pre-3.13: \file{frenchb.ldf}
% could be loaded with options \opt{acadian}, \opt{canadien},
% \opt{frenchb} or \opt{francais}.
% \begin{macrocode}
%<*frenchb>
\def\bbl@tempa{frenchb}
\ifx\CurrentOption\bbl@tempa
\chardef\l@frenchb\l@french
\def\CurrentOption{french}
\PackageWarning{babel-french}%
{Option `frenchb' for Babel is *deprecated*,\MessageBreak
it might be removed sooner or later. Please\MessageBreak
use `french' instead; reported}
\else
\def\bbl@tempa{francais}
\ifx\CurrentOption\bbl@tempa
\chardef\l@francais\l@french
\def\CurrentOption{french}
% \end{macrocode}
% Plain formats: no warning when \file{francais.sty} loads
% \file{frenchb.ldf} (\babel{} pre-3.13).
% \begin{macrocode}
\ifx\magnification\@undefined
\PackageWarning{babel-french}%
{Option `francais' for Babel is *deprecated*,\MessageBreak
it might be removed sooner or later. Please\MessageBreak
use `french' instead; reported}
\fi
\else
\def\bbl@tempa{canadien}
\ifx\CurrentOption\bbl@tempa
\def\CurrentOption{acadian}
\PackageWarning{babel-french}%
{Option `canadien' for Babel is *deprecated*,\MessageBreak
it might be removed sooner or later. Please\MessageBreak
use `acadian' instead; reported}
\fi
\fi
\fi
%</frenchb>
%<acadian|canadien|frenchb|francais>\input french.ldf\relax
%<acadian|canadien>\let\extrasacadian\extrasfrench
%<acadian|canadien>\let\noextrasacadian\noextrasfrench
% \end{macrocode}
%
% \Finale
% \iffalse
%<*!lua>
% \fi
%%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
% \iffalse
%</!lua>
% \fi
\endinput
%%% Local Variables:
%%% fill-column: 72
%%% coding: utf-8
%%% mode: doctex
%%% TeX-engine: luatex
%%% End:
|