diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/generic/babel-french/frenchb.pdf | bin | 259310 -> 261600 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/generic/babel-french/frenchb.dtx | 299 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/frenchb.ldf | 106 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/frenchb.lua | 31 |
4 files changed, 245 insertions, 191 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 4fe1211979e..bbeab074f65 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 f8c80ae196f..f8a289f85f0 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{3315} +%\CheckSum{3222} % %\iffalse % Tell the \LaTeX\ system who we are and write an entry on the @@ -13,14 +13,14 @@ %<ldf>\ProvidesLanguage{frenchb} %\ProvidesFile{frenchb.dtx} %<*!lua> - [2015/05/31 v3.1f French support from the babel system] + [2015/06/26 v3.1g French support from the babel system] %</!lua> %<*internal> \iffalse %</internal> %<*lua> -- --- File `frenchb.lua' generated from frenchb.dtx [2015/04/10 v3.1e] +-- File `frenchb.lua' generated from frenchb.dtx [2015/06/26 v3.1g] -- -- Copyright (C) 2014-2015 Daniel Flipo -- <daniel (dot) flipo (at) free (dot) fr> @@ -491,12 +491,12 @@ % \file{.log} file. % % With LuaTeX based engines, this option is set to \fbo{open} by -% default, it ensures that a \guillemotleft{} followed by proper +% default, it ensures that a `«' followed by proper % kern will be repeated at the beginning of every line in case an % embedded (inner) quotation spreads over more than one line % (provided that both outer and inner quotations are entered with % |\frquote{}|). Set this option to \fbo{close} if you want -% a \guillemotright{} instead of a \guillemotleft. +% a `»' instead of a `«'. % \item [InnerGuillSingle=true (false)]; % if \fbo{InnerGuillSingle=false} (default), inner quotations % entered with |\frquote{}| start with~\texttt{``} and end @@ -505,15 +505,13 @@ % \texttt{\guilsinglright} are used instead of British double % quotes. Please note that this option only makes % sense when \fbo{EveryLineGuill=none}. -% \item [og=\guillemotleft, fg=\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 \label{option-og-fg} -% \texttt{\guillemotleft{} guillemets \guillemotright} or -% \texttt{\guillemotleft{}guillemets\guillemotright} (with or +% \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} +% \texttt{« guillemets »} or \texttt{«guillemets»} (with or % without spaces) to get properly typeset French quotes. % This option works with LuaLaTeX and XeLaTeX; with pdfLaTeX it % requires \file{inputenc} to be loaded with a proper encoding: @@ -713,9 +711,8 @@ % Better compatibility with the \pkg{enumitem} package. % % When typewriter fonts are in use (hence in verbatim mode) no -% space is added after `\guillemotleft' and before -% `\guillemotright' when they are entered as characters -% (see \fbsetup{}). +% space is added after `«' and before `»' when they are entered as +% characters (see \fbsetup{}). % % \subsubsection*{What's new in version 2.3?} % @@ -1251,14 +1248,13 @@ local FB_punct_thin = local FB_punct_thick = {[string.byte(":")] = true} % \end{macrocode} -% Managing spacing after `\guillemotleft' (U+00AB) and before -% `\guillemotright' (U+00BB) can be done by the way; we define two -% flags, |FB_punct_left| for characters requiring some space before -% them and |FB_punct_right| for `\guillemotleft' which must be -% followed by some space. In case LuaTeX is used to output -% T1-encoded fonts instead of OpenType fonts, codes \texttt{0x13} -% and \texttt{0x14} have to be added for `\guillemotleft' and -% `\guillemotright'. +% Managing spacing after `«' (U+00AB) and before `»' (U+00BB) can be +% done by the way; we define two flags, |FB_punct_left| for +% characters requiring some space before them and |FB_punct_right| +% for `\guillemotleft' which must be followed by some space. +% In case LuaTeX is used to output T1-encoded fonts instead of +% OpenType fonts, codes \texttt{0x13} and \texttt{0x14} have to be +% added for `«' and `»'. % \begin{macrocode} local FB_punct_left = {[string.byte("!")] = true, @@ -1290,11 +1286,16 @@ local FB_guil_null = {[0xA0] = true, [0x202F] = true} % \end{macrocode} +% \changes{v3.1g}{2015/06/17}{frenchb.lua: node HLIST added; node TEMP +% added for the first node of \cs{hbox}es.} +% % Local definitions for nodes: % \begin{macrocode} local new_node = node.new local copy_node = node.copy local node_id = node.id +local HLIST = node_id("hlist") +local TEMP = node_id("temp") local KERN = node_id("kern") local GLUE = node_id("glue") local GSPEC = node_id("glue_spec") @@ -1356,13 +1357,12 @@ local addDPspace = luatexbase.attributes['FB@addDPspace'] local addGUILspace = luatexbase.attributes['FB@addGUILspace'] local has_attribute = node.has_attribute % \end{macrocode} -% The following function will be added to |pre_linebreak_filter| and -% |hpack_filter| callbacks. It catches all nodes of type |GLYPH| -% in the list starting at |head| and checks the language attributes -% of the current glyph: nothing is done if the current language is -% not French and only specific punctuation characters (those for -% which |FB_punct_left| or |FB_punct_right| is true) need a special -% treatment. +% The following function will be added to |kerning| callback. +% It catches all nodes of type |GLYPH| in the list starting at +% |head| and checks the language attributes of the current glyph: +% nothing is done if the current language is not French and only +% specific punctuation characters (those for which |FB_punct_left| +% or |FB_punct_right| is true) need a special treatment. % In French, local variables are defined to hold the properties of % the current glyph (|item|) and of the previous one (|prev|) or the % next one (|next|). @@ -1400,7 +1400,7 @@ local function french_punctuation (head) % Pointed out by Jacques André.} % % If the previous item is a glue, check its natural width, only -% positive glues (actually glues > 1 sp, for tabular ``l'' +% positive glues (actually glues > 1 sp, for tabular `l' % columns) are to be replaced by a nobreakspace. % \begin{macrocode} local glue = prev_id == GLUE and prev_subtype == 0 @@ -1425,7 +1425,7 @@ local function french_punctuation (head) % avoids spurious spaces in strings like |(!)| or |??|), % b) a null glue (actually glues <= 1 sp for tabulars) preceeds the % punctuation character, -% c) the punctuation character starts a paragraph. +% c) the punctuation character starts a paragraph or an |\hbox{}|. % % \begin{macrocode} if FB_punct_thin[char] or FB_punct_thick[char] then @@ -1434,7 +1434,8 @@ local function french_punctuation (head) if auto then if (prev_char and FB_punct_null[prev_char]) or (glue and glue_wd <= 1) or - (prev_id == 0 and prev_subtype == 3) then + (prev_id == HLIST and prev_subtype == 3) or + (prev_id == TEMP) then auto = false end end @@ -1452,27 +1453,40 @@ local function french_punctuation (head) insert_node_before(head, item, copy_node(fbglue)) end % \end{macrocode} -% Let's consider `\guillemotright' now (the only remaining glyph of +% Let's consider `»' now (the only remaining glyph of % |FB_punct_left| class): we just have to remove any \emph{glue} -% possibly preceeding `\guillemotright', then insert the nobreak -% penalty and the proper \emph{glue} (controlled by |\FBguillskip|). +% possibly preceeding `»', then to insert the nobreak penalty and +% the proper \emph{glue} (controlled by |\FBguillskip|). % This is done only if French quotes have been `activated' by -% options \fbo{og=\guillemotleft, fg=\guillemotright} in -% \fbsetup{} and can be denied locally with |\NoAutoSpacing| -% (this is controlled by the |SIG| flag). +% options \fbo{og=«, fg=»} in \fbsetup{} and can be denied locally +% with |\NoAutoSpacing| (this is controlled by the |SIG| flag). +% If either a) the preceding glyph is member of |FB_guil_null|, or +% b) `»' is the first glyph of an |\hbox{}| or a paragraph, nothing +% is done, this is controlled by the |addgl| flag. % % \changes{v3.1a}{2014/06/18}{frenchb.lua: added flag addgl which must % also be true when prev or next is not a char (i.e. kern0 in % «\cs{texttt}\{a\}»).} % -% \changes{v3.1a}{2014/06/18}{frenchb.lua: look ahead when next is a kern -% (i.e. in « \cs{texttt}\{a\} »).} +% \changes{v3.1g}{2015/06/26}{frenchb.lua: flag addgl set to false for +% `»' at the beginning of an \cs{hbox} or a paragraph or a tabular +% `l' and `c' columns.} % % \begin{macrocode} elseif SIG and SIG > 0 then local addgl = (prev_char and not FB_guil_null[prev_char]) or - (not prev_char) - if glue or addgl then + (not prev_char and + prev_id ~= TEMP and + not (prev_id == HLIST and prev_subtype == 3) + ) +% \end{macrocode} +% Correction for tabular `c' (glue 0 plus 1 fil) and `l' (glue 1sp) +% columns: +% \begin{macrocode} + if glue and glue_wd <= 1 then + addgl = false + end + if addgl then if glue then head = remove_node(head,prev,true) end @@ -1483,16 +1497,26 @@ local function french_punctuation (head) end end % \end{macrocode} -% Similarly, for `\guillemotleft' (unique member of the -% |FB_punct_right| class), we check the following node looking for -% \emph{glue} or |FB_guil_null| character, in order to remove any -% \emph{glue} possibly following it and to insert the proper -% \emph{glue} and nobreak penalty in this order if necessary. +% Similarly, for `«' (unique member of the |FB_punct_right| class): +% unless either a) the next glyph is member of |FB_guil_null|, or +% b) `«' is the last glyph of an |\hbox{}| or a paragraph (then the +% |addgl| flag is false, nothing is done), we remove any \emph{glue} +% possibly following it and insert first the proper \emph{glue} then +% a nobreak penalty so that finally the penalty preceeds the +% \emph{glue}. +% +% \changes{v3.1a}{2014/06/18}{frenchb.lua: look ahead when next is a kern +% (i.e. in « \cs{texttt}\{a\} »).} +% +% \changes{v3.1g}{2015/06/26}{frenchb.lua: flag addgl set to false for +% `«' at the end of an \cs{hbox} or a paragraph or when followed by +% a null glue (i.e. springs).} +% % \begin{macrocode} if lang == FR and FB_punct_right[char] and fid > 0 and SIG and SIG > 0 then local next = item.next - local next_id, next_subtype, next_char, kern_wd, nextnext + local next_id, next_subtype, next_char, nextnext, kern_wd if next then next_id = next.id next_subtype = next.subtype @@ -1510,7 +1534,9 @@ local function french_punctuation (head) next = nextnext next_id = nextnext.id next_subtype = nextnext.subtype - next_char = nextnext.char + if next_id == GLYPH then + next_char = nextnext.char + end end end end @@ -1520,10 +1546,17 @@ local function french_punctuation (head) glue_spec = next.spec glue_wd = glue_spec.width end - glue = glue and glue_wd > 0 local addgl = (next_char and not FB_guil_null[next_char]) or - (not next_char) - if glue or addgl then + (next and not next_char) +% \end{macrocode} +% Correction for tabular `c' columns. For `r' columns, a final +% `«' character needs to be coded as |\mbox{«}| for proper spacing +% (|\NoAutoSpacing| is another option). +% \begin{macrocode} + if glue and glue_wd == 0 then + addgl = false + end + if addgl then if glue then head = remove_node(head,next,true) end @@ -1582,31 +1615,32 @@ return french_punctuation % Lua function dofile (not kpathsea aware). % Call function kpse.find\_file first, as suggested by Paul Gaborit.} % +% \changes{v3.1g}{2015/06/17}{Lua function french\_punctuation is now +% inserted at the end of the "kerning" callback (no priority) +% instead of "hpack\_filter" and "pre\_linebreak\_filter".} +% % In \LaTeXe, file \file{frenchb.lua} will be loaded % `AtBeginDocument' \emph{after} processing options % (\fbo{ThinColonSpace} needs to be taken into account). The next % definition will be used to activate Lua punctuation: it sets the % language number for French, loads \file{frenchb.lua} and adds -% function |french_punctuation| to both callbacks -% |pre_linebreak_filter| (paragraph building) and |hpack_filter| -% (|\hbox| building). +% function |french_punctuation| at the end of the |kerning| callback +% (no priority). % \begin{macrocode} \def\activate@luatexpunct{% \directlua{% FR = \the\l@french local path = kpse.find_file("frenchb.lua", "lua") if path then - local f = dofile(path) - luatexbase.add_to_callback("pre_linebreak_filter", - f, "frenchb.french_punctuation",1) - luatexbase.add_to_callback("hpack_filter", - f, "frenchb.french_punctuation",1) + local f = dofile(path) + luatexbase.add_to_callback("kerning", + f, "frenchb.french_punctuation") else - texio.write_nl('') - texio.write_nl('*****************************') - texio.write_nl('Error: frenchb.lua not found.') - texio.write_nl('*****************************') - texio.write_nl('') + texio.write_nl('') + texio.write_nl('*****************************') + texio.write_nl('Error: frenchb.lua not found.') + texio.write_nl('*****************************') + texio.write_nl('') end }% } @@ -1622,10 +1656,9 @@ return french_punctuation % before the four characters |;| |!| |?| and |:|. The basis of the % following code was borrowed from the \pkg{polyglossia} package, % see \file{gloss-french.ldf}. We use the same mechanism for French -% quotes (\texttt{\guillemotleft} and \texttt{\guillemotright}), -% when automatic spacing for quotes is required by options -% \fbo{og=} and \fbo{fg=} in \fbsetup{} (see -% section~\ref{ssec-keyval}). +% quotes (\texttt{«} and \texttt{»}), when automatic spacing for +% quotes is required by options \fbo{og=«} and \fbo{fg=»} in +% \fbsetup{} (see section~\ref{ssec-keyval}). % % For every character used in French text-mode (except spaces), % |\XeTeXcharclass| value must be 0. @@ -1635,13 +1668,17 @@ return french_punctuation % % We switch |\XeTeXinterchartokenstate| to 1 and change the % |\XeTeXcharclass| values of |;| |!| |?| |:| |(| |]| -% \texttt{\guillemotleft} and \texttt{\guillemotright} when +% \texttt{«} and \texttt{»} when % entering French. Special care is taken to restore them to their % inital values when leaving French. % % \changes{v2.5d}{2011/01/19}{Moved the \cs{newcount} command outside % \cs{ifFB@xetex@punct} ... \cs{fi} (it broke Plain formats).} % +% \changes{v3.1g}{2015/06/14}{Use Babel defined loops \cs{bbl@for} +% instead of \cs{@for} borrowed from file ltcntrl.dtx +% (\cs{@for} is undefined in Plain).} +% % The following part holds specific code for punctuation with XeTeX % engines. % \begin{macrocode} @@ -1656,30 +1693,6 @@ return french_punctuation with this version of XeTeX!} \fi % \end{macrocode} -% The following code is borrowed from \file{ltcntrl.dtx} -% (LaTeX base) for loops (|\@for| undefined in Plain): -% \begin{macrocode} - \ifx\@for\@undefined - \def\@nnil{\@nil}% - \def\@empty{}% - \def\@fornoop#1\@@#2#3{}% - \long\def\@for#1:=#2\do#3{% - \expandafter\def\expandafter\@fortmp\expandafter{#2}% - \ifx\@fortmp\@empty \else - \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi}% - \long\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else - #5\def#4{#2}\ifx #4\@nnil \else#5\@iforloop #3\@@#4{#5}\fi\fi}% - \long\def\@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil - \expandafter\@fornoop \else - #4\relax\expandafter\@iforloop\fi#2\@@#3{#4}}% - \def\@tfor#1:={\@tf@r#1 }% - \long\def\@tf@r#1#2\do#3{\def\@fortmp{#2}\ifx\@fortmp\space\else - \@tforloop#2\@nil\@nil\@@#1{#3}\fi}% - \long\def\@tforloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil - \expandafter\@fornoop \else - #4\relax\expandafter\@tforloop\fi#2\@@#3{#4}}% - \fi -% \end{macrocode} % % \changes{v2.5i}{2012/04/20}{Temporary fix: as long as % \file{xeCJK.sty} will not use \cs{newXeTeXintercharclass} to @@ -1742,10 +1755,11 @@ return french_punctuation % \begin{macrocode} \ifx\FB@charclassesORI\empty \FB@interchartokenstateORI=\XeTeXinterchartokenstate - \@for\FB@char:={`\:,`\;,`\!,`\?,"AB,"BB,% - `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% - `\%,"22,"27,"60,"2019,"A0,"202F}\do - {\edef\FB@charclassesORI{\FB@charclassesORI% + \bbl@for\FB@char + {`\:,`\;,`\!,`\?,"AB,"BB,% + `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% + `\%,"22,"27,"60,"2019,"A0,"202F}% + {\edef\FB@charclassesORI{\FB@charclassesORI% \the\XeTeXcharclass\FB@char,}}% \let\shorthandonORI\shorthandon \let\shorthandoffORI\shorthandoff @@ -1761,8 +1775,9 @@ return french_punctuation \FDP@colonspace}% \XeTeXinterchartoks 255 \FB@punctthick = {% \ifhmode\unskip\penalty\@M\FBcolonspace\fi}% - \@for\FB@char:={`\;,`\!,`\?}\do - {\XeTeXcharclass\FB@char=\FB@punctthin}% + \bbl@for\FB@char + {`\;,`\!,`\?}% + {\XeTeXcharclass\FB@char=\FB@punctthin}% \XeTeXinterchartoks \z@ \FB@punctthin = {% \ifhmode\FDP@thinspace\fi}% \XeTeXinterchartoks \FB@guilf \FB@punctthin = {% @@ -1783,15 +1798,16 @@ return french_punctuation % This will avoid spurious spaces in (!), [?] and with Unicode % nobreakspaces (U+00A0, U+202F): % \begin{macrocode} - \@for\FB@char:={`\[,`\(,"A0,"202F}\do - {\XeTeXcharclass\FB@char=\FB@punctnul}% + \bbl@for\FB@char + {`\[,`\(,"A0,"202F}% + {\XeTeXcharclass\FB@char=\FB@punctnul}% % \end{macrocode} % These characters have their class changed by \file{xeCJK.sty}, % let's reset them to 0 in French. % \begin{macrocode} - \@for\FB@char:={`\{,`\,,`\.,`\-,`\),`\],`\},`\%,% - "22,"27,"60,"2019}\do - {\XeTeXcharclass\FB@char=\z@}% + \bbl@for\FB@char + {`\{,`\,,`\.,`\-,`\),`\],`\},`\%,"22,"27,"60,"2019}% + {\XeTeXcharclass\FB@char=\z@}% % \end{macrocode} % With Xe(La)TeX, French defines no active shorthands. % \begin{macrocode} @@ -1820,11 +1836,12 @@ return french_punctuation \newcommand*{\FB@xetex@punct@nonfrench}{% \ifx\FB@charclassesORI\empty \else - \@for\FB@char:={`\:,`\;,`\!,`\?,"AB,"BB,% - `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% - `\%,"22,"27,"60,"2019,"A0,"202F}\do - {\expandafter\FB@parse\FB@charclassesORI\endparse - \XeTeXcharclass\FB@char=\FB@class}% + \bbl@for\FB@char + {`\:,`\;,`\!,`\?,"AB,"BB,% + `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% + `\%,"22,"27,"60,"2019,"A0,"202F}% + {\expandafter\FB@parse\FB@charclassesORI\endparse + \XeTeXcharclass\FB@char=\FB@class}% \def\FB@charclassesORI{}% \XeTeXinterchartokenstate=\FB@interchartokenstateORI \let\shorthandon\shorthandonORI @@ -2864,6 +2881,9 @@ return french_punctuation % \changes{v3.1b}{2014/09/15}{Change \cs{scshape} to customisable % \cs{FBfigtabshape} for \cs{figurename} and \cs{tablename}.} % +% \changes{v3.1g}{2015/05/10}{\cs{partname}'s definition depends now on +% flag PartNameFull. No need to redefine it in \cs{frenchbsetup}.} +% % Let's give a chance to a class or a package read before frenchb to % define |\FBfigtabshape| as |\relax|, otherwise |\FBfigtabshape| % will be defined as |\scshape| (can be changed with @@ -2909,7 +2929,10 @@ return french_punctuation \SetString{\proofname}{D\'emonstration} \SetString{\glossaryname}{Glossaire} % \end{macrocode} -% ``Première partie'' instead of ``Part I''. +% When \fbo{PartNameFull=true} (default), |\part{}| is printed in +% French as ``Première partie'' instead of ``Partie I''. +% As logic is prohibited inside |\SetString|, let's hide the test +% about \fbo{PartNameFull} in |\FB@partname|. % \begin{macrocode} \SetStringLoop{ordinal#1}{% Premi\`ere,Deuxi\`eme,Troisi\`eme,Quatri\`eme,Cinqui\`eme,% @@ -2918,13 +2941,40 @@ return french_punctuation Dix-septi\`eme,Dix-huiti\`eme,Dix-neuvi\`eme,Vingti\`eme} \AfterBabelCommands{% \DeclareRobustCommand*{\FB@emptypart}{\def\thepart{}}% - \DeclareRobustCommand*{\FB@Rpart}{\def\thepart{\Roman{part}}}% + \DeclareRobustCommand*{\FB@partname}{% + \ifFBPartNameFull + \csname ordinal\romannumeral\value{part}\endcsname\space + partie\FB@emptypart + \else + Partie% + \fi}% } - \SetString{\partname}{% - \csname ordinal\romannumeral\value{part}\endcsname\space - partie\FB@emptypart} + \SetString{\partname}{\FB@partname} \EndBabelCommands % \end{macrocode} +% +% \changes{v3.1g}{2015/05/10}{Bug fix for koma-scripts classes: +% a spurious dot was added by the \cs{partformat} command.} +% +% The following patch is for koma-script classes: |\partformat| +% needs to be redefined in French as this command, defined as +% |\partname~\thepart\autodot| is incompatible with our redefinition +% of |\partname|. The code is postponed to the end of package +% because |\ifFB@koma| will be defined and set later on +% (see p.~\pageref{ifFB@koma}). +% \begin{macrocode} +\AtEndOfPackage{% + \ifFB@koma + \ifdefined\partformat + \FB@addto{captions}{% + \ifFBPartNameFull + \babel@save\partformat + \renewcommand*{\partformat}{\partname}% + \fi}% + \fi + \fi +} +% \end{macrocode} % \end{macro} % % \changes{v3.0a}{2014/02/28}{Merging of \cs{captionsfrenchb}, @@ -3057,7 +3107,8 @@ 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|). +% later on (see below after executing |\FBprocess@options|) +% \label{ifFB@koma}. % \begin{macrocode} \newif\ifFB@koma \@ifclassloaded{memoir}{\@FBwarning@capsepfalse}{} @@ -3351,6 +3402,9 @@ return french_punctuation % instead of SmallCapsFigTabCaptions. Pointed out by Céline % Chevalier.} % +% \changes{v3.1g}{2015/05/10}{PartNameFull now just sets the flag, +% nothing to add to \cs{captionsfrench} when false.} +% % \begin{macrocode} \newcommand*{\frenchbsetup}[1]{% \setkeys{FB}{#1}% @@ -3545,12 +3599,7 @@ return french_punctuation \define@key{FB}{LowercaseSuperscripts}[true]% {\csname FBLowercaseSuperscripts#1\endcsname} \define@key{FB}{PartNameFull}[true]% - {\csname FBPartNameFull#1\endcsname - \ifFBPartNameFull - \else - \FB@addto{captions}{% - \def\partname{Partie\protect\FB@Rpart}}% - \fi}% + {\csname FBPartNameFull#1\endcsname}% \define@key{FB}{CustomiseFigTabCaptions}[true]% {\csname FBCustomiseFigTabCaptions#1\endcsname}% \define@key{FB}{OldFigTabCaptions}[true]% diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf b/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf index 132b4049a6d..b5e4134f4d8 100644 --- a/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf +++ b/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf @@ -33,7 +33,7 @@ %% extension .ins) which are part of the distribution. %% \ProvidesLanguage{frenchb} - [2015/05/31 v3.1f French support from the babel system] + [2015/06/26 v3.1g French support from the babel system] %% %% File `frenchb.ldf' %% Babel package for LaTeX version 2e @@ -241,17 +241,15 @@ FR = \the\l@french local path = kpse.find_file("frenchb.lua", "lua") if path then - local f = dofile(path) - luatexbase.add_to_callback("pre_linebreak_filter", - f, "frenchb.french_punctuation",1) - luatexbase.add_to_callback("hpack_filter", - f, "frenchb.french_punctuation",1) + local f = dofile(path) + luatexbase.add_to_callback("kerning", + f, "frenchb.french_punctuation") else - texio.write_nl('') - texio.write_nl('*****************************') - texio.write_nl('Error: frenchb.lua not found.') - texio.write_nl('*****************************') - texio.write_nl('') + texio.write_nl('') + texio.write_nl('*****************************') + texio.write_nl('Error: frenchb.lua not found.') + texio.write_nl('*****************************') + texio.write_nl('') end }% } @@ -266,26 +264,6 @@ \fb@info{No need for active punctuation characters\\ with this version of XeTeX!} \fi - \ifx\@for\@undefined - \def\@nnil{\@nil}% - \def\@empty{}% - \def\@fornoop#1\@@#2#3{}% - \long\def\@for#1:=#2\do#3{% - \expandafter\def\expandafter\@fortmp\expandafter{#2}% - \ifx\@fortmp\@empty \else - \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi}% - \long\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else - #5\def#4{#2}\ifx #4\@nnil \else#5\@iforloop #3\@@#4{#5}\fi\fi}% - \long\def\@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil - \expandafter\@fornoop \else - #4\relax\expandafter\@iforloop\fi#2\@@#3{#4}}% - \def\@tfor#1:={\@tf@r#1 }% - \long\def\@tf@r#1#2\do#3{\def\@fortmp{#2}\ifx\@fortmp\space\else - \@tforloop#2\@nil\@nil\@@#1{#3}\fi}% - \long\def\@tforloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil - \expandafter\@fornoop \else - #4\relax\expandafter\@tforloop\fi#2\@@#3{#4}}% - \fi \newXeTeXintercharclass\FB@punctthick \newXeTeXintercharclass\FB@punctthin \newXeTeXintercharclass\FB@punctnul @@ -299,10 +277,11 @@ \newcommand*{\FB@xetex@punct@french}{% \ifx\FB@charclassesORI\empty \FB@interchartokenstateORI=\XeTeXinterchartokenstate - \@for\FB@char:={`\:,`\;,`\!,`\?,"AB,"BB,% - `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% - `\%,"22,"27,"60,"2019,"A0,"202F}\do - {\edef\FB@charclassesORI{\FB@charclassesORI% + \bbl@for\FB@char + {`\:,`\;,`\!,`\?,"AB,"BB,% + `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% + `\%,"22,"27,"60,"2019,"A0,"202F}% + {\edef\FB@charclassesORI{\FB@charclassesORI% \the\XeTeXcharclass\FB@char,}}% \let\shorthandonORI\shorthandon \let\shorthandoffORI\shorthandoff @@ -315,8 +294,9 @@ \FDP@colonspace}% \XeTeXinterchartoks 255 \FB@punctthick = {% \ifhmode\unskip\penalty\@M\FBcolonspace\fi}% - \@for\FB@char:={`\;,`\!,`\?}\do - {\XeTeXcharclass\FB@char=\FB@punctthin}% + \bbl@for\FB@char + {`\;,`\!,`\?}% + {\XeTeXcharclass\FB@char=\FB@punctthin}% \XeTeXinterchartoks \z@ \FB@punctthin = {% \ifhmode\FDP@thinspace\fi}% \XeTeXinterchartoks \FB@guilf \FB@punctthin = {% @@ -333,11 +313,12 @@ \ifFBAutoSpaceGuill\FBguillspace\fi}% \XeTeXinterchartoks 255 \FB@guilf = {% \ifFBAutoSpaceGuill\unskip\FBguillspace\fi}% - \@for\FB@char:={`\[,`\(,"A0,"202F}\do - {\XeTeXcharclass\FB@char=\FB@punctnul}% - \@for\FB@char:={`\{,`\,,`\.,`\-,`\),`\],`\},`\%,% - "22,"27,"60,"2019}\do - {\XeTeXcharclass\FB@char=\z@}% + \bbl@for\FB@char + {`\[,`\(,"A0,"202F}% + {\XeTeXcharclass\FB@char=\FB@punctnul}% + \bbl@for\FB@char + {`\{,`\,,`\.,`\-,`\),`\],`\},`\%,"22,"27,"60,"2019}% + {\XeTeXcharclass\FB@char=\z@}% \def\shorthandoff##1{% \ifx\PackageWarning\@undefined \fb@warning{\noexpand\shorthandoff{;:!?} is helpless with @@ -353,11 +334,12 @@ \newcommand*{\FB@xetex@punct@nonfrench}{% \ifx\FB@charclassesORI\empty \else - \@for\FB@char:={`\:,`\;,`\!,`\?,"AB,"BB,% - `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% - `\%,"22,"27,"60,"2019,"A0,"202F}\do - {\expandafter\FB@parse\FB@charclassesORI\endparse - \XeTeXcharclass\FB@char=\FB@class}% + \bbl@for\FB@char + {`\:,`\;,`\!,`\?,"AB,"BB,% + `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% + `\%,"22,"27,"60,"2019,"A0,"202F}% + {\expandafter\FB@parse\FB@charclassesORI\endparse + \XeTeXcharclass\FB@char=\FB@class}% \def\FB@charclassesORI{}% \XeTeXinterchartokenstate=\FB@interchartokenstateORI \let\shorthandon\shorthandonORI @@ -847,12 +829,27 @@ Dix-septi\`eme,Dix-huiti\`eme,Dix-neuvi\`eme,Vingti\`eme} \AfterBabelCommands{% \DeclareRobustCommand*{\FB@emptypart}{\def\thepart{}}% - \DeclareRobustCommand*{\FB@Rpart}{\def\thepart{\Roman{part}}}% + \DeclareRobustCommand*{\FB@partname}{% + \ifFBPartNameFull + \csname ordinal\romannumeral\value{part}\endcsname\space + partie\FB@emptypart + \else + Partie% + \fi}% } - \SetString{\partname}{% - \csname ordinal\romannumeral\value{part}\endcsname\space - partie\FB@emptypart} + \SetString{\partname}{\FB@partname} \EndBabelCommands +\AtEndOfPackage{% + \ifFB@koma + \ifdefined\partformat + \FB@addto{captions}{% + \ifFBPartNameFull + \babel@save\partformat + \renewcommand*{\partformat}{\partname}% + \fi}% + \fi + \fi +} \bgroup \catcode`:=12 \catcode`>=12 \relax \long\gdef\STD@makecaption#1#2{% @@ -1124,12 +1121,7 @@ \define@key{FB}{LowercaseSuperscripts}[true]% {\csname FBLowercaseSuperscripts#1\endcsname} \define@key{FB}{PartNameFull}[true]% - {\csname FBPartNameFull#1\endcsname - \ifFBPartNameFull - \else - \FB@addto{captions}{% - \def\partname{Partie\protect\FB@Rpart}}% - \fi}% + {\csname FBPartNameFull#1\endcsname}% \define@key{FB}{CustomiseFigTabCaptions}[true]% {\csname FBCustomiseFigTabCaptions#1\endcsname}% \define@key{FB}{OldFigTabCaptions}[true]% diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua index 172fb8eb82d..685ce072e07 100644 --- a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua +++ b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua @@ -1,5 +1,5 @@ -- --- File `frenchb.lua' generated from frenchb.dtx [2015/04/10 v3.1e] +-- File `frenchb.lua' generated from frenchb.dtx [2015/06/26 v3.1g] -- -- Copyright (C) 2014-2015 Daniel Flipo -- <daniel (dot) flipo (at) free (dot) fr> @@ -34,6 +34,8 @@ local FB_guil_null = local new_node = node.new local copy_node = node.copy local node_id = node.id +local HLIST = node_id("hlist") +local TEMP = node_id("temp") local KERN = node_id("kern") local GLUE = node_id("glue") local GSPEC = node_id("glue_spec") @@ -107,7 +109,8 @@ local function french_punctuation (head) if auto then if (prev_char and FB_punct_null[prev_char]) or (glue and glue_wd <= 1) or - (prev_id == 0 and prev_subtype == 3) then + (prev_id == HLIST and prev_subtype == 3) or + (prev_id == TEMP) then auto = false end end @@ -126,8 +129,14 @@ local function french_punctuation (head) end elseif SIG and SIG > 0 then local addgl = (prev_char and not FB_guil_null[prev_char]) or - (not prev_char) - if glue or addgl then + (not prev_char and + prev_id ~= TEMP and + not (prev_id == HLIST and prev_subtype == 3) + ) + if glue and glue_wd <= 1 then + addgl = false + end + if addgl then if glue then head = remove_node(head,prev,true) end @@ -140,7 +149,7 @@ local function french_punctuation (head) if lang == FR and FB_punct_right[char] and fid > 0 and SIG and SIG > 0 then local next = item.next - local next_id, next_subtype, next_char, kern_wd, nextnext + local next_id, next_subtype, next_char, nextnext, kern_wd if next then next_id = next.id next_subtype = next.subtype @@ -154,7 +163,9 @@ local function french_punctuation (head) next = nextnext next_id = nextnext.id next_subtype = nextnext.subtype - next_char = nextnext.char + if next_id == GLYPH then + next_char = nextnext.char + end end end end @@ -164,10 +175,12 @@ local function french_punctuation (head) glue_spec = next.spec glue_wd = glue_spec.width end - glue = glue and glue_wd > 0 local addgl = (next_char and not FB_guil_null[next_char]) or - (not next_char) - if glue or addgl then + (next and not next_char) + if glue and glue_wd == 0 then + addgl = false + end + if addgl then if glue then head = remove_node(head,next,true) end |