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
|
% \iffalse meta-comment
%
% Copyright 1989-2008 Johannes L. Braams and any individual authors
% listed elsewhere in this file. All rights reserved.
%
% This file is part of the Babel system.
% --------------------------------------
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work is Johannes Braams.
%
% The list of all files belonging to the Babel system is
% given in the file `manifest.bbl. See also `legal.bbl' for additional
% information.
%
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
% \fi
% \CheckSum{2047}
%
% \iffalse
% Tell the \LaTeX\ system who we are and write an entry on the
% transcript. Nothing to write to the .cfg file, if generated.
%<*dtx>
\ProvidesFile{frenchb.dtx}
%</dtx>
% \changes{v2.1d}{2008/05/04}{Argument of \cs{ProvidesLanguage} changed
% from `french' to `frenchb', otherwise \cs{listfiles} prints
% no date/version information. The bug with \cs{listfiles}
% (introduced in v.1.5!), was pointed out by Ulrike Fischer.}
%<code>\ProvidesLanguage{frenchb}
%\ProvidesFile{frenchb.dtx}
%<*!cfg>
[2008/05/08 v2.2a French support from the babel system]
%</!cfg>
%<*cfg>
%% frenchb.cfg: configuration file for frenchb.ldf
%% Daniel Flipo Daniel.Flipo at univ-lille1.fr
%</cfg>
%% File `frenchb.dtx'
%% Babel package for LaTeX version 2e
%% Copyright (C) 1989 - 2008
%% by Johannes Braams, TeXniek
%
%<*!cfg>
%% Frenchb language Definition File
%% Copyright (C) 1989 - 2008
%% by Johannes Braams, TeXniek
%% Daniel Flipo, GUTenberg
%
%% Please report errors to: Daniel Flipo, GUTenberg
%% Daniel.Flipo at univ-lille1.fr
%</!cfg>
%
% This file is part of the babel system, it provides the source
% code for the French language definition file.
%
%<*filedriver>
\documentclass[a4paper]{ltxdoc}
\DeclareFontEncoding{T1}{}{}
\DeclareFontSubstitution{T1}{lmr}{m}{n}
\DeclareTextCommand{\guillemotleft}{OT1}{%
{\fontencoding{T1}\fontfamily{lmr}\selectfont\char19}}
\DeclareTextCommand{\guillemotright}{OT1}{%
{\fontencoding{T1}\fontfamily{lmr}\selectfont\char20}}
\newcommand*\TeXhax{\TeX hax}
\newcommand*\babel{\textsf{babel}}
\newcommand*\langvar{$\langle \mathit lang \rangle$}
\newcommand*\note[1]{}
\newcommand*\Lopt[1]{\textsf{#1}}
\newcommand*\file[1]{\texttt{#1}}
\begin{document}
\setlength{\parindent}{0pt}
\begin{center}
\textbf{\Large A Babel language definition file for French}\\[3mm]^^A\]
Daniel \textsc{Flipo}\\
\texttt{Daniel.Flipo@univ-lille1.fr}
\end{center}
\RecordChanges
\DocInput{frenchb.dtx}
\end{document}
%</filedriver>
% \fi
% \GetFileInfo{frenchb.dtx}
%
% \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\`egles typographiques en usage \`a
% l'Imprimerie nationale'' troisi\`eme \'edition (1994),
% ISBN-2-11-081075-0.
%
% First version released: 1.1 (1996/05/31) as part of
% \babel-3.6beta.
%
% |frenchb| has been improved using helpful suggestions from many
% people, mainly from Jacques Andr\'e, Michel Bovani, Thierry Bouche,
% and Vincent Jalby. Thanks to all of them!
%
% This new version (2.x) has been designed to be used with \LaTeXe{}
% and Plain\TeX{} formats only. \LaTeX-2.09 is no longer supported.
% Changes between version 1.6 and \fileversion{} are listed in
% subsection~\ref{ssec-changes} p.~\pageref{ssec-changes}.
%
% An extensive documentation is available in French here:\\
% |http://daniel.flipo.free.fr/frenchb|
%
% \subsection{Basic interface}
%
% In a multilingual document, some typographic rules are language
% dependent, i.e. spaces before `double punctuation' (|:| |;| |!|
% |?|) in French, others concern the general layout (i.e. layout of
% lists, footnotes, indentation of first paragraphs of sections) and
% should apply to the whole document.
%
% Starting with version~2.2, |frenchb| behaves differently according
% to \babel's \emph{main language} defined as the \emph{last}
% option\footnote{Its name is kept in \texttt{\textbackslash
% bbl@main@language}.} at \babel's loading. When French is
% not \babel's main language, |frenchb| no longer alters the global
% 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 \texttt{frenchb} (see command
% \texttt{\textbackslash frenchbsetup\{\}},
% section~\ref{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 |\frenchbsetup{}|;
% \item vertical spacing in general \LaTeX{} lists is
% shortened;
% \item footnotes are displayed ``\`a la fran\c{c}aise''.
% \end{enumerate}
%
% Regarding local typography, the command |\selectlanguage{french}|
% switches to the French language\footnote{%
% \texttt{\textbackslash selectlanguage\{francais\}}
% and \texttt{\textbackslash selectlanguage\{frenchb\}} are kept
% for backward compatibility but should no longer be used.},
% with the following effects:
% \begin{enumerate}
% \item French hyphenation patterns are made active;
% \item `double punctuation' (|:| |;| |!| |?|) is made
% active%\footnote{Actually, they are active in the whole
% document, only their expansions differ in French and
% outside French} for correct spacing in French;
% \item |\today| prints the date in French;
% \item the caption names are translated into French
% (\LaTeX{} only);
% \item the space after |\dots| is removed in French.
% \end{enumerate}
%
% Some commands are provided in |frenchb| to make typesetting
% easier:
% \begin{enumerate}
% \item French quotation marks can be entered using the commands
% |\og| and |\fg| which work in \LaTeXe and Plain\TeX,
% their appearance depending on what is available to draw
% them; even if you use \LaTeXe{} \emph{and} |T1|-encoding,
% you should refrain from entering them as
% |<<~French quotation marks~>>|: |\og| and |\fg| provide
% better horizontal spacing.
% |\og| and |\fg| can be used outside French, they typeset
% then English quotes `` and ''.
% \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\textsuperscript{es}).
% \item Family names should be typeset in small capitals and never
% be hyphenated, the macro |\bsc| (boxed small caps) does
% this, e.g., |Leslie~\bsc{Lamport}| will produce
% Leslie~\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\textsuperscript{o}, 2\textsuperscript{o},
% 3\textsuperscript{o}, 4\textsuperscript{o}.
% |\FrenchEnumerate{6}| prints 6\textsuperscript{o}.
% \item Abbreviations for ``Num\'ero(s)'' and ``num\'ero(s)''
% (N\textsuperscript{o} N\textsuperscript{os}
% n\textsuperscript{o} and n\textsuperscript{os}~)
% are obtained via the commands |\No|, |\Nos|, |\no|, |\nos|.
% \item Two commands are provided to typeset the symbol for
% ``degr\'e'': |\degre| prints the raw character and
% |\degres| should be used to typeset temperatures (e.g.,
% ``|20~\degres C|'' with an unbreakable space), or for
% alcohols' strengths (e.g., ``|45\degres|'' with \emph{no}
% space in French).
% \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 be an
% ordinary character \emph{in French only} (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.
% \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}, see
% \file{numprint.pdf} for more information.
% \item |frenchb| has been designed to take advantage of the |xspace|
% package if present: adding |\usepackage{xspace}| in the
% preamble will force macros like |\fg|, |\ier|, |\ieme|,
% |\dots|, \dots, to respect the spaces you type after them,
% for instance typing `|1\ier juin|' will print
% `1\textsuperscript{er} juin' (no need for a forced space
% after |1\ier|).
% \end{enumerate}
%
% \subsection{Customisation}
% \label{ssec-custom}
%
% Up to version 1.6, customisation of |frenchb| was achieved
% by entering commands in \file{frenchb.cfg}. This possibility
% remains for compatibility, but \emph{should not longer be used}.
% Version 2.0 introduces a new command |\frenchbsetup{}| using
% the \file{keyval} syntax which should make it easier to choose
% among the many options available. The command |\frenchbsetup{}|
% is to appear in the preamble only (after loading \babel).
%
% \vspace{.5\baselineskip}
% |\frenchbsetup{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 |ShowOptions|) can be entered as
% |ShowOptions=true| or just |ShowOptions|, the `|=true|' part
% can be omitted.
%
% \vspace{.5\baselineskip}
% The other options are listed below. Their default value is shown
% between brackets, 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{itemize}
% \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. This option replaces the former
% command |\StandardLayout|. It can be used to avoid conflicts
% with classes or packages which customise lists or footnotes.
% \item |GlobalLayoutFrench=false [true*]| can be used, when French
% is the main language, to 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 ``\`a la fran\c{c}aise'' in French.
% Note that the layout of footnotes is language independent
% anyway (see below |FrenchFootnotes| and |AutoSpaceFootnotes|).
% This option replaces the former command |\FrenchLayout|.
% \item |ReduceListSpacing=false [true*]|; |frenchb| normally
% reduces the values of the vertical spaces used in the
% environment |list| in French; setting this option to |false|
% reverts to the standard settings of |list|. This option
% replaces the former command |\FrenchListSpacingfalse|.
% \item |CompactItemize=false [true*]|; |frenchb| normally
% suppresses any vertical space between items of |itemize| lists
% in French; setting this option to |false| reverts to the
% standard settings of |itemize| lists. This option replaces
% the former command |\FrenchItemizeSpacingfalse|.
% \item |StandardItemLabels=true [false*]| when set to |true| this
% option stops |frenchb| from changing the labels in |itemize|
% lists in French.
% \item |ItemLabels=\textemdash|, |\textbullet|, |\ding{43}|,
% \dots, |[\textendash*]|; when |StandardItemLabels=false| (the
% default), this option enables to choose the label used in
% |itemize| lists for all levels. The next three options do
% the same but each one for one level only. Note that the
% example |\ding{43}| requires |\usepackage{pifont}|.
% \item |ItemLabeli=\textemdash|, |\textbullet|, |\ding{43}|,
% \dots,|[\textendash*]|
% \item |ItemLabelii=\textemdash|, |\textbullet|, |\ding{43}|,
% \dots, |[\textendash*]|
% \item |ItemLabeliii=\textemdash|, |\textbullet|, |\ding{43}|,
% \dots, |[\textendash*]|
% \item |ItemLabeliv=\textemdash|, |\textbullet|, |\ding{43}|,
% \dots, |[\textendash*]|
% \item |StandardLists=true [false*]| forbids |frenchb| to
% customise any kind of list. Do activate the option
% |StandardLists| when using classes or packages that customise
% lists too (|enumitem|, |paralist|, \dots{}) to avoid conflicts.
% This option is just a shorthand for |ReduceListSpacing=false|
% and |CompactItemize=false| and |StandardItemLabels=true|.
% \item |IndentFirst=false [true*]|; |frenchb| normally forces
% indentation of the first paragraph of sections.
% When this option is set to |false|, the first paragraph of
% will look the same in French and in English (not indented).
% \item |FrenchFootnotes=false [true*]| reverts to the standard
% layout of footnotes. By default |frenchb| typesets leading
% numbers as `1.\hspace{.5em}' instead of `$\hbox{}^1$', but
% has no effect on footnotes numbered with symbols (as in the
% |\thanks| command). The former commands |\StandardFootnotes|
% and |\FrenchFootnotes| are still there, |\StandardFootnotes|
% can be useful 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 |false|
% reverts to the standard setting (no space added).
% \item |FrenchSuperscripts=false [true]| ; then
% |\up=\textsuperscript| (option added in version 2.1).
% Should only be made |false| to recompile older documents.
% By default |\up| now relies on |\fup| designed to produce
% better looking superscripts.
% \item |AutoSpacePunctuation=false [true]|; in French, the user
% \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 add a |\thinspace| before `|;|' `|!|' `|?|' and a
% normal (unbreakable) space before~`|:|' (recommended by the
% French Imprimerie nationale). This is convenient in most cases
% but can lead to addition of spurious spaces in URLs or in MS-DOS
% paths. Choosing |AutoSpacePunctuation=false| will ensure that
% a proper space will be added before `|:;!?|' \emph{if and only
% if} a (normal) space has been typed in. Those who are unsure
% about their typing in this area should stick to the default
% option and type |\string;| |\string:| |\string!| |\string?|
% instead of |;| |:| |!| |?| whenever no space should be added
% before them (mostly in URLs and MS-DOS paths).
% \item |ThinColonSpace=true [false]| changes the normal
% (unbreakable) space added before the colon `:' to a thin space,
% so that the same amount of space is added before any of the
% four double punctuation characters. The default setting is
% supported by the French Imprimerie nationale.
% \item |LowercaseSuperscripts=false [true]| ; by default |frenchb|
% inhibits the uppercasing of superscripts (for instance when they
% are moved to page headers). Making this option |false|
% will disable this behaviour (not recommended).
% \item |PartNameFull=false [true]|; when true, |frenchb| numbers
% the title of |\part{}| commands as ``Premi\`ere partie'',
% ``Deuxi\`eme partie'' and so on. With some classes which change
% the|\part{}| command (AMS and SMF classes do so), you will get
% ``Premi\`ere partie~I'', ``Deuxi\`eme partie~II'' instead;
% when this occurs, this option should be set to |false|,
% part titles will then be printed as ``Partie I'', ``Partie II''.
% \item |og=|\texttt{\guillemotleft}, |fg=|\texttt{\guillemotright};
% 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
% \texttt{\guillemotleft{} guillemets \guillemotright}, or
% \texttt{\guillemotleft{}guillemets\guillemotright} (with or
% without spaces), to get properly typeset French quotes.
% This option requires \file{inputenc} to be loaded with the
% proper encoding, it works with 8-bits encodings (latin1,
% latin9, ansinew, applemac,\dots) and multi-byte encodings
% (utf8 and utf8x).
% \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
% \LaTeXe{} I suggest this:
% \begin{itemize}
% \item run the following file, with the encoding suitable for
% your machine (\textit{my-encoding} will be |latin1| for
% \textsc{unix} machines, |ansinew| for PCs running~Windows,
% |applemac| or |latin1| for Macintoshs, or |utf8|\dots\\[3mm]^^A\]
% |%%% Test file for French hyphenation.|\\
% |\documentclass{article}|\\
% |\usepackage[|\textit{my-encoding}|]{inputenc}|\\
% |\usepackage[T1]{fontenc} % Use LM fonts|\\
% |\usepackage{lmodern} % for French|\\
% |\usepackage[frenchb]{babel}|\\
% |\begin{document}|\\
% |\showhyphens{signal container \'ev\'enement alg\`ebre}|\\
% |\showhyphens{|\texttt{signal container \'ev\'enement
% alg\`ebre}|}|\\
% |\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 \'ev\'e-ne-ment al-g\`ebre}.\\
% 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{\'ev\'e-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}
%
% \textbf{Options' order} -- Please remember that options are read
% in the order they appear inside the |\frenchbsetup| command.
% Someone wishing that |frenchb| leaves the layout of lists
% and footnotes untouched but caring for indentation of first
% paragraph of sections could choose
% |\frenchbsetup{StandardLayout,IndentFirst}| and get the expected
% layout. Choosing |\frenchbsetup{IndentFirst,StandardLayout}|
% would not lead to the expected result: option |IndentFirst| would
% be overwritten by |StandardLayout|.
%
% \subsection{Changes}
% \label{ssec-changes}
%
% \subsubsection*{What's new in version 2.0?}
%
% Here is the list of all changes:
% \begin{itemize}
% \item Support for \LaTeX-2.09 and for \LaTeXe{} in compatibility
% mode has been dropped. This version is meant for \LaTeXe{} and
% Plain based formats (like \file{bplain}). \LaTeXe{} formats
% based on ml\TeX{} are no longer supported either (plenty of
% good 8-bits fonts are available now, so T1 encoding should
% be preferred for typesetting in French). A warning is issued
% when OT1 encoding is in use at the |\begin{document}|.
% \item Customisation should now be handled by command
% |\frenchbsetup{}|, \file{frenchb.cfg} (kept for compatibility)
% should no longer be used. See section~\ref{ssec-custom} for
% the list of available options.
% \item Captions in figures and table have changed in French: former
% abbreviations ``Fig.'' and ``Tab.'' have been replaced by full
% names ``Figure'' and ``Table''. If this leads to formatting
% problems in captions, you can add the following two commands to
% your preamble (after loading \babel) to get the former captions\\
% |\addto\captionsfrench{\def\figurename{{\scshape Fig.}}}|\\
% |\addto\captionsfrench{\def\tablename{{\scshape Tab.}}}|.
% \item The |\nombre| command is now provided by the \file{numprint}
% package which has to be loaded \emph{after} \babel{} with the
% option |autolanguage| if number formatting should depend on the
% current language.
% \item The |\bsc| command no longer uses an |\hbox| to stop
% hyphenation of names but a |\kern0pt| instead. This change
% enables \file{microtype} to fine tune the length of the
% argument of |\bsc|; as a side-effect, compound names like
% Dupont-Durand can now be hyphenated on explicit hyphens.
% You can get back to the former behaviour of |\bsc| by adding\\
% |\renewcommand*{\bsc}[1]{\leavevmode\hbox{\scshape #1}}|\\
% to the preamble of your document.
% \item Footnotes are now displayed ``\`a la fran\c caise'' for the
% whole document, except with an explicit\\
% |\frenchbsetup{AutoSpaceFootnotes=false,FrenchFootnotes=false}|.\\
% Add this command if you want standard footnotes. It is still
% possible to revert locally to the standard layout of footnotes
% by adding |\StandardFootnotes| (inside a |minipage| environment
% for instance).
% \end{itemize}
%
% \subsubsection*{What's new in version 2.1?}
%
% New command |\fup| to typeset better looking superscripts.
% Former command |\up| is now defined as |\fup|, but an option
% |\frenchbsetup{FrenchSuperscripts=false}| is provided for
% backward compatibility. |\fup| was designed using ideas from
% Jacques Andr\'e, Thierry Bouche and Ren\'e Fritz, thanks to them!
%
% \subsubsection*{What's new in version 2.2?}
%
% Starting with version 2.2a, |frenchb| alters the layout of
% lists, footnotes, and the indentation of first paragraphs of
% sections) \emph{only if} French is the ``main language''
% (i.e. babel's last language option). The layout is global for
% the whole document: lists, etc. look the same in French and in
% other languages, everything is typeset ``\`a la fran\c caise''
% if French is the ``main language'', otherwise frenchb doesn't
% change anything regarding lists, footnotes, and indentation of
% paragraphs.
%
% \StopEventually{}
%
% \subsection{File frenchb.cfg}
% \label{sec-cfg}
%
% \file{frenchb.cfg} is now a dummy file just kept for compatibility
% with previous versions.
%
% \iffalse
%<*cfg>
% \fi
% \begin{macrocode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% WARNING: THIS FILE SHOULD NO LONGER BE USED %%%%%%%%%
%% If you want to customise frenchb, please DO NOT hack into the code!
%% Do no put any code in this file either, please use the new command
%% \frenchbsetup{} with the proper options to customise frenchb.
%%
%% Add \frenchbsetup{ShowOptions} to your preamble to see the list of
%% available options and/or read the documentation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \end{macrocode}
% \iffalse
%</cfg>
% \fi
%
% \section{\TeX{}nical details}
%
% \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}.}
%
% \iffalse
%<*code>
% \fi
%
% While this file was read through the option \Lopt{frenchb} we make
% it behave as if \Lopt{french} was specified.
% \begin{macrocode}
\def\CurrentOption{french}
% \end{macrocode}
%
% The macro |\LdfInit| takes care of preventing that this file is
% loaded more than once, checking the category code of the
% \texttt{@} sign, etc.
%
% \begin{macrocode}
\LdfInit\CurrentOption\datefrench
% \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
\ifx\magnification\@undefined
\ifx\@compatibilitytrue\@undefined
\PackageError{frenchb.ldf}
{LaTeX-2.09 format is no longer supported.\MessageBreak
Aborting here}
{Please upgrade to LaTeX2e!}
\let\bbl@tempa\endinput
\else
\LaTeXetrue
\fi
\fi
\bbl@tempa
% \end{macrocode}
% \end{macro}
%
% Check if hyphenation patterns for the French language have been
% loaded in language.dat; we allow for the names `french',
% `francais', `canadien' or `acadian'. The latter two are both
% names used in Canada for variants of French that are in use in
% that country.
%
% \begin{macrocode}
\ifx\l@french\@undefined
\ifx\l@francais\@undefined
\ifx\l@canadien\@undefined
\ifx\l@acadian\@undefined
\@nopatterns{French}
\adddialect\l@french0
\else
\let\l@french\l@acadian
\fi
\else
\let\l@french\l@canadien
\fi
\else
\let\l@french\l@francais
\fi
\fi
% \end{macrocode}
% Now |\l@french| is always defined.
%
% The internal name for the French language is |french|;
% |francais| and |frenchb| are synonymous for |french|:
% first let both names use the same hyphenation patterns.
% Later we will have to set aliases for |\captionsfrench|,
% |\datefrench|, |\extrasfrench| and |\noextrasfrench|.
% As French uses the standard values of |\lefthyphenmin| (2)
% and |\righthyphenmin| (3), no special setting is required here.
%
% \begin{macrocode}
\ifx\l@francais\@undefined
\let\l@francais\l@french
\fi
\ifx\l@frenchb\@undefined
\let\l@frenchb\l@french
\fi
% \end{macrocode}
% When this language definition file was loaded for one of the
% Canadian versions of French we need to make sure that a suitable
% hyphenation pattern register will be found by \TeX.
% \begin{macrocode}
\ifx\l@canadien\@undefined
\let\l@canadien\l@french
\fi
\ifx\l@acadian\@undefined
\let\l@acadian\l@french
\fi
% \end{macrocode}
%
% This language definition can be loaded for different variants of
% the French language. The `key' \babel\ macros are only defined
% once, using `french' as the language name, but |frenchb| and
% |francais| are synonymous.
% \begin{macrocode}
\def\datefrancais{\datefrench}
\def\datefrenchb{\datefrench}
\def\extrasfrancais{\extrasfrench}
\def\extrasfrenchb{\extrasfrench}
\def\noextrasfrancais{\noextrasfrench}
\def\noextrasfrenchb{\noextrasfrench}
% \end{macrocode}
%
% \begin{macro}{\extrasfrench}
% \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'' 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.
%
% \begin{macrocode}
\@namedef{extras\CurrentOption}{\lccode`\'=`\'}
\@namedef{noextras\CurrentOption}{\lccode`\'=0}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% One more thing |\extrasfrench| needs to do is to make sure that
% |\frenchspacing| is in effect. |\noextrasfrench| will switch
% |\frenchspacing| off again.
% \begin{macrocode}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
\bbl@frenchspacing}
\expandafter\addto\csname noextras\CurrentOption\endcsname{%
\bbl@nonfrenchspacing}
% \end{macrocode}
%
% \subsection{Punctuation}
% \label{sec-punct}
%
% As long as no better solution is available%
% \footnote{Lua\TeX, or pdf\TeX{} might provide alternatives in
% the future\dots},
% the `double punctuation' characters (|;| |!| |?| and |:|) have to
% be made |\active| for an automatic control of the amount of space
% to insert before them. Before doing so, we have to save the
% standard definition of |\@makecaption| (which includes two ':')
% to compare it later to its definition at the |\begin{document}|.
% \begin{macrocode}
\long\def\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}%
% \end{macrocode}
%
% We define a new `if' |\FBpunct@active| which will be made false
% whenever a better alternative will be available.
% The following code makes the four characters |;| |!| |?| and |:|
% `active' and provides their definitions.
% \begin{macrocode}
\newif\ifFBpunct@active \FBpunct@activetrue
\ifFBpunct@active
\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 an unbreakable |\thinspace| instead. If no
% space has been typed, we add |\FDP@thinspace| which will be
% defined, up to the user's wishes, as an automatic added
% thin space, or as |\@empty|.
% \begin{macrocode}
\declare@shorthand{french}{;}{%
\ifhmode
\ifdim\lastskip>\z@
\unskip\penalty\@M\thinspace
\else
\FDP@thinspace
\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}{!}{%
\ifhmode
\ifdim\lastskip>\z@
\unskip\penalty\@M\thinspace
\else
\FDP@thinspace
\fi
\fi
\string!}
\declare@shorthand{french}{?}{%
\ifhmode
\ifdim\lastskip>\z@
\unskip\penalty\@M\thinspace
\else
\FDP@thinspace
\fi
\fi
\string?}
% \end{macrocode}
% According to the I.N. specifications, the `:' requires a normal
% space before it, but some people prefer a |\thinspace| (just
% like the other three). We define |\Fcolonspace| to hold the
% required amount of space (user customisable).
% \begin{macrocode}
\newcommand*{\Fcolonspace}{\space}
\declare@shorthand{french}{:}{%
\ifhmode
\ifdim\lastskip>\z@
\unskip\penalty\@M\Fcolonspace
\else
\FDP@colonspace
\fi
\fi
\string:}
% \end{macrocode}
%
% \begin{macro}{\AutoSpaceBeforeFDP}
% \begin{macro}{\NoAutoSpaceBeforeFDP}
% |\FDP@thinspace| and |\FDP@space| are defined as unbreakable
% spaces by\\ |\AutoSpaceBeforeFDP| or as |\@empty| by
% |\NoAutoSpaceBeforeFDP|.\\
% Default is |\AutoSpaceBeforeFDP|.
% \begin{macrocode}
\def\AutoSpaceBeforeFDP{%
\def\FDP@thinspace{\penalty\@M\thinspace}%
\def\FDP@colonspace{\penalty\@M\Fcolonspace}}
\def\NoAutoSpaceBeforeFDP{\let\FDP@thinspace\@empty
\let\FDP@colonspace\@empty}
\AutoSpaceBeforeFDP
% \end{macrocode}
% \end{macro}
% \end{macro}
% 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.
% \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}
%
% \subsection{French quotation marks}
%
% \begin{macro}{\og}
% \begin{macro}{\fg}
% The top macros for quotation marks will be called |\og|
% (``\underline{o}uvrez \underline{g}uillemets'') and |\fg|
% (``\underline{f}ermez \underline{g}uillemets'').
% Another option for typesetting quotes in multilingual texts
% is to use the package |csquotes.sty| and its command |\enquote|.
%
% \begin{macrocode}
\newcommand*{\og}{\@empty}
\newcommand*{\fg}{\@empty}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\guillemotleft}
% \begin{macro}{\guillemotright}
% \LaTeX{} users are supposed to use 8-bit output encodings (T1,
% LY1,\dots) to typeset French, those who still stick to OT1 should
% call |aeguill.sty| 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, |\guillemotleft| and |\guillemotright| are defined
% by package \file{xunicode.sty}.
% We will check `AtBeginDocument' that the proper output encodings
% are in use (see end of section~\ref{sec-keyval}).
%
% We give the following definitions for Plain users only as a (poor)
% fall-back, they are welcome to change them for anything better.
% \begin{macrocode}
\ifLaTeXe
\else
\ifx\guillemotleft\@undefined
\def\guillemotleft{\leavevmode\raise0.25ex
\hbox{$\scriptscriptstyle\ll$}}
\fi
\ifx\guillemotright\@undefined
\def\guillemotright{\raise0.25ex
\hbox{$\scriptscriptstyle\gg$}}
\fi
\let\xspace\relax
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% The next step is to provide correct spacing after |\guillemotleft|
% and before |\guillemotright|: a space precedes and follows
% quotation marks but no line break is allowed neither \emph{after}
% the opening one, nor \emph{before} the closing one.
% |\FBguill@spacing| which does the spacing, has been fine tuned by
% Thierry Bouche. French quotes (including spacing) are printed by
% |\FB@og| and |\FB@fg|, the expansion of the top level commands
% |\og| and |\og| is different in and outside French.
% We'll try to be smart to users of David~Carlisle's |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).
%
% \begin{macrocode}
\newcommand*{\FBguill@spacing}{\penalty\@M\hskip.8\fontdimen2\font
plus.3\fontdimen3\font
minus.8\fontdimen4\font}
\DeclareRobustCommand*{\FB@og}{\leavevmode
\guillemotleft\FBguill@spacing}
\DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi
\FBguill@spacing\guillemotright\xspace}
% \end{macrocode}
%
% The top level definitions for French 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.
%
% \begin{macrocode}
\ifLaTeXe
\def\bbl@frenchguillemets{\renewcommand*{\og}{\FB@og}%
\renewcommand*{\fg}{\FB@fg}}
\def\bbl@nonfrenchguillemets{\renewcommand*{\og}{\textquotedblleft}%
\renewcommand*{\fg}{\ifdim\lastskip>\z@\unskip\fi
\textquotedblright}}
\else
\def\bbl@frenchguillemets{\let\og\FB@og
\let\fg\FB@fg}
\def\bbl@nonfrenchguillemets{\def\og{``}%
\def\fg{\ifdim\lastskip>\z@\unskip\fi ''}}
\fi
\expandafter\addto\csname extras\CurrentOption\endcsname{%
\bbl@frenchguillemets}
\expandafter\addto\csname noextras\CurrentOption\endcsname{%
\bbl@nonfrenchguillemets}
% \end{macrocode}
%
% \subsection{Date in French}
%
% \begin{macro}{\datefrench}
% The macro |\datefrench| redefines the command |\today| to
% produce French dates.
%
% \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).}
%
% \begin{macrocode}
\@namedef{date\CurrentOption}{%
\def\today{{\number\day}\ifnum1=\day {\ier}\fi \space
\ifcase\month
\or janvier\or f\'evrier\or mars\or avril\or mai\or juin\or
juillet\or ao\^ut\or septembre\or octobre\or novembre\or
d\'ecembre\fi
\space \number\year}}
% \end{macrocode}
% \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).}
%
% \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.}
%
% |\up| eases the typesetting of superscripts like
% `1\textsuperscript{er}'. Up to version 2.0 of |frenchb| |\up| was
% just a shortcut for |\textsuperscript| in \LaTeXe, 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 can be redefined by |\frenchbsetup{FrenchSuperscripts=false}|
% 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 \file{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 |\lowercase| 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 |LowercaseSuperscripts=false| of |\frenchbsetup{}|.
% \begin{macrocode}
\newcommand*{\FBsupR}{-0.12}
\newcommand*{\FBsupS}{0.65}
\newcommand*{\FB@lc}[1]{\lowercase{#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) \file{xltxtra} used in conjunction with
% XeLaTeX and OpenType fonts having the font feature
% 'VerticalPosition=Superior' (\file{xltxtra} defines
% |\realsuperscript| and |\fakesuperscript|) and b) \file{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, \dots) 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 now defined as |\FB@up| unless |\realsuperscript| is
% defined (occurs with XeLaTeX calling \file{xltxtra.sty}).
% \begin{macrocode}
\DeclareRobustCommand*{\fup}[1]{%
\@ifundefined{realsuperscript}%
{\FB@up{#1}}%
{\bgroup\let\fakesuperscript\FB@up@fake
\realsuperscript{\FB@lc{#1}}\egroup}}
% \end{macrocode}
% Temporary definition of |up| (redefined `AtBeginDocument').
% \begin{macrocode}
\newcommand*{\up}{\relax}
% \end{macrocode}
% Poor man's definition of |\up| for Plain. In \LaTeXe,
% |\up| will be defined as |\fup| or |\textsuperscript| later on
% while processing the options of |\frenchbsetup{}|.
% \begin{macrocode}
\else
\newcommand*{\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}
% Some handy macros for those who don't know how to abbreviate ordinals:
% \begin{macrocode}
\def\ieme{\up{\lowercase{e}}\xspace}
\def\iemes{\up{\lowercase{es}}\xspace}
\def\ier{\up{\lowercase{er}}\xspace}
\def\iers{\up{\lowercase{ers}}\xspace}
\def\iere{\up{\lowercase{re}}\xspace}
\def\ieres{\up{\lowercase{res}}\xspace}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \changes{v2.1c}{2008/04/29}{Added commands \cs{Nos} and \cs{nos}.}
%
% \begin{macro}{\No}
% \begin{macro}{\no}
% \begin{macro}{\Nos}
% \begin{macro}{\nos}
% \begin{macro}{\primo}
% \begin{macro}{\fprimo)}
% And some more macros relying on |\up| for numbering,
% first two support macros.
% \begin{macrocode}
\newcommand*{\FrenchEnumerate}[1]{%
#1\up{\lowercase{o}}\kern+.3em}
\newcommand*{\FrenchPopularEnumerate}[1]{%
#1\up{\lowercase{o}})\kern+.3em}
% \end{macrocode}
%
% Typing |\primo| should result in `$1^{\rm o}$\kern+.3em',
% \begin{macrocode}
\def\primo{\FrenchEnumerate1}
\def\secundo{\FrenchEnumerate2}
\def\tertio{\FrenchEnumerate3}
\def\quarto{\FrenchEnumerate4}
% \end{macrocode}
% while typing |\fprimo)| gives `1$^{\rm o}$)\kern+.3em.
% \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\'ero''.
% \begin{macrocode}
\DeclareRobustCommand*{\No}{N\up{\lowercase{o}}\kern+.2em}
\DeclareRobustCommand*{\no}{n\up{\lowercase{o}}\kern+.2em}
\DeclareRobustCommand*{\Nos}{N\up{\lowercase{os}}\kern+.2em}
\DeclareRobustCommand*{\nos}{n\up{\lowercase{os}}\kern+.2em}
% \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}.}
%
% \begin{macrocode}
\DeclareRobustCommand*{\bsc}[1]{\leavevmode\begingroup\kern0pt
\scshape #1\endgroup}
\ifLaTeXe\else\let\scshape\relax\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.
%
% \begin{macrocode}
\ifLaTeXe
\DeclareTextSymbol{\at}{T1}{64}
\DeclareTextSymbol{\circonflexe}{T1}{94}
\DeclareTextSymbol{\tild}{T1}{126}
\DeclareTextSymbolDefault{\at}{T1}
\DeclareTextSymbolDefault{\circonflexe}{T1}
\DeclareTextSymbolDefault{\tild}{T1}
\DeclareRobustCommand*{\boi}{\textbackslash}
\DeclareRobustCommand*{\degre}{\r{}}
\else
\def\T@one{T1}
\ifx\f@encoding\T@one
\newcommand*{\degre}{\char6}
\else
\newcommand*{\degre}{\char23}
\fi
\newcommand*{\at}{\char64}
\newcommand*{\circonflexe}{\char94}
\newcommand*{\tild}{\char126}
\newcommand*{\boi}{$\backslash$}
\fi
% \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|).
%
% If the \TeX{} Companion fonts are available (\file{textcomp.sty}),
% we pick up |\textdegree| from them instead of using emulating
% `degrees' from the |\r{}| accent. Otherwise we overwrite the
% (poor) definition of |\textdegree| given in \file{latin1.def},
% \file{applemac.def} etc. (called by \file{inputenc.sty}) by
% our definition of |\degres|. We also advice 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}
\ifLaTeXe
\newcommand*{\degres}{\degre}
\def\Warning@degree@TSone{%
\PackageWarning{frenchb.ldf}{%
Degrees would look better in TS1-encoding:
\MessageBreak add \protect
\usepackage{textcomp} to the preamble.
\MessageBreak Degrees used}}
\AtBeginDocument{\expandafter\ifx\csname M@TS1\endcsname\relax
\DeclareRobustCommand*{\degres}{%
\leavevmode\hbox to 0.3em{\hss\degre\hss}%
\Warning@degree@TSone
\global\let\Warning@degree@TSone\relax}%
\let\textdegree\degres
\else
\DeclareRobustCommand*{\degres}{%
\hbox{\UseTextSymbol{TS1}{\textdegree}}}%
\fi}
\else
\newcommand*{\degres}{%
\leavevmode\hbox to 0.3em{\hss\degre\hss}}
\fi
% \end{macrocode}
% \end{macro}
%
% \subsection{Formatting numbers}
% \label{sec-numbers}
%
% \begin{macro}{\DecimalMathComma}
% \begin{macro}{\StandardMathComma}
% As mentioned in the \TeX{}book p.~134, the comma is of type
% |\mathpunct| in math mode: it is automatically followed by a
% 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 \emph{only} (no space added);
% |\StandardMathComma| switches back to the standard behaviour
% of the comma.
% \begin{macrocode}
\newcount\std@mcc
\newcount\dec@mcc
\std@mcc=\mathcode`\,
\dec@mcc=\std@mcc
\@tempcnta=\std@mcc
\divide\@tempcnta by "1000
\multiply\@tempcnta by "1000
\advance\dec@mcc by -\@tempcnta
\newcommand*{\DecimalMathComma}{\iflanguage{french}%
{\mathcode`\,=\dec@mcc}{}%
\addto\extrasfrench{\mathcode`\,=\dec@mcc}}
\newcommand*{\StandardMathComma}{\mathcode`\,=\std@mcc
\addto\extrasfrench{\mathcode`\,=\std@mcc}}
\expandafter\addto\csname noextras\CurrentOption\endcsname{%
\mathcode`\,=\std@mcc}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\nombre}
%
% \changes{v2.0}{2006/11/06}{\cs{nombre} requires now numprint.sty.}
%
% The command |\nombre| is now borrowed from |numprint.sty| for
% \LaTeXe. 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. of the change.
% \begin{macrocode}
\newcommand*{\nombre}[1]{{#1}\message{%
*** \noexpand\nombre no longer formats numbers\string! ***}}%
% \end{macrocode}
% \end{macro}
%
% The next definitions only make sense for \LaTeXe. Let's cleanup
% and exit if the format in Plain based.
%
% \begin{macrocode}
\let\FBstop@here\relax
\def\FBclean@on@exit{\let\ifLaTeXe\@undefined
\let\LaTeXetrue\@undefined
\let\LaTeXefalse\@undefined}
\ifx\magnification\@undefined
\else
\def\FBstop@here{\let\STD@makecaption\relax
\FBclean@on@exit
\ldf@quit\CurrentOption\endinput}
\fi
\FBstop@here
% \end{macrocode}
%
% What follows now is for \LaTeXe{} \emph{only}.
% We redefine |\nombre| for \LaTeXe. A warning is issued
% at the first call of |\nombre| if |\numprint| is not
% defined, suggesting what to do. The package |numprint|
% is \emph{not} loaded automatically by |frenchb| because of
% possible options conflict.
%
% \begin{macrocode}
\renewcommand*{\nombre}[1]{\Warning@nombre\numprint{#1}}
\newcommand*{\Warning@nombre}{%
\@ifundefined{numprint}%
{\PackageWarning{frenchb.ldf}{%
\protect\nombre\space now relies on package numprint.sty,
\MessageBreak add \protect
\usepackage[autolanguage]{numprint}\MessageBreak
to your preamble *after* loading babel, \MessageBreak
see file numprint.pdf for other options.\MessageBreak
\protect\nombre\space called}%
\global\let\Warning@nombre\relax
\global\let\numprint\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}.}
%
% \changes{v2.0c}{2007/06/25}{\cs{ThinSpaceInFrenchNumbers} added
% for compatibility with frenchb-1.x.}
%
% \begin{macrocode}
\newcommand*{\ThinSpaceInFrenchNumbers}{%
\PackageWarning{frenchb.ldf}{%
Type \protect\frenchbsetup{ThinSpaceInFrenchNumbers}
\MessageBreak Command \protect\ThinSpaceInFrenchNumbers\space
is no longer\MessageBreak defined in frenchb v.2,}}
% \end{macrocode}
%
% \subsection{Caption names}
%
% The next step consists of 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.0}{2006/12/15}{Set \cs{CaptionSeparator} in
% \cs{extrasfrench} now instead of \cs{captionsfrench}
% because it has to be reset when leaving French.}
%
% \begin{macrocode}
\@namedef{captions\CurrentOption}{%
\def\refname{R\'ef\'erences}%
\def\abstractname{R\'esum\'e}%
\def\bibname{Bibliographie}%
\def\prefacename{Pr\'eface}%
\def\chaptername{Chapitre}%
\def\appendixname{Annexe}%
\def\contentsname{Table des mati\`eres}%
\def\listfigurename{Table des figures}%
\def\listtablename{Liste des tableaux}%
\def\indexname{Index}%
\def\figurename{{\scshape Figure}}%
\def\tablename{{\scshape Table}}%
% \end{macrocode}
% ``Premi\`ere partie'' instead of ``Part I''.
% \begin{macrocode}
\def\partname{\protect\@Fpt partie}%
\def\@Fpt{{\ifcase\value{part}\or Premi\`ere\or Deuxi\`eme\or
Troisi\`eme\or Quatri\`eme\or Cinqui\`eme\or Sixi\`eme\or
Septi\`eme\or Huiti\`eme\or Neuvi\`eme\or Dixi\`eme\or Onzi\`eme\or
Douzi\`eme\or Treizi\`eme\or Quatorzi\`eme\or Quinzi\`eme\or
Seizi\`eme\or Dix-septi\`eme\or Dix-huiti\`eme\or Dix-neuvi\`eme\or
Vingti\`eme\fi}\space\def\thepart{}}%
\def\pagename{page}%
\def\seename{{\emph{voir}}}%
\def\alsoname{{\emph{voir aussi}}}%
\def\enclname{P.~J. }%
\def\ccname{Copie \`a }%
\def\headtoname{}%
\def\proofname{D\'emonstration}%
\def\glossaryname{Glossaire}%
}
% \end{macrocode}
% \end{macro}
%
% As some users who choose |frenchb| or |francais| as option of
% \babel, might customise |\captionsfrenchb| or |\captionsfrancais|
% in the preamble, we merge their changes at the |\begin{document}|
% when they do so.
% The other variants of French (canadien, acadian) are defined by
% checking if the relevant option was used and then adding one extra
% level of expansion.
%
% \begin{macrocode}
\AtBeginDocument{\let\captions@French\captionsfrench
\@ifundefined{captionsfrenchb}%
{\let\captions@Frenchb\relax}%
{\let\captions@Frenchb\captionsfrenchb}%
\@ifundefined{captionsfrancais}%
{\let\captions@Francais\relax}%
{\let\captions@Francais\captionsfrancais}%
\def\captionsfrench{\captions@French
\captions@Francais\captions@Frenchb}%
\def\captionsfrancais{\captionsfrench}%
\def\captionsfrenchb{\captionsfrench}%
\iflanguage{french}{\captionsfrench}{}%
}
\@ifpackagewith{babel}{canadien}{%
\def\captionscanadien{\captionsfrench}%
\def\datecanadien{\datefrench}%
\def\extrascanadien{\extrasfrench}%
\def\noextrascanadien{\noextrasfrench}%
}{}
\@ifpackagewith{babel}{acadian}{%
\def\captionsacadian{\captionsfrench}%
\def\dateacadian{\datefrench}%
\def\extrasacadian{\extrasfrench}%
\def\noextrasacadian{\noextrasfrench}%
}{}
% \end{macrocode}
%
% \begin{macro}{\CaptionSeparator}
% Let's consider now captions in figures and tables.
% In French, captions in figures and tables should be printed with
% endash (`--') instead of the standard `:'.
%
% The standard definition of |\@makecaption| (e.g., the one provided
% in article.cls, report.cls, book.cls which is frozen for \LaTeXe{}
% according to Frank Mittelbach), has been saved in
% |\STD@makecaption| before making `:' active
% (see section~\ref{sec-punct}). `AtBeginDocument' we compare it to
% its current definition (some classes like koma-script classes,
% AMS classes, ua-thesis.cls\dots change it).
% If they are identical, |frenchb| just adds a hook called
% |\CaptionSeparator| to |\@makecaption|, |\CaptionSeparator|
% defaults to `: ' as in the standard |\@makecaption|, and will be
% changed to ` -- ' in French.
% If the definitions differ, |frenchb| doesn't overwrite the changes,
% but prints a message in the .log file.
%
% \begin{macrocode}
\def\CaptionSeparator{\string:\space}
\long\def\FB@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{#1\CaptionSeparator #2}%
\ifdim \wd\@tempboxa >\hsize
#1\CaptionSeparator #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\AtBeginDocument{%
\ifx\@makecaption\STD@makecaption
\global\let\@makecaption\FB@makecaption
\else
\@ifundefined{@makecaption}{}%
{\PackageWarning{frenchb.ldf}%
{The definition of \protect\@makecaption\space
has been changed,\MessageBreak
frenchb will NOT customise it;\MessageBreak reported}%
}%
\fi
\let\FB@makecaption\relax
\let\STD@makecaption\relax
}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
\def\CaptionSeparator{\space\textendash\space}}
\expandafter\addto\csname noextras\CurrentOption\endcsname{%
\def\CaptionSeparator{\string:\space}}
% \end{macrocode}
% \end{macro}
%
% \subsection{French lists}
% \label{sec-lists}
%
% \begin{macro}{\listFB}
% \begin{macro}{\listORI}
% Vertical spacing in general 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; as most lists are based on
% |\list| we will define a variant of |\list| (|\listFB|) to
% be used in French.
%
% 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.
%
% |\endlist| is not redefined, but |\endlistORI| is provided for
% the users who prefer to define their own lists from the original
% command, they can code: |\begin{listORI}{}{} \end{listORI}|.
% \begin{macrocode}
\let\listORI\list
\let\endlistORI\endlist
\def\FB@listsettings{%
\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@listsettings #2}}%
\let\endlistFB\endlist
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\itemizeFB}
% \begin{macro}{\itemizeORI}
% \begin{macro}{\bbl@frenchlabelitems}
% \begin{macro}{\bbl@nonfrenchlabelitems}
% Let's now consider French itemize lists. They differ from those
% provided by the standard \LaTeXe{} classes:
% \begin{itemize}
% \item vertical spacing between items, before and after
% the list, should be \emph{null} with \emph{no glue} added;
% \item the item labels of a first level list should be vertically
% aligned on the paragraph's first character (i.e. at
% |\parindent| from the left margin);
% \item the `\textbullet' is never used in French itemize-lists,
% a long dash `--' is preferred for all levels. The item label
% used in French is stored in |\FrenchLabelItem}|, it defaults
% to `--' and can be changed using |\frenchbsetup{}| (see
% section~\ref{sec-keyval}).
% \end{itemize}
%
% \begin{macrocode}
\newcommand*{\FrenchLabelItem}{\textendash}
\newcommand*{\Frlabelitemi}{\FrenchLabelItem}
\newcommand*{\Frlabelitemii}{\FrenchLabelItem}
\newcommand*{\Frlabelitemiii}{\FrenchLabelItem}
\newcommand*{\Frlabelitemiv}{\FrenchLabelItem}
% \end{macrocode}
% |\bbl@frenchlabelitems| saves current itemize labels and changes
% them to their value in French. This code should never be executed
% twice in a row, so we need a new flag that will be set and reset
% by |\bbl@nonfrenchlabelitems| and |\bbl@frenchlabelitems|.
% \begin{macrocode}
\newif\ifFB@enterFrench \FB@enterFrenchtrue
\def\bbl@frenchlabelitems{%
\ifFB@enterFrench
\let\@ltiORI\labelitemi
\let\@ltiiORI\labelitemii
\let\@ltiiiORI\labelitemiii
\let\@ltivORI\labelitemiv
\let\labelitemi\Frlabelitemi
\let\labelitemii\Frlabelitemii
\let\labelitemiii\Frlabelitemiii
\let\labelitemiv\Frlabelitemiv
\FB@enterFrenchfalse
\fi
}
\let\itemizeORI\itemize
\let\enditemizeORI\enditemize
\let\enditemizeFB\enditemize
\def\itemizeFB{%
\ifnum \@itemdepth >\thr@@\@toodeep\else
\advance\@itemdepth\@ne
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
\expandafter
\listORI
\csname\@itemitem\endcsname
{\settowidth{\labelwidth}{\csname\@itemitem\endcsname}%
\setlength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}%
\ifnum\@listdepth=0
\setlength{\itemindent}{\parindent}%
\else
\addtolength{\leftmargin}{\parindent}%
\fi
\setlength{\itemsep}{\z@}%
\setlength{\parsep}{\z@}%
\setlength{\topsep}{\z@}%
\setlength{\partopsep}{\z@}%
% \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}}%
\fi}
% \end{macrocode}
% The user's changes in labelitems are saved when leaving French for
% further use when switching back to French. This code should never
% be executed twice in a row (toggle with |\bbl@frenchlabelitems|).
% \begin{macrocode}
\def\bbl@nonfrenchlabelitems{%
\ifFB@enterFrench
\else
\let\Frlabelitemi\labelitemi
\let\Frlabelitemii\labelitemii
\let\Frlabelitemiii\labelitemiii
\let\Frlabelitemiv\labelitemiv
\let\labelitemi\@ltiORI
\let\labelitemii\@ltiiORI
\let\labelitemiii\@ltiiiORI
\let\labelitemiv\@ltivORI
\FB@enterFrenchtrue
\fi
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{French indentation of sections}
% \label{sec-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.
%
% \begin{macrocode}
\let\@aifORI\@afterindentfalse
\def\bbl@frenchindent{\let\@afterindentfalse\@afterindenttrue
\@afterindenttrue}
\def\bbl@nonfrenchindent{\let\@afterindentfalse\@aifORI
\@afterindentfalse}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Formatting footnotes}
% \label{sec-footnotes}
%
% \changes{v2.0}{2006/11/06}{Footnotes are now printed
% by default `\`a la fran\c caise' for the whole document.}
%
% \changes{v2.0b}{2007/04/18}{Footnotes: Just do nothing
% (except warning) when the bigfoot package is loaded.}
%
% The |bigfoot| package deeply changes the way footnotes are
% handled. When |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 |\frenchbsetup{}| (see section~\ref{sec-keyval}).
% Notice that 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!).
%
% When |\ifFBAutoSpaceFootnotes| is true, |\@footnotemark| (whose
% definition is saved at the |\begin{document}| in order to include
% any customisation that packages might have done) is redefined to
% add a thin space before the number or symbol calling a footnote
% (any space typed in is removed first). This has no effect on
% the layout of the footnote itself.
%
% \begin{macrocode}
\AtBeginDocument{\@ifpackageloaded{bigfoot}%
{\PackageWarning{frenchb.ldf}%
{bigfoot package in use.\MessageBreak
frenchb will NOT customise footnotes;\MessageBreak
reported}}%
{\let\@footnotemarkORI\@footnotemark
\def\@footnotemarkFB{\leavevmode\unskip\unkern
\,\@footnotemarkORI}%
\ifFBAutoSpaceFootnotes
\let\@footnotemark\@footnotemarkFB
\fi}%
}
% \end{macrocode}
%
% 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) and followed by a dot
% and an half quad space. 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).}
%
% 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
\def\ftnISsymbol{\@fnsymbol\c@footnote}
\long\def\@makefntextFB#1{\ifx\thefootnote\ftnISsymbol
\@makefntextORI{#1}%
\else
\parindent=\parindentFFN
\rule\z@\footnotesep
\setbox\@tempboxa\hbox{\@thefnmark}%
\ifdim\wd\@tempboxa>\z@
\llap{\@thefnmark}.\kern.5em
\fi #1
\fi}%
% \end{macrocode}
%
% We save the standard definition of |\@makefntext| at the
% |\begin{document}|, and then redefine |\@makefntext| according to
% the value of flag |\ifFBFrenchFootnotes| (true or false).
%
% \begin{macrocode}
\AtBeginDocument{\@ifpackageloaded{bigfoot}{}%
{\ifdim\parindentFFN<10in
\else
\parindentFFN=\parindent
\ifdim\parindentFFN<1.5em\parindentFFN=1.5em\fi
\fi
\let\@makefntextORI\@makefntext
\long\def\@makefntext#1{%
\ifFBFrenchFootnotes
\@makefntextFB{#1}%
\else
\@makefntextORI{#1}%
\fi}%
}%
}
% \end{macrocode}
%
% For compatibility reasons, we provide definitions for the commands
% dealing with the layout of footnotes in |frenchb| version~1.6.
% |\frenchbsetup{}| (see in section \ref{sec-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{Global layout}
% \label{sec-global}
%
% In multilingual documents, some typographic rules must depend
% on the current language (e.g., hyphenation, typesetting of
% numbers, spacing before double punctuation\dots), others should,
% IMHO, be kept global to the document: especially the layout of
% lists (see~\ref{sec-lists}) and footnotes
% (see~\ref{sec-footnotes}), and the indentation of the first
% paragraph of sections (see~\ref{sec-indent}).
%
% From version 2.2 on, if |frenchb| is \babel's ``main language''
% (i.e. last language option at \babel's loading), |frenchb|
% customises the layout (i.e. lists, indentation of the first
% paragraphs of sections and footnotes) in the whole document
% regardless the current language. On the other hand, if |frenchb|
% is \emph{not} \babel's ``main language'', it leaves the layout
% unchanged both in French and in other languages.
%
% \begin{macro}{\FrenchLayout}
% \begin{macro}{\StandardLayout}
% The former commands |\FrenchLayout| and |\StandardLayout| are kept
% for compatibility reasons but should no longer be used.
%
% \changes{v2.0g}{2008/03/23}{Flag \cs{ifFBStandardLayout} not checked
% by \cs{FBprocess@options}, low-level flags have to be set
% one by one.}
%
% \begin{macrocode}
\newcommand*{\FrenchLayout}{%
\FBGlobalLayoutFrenchtrue
\PackageWarning{frenchb.ldf}%
{\protect\FrenchLayout\space is obsolete. Please use\MessageBreak
\protect\frenchbsetup{GlobalLayoutFrench} instead.}%
}
\newcommand*{\StandardLayout}{%
\FBReduceListSpacingfalse
\FBCompactItemizefalse
\FBStandardItemLabelstrue
\FBIndentFirstfalse
\FBFrenchFootnotesfalse
\FBAutoSpaceFootnotesfalse
\PackageWarning{frenchb.ldf}%
{\protect\StandardLayout\space is obsolete. Please use\MessageBreak
\protect\frenchbsetup{StandardLayout} instead.}%
}
\@onlypreamble\FrenchLayout
\@onlypreamble\StandardLayout
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Dots\dots}
% \label{sec-dots}
%
% \begin{macro}{\FBtextellipsis}
% \LaTeXe's standard definition of |\dots| in text-mode is
% |\textellipsis| which 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 \LaTeXe{} only).
%
% The |\if| construction in the \LaTeXe{} definition of |\dots|
% doesn't allow the use of |xspace| (|xspace| is always followed
% by a |\fi|), so we use the AMS-\LaTeX{} construction of |\dots|;
% this has to be done `AtBeginDocument' not to be overwritten
% when \file{amsmath.sty} is loaded after \babel.
%
% \changes{v2.0}{2006/11/06}{Added special case for LY1 encoding,
% see bug report from Bruno Voisin (2004/05/18).}
%
% LY1 has a ready made character for |\textellipsis|, it should be
% used in French too (pointed out by Bruno Voisin).
%
% \begin{macrocode}
\DeclareTextSymbol{\FBtextellipsis}{LY1}{133}
\DeclareTextCommandDefault{\FBtextellipsis}{%
.\kern\fontdimen3\font.\kern\fontdimen3\font.\xspace}
% \end{macrocode}
% |\Mdots@| and |\Tdots@ORI| hold the definitions of |\dots| in
% Math and Text mode. They default to those of amsmath-2.0, and
% will revert to standard \LaTeX{} definitions `AtBeginDocument',
% if amsmath has not been loaded. |\Mdots@| doesn't change when
% switching from/to French, while |\Tdots@| is |\FBtextellipsis|
% in French and |\Tdots@ORI| otherwise.
% \begin{macrocode}
\newcommand*{\Tdots@ORI}{\@xp\textellipsis}
\newcommand*{\Tdots@}{\Tdots@ORI}
\newcommand*{\Mdots@}{\@xp\mdots@}
\AtBeginDocument{\DeclareRobustCommand*{\dots}{\relax
\csname\ifmmode M\else T\fi dots@\endcsname}%
\@ifundefined{@xp}{\let\@xp\relax}{}%
\@ifundefined{mdots@}{\let\Tdots@ORI\textellipsis
\let\Mdots@\mathellipsis}{}}
\def\bbl@frenchdots{\let\Tdots@\FBtextellipsis}
\def\bbl@nonfrenchdots{\let\Tdots@\Tdots@ORI}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
\bbl@frenchdots}
\expandafter\addto\csname noextras\CurrentOption\endcsname{%
\bbl@nonfrenchdots}
% \end{macrocode}
% \end{macro}
%
% \subsection{Setup options: keyval stuff}
% \label{sec-keyval}
%
% \changes{v2.0}{2006/11/06}{New command \cs{frenchbsetup} added
% for global customisation.}
%
% \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: [false] $\to$ [true] and
% StandardLayout $\to$ 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}{Values of flags
% \cs{ifFBReduceListSpacing}, \cs{ifFBCompactItemize},
% \cs{ifFBStandardItemLabels}, \cs{ifFBIndentFirst},
% \cs{ifFBFrenchFootnotes}, \cs{ifFBAutoSpaceFootnotes} changed:
% default now means `StandardLayout', it 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.}
%
% We first define a collection of conditionals with their defaults
% (true or false).
%
% \begin{macrocode}
\newif\ifFBStandardLayout \FBStandardLayouttrue
\newif\ifFBGlobalLayoutFrench \FBGlobalLayoutFrenchfalse
\newif\ifFBReduceListSpacing \FBReduceListSpacingfalse
\newif\ifFBCompactItemize \FBCompactItemizefalse
\newif\ifFBStandardItemLabels \FBStandardItemLabelstrue
\newif\ifFBStandardLists \FBStandardListstrue
\newif\ifFBIndentFirst \FBIndentFirstfalse
\newif\ifFBFrenchFootnotes \FBFrenchFootnotesfalse
\newif\ifFBAutoSpaceFootnotes \FBAutoSpaceFootnotesfalse
\newif\ifFBAutoSpacePunctuation \FBAutoSpacePunctuationtrue
\newif\ifFBThinColonSpace \FBThinColonSpacefalse
\newif\ifFBThinSpaceInFrenchNumbers \FBThinSpaceInFrenchNumbersfalse
\newif\ifFBFrenchSuperscripts \FBFrenchSuperscriptstrue
\newif\ifFBLowercaseSuperscripts \FBLowercaseSuperscriptstrue
\newif\ifFBPartNameFull \FBPartNameFulltrue
\newif\ifFBShowOptions \FBShowOptionsfalse
% \end{macrocode}
%
% The defaults values of these flags have been set 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. We check the current language
% `AtEndOfPackage' (it is |\bbl@main@language|); if it is French,
% 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 |\frenchbsetup{}|.
% \begin{macrocode}
\AtEndOfPackage{%
\iflanguage{french}{\FBReduceListSpacingtrue
\FBCompactItemizetrue
\FBStandardItemLabelsfalse
\FBIndentFirsttrue
\FBFrenchFootnotestrue
\FBAutoSpaceFootnotestrue
\FBGlobalLayoutFrenchtrue}%
{}%
}
% \end{macrocode}
%
% \begin{macro}{\frenchbsetup}
% From version 2.0 on, all setup options are handled by \emph{one}
% command |\frenchbsetup| using the keyval syntax.
% Let's now define this command which reads and sets the options
% to be processed later (at |\begin{document}|) by
% |\FBprocess@options|. It can only be called in the preamble.
% \begin{macrocode}
\newcommand*{\frenchbsetup}[1]{%
\setkeys{FB}{#1}%
}%
\@onlypreamble\frenchbsetup
% \end{macrocode}
% |frenchb| being an option of babel, it cannot load a package
% (keyval) while |frenchb.ldf| is read, so we defer the loading of
% \file{keyval} and the options setup at the end of \babel's loading.
%
% |StandardLayout| resets the layout in French to the standard layout
% defined par the \LaTeX{} class and packages loaded. It deals with
% lists, indentation of first paragraphs of sections and footnotes.
% Other keys, entered \emph{after} |StandardLayout| in
% |\frenchbsetup|, can overrule some of the |StandardLayout|
% settings.
%
% |GlobalLayoutFrench| forces the layout in French and (as far as
% possible) outside French to meet the French typographic standards.
%
% \begin{macrocode}
\AtEndOfPackage{%
\RequirePackage{keyval}%
\define@key{FB}{StandardLayout}[true]%
{\csname FBStandardLayout#1\endcsname
\ifFBStandardLayout
\FBReduceListSpacingfalse
\FBCompactItemizefalse
\FBStandardItemLabelstrue
\FBIndentFirstfalse
\FBFrenchFootnotesfalse
\FBAutoSpaceFootnotesfalse
\FBGlobalLayoutFrenchfalse
\else
\FBReduceListSpacingtrue
\FBCompactItemizetrue
\FBStandardItemLabelsfalse
\FBIndentFirsttrue
\FBFrenchFootnotestrue
\FBAutoSpaceFootnotestrue
\fi}%
\define@key{FB}{GlobalLayoutFrench}[true]%
{\csname FBGlobalLayoutFrench#1\endcsname
\ifFBGlobalLayoutFrench
\FBReduceListSpacingtrue
\FBCompactItemizetrue
\FBStandardItemLabelsfalse
\FBIndentFirsttrue
\FBFrenchFootnotestrue
\FBAutoSpaceFootnotestrue
\fi}%
\define@key{FB}{ReduceListSpacing}[true]%
{\csname FBReduceListSpacing#1\endcsname}%
\define@key{FB}{CompactItemize}[true]%
{\csname FBCompactItemize#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
\FBReduceListSpacingfalse
\FBCompactItemizefalse
\FBStandardItemLabelstrue
\else
\FBReduceListSpacingtrue
\FBCompactItemizetrue
\FBStandardItemLabelsfalse
\fi}%
\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}{ThinColonSpace}[true]%
{\csname FBThinColonSpace#1\endcsname}%
\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}{ShowOptions}[true]%
{\csname FBShowOptions#1\endcsname}%
% \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|.
% The purpose of the following code is to map the French quote
% characters to |\og\ignorespaces| and |{\fg}| respectively when
% the current language is French, and to |\guillemotleft| and
% |\guillemotright| otherwise (think of German quotes); thus correct
% unbreakable 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,\dots) or
% multi-bytes (utf-8, utf8x). We first check whether XeTeX is used
% or not, if not the package |inputenc| has to be loaded before the
% |\begin{document}| with the proper coding option, so we check if
% |\DeclareInputText| is defined.
% \begin{macrocode}
\define@key{FB}{og}{%
\newcommand*{\FB@@og}{\iflanguage{french}%
{\FB@og\ignorespaces}{\guillemotleft}}%
\expandafter\ifx\csname XeTeXrevision\endcsname\relax
\AtBeginDocument{%
\@ifundefined{DeclareInputText}%
{\PackageWarning{frenchb.ldf}%
{Option `og' requires package inputenc.\MessageBreak}%
}%
{\@ifundefined{uc@dclc}%
% \end{macrocode}
% if |\uc@dclc| is undefined, utf8x is not loaded\dots
% \begin{macrocode}
{\@ifundefined{DeclareUnicodeCharacter}%
% \end{macrocode}
% if |\DeclareUnicodeCharacter| is undefined, utf8 is not loaded
% either, we assume 8-bit character input encoding.
% Package MULEenc.sty (from CJK) defines |\mule@def| to map
% characters to control sequences.
% \begin{macrocode}
{\@tempcnta`#1\relax
\@ifundefined{mule@def}%
{\DeclareInputText{\the\@tempcnta}{\FB@@og}}%
{\mule@def{11}{{\FB@@og}}}%
}%
% \end{macrocode}
% utf8 loaded, use |\DeclareUnicodeCharacter|,
% \begin{macrocode}
{\DeclareUnicodeCharacter{00AB}{\FB@@og}}%
}%
% \end{macrocode}
% utf8x loaded, use |\uc@dclc|,
% \begin{macrocode}
{\uc@dclc{171}{default}{\FB@@og}}%
}%
}%
% \end{macrocode}
% XeTeX in use, the following trick for defining the active quote
% character is borrowed from \file{inputenc.dtx}.
% \begin{macrocode}
\else
\catcode`#1=\active
\bgroup
\uccode`\~`#1%
\uppercase{%
\egroup
\def~%
}{\FB@@og}%
\fi
}%
% \end{macrocode}
% Same code for the closing quote.
% \begin{macrocode}
\define@key{FB}{fg}{%
\newcommand*{\FB@@fg}{\iflanguage{french}%
{\FB@fg}{\guillemotright}}%
\expandafter\ifx\csname XeTeXrevision\endcsname\relax
\AtBeginDocument{%
\@ifundefined{DeclareInputText}%
{\PackageWarning{frenchb.ldf}%
{Option `fg' requires package inputenc.\MessageBreak}%
}%
{\@ifundefined{uc@dclc}%
{\@ifundefined{DeclareUnicodeCharacter}%
{\@tempcnta`#1\relax
\@ifundefined{mule@def}%
{\DeclareInputText{\the\@tempcnta}{{\FB@@fg}}}%
{\mule@def{27}{{\FB@@fg}}}%
}%
{\DeclareUnicodeCharacter{00BB}{{\FB@@fg}}}%
}%
{\uc@dclc{187}{default}{{\FB@@fg}}}%
}%
}%
\else
\catcode`#1=\active
\bgroup
\uccode`\~`#1%
\uppercase{%
\egroup
\def~%
}{{\FB@@fg}}%
\fi
}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FBprocess@options}
% |\FBprocess@options| processes the options, it is called \emph{once}
% at |\begin{document}|.
% \begin{macrocode}
\newcommand*{\FBprocess@options}{%
% \end{macrocode}
% Nothing has to be done here for |StandardLayout| and
% |StandardLists| (the involved flags have already been set in
% |\frenchbsetup{}| or before (at babel's EndOfPackage).
%
% The next three options deal with the layout of lists in French.
%
% |ReduceListSpacing| reduces the vertical spaces between list
% items in French (done by changing |\list| to |\listFB|).
% When |GlobalLayoutFrench| is true the same is done outside French.
% \begin{macrocode}
\ifFBReduceListSpacing
\addto\extrasfrench{\let\list\listFB
\let\endlist\endlistFB}%
\addto\noextrasfrench{\ifFBGlobalLayoutFrench
\let\list\listFB
\let\endlist\endlistFB
\else
\let\list\listORI
\let\endlist\endlistORI
\fi}%
\else
\addto\extrasfrench{\let\list\listORI
\let\endlist\endlistORI}%
\addto\noextrasfrench{\let\list\listORI
\let\endlist\endlistORI}%
\fi
% \end{macrocode}
%
% |CompactItemize| suppresses the vertical spacing between list
% items in French (done by changing |\itemize| to |\itemizeFB|).
% When |GlobalLayoutFrench| is true the same is done outside French.
% \begin{macrocode}
\ifFBCompactItemize
\addto\extrasfrench{\let\itemize\itemizeFB
\let\enditemize\enditemizeFB}%
\addto\noextrasfrench{\ifFBGlobalLayoutFrench
\let\itemize\itemizeFB
\let\enditemize\enditemizeFB
\else
\let\itemize\itemizeORI
\let\enditemize\enditemizeORI
\fi}%
\else
\addto\extrasfrench{\let\itemize\itemizeORI
\let\enditemize\enditemizeORI}%
\addto\noextrasfrench{\let\itemize\itemizeORI
\let\enditemize\enditemizeORI}%
\fi
% \end{macrocode}
%
% |StandardItemLabels| resets labelitems in French to their
% standard values set by the \LaTeX{} class and packages loaded.
% When |GlobalLayoutFrench| is true labelitems are identical inside
% and outside French.
% \begin{macrocode}
\ifFBStandardItemLabels
\addto\extrasfrench{\bbl@nonfrenchlabelitems}%
\addto\noextrasfrench{\bbl@nonfrenchlabelitems}%
\else
\addto\extrasfrench{\bbl@frenchlabelitems}%
\addto\noextrasfrench{\ifFBGlobalLayoutFrench
\bbl@frenchlabelitems
\else
\bbl@nonfrenchlabelitems
\fi}%
\fi
% \end{macrocode}
%
% |IndentFirst| forces the first paragraphs of sections to be
% indented just like the other ones in French.
% When |GlobalLayoutFrench| is true the same is done outside French.
% \begin{macrocode}
\ifFBIndentFirst
\addto\extrasfrench{\bbl@frenchindent}%
\addto\noextrasfrench{\ifFBGlobalLayoutFrench
\bbl@frenchindent
\else
\bbl@nonfrenchindent
\fi}%
\else
\addto\extrasfrench{\bbl@nonfrenchindent}%
\addto\noextrasfrench{\bbl@nonfrenchindent}%
\fi
% \end{macrocode}
%
% The layout of footnotes is handled at the |\begin{document}|
% depending on the values of flags |FrenchFootnotes|
% and |AutoSpaceFootnotes| (see section~\ref{sec-footnotes}),
% nothing has to be done here for footnotes.
%
% |AutoSpacePunctuation| adds an unbreakable space (in French only)
% before the four active characters (:;!?) even if none has been
% typed before them.
% \begin{macrocode}
\ifFBAutoSpacePunctuation
\AutoSpaceBeforeFDP
\else
\NoAutoSpaceBeforeFDP
\fi
% \end{macrocode}
%
% |ThinColonSpace| changes the normal unbreakable space typeset in
% French before `:' to a thin space.
% \begin{macrocode}
\ifFBThinColonSpace\renewcommand*{\Fcolonspace}{\thinspace}\fi
% \end{macrocode}
%
% When |true|, |ThinSpaceInFrenchNumbers| redefines |numprint.sty|'s
% command |\npstylefrench| to set |\npthousandsep| to |\,|
% (thinspace) instead of |~| (default) . This option has no effect
% if package |numprint.sty| is not loaded with `|autolanguage|'.
% As old versions of |numprint.sty| did not define |\npstylefrench|,
% we have to provide this command.
% \begin{macrocode}
\@ifpackageloaded{numprint}%
{\ifnprt@autolanguage
\providecommand*{\npstylefrench}{}%
\ifFBThinSpaceInFrenchNumbers
\renewcommand*\npstylefrench{%
\npthousandsep{\,}%
\npdecimalsign{,}%
\npproductsign{\cdot}%
\npunitseparator{\,}%
\npdegreeseparator{}%
\nppercentseparator{\nprt@unitsep}%
}%
\else
\renewcommand*\npstylefrench{%
\npthousandsep{~}%
\npdecimalsign{,}%
\npproductsign{\cdot}%
\npunitseparator{\,}%
\npdegreeseparator{}%
\nppercentseparator{\nprt@unitsep}%
}%
\fi
\npaddtolanguage{french}{french}%
\fi}{}%
% \end{macrocode}
%
% |FrenchSuperscripts|: if |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}{\@ifstar{\FB@up@fake}{\fup}}%
\else
\DeclareRobustCommand*{\up}{\@ifstar{\FB@up@fake}%
{\textsuperscript}}%
\fi
% \end{macrocode}
%
% |LowercaseSuperscripts|: if |true| let |\FB@lc| be |\lowercase|,
% else |\FB@lc| is redefined to do nothing.
% \begin{macrocode}
\ifFBLowercaseSuperscripts
\else
\renewcommand*{\FB@lc}[1]{##1}%
\fi
% \end{macrocode}
%
% |PartNameFull|: if |false|, redefine |\partname|.
% \begin{macrocode}
\ifFBPartNameFull
\else\addto\captionsfrench{\def\partname{Partie}}\fi
% \end{macrocode}
%
% |ShowOptions|: if |true|, print the list of all options to the
% \file{.log} file.
% \begin{macrocode}
\ifFBShowOptions
\GenericWarning{* }{%
* **** List of possible options for frenchb ****\MessageBreak
[Default values between brackets when frenchb is loaded *LAST*]%
\MessageBreak
ShowOptions=true [false]\MessageBreak
StandardLayout=true [false]\MessageBreak
GlobalLayoutFrench=false [true]\MessageBreak
StandardLists=true [false]\MessageBreak
ReduceListSpacing=false [true]\MessageBreak
CompactItemize=false [true]\MessageBreak
StandardItemLabels=true [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
IndentFirst=false [true]\MessageBreak
FrenchFootnotes=false [true]\MessageBreak
AutoSpaceFootnotes=false [true]\MessageBreak
AutoSpacePunctuation=false [true]\MessageBreak
ThinColonSpace=true [false]\MessageBreak
ThinSpaceInFrenchNumbers=true [false]\MessageBreak
FrenchSuperscripts=false [true]\MessageBreak
LowercaseSuperscripts=false [true]\MessageBreak
PartNameFull=false [true]\MessageBreak
og= <left quote character>, fg= <right quote character>
\MessageBreak
*********************************************
\MessageBreak\protect\frenchbsetup{ShowOptions}}
\fi
}
% \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2006/12/15}{AtBeginDocument, save again the
% definitions of the `list' and `itemize' environments and the
% values of labelitems. As of frenchb v.1.6, `ORI' values were
% set when reading frenchb.ldf, later changes were ignored.}
%
% \changes{v2.0}{2006/12/06}{Added warning for OT1 encoding.}
%
% \changes{v2.1b}{2008/04/07}{Disable some commands in bookmarks.}
%
% At |\begin{document}| we save again the definitions of the `list'
% and `itemize' environments and the values of labelitems so that
% all changes made in the preamble are taken into account in
% languages other than French and in French with the StandardLayout
% option. We also have to provide an |\xspace| command in case the
% |xspace.sty| package is not loaded.
%
% \begin{macrocode}
\AtBeginDocument{%
\let\listORI\list
\let\endlistORI\endlist
\let\itemizeORI\itemize
\let\enditemizeORI\enditemize
\let\@ltiORI\labelitemi
\let\@ltiiORI\labelitemii
\let\@ltiiiORI\labelitemiii
\let\@ltivORI\labelitemiv
\providecommand*{\xspace}{\relax}%
% \end{macrocode}
% Let's redefine some commands in \file{hyperref}'s bookmarks.
% \begin{macrocode}
\@ifundefined{pdfstringdefDisableCommands}{}%
{\pdfstringdefDisableCommands{%
\let\up\relax
\def\ieme{e\xspace}%
\def\iemes{es\xspace}%
\def\ier{er\xspace}%
\def\iers{ers\xspace}%
\def\iere{re\xspace}%
\def\ieres{res\xspace}%
\def\FrenchEnumerate#1{#1\degre\space}%
\def\FrenchPopularEnumerate#1{#1\degre)\space}%
\def\No{N\degre\space}%
\def\no{n\degre\space}%
\def\Nos{N\degre\space}%
\def\nos{n\degre\space}%
\def\og{\guillemotleft\space}%
\def\fg{\space\guillemotright}%
\let\bsc\textsc
\let\degres\degre
}}%
% \end{macrocode}
% It is time to process the options set with |\frenchboptions{}|.
% Then execute either |\extrasfrench| and |\captionsfrench| or
% |\noextrasfrench| according to the current language at the
% |\begin{document}| (these three commands are updated by
% |\FBprocess@options|).
% \begin{macrocode}
\FBprocess@options
\iflanguage{french}{\extrasfrench\captionsfrench}{\noextrasfrench}%
% \end{macrocode}
% Some warnings are issued when output font encodings are not
% properly set. With XeLaTeX, \file{fontspec.sty} and
% \file{xunicode.sty} should be loaded; with (pdf)\LaTeX, a warning
% is issued when OT1 encoding is in use at the |\begin{document}|.
% Mind that |\encodingdefault| is defined as `long', defining
% |\FBOTone| with |\newcommand*| would fail!
% \begin{macrocode}
\expandafter\ifx\csname XeTeXrevision\endcsname\relax
\begingroup \newcommand{\FBOTone}{OT1}%
\ifx\encodingdefault\FBOTone
\PackageWarning{frenchb.ldf}%
{OT1 encoding should not be used for French.
\MessageBreak
Add \protect\usepackage[T1]{fontenc} to the
preamble\MessageBreak of your document,}
\fi
\endgroup
\else
\@ifundefined{DeclareUTFcharacter}%
{\PackageWarning{frenchb.ldf}%
{Add \protect\usepackage{fontspec} *and*\MessageBreak
\protect\usepackage{xunicode} to the preamble\MessageBreak
of your document,}}%
{}%
\fi
}
% \end{macrocode}
%
% \subsection{Clean up and exit}
%
% Load |frenchb.cfg| (should do nothing, just for compatibility).
% \begin{macrocode}
\loadlocalcfg{frenchb}
% \end{macrocode}
% Final cleaning.
% The macro |\ldf@quit| 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.
% The config file searched for has to be |frenchb.cfg|, and
% |\CurrentOption| has been set to `french', so
% |\ldf@finish\CurrentOption| cannot be used: we first load
% |frenchb.cfg|, then call |\ldf@quit\CurrentOption|.
% \begin{macrocode}
\FBclean@on@exit
\ldf@quit\CurrentOption
% \end{macrocode}
% \iffalse
%</code>
%<*dtx>
% \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
%</dtx>
% \fi
%
% \Finale
\endinput
|