From fe33d3e4cbb440d57dead4cd3a0eeeee5e10188f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 10 Jan 2017 22:28:04 +0000 Subject: babel-french (10jan17) git-svn-id: svn://tug.org/texlive/trunk@42919 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/generic/babel-french/frenchb.dtx | 163 ++++++++++++++------- .../source/generic/babel-french/frenchb.ins | 6 +- 2 files changed, 115 insertions(+), 54 deletions(-) (limited to 'Master/texmf-dist/source/generic/babel-french') diff --git a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx index d476756dad9..06768510249 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{3344} +%\CheckSum{3410} % %\iffalse % Tell the \LaTeX\ system who we are and write an entry on the @@ -13,16 +13,16 @@ %\ProvidesLanguage{frenchb} %\ProvidesFile{frenchb.dtx} %<*!lua> - [2016/05/14 v3.2c French support from the babel system] + [2017/01/10 v3.2e French support from the babel system] % %<*internal> \iffalse % %<*lua> -- --- File `frenchb.lua' generated from frenchb.dtx [2016/05/14 v3.2c] +-- File `frenchb.lua' generated from frenchb.dtx [2017/01/10 v3.2e] -- --- Copyright © 2014-2016 Daniel Flipo +-- Copyright © 2014-2017 Daniel Flipo -- -- License LPPL: see frenchb.ldf. -- @@ -40,7 +40,7 @@ % %<*dtx|ldf> %% Babel package for LaTeX version 2e -%% Copyright © 1996 - 2016 +%% Copyright © 1996 - 2017 %% by Daniel Flipo %% % @@ -284,12 +284,13 @@ % \item In math mode the comma has to be surrounded with % braces to avoid a spurious space being inserted after it, % in decimal numbers for instance (see the \TeX{}book p.~134). -% The command |\DecimalMathComma| makes the comma be an -% ordinary character \emph{in French only} (no space added); +% The command |\DecimalMathComma| makes the comma behave as an +% ordinary character \emph{when the current language is French} +% (no space added); % as a counterpart, if |\DecimalMathComma| is active, an % explicit space has to be added in lists and intervals: % |$[0,\ 1]$|, |$(x,\ y)$|. |\StandardMathComma| switches -% back to the standard behaviour of the comma. +% back to the standard behaviour of the comma in French. % % \item A command |\nombre| was provided in 1.x versions to easily % format numbers in slices of three digits separated either @@ -425,7 +426,7 @@ % 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 -% either |\FBthinspace| (defauts to thin space) before `|;|' +% either |\FBthinspace| (defauts to a thin space) before `|;|' % `|!|' `|?|' or |\FBcolonspace| (defauts to |\space|) before % `|:|'; the defaults follow the French `Imprimerie Nationale's % recommendations. This is convenient in most cases but can lead @@ -451,8 +452,8 @@ % 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'. -% \item [OriginalTypewriter=true (false)] leaves the original -% definitions of |\ttfamily| and |\texttt{}| unchanged. +% \item [OriginalTypewriter=true (false)] prevents any +% customisation of |\ttfamily| and |\texttt{}| in French. % \item [LowercaseSuperscripts=false (true)]; by default \frenchb{} % inhibits the uppercasing of superscripts (for instance when % they are moved to page headers). Making this option @@ -677,8 +678,9 @@ % \item \frenchb{} no longer loads \file{frenchb.cfg}: % customisation should definitely be done using \fbsetup{} % options. -% \item Description lists labels are now indented; set -% |\listendentFB=0pt| to get the former layout. +% \item Description lists labels are now indented; try setting +% |\descindentFB=0pt| (or |\listindentFB=0pt| for all lists) +% in the preamble if you don't like it. % \item The last but not least change affects the (recent) % LuaTeX-based engines, (this means version 0.76 as included in % TL2013 and up): active characters are no longer used in French @@ -1082,14 +1084,14 @@ % a skip (frenchb adds a nobreak penalty before it).} % % \changes{v3.2c}{2016/05/14}{Change .16667em to -% .5\cs{fontdimen2}\cs{font} in \cs{FBthinspace} -% to get a real thinspace with every font.} +% .5\cs{fontdimen2}\cs{font} to get in XeTeX and pdfTeX +% the same spacing as in LuaTeX.} % % According to the I.N.\ specifications, the `:' requires an % inter-word space before it, the other three require just -% a |\thinspace|. We define |\FBcolonspace| as |\space| -% (inter-word space) and |\FBthinspace| as |\thinspace| (both -% are user customisable). +% a thin space. We define |\FBcolonspace| as |\space| +% (inter-word space) and |\FBthinspace| as an half inter-word space +% with no shrink nor stretch, both are user customisable. % \begin{macrocode} \newcommand*{\FBcolonspace}{\space} \newcommand*{\FBthinspace}{\hskip.5\fontdimen2\font \relax} @@ -1102,9 +1104,12 @@ % \changes{v3.0a}{2014/01/10}{LuaTeX requires dimensions: two new skips % \cs{FBcolonskip} and \cs{FBthinskip}.} % +% \changes{v3.2d}{2016/07/03}{Corrected typo in \cs{FBthinskip}: +% 1.66672pt changed to 1.6667pt.} +% % LuaTeX requires skips instead of commands, so we define -% |\FBcolonskip| and |\FBthinskip| to hold the specifications -% (width/stretch/shrink) of |\space| and |\thinspace| for the +% |\FBcolonskip| and |\FBthinskip| to hold the width/stretch/shrink +% specifications of |\FBcolonspace| and |\FBthinspace| for the % |lmr10| font; these parameters will be scaled for the current font % by the \file{frenchb.lua} script (see how p.~\pageref{lua-scaling}). % |\FBcolonskip| and |\FBthinskip| are also user customisable. @@ -1112,7 +1117,7 @@ \newskip\FBcolonskip \FBcolonskip=3.33pt plus 1.665pt minus 1.11pt \relax \newskip\FBthinskip -\FBthinskip=1.66672pt \relax +\FBthinskip=1.6667pt \relax % \end{macrocode} % \end{macro} % \end{macro} @@ -1320,7 +1325,7 @@ local remove_node = node.remove local thin10 = tex.skip['FBthinskip'] local thinwd = thin10.width/65536/3.33 local thinst = thin10.stretch/65536/1.665 -local thinsh = thin10.shrink/655.36/1.11 +local thinsh = thin10.shrink/65536/1.11 local coln10 = tex.skip['FBcolonskip'] local colnwd = coln10.width/65536/3.33 local colnst = coln10.stretch/65536/1.665 @@ -1373,7 +1378,7 @@ local function new_glue_scaled (fid,width,stretch,shrink) end % \end{macrocode} % Let's catch LuaTeX attributes |\FB@spacing|, |\FB@addDPspace| -% and |\FB@addGUILspace|. Constant |FR=lang.id(french)| will be +% and |\FB@addGUILspace|. Constant |FR=lang.id(french)| is % defined by command |\activate@luatexpunct|. % \begin{macrocode} local FBspacing = luatexbase.attributes['FB@spacing'] @@ -2100,7 +2105,7 @@ return french_punctuation % is added before the four |; : ! ?| characters, even if % \fbo{AutoSpacePunctuation} is \fbo{true}. When % \fbo{AutoSpacePunctuation} is \fbo{false}, the eventually typed -% spaces are left unchanged (not turned into thinspaces, no penalty +% spaces are left unchanged (not turned into thin spaces, no penalty % added). |\rmfamily| and |\sffamily| need to be redefined also % (|\ttfamily| is not always used inside a group, its effect can be % cancelled by |\rmfamily| or |\sffamily|). @@ -2882,34 +2887,65 @@ return french_punctuation % \subsection{Formatting numbers} % \label{ssec-numbers} % -% \begin{macro}{\DecimalMathComma} % \begin{macro}{\StandardMathComma} +% \begin{macro}{\DecimalMathComma} % As mentioned in the \TeX{}book p.~134, the comma is of type % |\mathpunct| in math mode: it is automatically followed by a -% space. This is convenient in lists and intervals but +% thin space. This is convenient in lists and intervals but % unpleasant when the comma is used as a decimal separator % in French: it has to be entered as |{,}|. % |\DecimalMathComma| makes the comma be an ordinary character % (of type |\mathord|) in French \emph{only} (no space added); % |\StandardMathComma| switches back to the standard behaviour % of the comma. +% +% \changes{v3.2e}{2017/01/09}{\cs{DecimalMathComma} didn’t work +% with LuaTeX. Fixed now.} +% +% Unfortunately, |\newcount| inside |\if| breaks Plain formats. % \begin{macrocode} +\newcount\mc@charclass +\newcount\mc@charfam +\newcount\mc@charslot \newcount\std@mcc \newcount\dec@mcc -\std@mcc=\mathcode`\, -\dec@mcc=\std@mcc -\@tempcnta=\std@mcc -\divide\@tempcnta by "1000 -\multiply\@tempcnta by "1000 -\advance\dec@mcc by -\@tempcnta -\newcommand*{\DecimalMathComma}{\iflanguage{french}% - {\mathcode`\,=\dec@mcc}{}% - \FB@addto{extras}{\mathcode`\,=\dec@mcc}% +\ifFBLuaTeX + \mc@charclass=\Umathcharclass`\, +\else + \std@mcc=\mathcode`\, + \dec@mcc=\std@mcc + \@tempcnta=\std@mcc + \divide\@tempcnta by "1000 + \multiply\@tempcnta by "1000 + \advance\dec@mcc by -\@tempcnta +\fi +\newcommand*{\dec@math@comma}{% + \ifFBLuaTeX + \mc@charfam=\Umathcharfam`\, + \mc@charslot=\Umathcharslot`\, + \Umathcode`\,= 0 \mc@charfam \mc@charslot + \else + \mathcode`\,=\dec@mcc + \fi } -\newcommand*{\StandardMathComma}{\mathcode`\,=\std@mcc - \FB@addto{extras}{\mathcode`\,=\std@mcc}% +\newcommand*{\std@math@comma}{% + \ifFBLuaTeX + \mc@charfam=\Umathcharfam`\, + \mc@charslot=\Umathcharslot`\, + \Umathcode`\,= \mc@charclass \mc@charfam \mc@charslot + \else + \mathcode`\,=\std@mcc + \fi +} +\newcommand*{\DecimalMathComma}{% + \iflanguage{french}{\dec@math@comma}{}% + \FB@addto{extras}{\dec@math@comma}% } -\FB@addto{noextras}{\mathcode`\,=\std@mcc} +\newcommand*{\StandardMathComma}{% + \std@math@comma + \FB@addto{extras}{\std@math@comma}% +} +\FB@addto{noextras}{\std@math@comma} % \end{macrocode} % \end{macro} % \end{macro} @@ -4426,21 +4462,28 @@ return french_punctuation % \end{macro} % % \begin{macro}{\listindentFB} +% \begin{macro}{\descindentFB} % \begin{macro}{\labelwidthFB} -% Let's define two lengths |\listindentFB| and |\labelwidthFB| to -% customise lists' horizontal indentations. They are given -% silly values here ($-1$\,pt) in order to eventually +% Let's define three lengths |\listindentFB|, |\descindentFB| and +% |\labelwidthFB| to customise lists' horizontal indentations. +% They are given silly values here ($-1$\,pt) in order to eventually % enable their customisation in the preamble. They will get % reasonnable defaults later when entering French (see % |\bbl@frenchlabelitems|) unless they have been customised. % \begin{macrocode} \newlength\listindentFB \setlength{\listindentFB}{-1pt} +\newlength\descindentFB +\setlength{\descindentFB}{-1pt} \newlength\labelwidthFB \setlength{\labelwidthFB}{-1pt} % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} +% +% \changes{v3.2e}{2016/10/28}{Add missing redefinitions for +% \cs{leftmarginv}, \cs{leftmarginvi}. Suggested by J.F. Burnol.} % % \begin{macro}{\FB@listHsettings} % \begin{macro}{\leftmarginFB} @@ -4453,12 +4496,11 @@ return french_punctuation \def\FB@listHsettings{% \leftmarginFB\labelwidthFB \advance\leftmarginFB \labelsep - \leftmargini\leftmarginFB + \bbl@for\FB@dp {1, 2, 3, 4, 5, 6}% + {\csname leftmargin\romannumeral\FB@dp\endcsname \leftmarginFB}% \advance\leftmargini \listindentFB - \leftmarginii\leftmarginFB - \leftmarginiii\leftmarginFB - \leftmarginiv\leftmarginFB - \leftmargin\csname leftmargin\romannumeral\the\@listdepth\endcsname + \leftmargin\csname leftmargin\ifnum\@listdepth=\@ne i\else + ii\fi\endcsname } % \end{macrocode} % \end{macro} @@ -4538,6 +4580,9 @@ return french_punctuation \setlength{\listindentFB}{\parindent}% \fi \fi + \ifdim\descindentFB<\z@ + \setlength{\descindentFB}{\listindentFB}% + \fi } % \end{macrocode} % @@ -4569,12 +4614,20 @@ return french_punctuation % \changes{v2.6b}{2013/02/10}{Settings of \cs{FB@listHsettings} should % apply to description lists too.} % -% \changes{v3.0a}{2014/02/28}{Add \cs{listindentFB} to +% \changes{v3.0a}{2014/02/28}{Added \cs{listindentFB} to % \cs{itemindent}. Suggested by Denis Bitouzé.} % -% Same tuning for the \env{description} environment (see the -% original definition in \file{classes.dtx}). Customisable -% |\listindentFB| added to |\itemindent| (first level only). +% \changes{v3.2d}{2014/07/01}{Changed \cs{listindentFB} to +% \cs{descindentFB} which defaults to \cs{listindentFB}. +% \cs{leftmargini} reduced when \cs{descindentFB} is null.} +% +% Same tuning for the \env{description} environment (see +% \file{classes.dtx} for the original definition). +% Customisable length |\descindentFB|, which defaults to +% |\listindentFB|, is added to |\itemindent| (first level only). +% When |\descindentFB=0pt| (1rst level labels start at the left +% margin), |\leftmargini| is reduced to |\listindentFB| instead +% of |\listindentFB| + |\leftmarginFB|. % % \begin{macrocode} \def\descriptionFB{% @@ -4582,7 +4635,15 @@ return french_punctuation \labelwidth\z@ \itemindent-\leftmargin \ifnum\@listdepth=1 - \advance\itemindent by \listindentFB + \ifdim\descindentFB=\z@ + \ifdim\listindentFB>\z@ + \leftmargini\listindentFB + \leftmargin\leftmargini + \itemindent-\leftmargin + \fi + \else + \advance\itemindent by \descindentFB + \fi \fi \let\makelabel\descriptionlabel}% } diff --git a/Master/texmf-dist/source/generic/babel-french/frenchb.ins b/Master/texmf-dist/source/generic/babel-french/frenchb.ins index 0d55a2e6c8c..7ac0e63db5c 100644 --- a/Master/texmf-dist/source/generic/babel-french/frenchb.ins +++ b/Master/texmf-dist/source/generic/babel-french/frenchb.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 2001-2016 Daniel Flipo. All rights reserved. +%% Copyright 2001-2017 Daniel Flipo. All rights reserved. %% %% This file is part of the Babel system, release 3.9. %% --------------------------------------------------- @@ -14,7 +14,7 @@ %% %% --------------- start of docstrip commands ------------------ %% -\def\filedate{2016/01/02} +\def\filedate{2017/01/09} \def\batchfile{frenchb.ins} \input docstrip.tex @@ -67,7 +67,7 @@ extension .ins) which are part of the distribution. This is a generated file. -Copyright 2001-2016 Daniel Flipo. All rights reserved. +Copyright 2001-2017 Daniel Flipo. All rights reserved. This file is part of the Babel system, release 3.9. --------------------------------------------------- -- cgit v1.2.3