diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/generic/babel-french/frenchb.pdf | bin | 278433 -> 285434 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/generic/babel-french/frenchb.dtx | 710 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/acadian.ldf | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/canadien.ldf | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/francais.ldf | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/french.ldf | 299 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/frenchb.ldf | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/frenchb.lua | 71 |
8 files changed, 649 insertions, 439 deletions
diff --git a/Master/texmf-dist/doc/generic/babel-french/frenchb.pdf b/Master/texmf-dist/doc/generic/babel-french/frenchb.pdf Binary files differindex 6399f445b3a..b00a00cb7b0 100644 --- a/Master/texmf-dist/doc/generic/babel-french/frenchb.pdf +++ b/Master/texmf-dist/doc/generic/babel-french/frenchb.pdf diff --git a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx index bf8cba8ecbc..61afd11a004 100644 --- a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx +++ b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx @@ -1,4 +1,4 @@ -%\CheckSum{3473} +%\CheckSum{3545} % %\iffalse % Tell the \LaTeX\ system who we are and write an entry on the @@ -13,7 +13,7 @@ %<frenchb>\ProvidesLanguage{frenchb} %<lua>--[[ %<lua> File `frenchb.lua’ generated from frenchb.dtx - [2017/07/08 v3.3b French support from the babel system] + [2017/09/07 v3.3c French support from the babel system] %<*internal> \iffalse %</internal> @@ -54,8 +54,9 @@ \usepackage[expansion=true,protrusion=true]{microtype} \def\ColorArg{\color{PineGreen}} \usepackage{url} -\usepackage{hypdoc} +\usepackage[numbered]{hypdoc} \hypersetup{colorlinks,urlcolor=blue,unicode} +\newcommand*{\hlabel}[1]{\phantomsection\label{#1}} \newcommand*\babel{\textsf{babel}} \newcommand*\frenchb{\textsf{babel-french}} \newcommand*\langvar{$\langle \it lang \rangle$} @@ -65,6 +66,7 @@ \newcommand*\cls[1]{\texttt{#1}} \newcommand*\pkg[1]{\texttt{#1}} \newcommand*\env[1]{\texttt{#1}} +\newcommand*\exe[1]{\texttt{#1}} \newcommand*\fbo[1]{\texttt{\ColorArg #1}} \newcommand*\fbsetup[1]{\cs{frenchsetup\{\fbo{#1}\}}} \renewcommand*\descriptionlabel[1]{% @@ -122,7 +124,8 @@ % % \frenchb{} has been improved using helpful suggestions from many % people, mainly from Jacques André, Michel Bovani, Thierry Bouche, -% Vincent Jalby and Denis Bitouzé. Thanks to all of them! +% Vincent Jalby, Denis Bitouzé and Ulrike Fisher. +% Thanks to all of them! % % \LaTeX-2.09 is no longer supported. % This new version (3.x) has been designed to be used only with @@ -175,8 +178,9 @@ % shortened; % \item footnotes are displayed ``à la française’’. % \item the separator following the table or figure number in -% captions is printed as `~--~’ instead of `:~’; for changing -% this see~\ref{sssec-captions} p.~\pageref{sssec-captions}. +% captions is printed as `~--~’ instead of `:~’; +% for changing this see~\ref{sssec-captions-fig} +% p.~\pageref{sssec-captions-fig}. % \end{enumerate} % % Regarding local typography, the command |\selectlanguage{french}| @@ -194,7 +198,8 @@ % \item |\today| prints the date in French; % \item the caption names are translated into French % (\LaTeX{} only). For customisation of caption names see -% section~\ref{sssec-captions} p.~\pageref{sssec-captions}. +% section~\ref{sssec-captions-name} +% p.~\pageref{sssec-captions-name}. % \item the space after |\dots| is removed in French. % \end{enumerate} % @@ -223,7 +228,7 @@ % paragraph of the quotation either an opening French % guillemet («), or a closing one (») or nothing depending % on option \fbo{EveryParGuill=open} or \fbo{=close} or -% \fbo{=none}, see p.~\pageref{everyparguill}.\label{frquote} +% \fbo{=none}, see p.~\pageref{everyparguill}.\hlabel{frquote} % % |\frquote| is recommended to enter embedded quotations ``à la % française’’, several variants are provided through options. @@ -280,7 +285,7 @@ % \item Two commands are provided to typeset the symbol for % ``degré’’: |\degre| prints the raw character and % |\degres| should be used to typeset temperatures (e.g., -% ``|20~\degres C|’’ with an nobreak space), or for +% ``|20~\degres C|’’ with a non-breaking space), or for % alcohols’’ strengths (e.g., ``|45\degres|’’ with \emph{no} % space in French). % @@ -305,9 +310,9 @@ % % \item \frenchb{} has been designed to take advantage of the % \pkg{xspace} package if present: adding -% |\usepackage{xspace}| in the preamble will force macros like -% |\fg|, |\ier|, |\ieme|, |\dots|, \dots, to respect the -% spaces you type after them, for instance typing +% |\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\up{er} juin’ % (no need for a forced space after |1\ier|). % \end{enumerate} @@ -440,7 +445,7 @@ % \emph{should} input a space before the four characters `|:;!?|’ % but as many people forget about it (even among native French % writers!), the default behaviour of \frenchb{} is to -% automatically typeset nobreak spaces the width of which is +% automatically typeset non-breaking spaces the width of which is % either |\FBthinspace| (defauts to a thin space) before `|;|’ % `|!|’ `|?|’ or |\FBcolonspace| (defauts to |\space|) before % `|:|’; the defaults follow the French `Imprimerie Nationale’s @@ -463,7 +468,7 @@ % inside a group in case an unwanted space is added by \frenchb{} % (i.e.\ |{\NoAutoSpacing 10:55}|). % \item [ThinColonSpace=true (false)] changes the inter-word -% unbreakable space added before the colon `:’ to a thin space, +% non-breaking space added before the colon `:’ to a thin space, % so that the same amount of space is added before any of the % four `high punctuation’ characters. The default setting is % supported by the French `Imprimerie Nationale’. @@ -483,8 +488,8 @@ % ``Partie II’’. % \item [CustomiseFigTabCaptions=false (true*)]; when \fbo{false} % the default separator (colon) is used instead of -% |\CaptionSeparator|. Anyway, \frenchb{} makes sure that the -% colon will be typeset with proper preceeding space in French. +% |\CaptionSeparator|. Anyway, \frenchb{} tries hard to insert +% a proper space before it and warns if it fails to do so. % \item [OldFigTabCaptions=true (false)] is to be used when % figures’ and tables’ captions must be typeset as with pre~3.0 % versions of \frenchb{} (with |\CaptionSeparator| in French and @@ -494,7 +499,9 @@ % French captions as ``Figure’’ and ``Table’’ instead of being % printed in small caps (the default). % \item [SuppressWarning=true (false)]; can be turned to \fbo{true} -% if you are bored with \frenchb’s warnings. +% if you are bored with \frenchb’s warnings; use this option as +% \emph{first} option of \fbsetup{} to cancel warnings launched +% by other options. % \item [INGuillSpace=true (false)] resets the dimensions of spaces % after opening French quotes and before closing French quotes to % the French `Imprimerie Nationale’ standards (inter-word space). @@ -507,7 +514,7 @@ % This option is also considered for level 2 (inner) quotations % to decide between \texttt{\guilsinglleft} and % \texttt{\guilsinglright} when \fbo{InnerGuillSingle=true} -% (see below). \label{everyparguill} +% (see below). \hlabel{everyparguill} % \item [EveryLineGuill=open, close, none (none)]; with LuaTeX % based engines \emph{only}, it is possible to set this option % to \fbo{open} [resp. \fbo{close}]; this ensures that a `«’ @@ -527,12 +534,20 @@ % \fbo{close}) is set, a \texttt{\guilsinglleft} (or % \texttt{\guilsinglright}) is added at the beginning of every % parapraph included in the inner quotation. +% \item [UnicodeNoBreakSpaces=true (false)];\hlabel{ucs-nbsp} +% (experimental) this option should be set to \fbo{true} +% \emph{only while converting LuaLaTeX files} to HTML. +% It ensures that non-breaking spaces added by \frenchb{} are +% inserted in the PDF file as U+A0 or U+202F (thin) instead of +% penalties and glues. +% Note that \exe{lwarp} (v.~0.37 and up) is fully compatible with +% \frenchb{} for translating PDFLaTeX or XeLaTeX files to HTML. % \item [og=«, fg=»]; when guillemets characters are available on % the keyboard (through a compose key for instance), it is nice % to use them instead of typing |\og| and |\fg|. This option % tells \frenchb{} which characters are opening and closing % French guillemets (they depend on the input encoding), then -% you can type either \label{option-og-fg} +% you can type either \hlabel{option-og-fg} % \texttt{« guillemets »} or \texttt{«guillemets»} (with or % without spaces) to get properly typeset French quotes. % This option works with LuaLaTeX and XeLaTeX; with pdfLaTeX it @@ -551,39 +566,54 @@ % \fbsetup{IndentFirst,StandardLayout} would lead to option % \fbo{IndentFirst} being overwritten by \fbo{StandardLayout}. % -% \subsubsection{Captions} -% \label{sssec-captions} +% \subsubsection{Caption names} +% \label{sssec-captions-name} % -% Caption names can be customised in French using the simplified -% syntax introduced by \babel~3.9, for instance: +% All caption names can easily be customised in French using the +% simplified syntax introduced by \babel~3.9, for instance: % |\def\frenchproofname{Preuve}|. % The older syntax |\addto\captionsfrench{\def\proofname{Preuve}}| -% still works. Keep in mind that \emph{only} |french| can be used to -% redefine captions, even if \babel{}’s option was entered as -% |frenchb|. +% still works. Keep in mind that \emph{only} |french| can be used +% to redefine captions, even if \babel{}’s option was entered as +% |frenchb| or |francais|. % -% When French is the main language, by default (see below) -% \frenchb{} changes the separator (colon) used in figures’ and +% \subsubsection{Figure and table captions} +% \label{sssec-captions-fig} +% +% In French, captions in figures and tables should never be printed +% as ‘Figure 1: ’ which is the default in standard \LaTeXe{} +% classes (a space should \emph{always} preceed a colon in French), +% anyway ‘Figure 1 -- ’ is preferred. +% +% When French is the main language, the default behaviour of +% \frenchb{} is to change the separator (colon) used in figures’ and % tables’ captions \emph{for all languages} to |\CaptionSeparator| % which defaults to ` -- ’ and can be redefined in the preamble with % |\renewcommand*{\CaptionSeparator}{...}|. +% This works for the standard \LaTeXe{} classes, for the \cls{memoir} +% and koma-script classes. +% In case this procedure fails a warning is issued. % % When French is not the main language, the colon is preserved for -% all languages but \frenchb{} makes sure that a proper space is -% typeset before it. -% -% Three new options are provided: if \fbo{CustomiseFigTabCaptions} is -% set to \fbo{false} the colon will be used as separator in all -% languages, with a proper space before the colon in French. -% The second option, \fbo{OldFigTabCaptions}, can be set to \fbo{true} -% to print figures’ and tables’ captions as they were with versions -% pre~3.0 of \frenchb{} (using |\CaptionSeparator| in French and -% colon in other languages); this option only makes sense with the -% standard \LaTeX{} classes \cls{article}, \cls{report} and -% \cls{book}. -% The last option, \fbo{SmallCapsFigTabCaptions}, can be set to -% \fbo{false} to typeset |\figurename| and |\tablename| in French as -% ``Figure’’ and ``Table’’ rather than in small caps (the default). +% all languages including French but \frenchb{} tries hard to insert +% a proper space before it and warns if it fails to do so. +% +% Three options are provided to customise figure and table captions: +% \begin{itemize} +% \item if \fbo{CustomiseFigTabCaptions} is set to \fbo{false} the +% colon will be used as separator in all languages, with a proper +% space before the colon in French (if possible); +% \item the second option, \fbo{OldFigTabCaptions}, can be set to +% \fbo{true} to print figures’ and tables’ captions as they were +% with versions pre~3.0 of \frenchb{} (using |\CaptionSeparator| +% in French and colon in other languages); this option only makes +% sense with the standard \LaTeX{} classes \cls{article}, +% \cls{report} and \cls{book}; +% \item the last option, \fbo{SmallCapsFigTabCaptions}, can be set +% to \fbo{false} to typeset |\figurename| and |\tablename| in +% French as ``Figure’’ and ``Table’’ rather than in small caps +% (the default). +% \end{itemize} % % \subsection{Hyphenation checks} % \label{ssec-hyphen} @@ -634,12 +664,20 @@ % % \subsubsection*{What’s new in version 3.3?} % +% A few internal changes have been made in version~3.3c to improve +% the convertion into HTML of non-breaking spaces added by \frenchb. +% Usage of \exe{lwarp} (v.0.37 and up) is recommended for HTML +% output, it works fine on files compiled with XeLaTeX or pdfLaTeX +% formats. +% A new experimental option \fbo{UnicodeNoBreakSpaces} has been +% added for LuaLaTeX in version~3.3c, see p.~\pageref{ucs-nbsp}. +% % According to current \babel's standards, every dialect should -% have it’s own \file{.ldf} file; the main support for French is -% now in \file{french.ldf}, portemanteau files \file{frenchb.ldf}, -% \file{francais.ldf}, \file{acadian.ldf} and \file{canadien.ldf} -% have been added. Recommended options are \Lopt{french} and -% \Lopt{acadian}, all other are deprecated. +% have it’s own \file{.ldf} file; starting with version~3.3b, +% the main support for French is in \file{french.ldf}, portemanteau +% files \file{frenchb.ldf},\file{francais.ldf}, \file{acadian.ldf} +% and \file{canadien.ldf} have been added. Recommended options are +% \Lopt{french} or \Lopt{acadian}, all other are deprecated. % % Release 3.3a is compatible with LuaTeX v.~0.95 (TL2016) and up. % Former skips |\FBcolonskip|, |\FBthinskip| and |\FBguillskip| @@ -706,7 +744,8 @@ % \file{frenchb.ldf}, this change allows for cleaner definitions % of dates and captions for the Unicode engines LuaTeX and % XeTeX and also provides a simpler syntax for end-users, see -% section~\ref{sssec-captions} p.\pageref{sssec-captions}. +% section~\ref{sssec-captions-name} +% p.\pageref{sssec-captions-name}. % \item \fbsetup{} options management has been completely % reworked; two new options added. % \item Canadian French didn’t work as a normal \babel’s dialect, @@ -1203,7 +1242,7 @@ % |french_punctuation| doesn’t alter the node list at all). % |\FB@addDPspace=0| switches off automatic insertion of spaces % before high punctuation characters (but typed spaces are still -% turned into nobreak thin- or word-spaces). +% turned into non-breaking thin- or word-spaces). % |\FB@addGUILspace| will be set to~1 by option \fbo{og=«, fg=»}, % thus enabling automatic insertion of proper spaces after `«’ and % before `»’. @@ -1211,6 +1250,7 @@ \newattribute\FB@spacing \FB@spacing=1 \relax \newattribute\FB@addDPspace \FB@addDPspace=1 \relax \newattribute\FB@addGUILspace \FB@addGUILspace=0 \relax + \newattribute\FB@ucsNBSP \FB@ucsNBSP=0 \relax \ifLaTeXe \PackageInfo{french.ldf}{No need for active punctuation characters\MessageBreak with this version @@ -1236,6 +1276,10 @@ % \changes{v3.1a}{2014/06/16}{Codes 0x13 and 0x14 added for French % quotes in T1-encoding.} % +% \changes{v3.3c}{2017/09/07}{Function `get\_glue' robustified. +% `french\_punctuation' can insert Unicode characters instead +% of glues.} +% % \begin{macrocode} %<*lua> local FB_punct_thin = @@ -1273,8 +1317,8 @@ local FB_punct_null = [string.byte("[")] = true, [string.byte("(")] = true, % \end{macrocode} -% or if the user has typed a nobreak space U+00A0 or a nobreak thin -% space U+202F before a `high punctuation’ character: no space +% or if the user has typed a non-breaking space U+00A0 or U+202F +% (thin) before a `high punctuation’ character: no space % should be added by \frenchb. Same is true inside French quotes. % \begin{macrocode} [0xA0] = true, @@ -1309,27 +1353,27 @@ local remove_node = node.remove % the latter are processed by the next function |get_glue| which % returns a table of three values which are fractions of % |\fontdimen2|, |\fontdimen3| and |\fontdimen4|. -% \label{lua-scaling} +% \hlabel{lua-scaling} % \begin{macrocode} local function get_glue(toks) local t = nil - local f = string.match(toks, "\092hskip%s*([%d%.]*)%s*\092fontdimen") + local f = string.match(toks, "\\hskip%s*([%d%.]*)%s*\\fontdimen 2") if f == "" then f = 1 end - if f then - t = {f, 0, 0} - f = string.match(toks, "plus%s*([%d%.]*)%s*\092fontdimen") + if tonumber(f) then + t = {tonumber(f), 0, 0} + f = string.match(toks, "plus%s*([%d%.]*)%s*\\fontdimen 3") if f == "" then f = 1 end - if f then - t[2] = f - f = string.match(toks, "minus%s*([%d%.]*)%s*\092fontdimen") + if tonumber(f) then + t[2] = tonumber(f) + f = string.match(toks, "minus%s*([%d%.]*)%s*\\fontdimen 4") if f == "" then f = 1 end - if f then - t[3] = f + if tonumber(f) then + t[3] = tonumber(f) end end - elseif string.match(toks, "\092F?B?thinspace") then + elseif string.match(toks, "\\F?B?thinspace") then t = {0.5, 0, 0} - elseif string.match(toks, "\092space") then + elseif string.match(toks, "\\space") then t = {1, 1, 1} end return t @@ -1388,6 +1432,7 @@ end local FBspacing = luatexbase.attributes['FB@spacing'] local addDPspace = luatexbase.attributes['FB@addDPspace'] local addGUILspace = luatexbase.attributes['FB@addGUILspace'] +local FBucsNBSP = luatexbase.attributes['FB@ucsNBSP'] local has_attribute = node.has_attribute % \end{macrocode} % The following function will be added to |kerning| callback. @@ -1413,6 +1458,25 @@ local function french_punctuation (head) local fid = item.font local FRspacing = has_attribute(item, FBspacing) FRspacing = FRspacing and FRspacing > 0 + local FRucsNBSP = has_attribute(item, FBucsNBSP) + FRucsNBSP = FRucsNBSP and FRucsNBSP > 0 + local NBthinspace = new_node("glyph") + NBthinspace.font = fid + NBthinspace.char = 0x202F + local NBcolnspace = new_node("glyph") + NBcolnspace.font = fid + if colngl[1] <= 0.5 then + NBcolnspace.char = 0x202F + else + NBcolnspace.char = 0xA0 + end + local NBguilspace = new_node("glyph") + NBguilspace.font = fid + if guilgl[1] <= 0.5 then + NBguilspace.char = 0x202F + else + NBguilspace.char = 0xA0 + end local SIG = has_attribute(item, addGUILspace) SIG = SIG and SIG >0 if lang == FR and FRspacing and @@ -1438,7 +1502,7 @@ local function french_punctuation (head) % % If the previous item is a glue, check its natural width, only % positive glues (actually glues > 1 sp, for tabular `l’ -% columns) are to be replaced by a nobreakspace. +% columns) are to be replaced by a non-breaking space. % \begin{macrocode} local is_glue = prev_id == GLUE local glue_wd @@ -1476,10 +1540,13 @@ local function french_punctuation (head) end end local fbglue + local nbspace if FB_punct_thick[char] then fbglue = new_glue_scaled(fid,colngl) + nbspace = NBcolnspace else fbglue = new_glue_scaled(fid,thingl) + nbspace = NBthinspace end % \end{macrocode} % In case |new_glue_scaled| fails (returns |nil|) the node list @@ -1489,8 +1556,12 @@ local function french_punctuation (head) if realglue then head = remove_node(head,prev,true) end - insert_node_before(head, item, copy_node(nobreak)) - insert_node_before(head, item, copy_node(fbglue)) + if (FRucsNBSP) then + insert_node_before(head, item, copy_node(nbspace)) + else + insert_node_before(head, item, copy_node(nobreak)) + insert_node_before(head, item, copy_node(fbglue)) + end end % \end{macrocode} % Let’s consider `»’ now (the only remaining glyph of @@ -1531,8 +1602,12 @@ local function french_punctuation (head) if is_glue then head = remove_node(head,prev,true) end - insert_node_before(head, item, copy_node(nobreak)) - insert_node_before(head, item, copy_node(fbglue)) + if (FRucsNBSP) then + insert_node_before(head, item, copy_node(NBguilspace)) + else + insert_node_before(head, item, copy_node(nobreak)) + insert_node_before(head, item, copy_node(fbglue)) + end end end end @@ -1601,8 +1676,12 @@ local function french_punctuation (head) if is_glue then head = remove_node(head,next,true) end - insert_node_after(head, item, copy_node(fbglue)) - insert_node_after(head, item, copy_node(nobreak)) + if (FRucsNBSP) then + insert_node_after(head, item, copy_node(NBguilspace)) + else + insert_node_after(head, item, copy_node(fbglue)) + insert_node_after(head, item, copy_node(nobreak)) + end end end end @@ -1905,7 +1984,7 @@ return french_punctuation \ifFB@spacing\unskip\FB@guillspace\fi}% % \end{macrocode} % This will avoid spurious spaces in (!), [?] and with Unicode -% nobreakspaces (U+00A0, U+202F): +% non-breaking spaces (U+00A0, U+202F): % \begin{macrocode} \bbl@for\FB@char {`\[,`\(,"A0,"202F}% @@ -1944,10 +2023,10 @@ return french_punctuation % in horizontal mode, hence the test |\ifhmode|. % % In horizontal mode, if a space has been typed before `;’ we -% remove it and put an unbreakable |\FBthinspace| instead. If no -% space has been typed, we add |\FDP@thinspace| which will be -% defined, up to the user’s wishes, as |\FBthinspace|, or as -% |\@empty|. +% remove it and put a non-breaking |\FBthinspace| instead. +% If no space has been typed, we add |\FDP@thinspace| which will be +% defined, up to the user’s wishes, as a non-breaking |\FBthinspace| +% or as |\@empty|. % % \changes{v3.1k}{2015/12/05}{(pdfTeX shorthands) test on \cs{lastskip} % changed from 0pt to 1sp for active punctuation for consistency @@ -2061,7 +2140,7 @@ return french_punctuation % % |\autospace@beforeFDP| and |\noautospace@beforeFDP| are internal % commands. |\autospace@beforeFDP| defines |\FDP@thinspace| and -% |\FDP@colonspace| as unbreakable spaces and sets LuaTeX attribute +% |\FDP@colonspace| as non-breaking spaces and sets LuaTeX attribute % |\FB@addDPspace| to 1 (true), while |\noautospace@beforeFDP| % lets these spaces empty and sets flag |\FB@addDPspace| % to 0 (false). User commands |\AutoSpaceBeforeFDP| and @@ -2070,23 +2149,23 @@ return french_punctuation % Set the default now for Plain (done later for \LaTeX). % \begin{macrocode} \def\autospace@beforeFDP{% - \ifFB@luatex@punct\FB@addDPspace=1 \fi - \def\FDP@thinspace{\penalty\@M\FBthinspace}% - \def\FDP@colonspace{\penalty\@M\FBcolonspace}} + \ifFB@luatex@punct\FB@addDPspace=1 \fi + \def\FDP@thinspace{\penalty\@M\FBthinspace}% + \def\FDP@colonspace{\penalty\@M\FBcolonspace}} \def\noautospace@beforeFDP{% - \ifFB@luatex@punct\FB@addDPspace=0 \fi - \let\FDP@thinspace\@empty - \let\FDP@colonspace\@empty} + \ifFB@luatex@punct\FB@addDPspace=0 \fi + \let\FDP@thinspace\@empty + \let\FDP@colonspace\@empty} \ifLaTeXe - \def\AutoSpaceBeforeFDP{\autospace@beforeFDP - \FBAutoSpacePunctuationtrue} - \def\NoAutoSpaceBeforeFDP{\noautospace@beforeFDP - \FBAutoSpacePunctuationfalse} - \AtEndOfPackage{\AutoSpaceBeforeFDP} + \def\AutoSpaceBeforeFDP{\autospace@beforeFDP + \FBAutoSpacePunctuationtrue} + \def\NoAutoSpaceBeforeFDP{\noautospace@beforeFDP + \FBAutoSpacePunctuationfalse} + \AtEndOfPackage{\AutoSpaceBeforeFDP} \else - \let\AutoSpaceBeforeFDP\autospace@beforeFDP - \let\NoAutoSpaceBeforeFDP\noautospace@beforeFDP - \AutoSpaceBeforeFDP + \let\AutoSpaceBeforeFDP\autospace@beforeFDP + \let\NoAutoSpaceBeforeFDP\noautospace@beforeFDP + \AutoSpaceBeforeFDP \fi % \end{macrocode} % \end{macro} @@ -2418,7 +2497,7 @@ return french_punctuation % \end{macrocode} % This for level 2 (inner) quotations: Omega’s command % |\localleftbox| included in LuaTeX, is convenient for repeating -% guillemets at the beginning of every line.\label{cs:localleftbox} +% guillemets at the beginning of every line.\hlabel{cs:localleftbox} % % \changes{v3.1i}{2015/10/04}{\cs{luatexlocalleftbox} changed to % \cs{localleftbox} by new LaTeX release 2015/10/01.} @@ -2715,6 +2794,18 @@ return french_punctuation % \end{macro} % \end{macro} % +% \changes{v3.3c}{2017/07/23}{New configurable kerns \cs{FBmedkern}, +% and \cs{FBthickkern} suitable for HTML translation.} +% +% \begin{macro}{\FBmedkern} +% \begin{macro}{\FBthickkern} +% \begin{macrocode} +\newcommand*{\FBmedkern}{\kern+.2em} +\newcommand*{\FBthickkern}{\kern+.3em} +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \changes{v2.1c}{2008/04/29}{Added commands \cs{Nos} and \cs{nos}.} % % \begin{macro}{\No} @@ -2730,10 +2821,8 @@ return french_punctuation % And some more macros relying on |\up| for numbering, % first two support macros. % \begin{macrocode} -\newcommand*{\FrenchEnumerate}[1]{% - #1\up{o}\kern+.3em} -\newcommand*{\FrenchPopularEnumerate}[1]{% - #1\up{o})\kern+.3em} +\newcommand*{\FrenchEnumerate}[1]{#1\up{o}\FBthickkern} +\newcommand*{\FrenchPopularEnumerate}[1]{#1\up{o})\FBthickkern} % \end{macrocode} % % Typing |\primo| should result in `\up{o}\kern+.3em’, @@ -2754,10 +2843,10 @@ return french_punctuation % Let’s provide four macros for the common abbreviations % of ``Numéro’’. % \begin{macrocode} -\DeclareRobustCommand*{\No}{N\up{o}\kern+.2em} -\DeclareRobustCommand*{\no}{n\up{o}\kern+.2em} -\DeclareRobustCommand*{\Nos}{N\up{os}\kern+.2em} -\DeclareRobustCommand*{\nos}{n\up{os}\kern+.2em} +\DeclareRobustCommand*{\No}{N\up{o}\FBmedkern} +\DeclareRobustCommand*{\no}{n\up{o}\FBmedkern} +\DeclareRobustCommand*{\Nos}{N\up{os}\FBmedkern} +\DeclareRobustCommand*{\nos}{n\up{os}\FBmedkern} % \end{macrocode} % \end{macro} % \end{macro} @@ -3024,12 +3113,19 @@ return french_punctuation } % \end{macrocode} % +% \changes{v3.3c}{2017/00/10}{New command \cs{FBthousandsep} to +% customise numprint.} +% +% \begin{macrocode} +\newcommand*{\FBthousandsep}{~} +% \end{macrocode} +% % \changes{v2.0c}{2007/06/25}{There is no need to define here % numprint’s command \cs{npstylefrench}, it will be redefined % `AtBeginDocument’ by \cs{FBprocess@options}.} % % \subsection{Caption names} -% \label{ssec-captions} +% \label{ssec-captions-name} % % The next step consists in defining the French equivalents for % the \LaTeX{} caption names. @@ -3160,19 +3256,30 @@ return french_punctuation % \cs{captionsfrancais} with \cs{captionsfrench} deleted in favor % of new babel 3.9 syntax.} % -% Up to v2.6h \frenchb{} used to merge |\captionsfrenchb| and -% |\captionsfrancais| into |\captionsfrench| at |\begin{document}|. -% This is deprecated in favor of the new (much simpler!) syntax -% introduced in \babel~3.9. No need to define |\captionsacadian| -% either. +% \subsection{Figure and table captions} +% \label{ssec-captions-fig} +% +% \changes{v2.4a}{2009/11/23}{\cs{PackageWarning} changed to +% \cs{FBWarning} (in case \cs{@makecaption} has been customised). +% \cs{FBWarning} is defined as \cs{PackageWarning} by default but +% can be made silent using \cs{frenchbsetup}, (suggested by MPG).} +% +% \begin{macro}{\FBWarning} +% |\FBWarning| is an alias of |\PackageWarning{french.ldf}| which +% can be made silent by option \fbo{SuppressWarning}. +% \begin{macrocode} +\newcommand{\FBWarning}[1]{\PackageWarning{french.ldf}{#1}} +% \end{macrocode} +% \end{macro} % % \begin{macro}{\CaptionSeparator} % Let’s consider now captions in figures and tables. % In French, captions in figures and tables should never be printed -% as `Figure 1:’ which is the default in standard \LaTeXe{} classes; -% the `:’ is made active too late, no space is added before it. +% as `Figure 1:~’ which is the default in standard \LaTeXe{} classes +% (a space should preceed the colon in French). This flaw may occur +% with pdfLaTeX as `:’ is made active too late. % With LuaLaTeX and XeLaTeX, this glitch doesn’t occur, you get -% `Figure 1~:’ which is correct in French. With pdfLaTeX \frenchb{} +% `Figure 1~:~’ which is correct in French. With pdfLaTeX \frenchb{} % provides the following workaround. % % The standard definition of |\@makecaption| (e.g., the one provided @@ -3183,15 +3290,10 @@ return french_punctuation % ua-thesis.cls\dots change it). % If they are identical, \frenchb{} just adds a hook called % |\FBCaption@Separator| to |\@makecaption|; |\FBCaption@Separator| -% defaults to `: ’ as in the standard |\@makecaption| and will be -% changed to ` : ’ in French `AtBeginDocument’; it can be also set to +% defaults to `:~’ as in the standard |\@makecaption| and will be +% changed to `~:~’ in French `AtBeginDocument’; it can be also set to % |\CaptionSeparator| (` -- ’) using \fbo{CustomiseFigTabCaptions}. % -% \changes{v2.4a}{2009/11/23}{\cs{PackageWarning} changed to -% \cs{FBWarning} (in case \cs{@makecaption} has been customised). -% \cs{FBWarning} is defined as \cs{PackageWarning} by default but -% can be made silent using \cs{frenchbsetup}, (suggested by MPG).} -% % \changes{v2.6c}{2013/05/18}{Former \cs{CaptionSeparator} % has been renamed as \cs{FBCaption@Separator}; % Newif \cs{if@FBwarning@capsep} added.} @@ -3199,7 +3301,7 @@ return french_punctuation % \changes{v2.6h}{2014/01/03}{No active catcodes in % \cs{STD@makecaption}’s definition.} % -% \changes{v3.0a}{2014/02/28}{Remove \cs{CaptionSeparatorORI}, use +% \changes{v3.0a}{2014/02/28}{Remove \cs{FBCaption@SeparatorORI}, use % \cs{babel@save} instead.} % % While saving the standard definition of |\@makecaption| we have to @@ -3222,8 +3324,8 @@ return french_punctuation \egroup % \end{macrocode} % -% No warning is issued for SMF and AMS classes as their layout of -% captions is compatible with French typographic standards. +% No warning is issued for SMF, AMS and ACM classes as their layout +% of captions is compatible with French typographic standards. % % With \cls{memoir} and koma-script classes, \frenchb{} customises % |\captiondelim| or |\captionformat| in French (unless option @@ -3233,10 +3335,10 @@ return french_punctuation % When |\@makecaption| has been changed by another class % or package, a warning is printed in the .log file. % +% Enable the standard warning only if high punctuation is active. % \begin{macrocode} \newif\if@FBwarning@capsep -\@FBwarning@capseptrue -\newcommand{\FBWarning}[1]{\PackageWarning{french.ldf}{#1}} +\ifFB@active@punct\@FBwarning@capseptrue\fi \newcommand*{\CaptionSeparator}{\space\textendash\space} \def\FBCaption@Separator{: } \long\def\FB@makecaption#1#2{% @@ -3256,10 +3358,11 @@ return french_punctuation % AMS classes.} % % \changes{v3.0a}{2014/02/20}{No warning about \cs{@makecaption} for -% SMF classes. No warning either with LuaTeX or XeTeX engines.} +% SMF classes.} % -% Disable the standard warning with AMS and SMF classes. +% Disable the standard warning with ACM, AMS and SMF classes. % \begin{macrocode} +\@ifclassloaded{acmart}{\@FBwarning@capsepfalse}{} \@ifclassloaded{amsart}{\@FBwarning@capsepfalse}{} \@ifclassloaded{amsbook}{\@FBwarning@capsepfalse}{} \@ifclassloaded{amsdtx}{\@FBwarning@capsepfalse}{} @@ -3269,11 +3372,6 @@ return french_punctuation \@ifclassloaded{smfbook}{\@FBwarning@capsepfalse}{} % \end{macrocode} % -% Disable the standard warning unless high punctuation is active. -% \begin{macrocode} -\ifFB@active@punct\else\@FBwarning@capsepfalse\fi -% \end{macrocode} -% % \changes{v2.6c}{2013/05/18}{No warning about \cs{@makecaption} for % koma-script classes. \cs{captionformat} customised in French.} % @@ -3283,7 +3381,7 @@ return french_punctuation % No warning with \cls{memoir} or koma-script classes: they change % |\@makecaption| but we will manage to customise them in French % later on (see below after executing |\FBprocess@options|) -% \label{ifFB@koma}. +% \hlabel{ifFB@koma}. % \begin{macrocode} \newif\ifFB@koma \@ifclassloaded{memoir}{\@FBwarning@capsepfalse}{} @@ -3301,41 +3399,27 @@ return french_punctuation % \end{macrocode} % % \changes{v2.6c}{2013/05/18}{Warning added when the caption -% or floatrow package is loaded before babel/frenchb.} -% -% The \pkg{caption}, \pkg{subcaption} and \pkg{floatrow} packages are -% compatible with \frenchb{} if they are loaded after \babel{}. -% -% Check if package \pkg{caption} is loaded now (before \frenchb), -% then issue a warning advising to load it after \frenchb{} and -% disable the standard warning. -% \begin{macrocode} -\@ifpackageloaded{caption} - {\FBWarning{Please load the "caption" package\MessageBreak - AFTER babel/frenchb; reported}% - \@FBwarning@capsepfalse}% - {} -% \end{macrocode} +% or floatrow package is loaded before babel/french.} % % \changes{v3.2b}{2016/03/30}{Warning added when the subcaption -% package is loaded before babel/frenchb.} +% package is loaded before babel/french.} % -% Same for package \pkg{subcaption}. -% \begin{macrocode} -\@ifpackageloaded{subcaption} - {\FBWarning{Please load the "subcaption" package\MessageBreak - AFTER babel/frenchb; reported}% - \@FBwarning@capsepfalse}% - {} -% \end{macrocode} +% \changes{v3.3c}{2017/08/16}{Reorganise warnings when the caption, +% subcaption or floatrow packages are loaded before babel/french.} +% +% The \pkg{caption}, \pkg{subcaption} and \pkg{floatrow} packages are +% compatible with \frenchb{} if they are loaded after \babel{}. % -% Same for package \pkg{floatrow}. +% Check if packages \pkg{caption3} \pkg{subcaption} or \pkg{floatrow} +% are loaded now (before \frenchb) and step counter |FBcaption@count| +% accordingly; it’s value will be checked |\AtBeginDocument|. +% N.B.: \pkg{caption} loads \pkg{caption3}, \pkg{subcaption} loads +% \pkg{caption3} and \pkg{floatrow} loads \pkg{caption3}. % \begin{macrocode} -\@ifpackageloaded{floatrow} - {\FBWarning{Please load the "floatrow" package\MessageBreak - AFTER babel/frenchb; reported}% - \@FBwarning@capsepfalse}% - {} +\newcounter{FBcaption@count} +\@ifpackageloaded{caption3}{\addtocounter{FBcaption@count}{4}}{} +\@ifpackageloaded{subcaption}{\addtocounter{FBcaption@count}{2}}{} +\@ifpackageloaded{floatrow}{\stepcounter{FBcaption@count}}{} % \end{macrocode} % % \changes{v3.0a}{2014/02/20}{More informative, less TeXnical warning @@ -3355,13 +3439,15 @@ return french_punctuation \ifx\@makecaption\STD@makecaption \global\let\@makecaption\FB@makecaption % \end{macrocode} -% Do not overwrite |\FBCaption@Separator| if already saved -% as `: ’ for other languages and set to |\CaptionSeparator| by -% |\extrasfrench| when French is the main language. +% If \fbo{OldFigTabCaptions=true}, do not overwrite +% |\FBCaption@Separator| (already saved as `: ’ for other languages +% and set to |\CaptionSeparator| by |\extrasfrench| when French is +% the main language); otherwise add a space before the `:’ in French +% in order to avoid problems when \fbo{AutoSpacePunctuation=false}. % \begin{macrocode} \ifFBOldFigTabCaptions \else - \def\FBCaption@Separator{{\autospace@beforeFDP : }}% + \def\FBCaption@Separator{\ifFBfrench\space\fi : }% \fi \ifFBCustomiseFigTabCaptions \ifx\bbl@main@language\FB@french @@ -3370,12 +3456,43 @@ return french_punctuation \fi \@FBwarning@capsepfalse \fi +% \end{macrocode} +% Cancel the warning if \file{caption3.sty} has been loaded +% \emph{after} \babel. +% \begin{macrocode} + \@ifpackageloaded{caption3}{% + \ifnum\value{FBcaption@count}=0 \@FBwarning@capsepfalse\fi + }{}% \if@FBwarning@capsep - \FBWarning + \ifnum\value{FBcaption@count}>0 +% \end{macrocode} +% \file{caption3.sty} has been loaded \emph{before} babel, maybe by +% the class\dots +% \begin{macrocode} + \FBWarning + {Figures' and tables' captions might look like\MessageBreak + `Figure 1:' in French instead of `Figure 1 :'.\MessageBreak + If you have loaded any of the packages caption,\MessageBreak + subcaption or floatrow BEFORE babel/french,\MessageBreak + please move them AFTER babel/french.\MessageBreak + If one of them is loaded by your class,\MessageBreak + you can still add AFTER babel/french\MessageBreak + \protect\usepackage[labelsep=period]{caption} or\MessageBreak + \protect\usepackage[labelsep=endash]{caption} or\MessageBreak + ... live with it; reported}% + \else +% \end{macrocode} +% \file{caption3.sty} hasn’t been loaded at all. +% \begin{macrocode} + \FBWarning {Figures' and tables' captions might look like\MessageBreak - `Figure 1:' which is wrong in French.\MessageBreak - Check your class or packages to change this;\MessageBreak - reported}% + `Figure 1:' in French instead of `Figure 1 :'.\MessageBreak + If it happens, see your class documentation to\MessageBreak + fix this issue or add AFTER babel/french\MessageBreak + \protect\usepackage[labelsep=period]{caption} or\MessageBreak + \protect\usepackage[labelsep=endash]{caption} or\MessageBreak + or ... live with it; reported}% + \fi \fi \let\FB@makecaption\relax \let\STD@makecaption\relax @@ -3448,15 +3565,16 @@ return french_punctuation % numprint.sty after babel.} % % Like packages \file{captions} and \file{floatrow} (see -% section~\ref{ssec-captions}), package \file{listings} should +% section~\ref{ssec-captions-fig}), package \file{listings} should % be loaded after \frenchb{} due to active characters issues % (pdfLaTeX only). % % \begin{macrocode} \ifFB@active@punct \@ifpackageloaded{listings} - {\FBWarning{Please load the "listings" package\MessageBreak - AFTER babel/frenchb; reported}% + {\AtBeginDocument{% + \FBWarning{Please load the "listings" package\MessageBreak + AFTER babel/french; reported}}% }{} \fi % \end{macrocode} @@ -3475,7 +3593,7 @@ return french_punctuation \fi \if@FBwarning@natbib \FBWarning{Please load the "natbib" package\MessageBreak - BEFORE babel/frenchb; reported}% + BEFORE babel/french; reported}% \fi } % \end{macrocode} @@ -3496,7 +3614,7 @@ return french_punctuation \fi \if@FBwarning@beamerarticle \FBWarning{Please load the "beamerarticle" package\MessageBreak - BEFORE babel/frenchb; reported}% + BEFORE babel/french; reported}% \fi } % \end{macrocode} @@ -3620,30 +3738,32 @@ return french_punctuation % (true or false). % % \begin{macrocode} -\newif\ifFBShowOptions \FBShowOptionsfalse +\newif\ifFBShowOptions \newif\ifFBStandardLayout \FBStandardLayouttrue \newif\ifFBGlobalLayoutFrench \FBGlobalLayoutFrenchtrue -\newif\ifFBReduceListSpacing \FBReduceListSpacingfalse -\newif\ifFBListOldLayout \FBListOldLayoutfalse -\newif\ifFBCompactItemize \FBCompactItemizefalse +\newif\ifFBReduceListSpacing +\newif\ifFBListOldLayout +\newif\ifFBCompactItemize \newif\ifFBStandardItemizeEnv \FBStandardItemizeEnvtrue \newif\ifFBStandardEnumerateEnv \FBStandardEnumerateEnvtrue \newif\ifFBStandardItemLabels \FBStandardItemLabelstrue \newif\ifFBStandardLists \FBStandardListstrue -\newif\ifFBIndentFirst \FBIndentFirstfalse -\newif\ifFBFrenchFootnotes \FBFrenchFootnotesfalse -\newif\ifFBAutoSpaceFootnotes \FBAutoSpaceFootnotesfalse -\newif\ifFBOriginalTypewriter \FBOriginalTypewriterfalse -\newif\ifFBThinColonSpace \FBThinColonSpacefalse -\newif\ifFBThinSpaceInFrenchNumbers \FBThinSpaceInFrenchNumbersfalse +\newif\ifFBIndentFirst +\newif\ifFBFrenchFootnotes +\newif\ifFBAutoSpaceFootnotes +\newif\ifFBOriginalTypewriter +\newif\ifFBThinColonSpace +\newif\ifFBThinSpaceInFrenchNumbers \newif\ifFBFrenchSuperscripts \FBFrenchSuperscriptstrue \newif\ifFBLowercaseSuperscripts \FBLowercaseSuperscriptstrue \newif\ifFBPartNameFull \FBPartNameFulltrue -\newif\ifFBCustomiseFigTabCaptions \FBCustomiseFigTabCaptionsfalse -\newif\ifFBOldFigTabCaptions \FBOldFigTabCaptionsfalse +\newif\ifFBCustomiseFigTabCaptions +\newif\ifFBOldFigTabCaptions \newif\ifFBSmallCapsFigTabCaptions \FBSmallCapsFigTabCaptionstrue -\newif\ifFBSuppressWarning \FBSuppressWarningfalse -\newif\ifFBINGuillSpace \FBINGuillSpacefalse +\newif\ifFBSuppressWarning +\newif\ifFBINGuillSpace +\newif\ifFBucsNBSP + % \end{macrocode} % % The defaults values of these flags have been choosen so that @@ -3678,7 +3798,7 @@ return french_punctuation % \pkg{beamerbasecompatibility} solves the conflict except in case % of language changes, so we provide our own patch. % When the \cls{beamer} is loaded, lists are not customised at all -% to ensure compatibility.\label{beamerarticle} +% to ensure compatibility.\hlabel{beamerarticle} % The \pkg{beamerarticle} package needs to be loaded \emph{before} % \babel, a warning is issued otherwise, see % section~\ref{ssec-loading-order}; a light customisation is @@ -3880,10 +4000,9 @@ return french_punctuation \else\ifx\FBeveryparguill\FBguillnone \else \let\FBeveryparguill\FBguillopen - \PackageWarning{french.ldf}% - {Wrong value for `EveryParGuill': - try `open',\MessageBreak - `close' or `none'. Reported}% + \FBWarning{Wrong value for `EveryParGuill': + try `open',\MessageBreak + `close' or `none'. Reported}% \fi \fi \fi}% @@ -3908,6 +4027,26 @@ return french_punctuation LuaTeX *only*.\MessageBreak Reported}% \fi}% % \end{macrocode} +% +% \changes{v3.3c}{2017/07/23}{New option `UnicodeNoBreakSpaces' for +% html translators (LuaLaTeX only).} +% +% Option \fbo{UnicodeNoBreakSpaces} (LuaLaTeX only) is meant for +% HTML translators: when true, all non-breaking spaces added by +% \frenchb{} are coded in the PDF file as Unicode characters, namely +% U+A0 or U+202F, instead of penalties and glues. +% \begin{macrocode} + \define@key{FB}{UnicodeNoBreakSpaces}[true]% + {\ifFB@luatex@punct + \csname FBucsNBSP#1\endcsname + \ifFBucsNBSP \FB@ucsNBSP=1 \fi + \else + \FBWarning{Option `UnicodeNoBreakSpaces' skipped:% + \MessageBreak this option is for + LuaTeX *only*.\MessageBreak Reported}% + \fi + }% +% \end{macrocode} % Inputing French quotes as \emph{single characters} when they are % available on the keyboard (through a compose key for instance) % is more comfortable than typing |\og| and |\fg|. @@ -3917,7 +4056,7 @@ return french_punctuation % respectively if the current language is French, and to % |\guillemotleft| and |\guillemotright| otherwise (think of German % quotes), this is done by |\FB@@og| and |\FB@@fg|; thus correct -% unbreakable spaces will be added automatically to French quotes. +% non-breaking spaces will be added automatically to French quotes. % The quote characters typed in depend on the input encoding, % it can be single-byte (latin1, latin9, applemac,\dots) or % multi-bytes (utf-8, utf8x); the \pkg{inputenc} package has to @@ -3976,9 +4115,8 @@ return french_punctuation % characters. % \begin{macrocode} \ifFB@active@punct - \PackageWarning{french.ldf}% - {Option og=« not supported with this version - of\MessageBreak LuaTeX/XeTeX; reported}% + \FBWarning{Option og=« not supported with this version + of\MessageBreak LuaTeX/XeTeX; reported}% \fi \else % \end{macrocode} @@ -4024,9 +4162,8 @@ return french_punctuation % \end{macrocode} % Package \pkg{inputenc} not loaded, no way\dots{} % \begin{macrocode} - \PackageWarning{french.ldf}% - {Option `og' requires package inputenc;% - \MessageBreak reported}% + \FBWarning{Option `og' requires package inputenc;% + \MessageBreak reported}% \fi }% \fi @@ -4047,9 +4184,8 @@ return french_punctuation \XeTeXcharclass"202F = \FB@guilnul \fi \ifFB@active@punct - \PackageWarning{french.ldf}% - {Option fg=» not supported with this version - of\MessageBreak LuaTeX/XeTeX; reported}% + \FBWarning{Option fg=» not supported with this version + of\MessageBreak LuaTeX/XeTeX; reported}% \fi \else \newcommand*{\FB@@fg}{% @@ -4075,9 +4211,8 @@ return french_punctuation \fi \fi \else - \PackageWarning{french.ldf}% - {Option `fg' requires package inputenc;% - \MessageBreak reported}% + \FBWarning{Option `fg' requires package inputenc;% + \MessageBreak reported}% \fi }% \fi @@ -4148,7 +4283,7 @@ return french_punctuation \fi}{}% % \end{macrocode} % Reset |\FB@ufl|’s normal meaning and update lists’ settings -% now in case French is the main language: \label{FB@ufl} +% now in case French is the main language: \hlabel{FB@ufl} % \begin{macrocode} \def\FB@ufl{\update@frenchlists} \ifx\bbl@main@language\FB@french @@ -4160,7 +4295,7 @@ return french_punctuation % and \fbo{AutoSpaceFootnotes} (see section~\ref{ssec-footnotes}), % nothing has to be done here for footnotes. % -% \fbo{AutoSpacePunctuation} adds an unbreakable space (in French +% \fbo{AutoSpacePunctuation} adds a non-breaking space (in French % only) before the four active characters (:;!?) even if none has % been typed before them. % \begin{macrocode} @@ -4192,32 +4327,17 @@ return french_punctuation % to be redefined differently according to the value of flag % \fbo{ThinSpaceInFrenchNumbers}. % As |\npstylefrench| was undefined in old versions of -% \pkg{numprint}, we have to provide this command. +% \pkg{numprint}, we 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}% - }% + {\ifnprt@autolanguage + \providecommand*{\npstylefrench}{}% + \ifFBThinSpaceInFrenchNumbers + \renewcommand*{\FBthousandsep}{\,}% + \fi + \g@addto@macro\npstylefrench{\npthousandsep{\FBthousandsep}}% \fi - \npaddtolanguage{french}{french}% - \fi}{}% + }{}% % \end{macrocode} % \fbo{FrenchSuperscripts}: if \fbo{true} |\up=\fup|, else % |\up=\textsuperscript|. Anyway |\up*=\FB@up@fake|. The star-form @@ -4331,6 +4451,7 @@ return french_punctuation EveryParGuill=open, close, none [open]\MessageBreak EveryLineGuill=open, close, none [open in LuaTeX, none otherwise]\MessageBreak + UnicodeNoBreakSpaces=true [false]\MessageBreak og= <left quote character>, fg= <right quote character>% \MessageBreak *********************************************% @@ -4405,12 +4526,28 @@ return french_punctuation % and load file \file{frenchb.lua} (LuaTeX only). % \begin{macrocode} \ifFB@luatex@punct - \FBcolonsp=\expandafter{\meaning\FBcolonspace} - \FBthinsp= \expandafter{\meaning\FBthinspace} - \FBguillsp=\expandafter{\meaning\FBguillspace} + \FBcolonsp=\expandafter{\meaning\FBcolonspace}% + \FBthinsp= \expandafter{\meaning\FBthinspace}% + \FBguillsp=\expandafter{\meaning\FBguillspace}% \activate@luatexpunct \fi % \end{macrocode} +% When option \fbo{UnicodeNoBreakSpaces} is \fbo{true} +% (LuaLaTeX only) we need to redefine as Unicode characters +% |\FBguillspace| (for commands |\og| and |\fg|), |\FBmedkern|, +% |\FBthickkern| and |\FBthousandsep|. +% \begin{macrocode} + \ifFBucsNBSP + \renewcommand*{\FBguillspace}{\char"A0\relax}% + \renewcommand*{\FBmedkern}{\char"202F\relax}% + \renewcommand*{\FBthickkern}{\char"A0\relax}% + \ifFBThinSpaceInFrenchNumbers + \renewcommand*{\FBthousandsep}{\char"202F\relax}% + \else + \renewcommand*{\FBthousandsep}{\char"A0\relax}% + \fi + \fi +% \end{macrocode} % % \changes{v3.0a}{2014/01/28}{Test \cs{ifXeTeX} changed to % \cs{ifFBunicode} and `xltxtra’ changed to `fontspec’.} @@ -4421,34 +4558,41 @@ return french_punctuation % \changes{v3.2g}{2017/01/24}{fontspec defines TU encoding now and % no longer loads xunicode.sty. Test changed.} % +% \changes{v3.3c}{2017/09/06}{LaTeX 2017-04-15 defines TU encoding +% for Unicode engines, fontspec is no longer required.} +% % Some warnings are issued when output font encodings are not % properly set. With XeLaTeX or LuaLaTeX, \file{fontspec.sty} -% should be loaded unless T1 encoded fonts are used through -% \file{luainputenc}, in the latter case |\FB@og| and |\FB@fg| -% have to be redefined; with (pdf)\LaTeX, a warning is issued -% when OT1 encoding is in use at the |\begin{document}|. +% should be loaded unless either TU encoding is set by LaTeX or +% T1 encoded fonts are used through \file{luainputenc}, in the +% latter case |\FB@og| and |\FB@fg| have to be redefined. +% 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} - \ifFBunicode - \@ifpackageloaded{fontspec}{}% - {\@ifpackageloaded{luainputenc}{}% - {\PackageWarning{french.ldf}% - {Add \protect\usepackage{fontspec} to the\MessageBreak - preamble of your document, reported}% - }% - } - \else - \begingroup \newcommand{\FBOTone}{OT1}% - \ifx\encodingdefault\FBOTone - \PackageWarning{french.ldf}% - {OT1 encoding should not be used for French.% - \MessageBreak - Add \protect\usepackage[T1]{fontenc} to the - preamble\MessageBreak of your document; reported}% +% |\FBTU| or |\FBOTone| with |\newcommand*| would fail! +% \begin{macrocode} + \begingroup + \newcommand{\FBTU}{TU}% + \newcommand{\FBOTone}{OT1}% + \ifFBunicode + \ifx\encodingdefault\FBTU + \else + \@ifpackageloaded{fontspec}{}% + {\@ifpackageloaded{luainputenc}{}% + {\FBWarning{Add \protect\usepackage{fontspec} to the% + \MessageBreak preamble of your document, reported}% + }% + } + \fi + \else + \ifx\encodingdefault\FBOTone + \FBWarning{OT1 encoding should not be used for French.% + \MessageBreak + Add \protect\usepackage[T1]{fontenc} to the + preamble\MessageBreak of your document; reported}% + \fi \fi - \endgroup - \fi + \endgroup } % \end{macrocode} % @@ -5020,7 +5164,13 @@ return french_punctuation % to the value of flag |\ifFBFrenchFootnotes| (true or false). % Koma-script classes require a special treatment. % +% \changes{v3.3c}{2017/07/28}{Reset \cs{localleftbox} locally +% inside \cs{@makefntext}. Needed by \cs{frquote} with LuaTeX.} +% +% The LuaTeX command |\localleftbox| used by |\frquote{}| has to +% be reset inside footnotes, done for LaTeX based formats only. % \begin{macrocode} +\providecommand\localleftbox[1]{} \AtBeginDocument{% \@ifpackageloaded{bigfoot}{}% {\ifdim\parindentFFN<10in @@ -5033,22 +5183,26 @@ return french_punctuation \let\@makefntextORI\@makefntext \ifFB@koma % \end{macrocode} -% Definition of |\@makefntext| for koma-script classes: +% Definition of |\@makefntext| for koma-script classes: running +% \@makefntextORI inside a group to reset |\localleftbox{}| would +% mess up the layout of footnotes whenever the first manadatory +% argument of |\deffootnote{}| (used as |\leftskip|) is non-nil +% (default is 1em, 0pt in French). % \begin{macrocode} \let\@@makefnmarkORI\@@makefnmark \long\def\@makefntext#1{% - \ifFBFrenchFootnotes - \ifx\footnote\thanks - \let\@@makefnmark\@@makefnmarkTH - \@makefntextTH{#1}% - \else - \let\@@makefnmark\@@makefnmarkFB - \@makefntextFB{#1}% - \fi - \else - \let\@@makefnmark\@@makefnmarkORI - \@makefntextORI{#1}% - \fi}% + \ifFBFrenchFootnotes + \ifx\footnote\thanks + \let\@@makefnmark\@@makefnmarkTH + \begingroup\localleftbox{}\@makefntextTH{#1}\endgroup + \else + \let\@@makefnmark\@@makefnmarkFB + \begingroup\localleftbox{}\@makefntextFB{#1}\endgroup + \fi + \else + \let\@@makefnmark\@@makefnmarkORI + \@makefntextORI{#1}% + \fi}% \else % \end{macrocode} % Special add-on for the \cls{memoir} class: |\maketitle| redefines @@ -5079,12 +5233,12 @@ return french_punctuation % Definition of |\@makefntext| for all classes other than % koma-script: % \begin{macrocode} - \long\def\@makefntext#1{% - \ifFBFrenchFootnotes - \@makefntextFB{#1}% - \else - \@makefntextORI{#1}% - \fi}% + \long\def\@makefntext#1{\begingroup\localleftbox{}% + \ifFBFrenchFootnotes + \@makefntextFB{#1}% + \else + \@makefntextORI{#1}% + \fi\endgroup}% \fi }% } @@ -5128,8 +5282,10 @@ return french_punctuation %</french> % \fi % -% \subsection{Files \file{frenchb.ldf}, \file{francais.ldf}, -% \file{canadien.ldf} and\\ \file{acadian.ldf}} +% \subsection[Files \file{frenchb.ldf}, \file{francais.ldf}, +% \file{canadien.ldf} and \file{acadian.ldf}]% +% {Files \file{frenchb.ldf}, \file{francais.ldf}, +% \file{canadien.ldf} and\\ \file{acadian.ldf}} % % \changes{v3.3b}{2017/06/28}{Generate portmanteau files % \file{acadian.ldf}, \file{canadien.ldf}, \file{frenchb.ldf}, diff --git a/Master/texmf-dist/tex/generic/babel-french/acadian.ldf b/Master/texmf-dist/tex/generic/babel-french/acadian.ldf index a3c517b808d..4537821aaa7 100644 --- a/Master/texmf-dist/tex/generic/babel-french/acadian.ldf +++ b/Master/texmf-dist/tex/generic/babel-french/acadian.ldf @@ -24,7 +24,7 @@ %% Please report errors to: <daniel (dot) flipo (at) free (dot) fr> %% \ProvidesLanguage{acadian} - [2017/07/08 v3.3b French support from the babel system] + [2017/09/07 v3.3c French support from the babel system] \input french.ldf\relax %% %% \CharacterTable diff --git a/Master/texmf-dist/tex/generic/babel-french/canadien.ldf b/Master/texmf-dist/tex/generic/babel-french/canadien.ldf index 45bb81d2581..c09a508d3cc 100644 --- a/Master/texmf-dist/tex/generic/babel-french/canadien.ldf +++ b/Master/texmf-dist/tex/generic/babel-french/canadien.ldf @@ -24,7 +24,7 @@ %% Please report errors to: <daniel (dot) flipo (at) free (dot) fr> %% \ProvidesLanguage{canadien} - [2017/07/08 v3.3b French support from the babel system] + [2017/09/07 v3.3c French support from the babel system] \PackageWarning{canadien.ldf}% {Option `canadien' for Babel is *deprecated*,\MessageBreak it might be removed sooner or later. Please\MessageBreak diff --git a/Master/texmf-dist/tex/generic/babel-french/francais.ldf b/Master/texmf-dist/tex/generic/babel-french/francais.ldf index 8bfe1ef23d7..cade83da2d9 100644 --- a/Master/texmf-dist/tex/generic/babel-french/francais.ldf +++ b/Master/texmf-dist/tex/generic/babel-french/francais.ldf @@ -24,7 +24,7 @@ %% Please report errors to: <daniel (dot) flipo (at) free (dot) fr> %% \ProvidesLanguage{francais} - [2017/07/08 v3.3b French support from the babel system] + [2017/09/07 v3.3c French support from the babel system] \PackageWarning{francais.ldf}% {Option `francais' for Babel is *deprecated*,\MessageBreak it might be removed sooner or later. Please\MessageBreak diff --git a/Master/texmf-dist/tex/generic/babel-french/french.ldf b/Master/texmf-dist/tex/generic/babel-french/french.ldf index dd45998b7e2..7ecb9bda3f4 100644 --- a/Master/texmf-dist/tex/generic/babel-french/french.ldf +++ b/Master/texmf-dist/tex/generic/babel-french/french.ldf @@ -24,7 +24,7 @@ %% Please report errors to: <daniel (dot) flipo (at) free (dot) fr> %% \ProvidesLanguage{french} - [2017/07/08 v3.3b French support from the babel system] + [2017/09/07 v3.3c French support from the babel system] %% %% Babel package for LaTeX version 2e %% Copyright © 1996 - 2017 @@ -182,6 +182,7 @@ \newattribute\FB@spacing \FB@spacing=1 \relax \newattribute\FB@addDPspace \FB@addDPspace=1 \relax \newattribute\FB@addGUILspace \FB@addGUILspace=0 \relax + \newattribute\FB@ucsNBSP \FB@ucsNBSP=0 \relax \ifLaTeXe \PackageInfo{french.ldf}{No need for active punctuation characters\MessageBreak with this version @@ -381,23 +382,23 @@ \fi \newif\ifFBAutoSpacePunctuation \FBAutoSpacePunctuationtrue \def\autospace@beforeFDP{% - \ifFB@luatex@punct\FB@addDPspace=1 \fi - \def\FDP@thinspace{\penalty\@M\FBthinspace}% - \def\FDP@colonspace{\penalty\@M\FBcolonspace}} + \ifFB@luatex@punct\FB@addDPspace=1 \fi + \def\FDP@thinspace{\penalty\@M\FBthinspace}% + \def\FDP@colonspace{\penalty\@M\FBcolonspace}} \def\noautospace@beforeFDP{% - \ifFB@luatex@punct\FB@addDPspace=0 \fi - \let\FDP@thinspace\@empty - \let\FDP@colonspace\@empty} + \ifFB@luatex@punct\FB@addDPspace=0 \fi + \let\FDP@thinspace\@empty + \let\FDP@colonspace\@empty} \ifLaTeXe - \def\AutoSpaceBeforeFDP{\autospace@beforeFDP - \FBAutoSpacePunctuationtrue} - \def\NoAutoSpaceBeforeFDP{\noautospace@beforeFDP - \FBAutoSpacePunctuationfalse} - \AtEndOfPackage{\AutoSpaceBeforeFDP} + \def\AutoSpaceBeforeFDP{\autospace@beforeFDP + \FBAutoSpacePunctuationtrue} + \def\NoAutoSpaceBeforeFDP{\noautospace@beforeFDP + \FBAutoSpacePunctuationfalse} + \AtEndOfPackage{\AutoSpaceBeforeFDP} \else - \let\AutoSpaceBeforeFDP\autospace@beforeFDP - \let\NoAutoSpaceBeforeFDP\noautospace@beforeFDP - \AutoSpaceBeforeFDP + \let\AutoSpaceBeforeFDP\autospace@beforeFDP + \let\NoAutoSpaceBeforeFDP\noautospace@beforeFDP + \AutoSpaceBeforeFDP \fi \ifLaTeXe \DeclareRobustCommand\ttfamilyFB{\FB@spacing@off \ttfamilyORI} @@ -626,10 +627,10 @@ \def\iers{\up{ers}\xspace} \def\iere{\up{re}\xspace} \def\ieres{\up{res}\xspace} -\newcommand*{\FrenchEnumerate}[1]{% - #1\up{o}\kern+.3em} -\newcommand*{\FrenchPopularEnumerate}[1]{% - #1\up{o})\kern+.3em} +\newcommand*{\FBmedkern}{\kern+.2em} +\newcommand*{\FBthickkern}{\kern+.3em} +\newcommand*{\FrenchEnumerate}[1]{#1\up{o}\FBthickkern} +\newcommand*{\FrenchPopularEnumerate}[1]{#1\up{o})\FBthickkern} \def\primo{\FrenchEnumerate1} \def\secundo{\FrenchEnumerate2} \def\tertio{\FrenchEnumerate3} @@ -638,10 +639,10 @@ \def\fsecundo){\FrenchPopularEnumerate2} \def\ftertio){\FrenchPopularEnumerate3} \def\fquarto){\FrenchPopularEnumerate4} -\DeclareRobustCommand*{\No}{N\up{o}\kern+.2em} -\DeclareRobustCommand*{\no}{n\up{o}\kern+.2em} -\DeclareRobustCommand*{\Nos}{N\up{os}\kern+.2em} -\DeclareRobustCommand*{\nos}{n\up{os}\kern+.2em} +\DeclareRobustCommand*{\No}{N\up{o}\FBmedkern} +\DeclareRobustCommand*{\no}{n\up{o}\FBmedkern} +\DeclareRobustCommand*{\Nos}{N\up{os}\FBmedkern} +\DeclareRobustCommand*{\nos}{n\up{os}\FBmedkern} \DeclareRobustCommand*{\bsc}[1]{\leavevmode\begingroup\kern0pt \scshape #1\endgroup} \ifLaTeXe\else\let\scshape\relax\fi @@ -773,6 +774,7 @@ {#1}% \fi } +\newcommand*{\FBthousandsep}{~} \ifx\FBfigtabshape\@undefined \let\FBfigtabshape\scshape \fi \StartBabelCommands*{\BabelLanguages}{captions} [unicode, fontenc=EU1 EU2 TU, charset=utf8] @@ -842,6 +844,7 @@ \fi \fi } +\newcommand{\FBWarning}[1]{\PackageWarning{french.ldf}{#1}} \bgroup \catcode`:=12 \catcode`>=12 \relax \long\gdef\STD@makecaption#1#2{% @@ -856,8 +859,7 @@ \vskip\belowcaptionskip} \egroup \newif\if@FBwarning@capsep -\@FBwarning@capseptrue -\newcommand{\FBWarning}[1]{\PackageWarning{french.ldf}{#1}} +\ifFB@active@punct\@FBwarning@capseptrue\fi \newcommand*{\CaptionSeparator}{\space\textendash\space} \def\FBCaption@Separator{: } \long\def\FB@makecaption#1#2{% @@ -870,6 +872,7 @@ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% \fi \vskip\belowcaptionskip} +\@ifclassloaded{acmart}{\@FBwarning@capsepfalse}{} \@ifclassloaded{amsart}{\@FBwarning@capsepfalse}{} \@ifclassloaded{amsbook}{\@FBwarning@capsepfalse}{} \@ifclassloaded{amsdtx}{\@FBwarning@capsepfalse}{} @@ -877,7 +880,6 @@ \@ifclassloaded{amproc}{\@FBwarning@capsepfalse}{} \@ifclassloaded{smfart}{\@FBwarning@capsepfalse}{} \@ifclassloaded{smfbook}{\@FBwarning@capsepfalse}{} -\ifFB@active@punct\else\@FBwarning@capsepfalse\fi \newif\ifFB@koma \@ifclassloaded{memoir}{\@FBwarning@capsepfalse}{} \@ifclassloaded{scrartcl}{\@FBwarning@capsepfalse\FB@komatrue}{} @@ -885,27 +887,16 @@ \@ifclassloaded{scrreprt}{\@FBwarning@capsepfalse\FB@komatrue}{} \@ifclassloaded{beamer}{\@FBwarning@capsepfalse}{} \ifdefined\@makecaption\else\@FBwarning@capsepfalse\fi -\@ifpackageloaded{caption} - {\FBWarning{Please load the "caption" package\MessageBreak - AFTER babel/frenchb; reported}% - \@FBwarning@capsepfalse}% - {} -\@ifpackageloaded{subcaption} - {\FBWarning{Please load the "subcaption" package\MessageBreak - AFTER babel/frenchb; reported}% - \@FBwarning@capsepfalse}% - {} -\@ifpackageloaded{floatrow} - {\FBWarning{Please load the "floatrow" package\MessageBreak - AFTER babel/frenchb; reported}% - \@FBwarning@capsepfalse}% - {} +\newcounter{FBcaption@count} +\@ifpackageloaded{caption3}{\addtocounter{FBcaption@count}{4}}{} +\@ifpackageloaded{subcaption}{\addtocounter{FBcaption@count}{2}}{} +\@ifpackageloaded{floatrow}{\stepcounter{FBcaption@count}}{} \AtBeginDocument{% \ifx\@makecaption\STD@makecaption \global\let\@makecaption\FB@makecaption \ifFBOldFigTabCaptions \else - \def\FBCaption@Separator{{\autospace@beforeFDP : }}% + \def\FBCaption@Separator{\ifFBfrench\space\fi : }% \fi \ifFBCustomiseFigTabCaptions \ifx\bbl@main@language\FB@french @@ -914,12 +905,32 @@ \fi \@FBwarning@capsepfalse \fi + \@ifpackageloaded{caption3}{% + \ifnum\value{FBcaption@count}=0 \@FBwarning@capsepfalse\fi + }{}% \if@FBwarning@capsep - \FBWarning + \ifnum\value{FBcaption@count}>0 + \FBWarning {Figures' and tables' captions might look like\MessageBreak - `Figure 1:' which is wrong in French.\MessageBreak - Check your class or packages to change this;\MessageBreak - reported}% + `Figure 1:' in French instead of `Figure 1 :'.\MessageBreak + If you have loaded any of the packages caption,\MessageBreak + subcaption or floatrow BEFORE babel/french,\MessageBreak + please move them AFTER babel/french.\MessageBreak + If one of them is loaded by your class,\MessageBreak + you can still add AFTER babel/french\MessageBreak + \protect\usepackage[labelsep=period]{caption} or\MessageBreak + \protect\usepackage[labelsep=endash]{caption} or\MessageBreak + ... live with it; reported}% + \else + \FBWarning + {Figures' and tables' captions might look like\MessageBreak + `Figure 1:' in French instead of `Figure 1 :'.\MessageBreak + If it happens, see your class documentation to\MessageBreak + fix this issue or add AFTER babel/french\MessageBreak + \protect\usepackage[labelsep=period]{caption} or\MessageBreak + \protect\usepackage[labelsep=endash]{caption} or\MessageBreak + or ... live with it; reported}% + \fi \fi \let\FB@makecaption\relax \let\STD@makecaption\relax @@ -942,8 +953,9 @@ \FB@addto{extras}{\bbl@frenchdots} \ifFB@active@punct \@ifpackageloaded{listings} - {\FBWarning{Please load the "listings" package\MessageBreak - AFTER babel/frenchb; reported}% + {\AtBeginDocument{% + \FBWarning{Please load the "listings" package\MessageBreak + AFTER babel/french; reported}}% }{} \fi \newif\if@FBwarning@natbib @@ -956,7 +968,7 @@ \fi \if@FBwarning@natbib \FBWarning{Please load the "natbib" package\MessageBreak - BEFORE babel/frenchb; reported}% + BEFORE babel/french; reported}% \fi } \newif\if@FBwarning@beamerarticle @@ -968,7 +980,7 @@ \fi \if@FBwarning@beamerarticle \FBWarning{Please load the "beamerarticle" package\MessageBreak - BEFORE babel/frenchb; reported}% + BEFORE babel/french; reported}% \fi } \newcommand*{\frenchsetup}[1]{% @@ -977,30 +989,32 @@ \@onlypreamble\frenchsetup \let\frenchbsetup\frenchsetup \@onlypreamble\frenchbsetup -\newif\ifFBShowOptions \FBShowOptionsfalse +\newif\ifFBShowOptions \newif\ifFBStandardLayout \FBStandardLayouttrue \newif\ifFBGlobalLayoutFrench \FBGlobalLayoutFrenchtrue -\newif\ifFBReduceListSpacing \FBReduceListSpacingfalse -\newif\ifFBListOldLayout \FBListOldLayoutfalse -\newif\ifFBCompactItemize \FBCompactItemizefalse +\newif\ifFBReduceListSpacing +\newif\ifFBListOldLayout +\newif\ifFBCompactItemize \newif\ifFBStandardItemizeEnv \FBStandardItemizeEnvtrue \newif\ifFBStandardEnumerateEnv \FBStandardEnumerateEnvtrue \newif\ifFBStandardItemLabels \FBStandardItemLabelstrue \newif\ifFBStandardLists \FBStandardListstrue -\newif\ifFBIndentFirst \FBIndentFirstfalse -\newif\ifFBFrenchFootnotes \FBFrenchFootnotesfalse -\newif\ifFBAutoSpaceFootnotes \FBAutoSpaceFootnotesfalse -\newif\ifFBOriginalTypewriter \FBOriginalTypewriterfalse -\newif\ifFBThinColonSpace \FBThinColonSpacefalse -\newif\ifFBThinSpaceInFrenchNumbers \FBThinSpaceInFrenchNumbersfalse +\newif\ifFBIndentFirst +\newif\ifFBFrenchFootnotes +\newif\ifFBAutoSpaceFootnotes +\newif\ifFBOriginalTypewriter +\newif\ifFBThinColonSpace +\newif\ifFBThinSpaceInFrenchNumbers \newif\ifFBFrenchSuperscripts \FBFrenchSuperscriptstrue \newif\ifFBLowercaseSuperscripts \FBLowercaseSuperscriptstrue \newif\ifFBPartNameFull \FBPartNameFulltrue -\newif\ifFBCustomiseFigTabCaptions \FBCustomiseFigTabCaptionsfalse -\newif\ifFBOldFigTabCaptions \FBOldFigTabCaptionsfalse +\newif\ifFBCustomiseFigTabCaptions +\newif\ifFBOldFigTabCaptions \newif\ifFBSmallCapsFigTabCaptions \FBSmallCapsFigTabCaptionstrue -\newif\ifFBSuppressWarning \FBSuppressWarningfalse -\newif\ifFBINGuillSpace \FBINGuillSpacefalse +\newif\ifFBSuppressWarning +\newif\ifFBINGuillSpace +\newif\ifFBucsNBSP + \edef\FB@french{\CurrentOption} \AtEndOfPackage{% \ifx\bbl@main@language\FB@french @@ -1168,10 +1182,9 @@ \else\ifx\FBeveryparguill\FBguillnone \else \let\FBeveryparguill\FBguillopen - \PackageWarning{french.ldf}% - {Wrong value for `EveryParGuill': - try `open',\MessageBreak - `close' or `none'. Reported}% + \FBWarning{Wrong value for `EveryParGuill': + try `open',\MessageBreak + `close' or `none'. Reported}% \fi \fi \fi}% @@ -1195,6 +1208,16 @@ \MessageBreak this option is for LuaTeX *only*.\MessageBreak Reported}% \fi}% + \define@key{FB}{UnicodeNoBreakSpaces}[true]% + {\ifFB@luatex@punct + \csname FBucsNBSP#1\endcsname + \ifFBucsNBSP \FB@ucsNBSP=1 \fi + \else + \FBWarning{Option `UnicodeNoBreakSpaces' skipped:% + \MessageBreak this option is for + LuaTeX *only*.\MessageBreak Reported}% + \fi + }% \define@key{FB}{og}% {\ifFBunicode \ifFB@luatex@punct @@ -1207,9 +1230,8 @@ \XeTeXcharclass"202F = \FB@guilnul \fi \ifFB@active@punct - \PackageWarning{french.ldf}% - {Option og=« not supported with this version - of\MessageBreak LuaTeX/XeTeX; reported}% + \FBWarning{Option og=« not supported with this version + of\MessageBreak LuaTeX/XeTeX; reported}% \fi \else \newcommand*{\FB@@og}{% @@ -1235,9 +1257,8 @@ \fi \fi \else - \PackageWarning{french.ldf}% - {Option `og' requires package inputenc;% - \MessageBreak reported}% + \FBWarning{Option `og' requires package inputenc;% + \MessageBreak reported}% \fi }% \fi @@ -1254,9 +1275,8 @@ \XeTeXcharclass"202F = \FB@guilnul \fi \ifFB@active@punct - \PackageWarning{french.ldf}% - {Option fg=» not supported with this version - of\MessageBreak LuaTeX/XeTeX; reported}% + \FBWarning{Option fg=» not supported with this version + of\MessageBreak LuaTeX/XeTeX; reported}% \fi \else \newcommand*{\FB@@fg}{% @@ -1282,9 +1302,8 @@ \fi \fi \else - \PackageWarning{french.ldf}% - {Option `fg' requires package inputenc;% - \MessageBreak reported}% + \FBWarning{Option `fg' requires package inputenc;% + \MessageBreak reported}% \fi }% \fi @@ -1353,29 +1372,14 @@ \let\sffamily\sffamilyFB \fi \@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}% - }% + {\ifnprt@autolanguage + \providecommand*{\npstylefrench}{}% + \ifFBThinSpaceInFrenchNumbers + \renewcommand*{\FBthousandsep}{\,}% + \fi + \g@addto@macro\npstylefrench{\npthousandsep{\FBthousandsep}}% \fi - \npaddtolanguage{french}{french}% - \fi}{}% + }{}% \ifFBFrenchSuperscripts \DeclareRobustCommand*{\up}{\@ifstar{\FB@up@fake}{\fup}}% \else @@ -1452,6 +1456,7 @@ EveryParGuill=open, close, none [open]\MessageBreak EveryLineGuill=open, close, none [open in LuaTeX, none otherwise]\MessageBreak + UnicodeNoBreakSpaces=true [false]\MessageBreak og= <left quote character>, fg= <right quote character>% \MessageBreak *********************************************% @@ -1489,30 +1494,43 @@ \fi \FBprocess@options \ifFB@luatex@punct - \FBcolonsp=\expandafter{\meaning\FBcolonspace} - \FBthinsp= \expandafter{\meaning\FBthinspace} - \FBguillsp=\expandafter{\meaning\FBguillspace} + \FBcolonsp=\expandafter{\meaning\FBcolonspace}% + \FBthinsp= \expandafter{\meaning\FBthinspace}% + \FBguillsp=\expandafter{\meaning\FBguillspace}% \activate@luatexpunct \fi - \ifFBunicode - \@ifpackageloaded{fontspec}{}% - {\@ifpackageloaded{luainputenc}{}% - {\PackageWarning{french.ldf}% - {Add \protect\usepackage{fontspec} to the\MessageBreak - preamble of your document, reported}% - }% - } - \else - \begingroup \newcommand{\FBOTone}{OT1}% - \ifx\encodingdefault\FBOTone - \PackageWarning{french.ldf}% - {OT1 encoding should not be used for French.% - \MessageBreak - Add \protect\usepackage[T1]{fontenc} to the - preamble\MessageBreak of your document; reported}% + \ifFBucsNBSP + \renewcommand*{\FBguillspace}{\char"A0\relax}% + \renewcommand*{\FBmedkern}{\char"202F\relax}% + \renewcommand*{\FBthickkern}{\char"A0\relax}% + \ifFBThinSpaceInFrenchNumbers + \renewcommand*{\FBthousandsep}{\char"202F\relax}% + \else + \renewcommand*{\FBthousandsep}{\char"A0\relax}% \fi - \endgroup \fi + \begingroup + \newcommand{\FBTU}{TU}% + \newcommand{\FBOTone}{OT1}% + \ifFBunicode + \ifx\encodingdefault\FBTU + \else + \@ifpackageloaded{fontspec}{}% + {\@ifpackageloaded{luainputenc}{}% + {\FBWarning{Add \protect\usepackage{fontspec} to the% + \MessageBreak preamble of your document, reported}% + }% + } + \fi + \else + \ifx\encodingdefault\FBOTone + \FBWarning{OT1 encoding should not be used for French.% + \MessageBreak + Add \protect\usepackage[T1]{fontenc} to the + preamble\MessageBreak of your document; reported}% + \fi + \fi + \endgroup } \let\listORI\list \let\endlistORI\endlist @@ -1722,6 +1740,7 @@ \llap{\@thefnmark}\dotFFN\kernFFN \fi} \providecommand\@makefntextFB[1]{\insertfootnotemarkFB #1} +\providecommand\localleftbox[1]{} \AtBeginDocument{% \@ifpackageloaded{bigfoot}{}% {\ifdim\parindentFFN<10in @@ -1735,18 +1754,18 @@ \ifFB@koma \let\@@makefnmarkORI\@@makefnmark \long\def\@makefntext#1{% - \ifFBFrenchFootnotes - \ifx\footnote\thanks - \let\@@makefnmark\@@makefnmarkTH - \@makefntextTH{#1}% - \else - \let\@@makefnmark\@@makefnmarkFB - \@makefntextFB{#1}% - \fi - \else - \let\@@makefnmark\@@makefnmarkORI - \@makefntextORI{#1}% - \fi}% + \ifFBFrenchFootnotes + \ifx\footnote\thanks + \let\@@makefnmark\@@makefnmarkTH + \begingroup\localleftbox{}\@makefntextTH{#1}\endgroup + \else + \let\@@makefnmark\@@makefnmarkFB + \begingroup\localleftbox{}\@makefntextFB{#1}\endgroup + \fi + \else + \let\@@makefnmark\@@makefnmarkORI + \@makefntextORI{#1}% + \fi}% \else \@ifclassloaded{memoir}% {\ifFBFrenchFootnotes @@ -1764,12 +1783,12 @@ \fi \fi }{}% - \long\def\@makefntext#1{% - \ifFBFrenchFootnotes - \@makefntextFB{#1}% - \else - \@makefntextORI{#1}% - \fi}% + \long\def\@makefntext#1{\begingroup\localleftbox{}% + \ifFBFrenchFootnotes + \@makefntextFB{#1}% + \else + \@makefntextORI{#1}% + \fi\endgroup}% \fi }% } diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf b/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf index d3de9a86b00..8727ecfd604 100644 --- a/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf +++ b/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf @@ -24,7 +24,7 @@ %% Please report errors to: <daniel (dot) flipo (at) free (dot) fr> %% \ProvidesLanguage{frenchb} - [2017/07/08 v3.3b French support from the babel system] + [2017/09/07 v3.3c French support from the babel system] \def\bbl@tempa{frenchb} \ifx\CurrentOption\bbl@tempa \let\l@frenchb\l@french diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua index 3a4ba453dde..bbad9953a99 100644 --- a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua +++ b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua @@ -1,6 +1,6 @@ --[[ File `frenchb.lua’ generated from frenchb.dtx - [2017/07/08 v3.3b French support from the babel system] + [2017/09/07 v3.3c French support from the babel system] Copyright © 2014-2017 Daniel Flipo <daniel (dot) flipo (at) free (dot) fr> License LPPL: see french.ldf. @@ -47,23 +47,23 @@ local insert_node_after = node.insert_after local remove_node = node.remove local function get_glue(toks) local t = nil - local f = string.match(toks, "\092hskip%s*([%d%.]*)%s*\092fontdimen") + local f = string.match(toks, "\\hskip%s*([%d%.]*)%s*\\fontdimen 2") if f == "" then f = 1 end - if f then - t = {f, 0, 0} - f = string.match(toks, "plus%s*([%d%.]*)%s*\092fontdimen") + if tonumber(f) then + t = {tonumber(f), 0, 0} + f = string.match(toks, "plus%s*([%d%.]*)%s*\\fontdimen 3") if f == "" then f = 1 end - if f then - t[2] = f - f = string.match(toks, "minus%s*([%d%.]*)%s*\092fontdimen") + if tonumber(f) then + t[2] = tonumber(f) + f = string.match(toks, "minus%s*([%d%.]*)%s*\\fontdimen 4") if f == "" then f = 1 end - if f then - t[3] = f + if tonumber(f) then + t[3] = tonumber(f) end end - elseif string.match(toks, "\092F?B?thinspace") then + elseif string.match(toks, "\\F?B?thinspace") then t = {0.5, 0, 0} - elseif string.match(toks, "\092space") then + elseif string.match(toks, "\\space") then t = {1, 1, 1} end return t @@ -98,6 +98,7 @@ end local FBspacing = luatexbase.attributes['FB@spacing'] local addDPspace = luatexbase.attributes['FB@addDPspace'] local addGUILspace = luatexbase.attributes['FB@addGUILspace'] +local FBucsNBSP = luatexbase.attributes['FB@ucsNBSP'] local has_attribute = node.has_attribute local function french_punctuation (head) for item in node.traverse_id(GLYPH, head) do @@ -106,6 +107,25 @@ local function french_punctuation (head) local fid = item.font local FRspacing = has_attribute(item, FBspacing) FRspacing = FRspacing and FRspacing > 0 + local FRucsNBSP = has_attribute(item, FBucsNBSP) + FRucsNBSP = FRucsNBSP and FRucsNBSP > 0 + local NBthinspace = new_node("glyph") + NBthinspace.font = fid + NBthinspace.char = 0x202F + local NBcolnspace = new_node("glyph") + NBcolnspace.font = fid + if colngl[1] <= 0.5 then + NBcolnspace.char = 0x202F + else + NBcolnspace.char = 0xA0 + end + local NBguilspace = new_node("glyph") + NBguilspace.font = fid + if guilgl[1] <= 0.5 then + NBguilspace.char = 0x202F + else + NBguilspace.char = 0xA0 + end local SIG = has_attribute(item, addGUILspace) SIG = SIG and SIG >0 if lang == FR and FRspacing and @@ -137,17 +157,24 @@ local function french_punctuation (head) end end local fbglue + local nbspace if FB_punct_thick[char] then fbglue = new_glue_scaled(fid,colngl) + nbspace = NBcolnspace else fbglue = new_glue_scaled(fid,thingl) + nbspace = NBthinspace end if (realglue or auto) and fbglue then if realglue then head = remove_node(head,prev,true) end - insert_node_before(head, item, copy_node(nobreak)) - insert_node_before(head, item, copy_node(fbglue)) + if (FRucsNBSP) then + insert_node_before(head, item, copy_node(nbspace)) + else + insert_node_before(head, item, copy_node(nobreak)) + insert_node_before(head, item, copy_node(fbglue)) + end end elseif SIG then local addgl = (prev_char and not FB_guil_null[prev_char]) or @@ -163,8 +190,12 @@ local function french_punctuation (head) if is_glue then head = remove_node(head,prev,true) end - insert_node_before(head, item, copy_node(nobreak)) - insert_node_before(head, item, copy_node(fbglue)) + if (FRucsNBSP) then + insert_node_before(head, item, copy_node(NBguilspace)) + else + insert_node_before(head, item, copy_node(nobreak)) + insert_node_before(head, item, copy_node(fbglue)) + end end end end @@ -207,8 +238,12 @@ local function french_punctuation (head) if is_glue then head = remove_node(head,next,true) end - insert_node_after(head, item, copy_node(fbglue)) - insert_node_after(head, item, copy_node(nobreak)) + if (FRucsNBSP) then + insert_node_after(head, item, copy_node(NBguilspace)) + else + insert_node_after(head, item, copy_node(fbglue)) + insert_node_after(head, item, copy_node(nobreak)) + end end end end |