\ProvidesFile{gloss-french.ldf}[polyglossia: module for french] \PolyglossiaSetup{french}{% language=French, script=Latin, langtag=FRA, hyphennames={french,francais}, frenchspacing=true, indentfirst=true, hyphenmins={2,2}, fontsetup=true} \def\french@variant{french} \define@choicekey*+{french}{variant}[\val\nr]{french,canadian,acadian}[french]{% \ifcase\nr\relax % french: \def\french@variant{french}% \or % canadian: \def\french@variant{canadien}% \SetLanguageKeys{french}{babelname=canadien}% \xpg@ifdefined{canadien}{}% {\xpg@warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak I will use the standard patterns for French instead}% \adddialect\l@canadien\l@french\relax}% \or % acadian: \def\french@variant{acadian}% \SetLanguageKeys{french}{babelname=canadien}% \xpg@ifdefined{acadian}{}% {\xpg@warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak I will use the standard patterns for French instead}% \adddialect\l@acadian\l@french\relax}% \fi \xpg@info{Option: French, variant=\val}% }{\xpg@warning{Unknown French variant `#1'}} \def\french@language{% \polyglossia@setup@language@patterns{\french@variant} }% \ifluatex \newluatexattribute\xpg@frpt % \directlua{polyglossia.load_frpt()}% \else \newXeTeXintercharclass\french@openbrackets % ( ] { \newXeTeXintercharclass\french@closebrackets % ( ] { \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} % Save original footnote definition \let\xpg@orig@makefntext\@makefntext \define@boolkey{french}[french@]{frenchfootnote}[true]{% \AfterPreamble{% \ifdefstring{\xpg@main@language}{french}{% \iffrench@frenchfootnote \ifx\@makefntext\undefined\else \long\def\french@makefntext##1{% \parindent1em \noindent\quad% \ifx\@thefnmark\empty\else% \@thefnmark.\space\fi ##1% } \let\@makefntext\french@makefntext \fi \else \let\@makefntext\xpg@orig@makefntext \fi }{\xpg@warning{Option 'frenchfootnote' only supported if French is main language!}}% }% } \define@boolkey{french}[french@]{autospacing}[true]{} \french@autospacingtrue \newif\iffrench@autospaceguillemets \define@boolkey{french}[french@]{autospaceguillemets}[true]{} \french@autospaceguillemetstrue % Backwards compatibility \define@boolkey{french}[french@]{automaticspacesaroundguillemets}[true]{% \iffrench@automaticspacesaroundguillemets \setkeys{french}{autospaceguillemets=true}% \else \setkeys{french}{autospaceguillemets=false}% \fi } % name is for compatibility with babel \let\french@ttfamilyORI\ttfamily \DeclareRobustCommand\french@ttfamilyFB{\nofrench@punctuation\french@ttfamilyORI} % Allow to switch on autospacing in ttfamily context \define@boolkey{french}[french@]{autospacetypewriter}[true]{} \french@autospacetypewriterfalse % This is how babel-french has it \define@boolkey{french}[french@]{OriginalTypewriter}[true]{% \iffrench@OriginalTypewriter \setkeys{french}{autospacetypewriter=false}% \else \setkeys{french}{autospacetypewriter=true}% \fi } \def\french@fontsetup{% \unless\iffrench@autospacetypewriter \let\ttfamily\french@ttfamilyFB \fi } \def\nofrench@fontsetup{% \let\ttfamily\french@ttfamilyORI } \def\french@punctuation{% \lccode"2019="2019 \ifluatex \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 \XeTeXcharclass `\( \french@openbrackets \XeTeXcharclass `\) \french@closebrackets \XeTeXcharclass `\] \french@openbrackets \XeTeXcharclass `\[ \french@closebrackets \XeTeXcharclass `\{ \french@openbrackets \XeTeXcharclass `\} \french@closebrackets \XeTeXinterchartoks \z@ \french@punctthin = {\thinspace}% \XeTeXinterchartoks \z@ \french@punctthick = {\nobreakspace}% \XeTeXinterchartoks \xpg@boundaryclass \french@punctthin = {\xpg@unskip\thinspace}% \XeTeXinterchartoks \xpg@boundaryclass \french@punctthick = {\xpg@unskip\nobreakspace}% \iffrench@autospaceguillemets \XeTeXinterchartoks \french@punctguillstart \z@ = {\thinspace}% "«a" -> "«\,a" % \XeTeXinterchartoks \z@ \french@punctguillstart = {\nobreakspace}% "a«" unchanged? % \XeTeXinterchartoks \french@punctguillend \z@ = {\nobreakspace}% "»a" unchanged? \XeTeXinterchartoks \z@ \french@punctguillend = {\thinspace}% "a»" -> "a\,»" \XeTeXinterchartoks \french@punctguillstart \xpg@boundaryclass = {\thinspace\ignorespaces}% "« " -> "«\," \XeTeXinterchartoks \xpg@boundaryclass \french@punctguillend = {\xpg@unskip\thinspace}% " »" -> "\,»" \fi \XeTeXinterchartoks \french@punctguillend \french@punctthin = {\thinspace}% "»;" -> "»\,;" \XeTeXinterchartoks \french@punctguillend \french@punctthick = {\nobreakspace}% "»:" -> "» :" \XeTeXinterchartoks \french@punctthin \french@punctguillend = {\thinspace}% "?»" -> "?\,»" \XeTeXinterchartoks \french@openbrackets \french@punctthin = {\xpg@unskip}% "(?" -> "(?" and not "( ?" \XeTeXinterchartoks \french@punctthin \french@closebrackets = {\xpg@unskip}% "?)" -> "?)" (code not need, just for symetry with previous one) \XeTeXinterchartoks \french@closebrackets \french@punctthin = {\thinspace}% ")?" -> ")\,?" \XeTeXinterchartoks \french@closebrackets \french@punctthick = {\nobreakspace}% "):" -> ") :" \fi } \def\nofrench@punctuation{% \lccode"2019=\z@ \ifluatex \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{\@Fpt partie}% \def\partname{}% \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% \nofrench@fontsetup% } \def\blockextras@french{% \iffrench@autospacing \french@punctuation% \fi \french@fontsetup% } \def\inlineextras@french{% \iffrench@autospacing \french@punctuation% \fi \french@fontsetup% } \def\NoAutoSpacing{% \nofrench@punctuation% } \def\AutoSpacing{% \french@punctuation% } \def\ier{\textsuperscript{er}} \def\iers{\textsuperscript{ers}} \def\iere{\textsuperscript{re}} \def\ieres{\textsuperscript{res}} \def\ieme{\textsuperscript{e}} \def\iemes{\textsuperscript{es}} \def\nd{\textsuperscript{nd}} \def\nds{\textsuperscript{nds}} \def\nde{\textsuperscript{nde}} \def\ndes{\textsuperscript{ndes}} \def\no{\textsuperscript{o}} \def\nos{\textsuperscript{os}} \def\mme{M\textsuperscript{me}\space} \def\mmes{M\textsuperscript{mes}\space} \def\mr{M.\space} \def\mrs{MM.\space} \endinput