summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf
blob: 3de602cf24178041f6ac2951d54a8fe79b302ca1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
\ProvidesFile{gloss-french.ldf}[polyglossia: module for french]

\PolyglossiaSetup{french}{%
  language=French,
  script=Latin,
  hyphennames={french,francais},
  frenchspacing=true,
  indentfirst=true,
  hyphenmins={2,2},
  fontsetup=true}

\ifluatex
  \newluatexattribute\xpg@frpt %
  \directlua{polyglossia.load_frpt()}%
\else
  \newXeTeXintercharclass\french@punctthin % ! ? ; et autres
  \newXeTeXintercharclass\french@punctthick % :
  \newXeTeXintercharclass\french@punctguillstart % « ‹
  \newXeTeXintercharclass\french@punctguillend % » ›
\fi

\def\xpg@unskip{\ifhmode\ifdim\lastskip>\z@\unskip\fi\fi}
\def\xpg@nospace#1{#1}

\def\french@punctuation{%
    \lccode"2019="2019
    \ifluatex
      \global\xpg@frpt=1\relax %
      \directlua{polyglossia.activate_frpt()}%
    \else
      \XeTeXinterchartokenstate=1
      \XeTeXcharclass `\! \french@punctthin
      \XeTeXcharclass `\? \french@punctthin
      \XeTeXcharclass `\‼ \french@punctthin
      \XeTeXcharclass `\⁇ \french@punctthin
      \XeTeXcharclass `\⁈ \french@punctthin
      \XeTeXcharclass `\⁉ \french@punctthin
      \XeTeXcharclass `\; \french@punctthin
      \XeTeXcharclass `\: \french@punctthick
      \XeTeXcharclass `\« \french@punctguillstart
      \XeTeXcharclass `\» \french@punctguillend
      \XeTeXcharclass `\‹ \french@punctguillstart
      \XeTeXcharclass `\› \french@punctguillend
      \XeTeXinterchartoks \z@ \french@punctthin = {\nobreak\thinspace}%
      \XeTeXinterchartoks \z@ \french@punctthick = {\nobreakspace}%
      \XeTeXinterchartoks 255 \french@punctthin = {\xpg@unskip\nobreak\thinspace}%
      \XeTeXinterchartoks 255 \french@punctthick = {\xpg@unskip\nobreakspace}%
      \XeTeXinterchartoks \french@punctguillstart \z@ = {\nobreakspace}% "«a" -> "« a"
  %   \XeTeXinterchartoks \z@ \french@punctguillstart = {\nobreakspace}% "a«" unchanged?
  %   \XeTeXinterchartoks \french@punctguillend \z@ = {\nobreakspace}% "»a" unchanged?
      \XeTeXinterchartoks \z@ \french@punctguillend = {\nobreakspace}% "a»" -> "a »"
      \XeTeXinterchartoks \french@punctguillstart 255 = {\nobreakspace\xpg@nospace}% "«  " -> "«~"
      \XeTeXinterchartoks 255 \french@punctguillend = {\xpg@unskip\nobreakspace}% "  »" -> "~»"
      \XeTeXinterchartoks \french@punctguillend \french@punctthin = {\nobreak\thinspace}% "»;" -> "» ;"
      \XeTeXinterchartoks \french@punctguillend \french@punctthick = {\nobreakspace}% "»:" -> "» :"
      \XeTeXinterchartoks \french@punctthin \french@punctguillend  = {\nobreakspace}% "?»" -> "? »"
    \fi
    }

\def\nofrench@punctuation{%
    \lccode"2019=\z@
    \ifluatex
      \global\xpg@frpt=0\relax %
      % Though it would make compilation slightly faster, it is not possible to
      % safely uncomment the following line. Imagine the following case: you start
      % a paragraph by some french text, then, in the same paragraph, you change
      % the language to something else, and thus call the following line. This means
      % that, at then end of the paragraph, the function won't be in the callback,
      % so the beginning of the paragraph won't be processed by it.
      %\directlua{polyglossia.desactivate_frpt()}
    \else
      \XeTeXcharclass `\! \z@
      \XeTeXcharclass `\? \z@
      \XeTeXcharclass `\‼ \z@
      \XeTeXcharclass `\⁇ \z@
      \XeTeXcharclass `\⁈ \z@
      \XeTeXcharclass `\⁉ \z@
      \XeTeXcharclass `\; \z@
      \XeTeXcharclass `\: \z@
      \XeTeXcharclass `\« \z@
      \XeTeXcharclass `\» \z@
      \XeTeXcharclass `\‹ \z@
      \XeTeXcharclass `\› \z@
      \XeTeXinterchartokenstate=0
    \fi
    }

\def\captionsfrench{%
   \def\refname{Références}%
   \def\abstractname{Résumé}%
   \def\bibname{Bibliographie}%
   \def\prefacename{Préface}%
   \def\chaptername{Chapitre}%
   \def\appendixname{Annexe}%
   \def\contentsname{Table des matières}%
   \def\listfigurename{Table des figures}%
   \def\listtablename{Liste des tableaux}%
   \def\indexname{Index}%
   \def\figurename{\textsc{Fig.}}%
   \def\tablename{\textsc{Tab.}}%
   \def\@Fpt{\ifcase\value{part}\or Première\or Deuxième\or
   Troisième\or Quatrième\or Cinquième\or Sixième\or
   Septième\or Huitième\or Neuvième\or Dixième\or Onzième\or
   Douzième\or Treizième\or Quatorzième\or Quinzième\or
   Seizième\or Dix-septième\or Dix-huitième\or Dix-neuvième\or
   Vingtième\fi\space}%
   \def\thepart{}%
   \def\partname{\protect\@Fpt partie}%
   \def\pagename{page}%
   \def\seename{\emph{voir}}%
   \def\alsoname{\emph{voir aussi}}%
   \def\enclname{P.~J. }%
   \def\ccname{Copie à }%
   \def\headtoname{}%
   \def\proofname{Démonstration}%
   }
\def\datefrench{%
   \def\today{\ifx\ier\undefined\def\ier{er}\fi
      \ifnum\day=1\relax 1\ier%
      \else \number\day\fi
      \space \ifcase\month%
      \or janvier\or février\or mars\or avril\or mai\or juin\or
      juillet\or août\or septembre\or octobre\or novembre\or
      décembre\fi
      \space \number\year}}

\def\noextras@french{%
   \nofrench@punctuation%
   }

\def\blockextras@french{%
   \french@punctuation%
   }

\def\inlineextras@french{%
   \french@punctuation%
   }

\endinput