summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/babel-contrib/french/frenchb.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-01-03 03:01:37 +0000
committerNorbert Preining <norbert@preining.info>2023-01-03 03:01:37 +0000
commit660cf44d2a0aee74bd6e69615fedfc57c966a260 (patch)
tree3e62bc2b2f8208c4abcad9423ee2efa266fa8c7b /macros/latex/contrib/babel-contrib/french/frenchb.dtx
parent4841af990664e40ab2f20099d8b39dabacf5ad0f (diff)
CTAN sync 202301030301
Diffstat (limited to 'macros/latex/contrib/babel-contrib/french/frenchb.dtx')
-rw-r--r--macros/latex/contrib/babel-contrib/french/frenchb.dtx130
1 files changed, 87 insertions, 43 deletions
diff --git a/macros/latex/contrib/babel-contrib/french/frenchb.dtx b/macros/latex/contrib/babel-contrib/french/frenchb.dtx
index 11036d0c9c..441b411aee 100644
--- a/macros/latex/contrib/babel-contrib/french/frenchb.dtx
+++ b/macros/latex/contrib/babel-contrib/french/frenchb.dtx
@@ -11,7 +11,7 @@
%<frenchb>\ProvidesLanguage{frenchb}
%<lua>--[[
%<lua> File `frenchb.lua’ generated from frenchb.dtx
- [2022/11/11 v3.5o French support from the babel system]
+ [2023/01/02 v3.5p French support from the babel system]
%<*internal>
\iffalse
%</internal>
@@ -82,7 +82,7 @@
\let\Module\meta % no math mode (see doc.sty)
\renewcommand*\descriptionlabel[1]{%
\hspace{\labelsep}\normalfont \fbo{#1}}
-\let\up\textsuperscript
+\NewCommandCopy{\up}{\textsuperscript}
\newcommand*{\FRguillspace}{\penalty 10000
\hskip.8\fontdimen2\font
plus.3\fontdimen3\font
@@ -318,8 +318,8 @@
% 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
+% explicit thin space has to be added in lists and intervals:
+% |$(x,\,y)$|, |$[0,\,1]$|. |\StandardMathComma| switches
% back to the standard behaviour of the comma in French.
%
% The \pkg{icomma} package is an alternative workaround.
@@ -1458,8 +1458,8 @@
\ifFB@luatex@punct
\edef\bbl@tempa{\detokenize\expandafter{\languagename}}%
\edef\bbl@tempb{\detokenize{french}}%
- \ifx\bbl@tempa\bbl@tempb \FB@dialect=0 \relax
- \else \FB@dialect=1 \relax
+ \ifx\bbl@tempa\bbl@tempb \FB@dialect=\z@
+ \else \FB@dialect=\@ne
\fi
% \end{macrocode}
% When first entering French, we must set the LuaTeX
@@ -1528,8 +1528,8 @@
% any engine (up to version 3.2b, results were engine dependent).
% \begin{macrocode}
\ifFB@luatex@punct
- \newcommand*{\FB@spacing@on}{\FB@spacing=1 \relax}
- \newcommand*{\FB@spacing@off}{\FB@spacing=0 \relax}
+ \newcommand*{\FB@spacing@on}{\FB@spacing=\@ne}
+ \newcommand*{\FB@spacing@off}{\FB@spacing=\z@}
\else
\newcommand*{\FB@spacing@on}{\FB@spacingtrue}
\newcommand*{\FB@spacing@off}{\FB@spacingfalse}
@@ -1602,11 +1602,11 @@
% which parts of the glue table (|.fr| or |.ac|) are taken into
% account.
% \begin{macrocode}
- \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
- \newattribute\FB@dialect \FB@dialect=0 \relax
+ \newattribute\FB@spacing \FB@spacing=\@ne
+ \newattribute\FB@addDPspace \FB@addDPspace=\@ne
+ \newattribute\FB@addGUILspace \FB@addGUILspace=\z@
+ \newattribute\FB@ucsNBSP \FB@ucsNBSP=\z@
+ \newattribute\FB@dialect \FB@dialect=\z@
\ifLaTeXe
\PackageInfo{french.ldf}{No need for active punctuation
characters\MessageBreak with this version
@@ -2421,7 +2421,7 @@ return french_punctuation
% |\NoAutoSpacing|; this flag is also set to false when the current
% font is a typewriter font).
% \begin{macrocode}
- \XeTeXinterchartokenstate=1
+ \XeTeXinterchartokenstate=\@ne
\XeTeXcharclass `\: = \FB@punctthick
\XeTeXinterchartoks \z@ \FB@punctthick = {%
\ifFB@spacing\ifhmode\FDP@colonspace\fi\fi}%
@@ -2656,11 +2656,11 @@ 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
+ \ifFB@luatex@punct \FB@addDPspace=\@ne \fi
\def\FDP@thinspace{\penalty\@M\FBthinspace}%
\def\FDP@colonspace{\penalty\@M\FBcolonspace}}
\def\noautospace@beforeFDP{%
- \ifFB@luatex@punct\FB@addDPspace=0 \fi
+ \ifFB@luatex@punct \FB@addDPspace=\z@ \fi
\let\FDP@thinspace\@empty
\let\FDP@colonspace\@empty}
\ifLaTeXe
@@ -2838,11 +2838,11 @@ return french_punctuation
\newif\ifFBucsNBSP
\ifFB@luatex@punct
\DeclareRobustCommand*{\@FB@og}{\leavevmode
- \bgroup\FB@spacing=0 \guillemotleft\egroup
+ \bgroup\FB@spacing=\z@ \guillemotleft\egroup
\ifFBucsNBSP\FBgspchar\else\FB@guillspace\fi}
\DeclareRobustCommand*{\@FB@fg}{\ifdim\lastskip>\z@\unskip\fi
\ifFBucsNBSP\FBgspchar\else\FB@guillspace\fi
- \bgroup\FB@spacing=0 \guillemotright\egroup}
+ \bgroup\FB@spacing=\z@ \guillemotright\egroup}
\fi
% \end{macrocode}
% With XeTeX, |\ifFB@spacing| is set to |false| locally for the
@@ -3046,17 +3046,20 @@ return french_punctuation
% \changes{v3.5e}{2019/03/23}{reset \cs{FB@addGUILspace} attribute
% inside \cs{localleftbox} (LuaTeX).}
%
+% \changes{v3.5p}{2022/12/04}{\cs{FBeveryline@quote}: no need for
+% a penalty inside a \cs{localleftbox}.}
+%
% \begin{macrocode}
\ifx\FBeverylineguill\FBguillopen
- \def\FBeveryline@quote{\FB@addGUILspace=0 \guillemotleft
- \FB@guillspace}%
+ \def\FBeveryline@quote{\FB@addGUILspace=\z@
+ \guillemotleft\FBguillspace}%
\localleftbox{\FBeveryline@quote}%
\let\FBeverypar@quote\relax
\@ogi #1\ifFBcloseguill\@fgi\fi
\else
\ifx\FBeverylineguill\FBguillclose
- \def\FBeveryline@quote{\FB@addGUILspace=0 \guillemotright
- \FB@guillspace}%
+ \def\FBeveryline@quote{\FB@addGUILspace=\z@
+ \guillemotright\FBguillspace}%
\localleftbox{\FBeveryline@quote}%
\let\FBeverypar@quote\relax
\@ogi #1\ifFBcloseguill\@fgi\fi
@@ -3585,6 +3588,10 @@ return french_punctuation
% \changes{v3.5f}{2019/09/07}{Fixed bug with the acadian language.
% Warning added if used with the icomma package.}
%
+% \changes{v3.5p}{2023/01/02}{\cs{DecimalMathComma} can again be
+% used in the preamble for a global action. It now works as
+% expected inside a group.}
+%
% Unfortunately, |\newcount| inside |\if| breaks Plain formats.
% \begin{macrocode}
\newif\ifFB@icomma
@@ -3615,19 +3622,30 @@ return french_punctuation
\newcommand*{\dec@math@comma}{\mathcode`\,=\dec@mcc}
\newcommand*{\std@math@comma}{\mathcode`\,=\std@mcc}
\fi
+\let\dec@m@c\relax
% \end{macrocode}
-% |\DecimalMathComma| operates in French or Acadian independently.
+% If |\DecimalMathComma| is issued in the document body
+% (when the current language is French or Acadian) its effect will
+% survive to a language switch, unless issued inside a group
+% (see |\dec@m@c|’s expansion).
+% The \pkg{icomma} inhibits |\DecimalMathComma|.
% \begin{macrocode}
+\newif\if@FBpreamble \ifLaTeXe \@FBpreambletrue \fi
+\newif\if@preamble@DecimalMathComma
\newcommand*{\DecimalMathComma}{%
- \ifFB@icomma
- \PackageWarning{french.ldf}{%
- icomma package loaded, \protect\DecimalMathComma\MessageBreak
- does nothing. Reported}%
+ \if@FBpreamble \@preamble@DecimalMathCommatrue
\else
- \ifFBfrench
- \dec@math@comma
- \expandafter\addto\csname extras\languagename\endcsname
- {\dec@math@comma}%
+ \ifFB@icomma
+ \PackageWarning{french.ldf}{%
+ icomma package loaded, \protect\DecimalMathComma\MessageBreak
+ does nothing. Reported}%
+ \else
+ \ifFBfrench
+ \dec@math@comma
+ \let\dec@m@c\dec@math@comma
+ \expandafter\addto\csname extras\languagename\endcsname
+ {\dec@m@c}%
+ \fi
\fi
\fi
}
@@ -3637,19 +3655,45 @@ return french_punctuation
icomma package loaded, \protect\StandardMathComma\MessageBreak
does nothing. Reported}%
\else
- \std@math@comma
- \expandafter\addto\csname extras\languagename\endcsname
- {\std@math@comma}%
+ \ifFBfrench
+ \std@math@comma
+ \let\dec@m@c\relax
+ \fi
\fi
}
+% \end{macrocode}
+% Ii issued in the preamble, |\DecimalMathComma| works globally on
+% all parts of the document that are typeset in a French dialect.
+% Can be canceled anytime by |\StandardMathComma|.
+% \begin{macrocode}
\ifLaTeXe
- \AtBeginDocument{\@ifpackageloaded{icomma}%
- {\FB@icommatrue}%
- {\addto\noextrasfrench{\std@math@comma}%
- \ifdefined\noextrasacadian
- \addto\noextrasacadian{\std@math@comma}%
- \fi
- }%
+ \AtBeginDocument{%
+ \@FBpreamblefalse
+ \@ifpackageloaded{icomma}%
+ {\FB@icommatrue
+ \if@preamble@DecimalMathComma
+ \PackageWarning{french.ldf}{%
+ icomma package loaded, \protect\DecimalMathComma%
+ \MessageBreak does nothing. Reported}%
+ \fi
+ }%
+ {\if@preamble@DecimalMathComma
+ \ifFB@mainlanguage@FR \dec@math@comma \fi
+ \let\dec@m@c\dec@math@comma
+ \addto\extrasfrench{\dec@m@c}%
+ \ifdefined\extrasacadian
+ \addto\extrasacadian{\dec@m@c}%
+ \fi
+ \fi
+% \end{macrocode}
+% The comma is reset to type |\mathpunct| when leaving French
+% dialects (only if the icomma package is not loaded).
+% \begin{macrocode}
+ \addto\noextrasfrench{\std@math@comma}%
+ \ifdefined\noextrasacadian
+ \addto\noextrasacadian{\std@math@comma}%
+ \fi
+ }%
}
\else
\addto\noextrasfrench{\std@math@comma}
@@ -4673,7 +4717,7 @@ return french_punctuation
\define@key{FB}{UnicodeNoBreakSpaces}[true]%
{\ifFB@luatex@punct
\csname FBucsNBSP#1\endcsname
- \ifFBucsNBSP \FB@ucsNBSP=1 \fi
+ \ifFBucsNBSP \FB@ucsNBSP=\@ne \fi
\else
\FBWarning{Option `UnicodeNoBreakSpaces' skipped:%
\MessageBreak this option is for
@@ -5510,7 +5554,7 @@ return french_punctuation
\itemindent=\descindentFB
\else
\itemindent=-\leftmargin
- \ifnum\@listdepth=1
+ \ifnum\@listdepth=\@ne
\ifdim\descindentFB=\z@
\ifdim\listindentFB>\z@
\leftmargini=\listindentFB