texlive[46493] Master/texmf-dist: babel-french (30jan18)
commits+karl at tug.org
commits+karl at tug.org
Tue Jan 30 22:04:29 CET 2018
Revision: 46493
http://tug.org/svn/texlive?view=revision&revision=46493
Author: karl
Date: 2018-01-30 22:04:29 +0100 (Tue, 30 Jan 2018)
Log Message:
-----------
babel-french (30jan18)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/generic/babel-french/README
trunk/Master/texmf-dist/doc/generic/babel-french/frenchb.pdf
trunk/Master/texmf-dist/source/generic/babel-french/frenchb.dtx
trunk/Master/texmf-dist/source/generic/babel-french/frenchb.ins
trunk/Master/texmf-dist/tex/generic/babel-french/acadian.ldf
trunk/Master/texmf-dist/tex/generic/babel-french/canadien.ldf
trunk/Master/texmf-dist/tex/generic/babel-french/francais.ldf
trunk/Master/texmf-dist/tex/generic/babel-french/french.ldf
trunk/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf
trunk/Master/texmf-dist/tex/generic/babel-french/frenchb.lua
Modified: trunk/Master/texmf-dist/doc/generic/babel-french/README
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/generic/babel-french/frenchb.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/generic/babel-french/frenchb.dtx
===================================================================
--- trunk/Master/texmf-dist/source/generic/babel-french/frenchb.dtx 2018-01-30 21:04:11 UTC (rev 46492)
+++ trunk/Master/texmf-dist/source/generic/babel-french/frenchb.dtx 2018-01-30 21:04:29 UTC (rev 46493)
@@ -1,4 +1,4 @@
-%\CheckSum{3545}
+%\CheckSum{3593}
%
%\iffalse
% Tell the \LaTeX\ system who we are and write an entry on the
@@ -13,12 +13,12 @@
%<frenchb>\ProvidesLanguage{frenchb}
%<lua>--[[
%<lua> File `frenchb.lua’ generated from frenchb.dtx
- [2017/10/19 v3.3d French support from the babel system]
+ [2018/01/30 v3.4a French support from the babel system]
%<*internal>
\iffalse
%</internal>
%<*lua>
- Copyright © 2014-2017 Daniel Flipo
+ Copyright © 2014-2018 Daniel Flipo
<daniel (dot) flipo (at) free (dot) fr>
License LPPL: see french.ldf.
--]]
@@ -32,7 +32,7 @@
%<*dtx|french>
%%
%% Babel package for LaTeX version 2e
-%% Copyright © 1996 - 2017
+%% Copyright © 1996-2018
%% by Daniel Flipo <daniel (dot) flipo (at) free (dot) fr>
%%
%</dtx|french>
@@ -265,6 +265,11 @@
% character (the outer one) as recommended by the French
% `Imprimerie Nationale’.
%
+% \item |\frenchdate|\marg{year}\marg{month}\marg{day} helps
+% typesetting dates in French: |\frenchdate{2001}{01}{01}|
+% will print 1\up{er} janvier 2001 in a box without any
+% linebreak.
+%
% \item A command |\up| is provided to typeset superscripts like
% |M\up{me}| (abbreviation for ``Madame’’), |1\up{er}| (for
% ``premier’’). Other commands are also provided for
@@ -518,7 +523,7 @@
% after opening French quotes and before closing French quotes to
% the French `Imprimerie Nationale’ standards (inter-word space).
% \frenchb’s default setting produces slightly narrower spaces
-% with lesser stretchability.
+% with less stretchability.
% \item [EveryParGuill=open, close, none (open)]; sets whether
% an opening quote (\texttt{«}) or a closing one (\texttt{»}) or
% nothing should be printed by |\frquote{}| at the beginning of
@@ -582,8 +587,9 @@
% \label{sssec-captions-name}
%
% All caption names can easily be customised in French using the
-% simplified syntax introduced by \babel~3.9, for instance:
-% |\def\frenchproofname{Preuve}|.
+% simplified syntax introduced by \babel~3.9, for instance
+% |\def\frenchproofname{Preuve}| or
+% |\def\acadianproofname{Preuve}| for the \Lopt{acadian} dialect.
% 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
@@ -639,11 +645,11 @@
% for Unix machines, |ansinew| for PCs running~Windows,
% |applemac| or |latin1| for Macintoshs, or |utf8|\dots\\[3mm]^^A\]
% |%%% Test file for French hyphenation.|\\
-% |\documentclass{article}|\\
+% |\documentclass[french]{article}|\\
% |\usepackage[|\textit{my-encoding}|]{inputenc}|\\
% |\usepackage[T1]{fontenc} % Use LM fonts|\\
% |\usepackage{lmodern} % for French|\\
-% |\usepackage[frenchb]{babel}|\\
+% |\usepackage{babel}|\\
% |\begin{document}|\\
% |\showhyphens{signal container \'ev\'enement alg\`ebre}|\\
% |\showhyphens{signal container événement algèbre}|\\
@@ -674,6 +680,25 @@
% \subsection{Changes}
% \label{ssec-changes}
%
+% \subsubsection*{What’s new in version 3.4?}
+%
+% Version 3.4a adds a new command |\frenchdate| (see
+% p.~\pageref{sssec-date}) and slightly changes number formatting:
+% |\FBthousandsep| is now a \textit{kern} instead of a rubber
+% length. |\renewcommand*{\FBthousandsep}{~}| will switch back
+% to the former (wrong) behaviour.
+%
+% Both options \Lopt{french} and \Lopt{acadian} can now be used
+% simultaneously in a document; currently \Lopt{french} and
+% \Lopt{acadian} are identical, it is up to the user to customise
+% \Lopt{acadian} in terms of hyphenation patterns, captionnames,
+% date format or high punctuation and quotes spacing if he/she
+% needs a variant for French.
+%
+% A new command |\FBsetspaces| has been added for easy customising of
+% spacing before high punctuation and inside quotes independently for
+% \Lopt{french} and \Lopt{acadian}, see p.~\pageref{FBsetspaces}.
+%
% \subsubsection*{What’s new in version 3.3?}
%
% In version~3.3d the automatic insertion of non-breaking spaces
@@ -697,6 +722,8 @@
% 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.
+% BTW, options \Lopt{french} and \Lopt{acadian} are currently
+% strictly identical.
%
% Release 3.3a is compatible with LuaTeX v.~0.95 (TL2016) and up.
% Former skips |\FBcolonskip|, |\FBthinskip| and |\FBguillskip|
@@ -824,63 +851,23 @@
% \changes{v3.0a}{2014/02/28}{Support for options frenchb, francais,
% canadien, acadian changed.}
%
-% \changes{v3.0a}{2014/02/19}{\cs{LdfInit} checks \cs{datefrench}
-% instead of \cs{captionsfrench} to avoid a conflict with
-% papertex.cls which loads datetime.sty.}
+% \changes{v3.0a}{2014/02/19}{\cs{LdfInit} checks \cs{captionsfrench}
+% instead of \cs{datefrench} to avoid a conflict with papertex.cls
+% which loads datetime.sty.}
%
+% \changes{v3.4a}{2018/01/14}{\cs{LdfInit} checks \cs{FBclean at on@exit}
+% instead of \cs{captionsfrench} (undefined in PLain).
+% Prevents loading french.ldf again with acadian option.}
+%
% The macro |\LdfInit| takes care of preventing that this file is
-% loaded more than once, checking the category code of the
-% \texttt{@} sign, etc.
+% loaded more than once (even if both options \Lopt{french} and
+% \Lopt{acadian} are used in the same document), checking the
+% category code of the \texttt{@} sign, etc.
%
% \begin{macrocode}
-\LdfInit\CurrentOption\captionsfrench
+\LdfInit\CurrentOption{FBclean at on@exit}
% \end{macrocode}
%
-% \changes{v3.0c}{2014/03/30}{No need to define \cs{l at french} as
-% \cs{lang at french}, babel.def (3.9j) takes care for this.}
-%
-% Make sure that |\l at french| is defined (possibly as 0).
-% \file{babel.def} now (3.9i) defines |\l@<languagename>| also for
-% eTeX, LuaTeX and XeTeX formats which set |\lang@<languagename>|.
-% \begin{macrocode}
-\def\FB at nopatterns{%
- \ifx\l at nohyphenation\@undefined
- \edef\bbl at nulllanguage{\string\language=0}%
- \adddialect\l at french0
- \else
- \adddialect\l at french\l at nohyphenation
- \edef\bbl at nulllanguage{\string\language=nohyphenation}%
- \fi
- \@nopatterns{French}}
-\ifx\l at french\@undefined
- \FB at nopatterns
-\fi
-% \end{macrocode}
-%
-% \changes{v2.1d}{2008/05/04}{Avoid warning `\cs{end} occurred
-% when \cs{ifx} ... incomplete’ with LaTeX-2.09.}
-%
-% \begin{macro}{\ifLaTeXe}
-% No support is provided for late \LaTeX-2.09: issue a warning
-% and exit if \LaTeX-2.09 is in use. Plain is still supported.
-% \begin{macrocode}
-\newif\ifLaTeXe
-\let\bbl at tempa\relax
-\ifx\magnification\@undefined
- \ifx\@compatibilitytrue\@undefined
- \PackageError{french.ldf}
- {LaTeX-2.09 format is no longer supported.\MessageBreak
- Aborting here}
- {Please upgrade to LaTeX2e!}
- \let\bbl at tempa\endinput
- \else
- \LaTeXetrue
- \fi
-\fi
-\bbl at tempa
-% \end{macrocode}
-% \end{macro}
-%
% \changes{v3.0a}{2014/02/15}{In Plain, provide a substitute for
% \cs{PackageWarning} and \cs{PackageInfo}.}
%
@@ -907,20 +894,37 @@
\endgroup}
% \end{macrocode}
%
-% \changes{v3.0c}{2014/03/30}{frenchb requires babel-3.9i.}
+% \changes{v3.4a}{2018/01/04}{babel-french now requires eTeX.}
%
+% Quit if eTeX is not available.
+% \begin{macrocode}
+\let\bbl at tempa\relax
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname eTeXversion\endcsname\relax
+ \let\bbl at tempa\endinput
+ \fb at error{babel-french requires eTeX.\\
+ Aborting here}
+ {Orignal PlainTeX is not supported,\\
+ please use LuaTeX or XeTeX engines.}
+\fi
+\bbl at tempa
+% \end{macrocode}
+%
+% \changes{v3.0c}{2014/03/30}{babel-french requires babel-3.9i.}
+%
% Quit if \babel’s version is less than 3.9i.
% \begin{macrocode}
\let\bbl at tempa\relax
-\ifx\babeltags\@undefined
+\ifdefined\babeltags
+\else
\let\bbl at tempa\endinput
- \ifLaTeXe
+ \ifdefined\PackageError
\PackageError{french.ldf}
- {frenchb requires babel v.3.9i.\MessageBreak
+ {babel-french requires babel v.3.16.\MessageBreak
Aborting here}
{Please upgrade Babel!}
\else
- \fb at error{frenchb requires babel v.3.9i.\\
+ \fb at error{babel-french requires babel v.3.16.\\
Aborting here}
{Please upgrade Babel!}
\fi
@@ -928,17 +932,32 @@
\bbl at tempa
% \end{macrocode}
%
+% \changes{v3.0c}{2014/03/30}{No need to define \cs{l at french} as
+% \cs{lang at french}, babel.def (3.9j) takes care for this.}
+%
+% Make sure that |\l at french| is defined (fallbacks are
+% |\l at nohyphenation| if available or~0).
+% \file{babel.def} (3.9i and up) defines |\l@<languagename>| also for
+% eTeX, LuaTeX and XeTeX formats which set |\lang@<languagename>|.
+% \begin{macrocode}
+\def\FB at nopatterns{%
+ \ifdefined\l at nohyphenation
+ \adddialect\l at french\l at nohyphenation
+ \edef\bbl at nulllanguage{\string\language=nohyphenation}%
+ \else
+ \edef\bbl at nulllanguage{\string\language=0}%
+ \adddialect\l at french0
+ \fi
+ \@nopatterns{French}}
+\ifdefined\l at french \else \FB at nopatterns \fi
+% \end{macrocode}
+%
% Babel’s French language can be loaded with option \Lopt{acadian}
% which stands for Canadian French.
% If no specific hyphenation patterns are available, Canadian French
% will use the French ones.
% \begin{macrocode}
-\def\bbl at tempa{acadian}
-\ifx\CurrentOption\bbl at tempa
- \ifx\l at acadian\@undefined
- \adddialect\l at acadian\l at french
- \fi
-\fi
+\ifdefined\l at acadian \else \adddialect\l at acadian\l at french \fi
% \end{macrocode}
%
% French uses the standard values of |\lefthyphenmin| (2)
@@ -946,9 +965,35 @@
% as required by \babel.
%
% \begin{macrocode}
-\expandafter\providehyphenmins\expandafter{\CurrentOption}{\tw@\thr@@}
+\providehyphenmins{french}{\tw@\thr@@}
+\providehyphenmins{acadian}{\tw@\thr@@}
% \end{macrocode}
%
+%\changes{v2.1d}{2008/05/04}{Avoid warning `\cs{end} occurred
+% when \cs{ifx} ... incomplete’ with LaTeX-2.09.}
+%
+% \begin{macro}{\ifLaTeXe}
+% No support is provided for late \LaTeX-2.09: issue a warning
+% and exit if \LaTeX-2.09 is in use. Plain is still supported.
+% \begin{macrocode}
+\newif\ifLaTeXe
+\let\bbl at tempa\relax
+\ifdefined\magnification
+\else
+ \ifdefined\@compatibilitytrue
+ \LaTeXetrue
+ \else
+ \PackageError{french.ldf}
+ {LaTeX-2.09 format is no longer supported.\MessageBreak
+ Aborting here}
+ {Please upgrade to LaTeX2e!}
+ \let\bbl at tempa\endinput
+ \fi
+\fi
+\bbl at tempa
+% \end{macrocode}
+% \end{macro}
+%
%\begin{macro}{\ifFBunicode}
% \begin{macro}{\ifFBLuaTeX}
% \begin{macro}{\ifFBXeTeX}
@@ -970,20 +1015,14 @@
% \changes{v2.6g}{2013/12/15}{lccode values for the French
% `apostrophe’ are now the same for XeTeX and LuaTeX.}
%
-% We cannot rely on \eTeX’s |\ifdefined| at this stage, as it is not
-% defined in Plain \TeX{} format.
% \begin{macrocode}
\newif\ifFBunicode
\newif\ifFBLuaTeX
\newif\ifFBXeTeX
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname luatexversion\endcsname\relax
-\else
+\ifdefined\luatexversion
\FBunicodetrue \FBLuaTeXtrue
\fi
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname XeTeXrevision\endcsname\relax
-\else
+\ifdefined\XeTeXrevision
\FBunicodetrue \FBXeTeXtrue
\fi
% \end{macrocode}
@@ -996,8 +1035,8 @@
%
% \begin{macro}{\ifFBfrench}
% True when the current language is French or any of its dialects;
-% will be set to true by |\extras\CurrentOption| and to false by
-% |\noextras\CurrentOption|. Used in |\DecimalMathComma| and
+% will be set to true by |\extrasfrench| and to false by
+% |\noextrasfrench|. Used in |\DecimalMathComma| and
% |frenchsetup{og=«, fg=»}|.
% \begin{macrocode}
\newif\ifFBfrench
@@ -1008,6 +1047,10 @@
% \changes{v3.0a}{2014/02/18}{Take advantage of babel’s
% \cs{babel at savevariable} to handle apostrophe’s \cs{lccode}.}
%
+% \changes{v3.4a}{2018/01/06}{Change \cs{(no)extras}\cs{CurrentOption}
+% to \cs{(no)extrasfrench}. \cs{(no)extrasacadian} will be defined
+% as \cs{(no)extrasfrench} in file acadian.ldf.}
+%
% \begin{macro}{\noextrasfrench}
% The macro |\extrasfrench| will perform all the extra
% definitions needed for the French language.
@@ -1026,7 +1069,7 @@
% pdfTeX) using \file{hyph-fr.tex} patterns.
%
% \begin{macrocode}
-\@namedef{extras\CurrentOption}{%
+\def\extrasfrench{%
\FBfrenchtrue
\babel at savevariable{\lccode`\'}%
\ifFBunicode
@@ -1036,26 +1079,15 @@
\lccode`\'=`\'
\fi
}
-\@namedef{noextras\CurrentOption}{\FBfrenchfalse}
+\def\noextrasfrench{\FBfrenchfalse}
% \end{macrocode}
%
-% Let’s define a handy command for adding stuff to
-% |\extras\CurrentOption|,\linebreak[0] |\noextras\CurrentOption| or
-% |\captions\CurrentOption| but first let’s save the value of
-% |\CurrentOption| for later use in \fbsetup{} (`AfterEndOfPackage’,
-% |\CurrentOption| will be lost).
-% \begin{macrocode}
-\let\FB at CurOpt\CurrentOption
-\newcommand*{\FB at addto}[2]{%
- \expandafter\addto\csname #1\FB at CurOpt\endcsname{#2}}
-% \end{macrocode}
-%
% One more thing |\extrasfrench| needs to do is to make sure that
% ``Frenchspacing’’ is in effect. |\noextrasfrench| will switch
% ``Frenchspacing’’ off again if necessary.
% \begin{macrocode}
-\FB at addto{extras}{\bbl at frenchspacing}
-\FB at addto{noextras}{\bbl at nonfrenchspacing}
+\addto\extrasfrench{\bbl at frenchspacing}
+\addto\noextrasfrench{\bbl at nonfrenchspacing}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1077,6 +1109,8 @@
% `high punctuation’ management with LuaTeX engines.}
%
% \begin{macro}{\ifFB at active@punct}
+% Three internal flags are needed for the three different techniques
+% used for `high punctuation’ management.
% \begin{macrocode}
\newif\ifFB at active@punct \FB at active@puncttrue
% \end{macrocode}
@@ -1083,9 +1117,6 @@
% \end{macro}
%
% \begin{macro}{\ifFB at luatex@punct}
-% Three internal flags are needed for the three different techniques
-% used for `high punctuation’ management.
-%
% With LuaTeX, starting with version 0.95, callbacks are used to
% get rid of active punctuation. With previous versions, `high
% punctuation’ characters remain active (see below).
@@ -1095,13 +1126,14 @@
\ifnum\luatexversion<95
\ifx\PackageWarning\@undefined
\fb at warning{Please upgrade LuaTeX to version 0.95 or above!\\%
- frenchb will make high punctuation characters (;:!?) active\\%
- with LuaTeX < 0.95.}%
+ babel-french will make high punctuation characters (;:!?)\\%
+ active with LuaTeX < 0.95.}%
\else
\PackageWarning{french.ldf}{Please upgrade LuaTeX
to version 0.95 or above!\MessageBreak
- frenchb will make high punctuation characters\MessageBreak
- (;:!?) active with LuaTeX < 0.95;\MessageBreak reported}%
+ babel-french will make high punctuation characters%
+ \MessageBreak (;:!?) active with LuaTeX < 0.95;%
+ \MessageBreak reported}%
\fi
\else
\FB at luatex@puncttrue\FB at active@punctfalse
@@ -1119,15 +1151,13 @@
% non characters: it’s value will be 4095 for new engines and 255
% for older ones.}
%
-% The number of available character classes has been increased
-% from 256 to 4096 in XeTeX v.~0.99994, the class for
-% non-characters is now 4095 instead of 255.
+% The number of available character classes has been increased from
+% 256 to 4096 in XeTeX v.~0.99994, the class for non-characters is
+% now 4095 instead of 255.
% \begin{macrocode}
\newcount\FB at nonchar
\newif\ifFB at xetex@punct
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname XeTeXinterchartokenstate\endcsname\relax
-\else
+\ifdefined\XeTeXinterchartokenstate
\FB at xetex@puncttrue\FB at active@punctfalse
\ifdim\the\XeTeXversion\XeTeXrevision pt<0.99994pt
\FB at nonchar=255 \relax
@@ -1138,6 +1168,7 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\FBguillspace}
% \begin{macro}{\FBcolonspace}
% \begin{macro}{\FBthinspace}
% \changes{v2.5a}{2010/08/10}{Define \cs{FBthinspace} for those who want
@@ -1148,7 +1179,7 @@
% a conflict with fournier.sty.}
%
% \changes{v3.1f}{2015/05/31}{\cs{FBthinspace} is no longer a kern but
-% a skip (frenchb adds a nobreak penalty before it).}
+% a skip (babel-french adds a nobreak penalty before it).}
%
% \changes{v3.2c}{2016/05/14}{Change .16667em to
% .5\cs{fontdimen2}\cs{font} to get in XeTeX and pdfTeX
@@ -1158,32 +1189,167 @@
% \cs{FBthinskip} replaced by toks \cs{FBcolonsp} and
% \cs{FBthinsp}.}
%
+% These three commands are meant for basic French. Other French
+% dialects can use different settings, see below.
% According to the I.N.\ specifications, the `:’ requires an
% inter-word space before it, the other three require just 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 in the preamble.
+% stretch.
+% |\FBguillspace| is defined btw. as spacing for French quotes is
+% handled together with high punctuation for LuaTeX and XeTeX.
+% |\FBguillspace| has been fine tuned by Thierry Bouche to 80\% of an
+% inter-word space with reduced stretchability.
+% All three are user customisable in the preamble, best using the
+% |\FBsetspaces| command described below.
+% A penalty will be added before these spaces to prevent line
+% breaking.
% \begin{macrocode}
+\newcommand*{\FBguillspace}{\hskip .8\fontdimen2\font
+ plus .3\fontdimen3\font
+ minus .8\fontdimen4\font \relax}
\newcommand*{\FBcolonspace}{\space}
-\newcommand*{\FBthinspace}{\hskip.5\fontdimen2\font \relax}
+\newcommand*{\FBthinspace}{\hskip .5\fontdimen2\font \relax}
% \end{macrocode}
-% These commands will be converted into toks `AtBeginDocument’
-% for LuaTeX.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v3.3a}{2016/04/30}{Skip \cs{FBguillskip} for LuaTeX
+% replaced by toks \cs{FBguillsp}.}
+%
+% \changes{v3.4a}{2018/01/15}{Toks \cs{FBcolonsp}, \cs{FBthinsp} and
+% \cs{FBguillsp} removed.}
+%
+% \changes{v3.4a}{2018/01/26}{New command \cs{FBsetspaces} to fine tune
+% spacing independently in French and in French dialects.}
+%
+% \begin{macro}{\FBsetspaces}
+% This command makes it easy to fine tune |\FBguillspace|,
+% |\FBcolonspace| and |\FBthinspace| in French (defaut) or
+% independently in a French dialect using the optional argument.
+% They are meant for \LaTeXe{} \emph{only} and can only be used
+% in the preamble.
+% Four mandatory arguments are expected besides the optional one:
+% the first one is a \textit{string} either "guill", "colon", or
+% "thin", the last four are decimal numbers specifying
+% \textit{width}, \textit{stretch} and \textit{shrink} relative to
+% \textit{fontdimens}.\hlabel{FBsetspaces}
+% For instance |\FBsetspaces[acadian]{colon}{0.5}{0}{0}| defines
+% |\acadianFBcolonspace| as a thinspace which will be used for
+% the Acadian dialect only. When used without optional argument or
+% with argument `french’, the same command would tune the basic
+% |\FBcolonspace| command.
% \begin{macrocode}
-\newtoks\FBcolonsp
-\newtoks\FBthinsp
+\ifLaTeXe
+ \newcommand*{\FBsetspaces}[5][french]{%
+ \def\bbl at tempa{french}\def\bbl at tempb{#1}%
+ \ifx\bbl at tempa\bbl at tempb \def\bbl at tempb{}\fi
+ \@namedef{\bbl at tempb FB#2space}{\hskip #3\fontdimen2\font
+ plus #4\fontdimen3\font
+ minus #5\fontdimen4\font \relax}%
% \end{macrocode}
+% With option "acadian", fill the corresponding LuaTeX table.
+% All unset values in the "acadian" subtables will be filled
+% `AtBeginDocument’ by |\set at glue@table| with the value available
+% for "french".
+% \begin{macrocode}
+ \ifFB at luatex@punct
+ \ifx\bbl at tempb\FB at acadian
+ \directlua{
+ FBsp.#2.gl.ac[1] = #3
+ FBsp.#2.gl.ac[2] = #4
+ FBsp.#2.gl.ac[3] = #5
+ if #3 > 0.6 then
+ FBsp.#2.ch.ac = 0xA0
+ elseif #3 > 0.2 then
+ FBsp.#2.ch.ac = 0x202F
+ else
+ FBsp.#2.ch.ac = 0x200B
+ end
+ }%
+ \fi
+ \fi
+ }
+ \@onlypreamble\FBsetspaces
+\fi
+% \end{macrocode}
% \end{macro}
-% \end{macro}
%
+% Remember that the \emph{same} |\extrasfrench| command is executed
+% when switching to French or to a French dialect (Acadian).
+% Acadian and French may share the same patterns (or not), and may
+% use different spacing for high punctuation and/or quotes.
+% Basically, for pdfLaTeX and XeLaTeX, the spacing is set for French,
+% then potentially tuned differently for Acadian.
+% LuaTeX relies on an attribute |\FB at dialect| to decide what spacing
+% is needed for French or Acadian (see LuaTeX table |FBsp|).
+% \hlabel{extrapunct}
+% As a rough test on |\languagename| would be unreliable to set the
+% value of |\FB at dialect| (see \file{babel.pdf}), we use a trick
+% based on |\detokenize|; another option would be to use the
+% |\IfLanguageName| command from Oberdiek’s package \file{iflang}.
+% \begin{macrocode}
+\ifLaTeXe
+ \addto\extrasfrench{%
+ \ifFB at luatex@punct
+ \edef\bbl at tempa{\detokenize\expandafter{\languagename}}%
+ \edef\bbl at tempb{\detokenize{french}}%
+ \ifx\bbl at tempa\bbl at tempb \FB at dialect=0 \relax
+ \else \FB at dialect=1 \relax
+ \fi
+% \end{macrocode}
+% The first time whe enter French, we have to set the LuaTeX
+% tables for French (|\FB at dialet=0|) \emph{before} any dialect
+% redefines any |\FB...space| command. Doing this `AtBeginDocument’
+% would be too late: if French or a French dialect is the main
+% language, |\extrasfrench| has been executed before!
+% \begin{macrocode}
+ \ifdefined\FB at once\else
+ \set at glue@table{FBcolonspace}{colon}%
+ \set at glue@table{FBthinspace}{thin}%
+ \set at glue@table{FBguillspace}{guill}%
+ \def\FB at once{}%
+ \fi
+ \fi
+% \end{macrocode}
+% Any dialect dependent customisation done using
+% |\FBsetspaces[|\textit{dialect}|]| command or alike is now
+% taken into account: the value of |\FBthinspace| (meant for French,
+% i.e.|\FB at dialect=0|) is first saved then changed (for Acadian).
+% \begin{macrocode}
+ \ifcsname\languagename FBthinspace\endcsname
+ \babel at save\FBthinspace
+ \renewcommand*{\FBthinspace}{%
+ \csname\languagename FBthinspace\endcsname}%
+ \fi
+% \end{macrocode}
+% Same for |\FBcolonspace|:
+% \begin{macrocode}
+ \ifcsname\languagename FBcolonspace\endcsname
+ \babel at save\FBcolonspace
+ \renewcommand*{\FBcolonspace}{%
+ \csname\languagename FBcolonspace\endcsname}%
+ \fi
+% \end{macrocode}
+% And for |\FBguillspace|:
+% \begin{macrocode}
+ \ifcsname\languagename FBguillspace\endcsname
+ \babel at save\FBguillspace
+ \renewcommand*{\FBguillspace}{%
+ \csname\languagename FBguillspace\endcsname}%
+ \fi
+ }
+\fi
+% \end{macrocode}
+%
% \changes{v3.2c}{2016/05/14}{Newif \cs{ifFB at spacing} and new commands
% \cs{FB at spacingon}, \cs{FB at spacingoff} to control space tuning in
% French.}
%
-% With LuaTeX and XeTeX engines, \frenchb{} handles French quotes
-% together with `high punctuation’; the conditional |\ifFB at spacing|
-% will be used by PdfTeX and XeTeX engines to switch on or off space
-% tuning before high punctuation and inside French quotes.
+% The conditional |\ifFB at spacing| will be used by pdfTeX and XeTeX
+% engines to switch on or off space tuning before high punctuation
+% and inside French quotes.
% A matching attribute will be defined later for LuaTeX.
% \begin{macrocode}
\newif\ifFB at spacing \FB at spacingtrue
@@ -1242,34 +1408,47 @@
% \changes{v3.3a}{2017/04/30}{Compatibility code for pre
% 2015/10/01 LaTeX release removed, see ltnews23.tex.}
%
-% We define three LuaTeX attributes to control spacing in French
-% for `high punctuation’ and quotes, making sure that
-% |\newattribute| is defined.
+% \changes{v3.4a}{2018/01/15}{New attribute \cs{FB at dialect} for the
+% French dialect acadian.}
+%
% \begin{macrocode}
\ifFB at luatex@punct
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname newluafunction\endcsname\relax
+ \ifdefined\newluafunction\else
% \end{macrocode}
-% This code is for Plain: load\file{ltluatex.tex} if it hasn’t been
+% This code is for Plain: load \file{ltluatex.tex} if it hasn’t been
% loaded before \babel.
% \begin{macrocode}
\input ltluatex.tex
\fi
% \end{macrocode}
+% We define five LuaTeX attributes to control spacing in French
+% and/or Acadian for `high punctuation’ and quotes, making sure
+% that |\newattribute| is defined.
+%
% |\FB at spacing=0| switches off any space tuning both before high
% punctuation characters and inside French quotes (i.e.\ function
% |french_punctuation| doesn’t alter the node list at all).
+%
% |\FB at addDPspace=0| switches off automatic insertion of spaces
% before high punctuation characters (but typed spaces are still
% turned into non-breaking thin- or word-spaces).
+%
% |\FB at addGUILspace| will be set to~1 by option \fbo{og=«, fg=»},
% thus enabling automatic insertion of proper spaces after `«’ and
% before `»’.
+%
+% |\FB at ucsNBSP| triggers the replacement of glues by characters, it
+% is controlled by option \fbo{UnicodeNoBreakSpaces}.
+%
+% |\FB at dialect| is 0 for French and 1 for Acadian; its value controls
+% which parts of the glue table (|.fr| or |.ac|) are taken into
+% account.
% \begin{macrocode}
\newattribute\FB at spacing \FB at spacing=1 \relax
\newattribute\FB at addDPspace \FB at addDPspace=1 \relax
\newattribute\FB at addGUILspace \FB at addGUILspace=0 \relax
\newattribute\FB at ucsNBSP \FB at ucsNBSP=0 \relax
+ \newattribute\FB at dialect \FB at dialect=0 \relax
\ifLaTeXe
\PackageInfo{french.ldf}{No need for active punctuation
characters\MessageBreak with this version
@@ -1278,6 +1457,53 @@
\fb at info{No need for active punctuation characters\\
with this version of LuaTeX!}
\fi
+% \end{macrocode}
+% The next command will be used in the first call of |\extrasfrench|
+% to convert |\FBcolonspace|, |\FBthinspace| and |\FBguillspace|
+% into a table usable by LuaTeX. This way, any customisation done
+% in the preamble (by \fbsetup{}, redefinitions or |\FBsetspaces|
+% commands) are taken into account. Values not explicitly set for
+% Acadian by |\FBsetspaces[|\textit{acadian}|]| commands are copied
+% from the French ones.
+% In case parsing by the Lua function |FBget_glue| (defined in file
+% \file{frenchb.lua}) fails due to unexpected syntax in |\FB...space|
+% the table remains unchanged and a warning is issued.
+% The matching space characters for option \fbo{UnicodeNoBreakSpaces}
+% are set as word space, thin space or null space according to the
+% \textit{width} parameter.
+% \begin{macrocode}
+ \newcommand*{\set at glue@table}[2]{%
+ \directlua {
+ local s = token.get_meaning("#1")
+ local t = FBget_glue(s)
+ if t then
+ FBsp.#2.gl.fr = t
+ if not FBsp.#2.gl.ac[1] then
+ FBsp.#2.gl.ac = t
+ end
+ if FBsp.#2.gl.fr[1] > 0.6 then
+ FBsp.#2.ch.fr = 0xA0
+ elseif FBsp.#2.gl.fr[1] > 0.2 then
+ FBsp.#2.ch.fr = 0x202F
+ else
+ FBsp.#2.ch.fr = 0x200B
+ end
+ if not FBsp.#2.ch.ac then
+ FBsp.#2.ch.ac = FBsp.#2.ch.fr
+ end
+ else
+ texio.write_nl('term and log', '')
+ texio.write_nl('term and log',
+ '*** french.ldf warning: Unexpected syntax in FB#2space,')
+ texio.write_nl('term and log',
+ '*** french.ldf warning: LuaTeX table FBsp unchanged.')
+ texio.write_nl('term and log',
+ '*** french.ldf warning: Consider using FBsetspaces to ')
+ texio.write('term and log', 'customise FB#2space.')
+ texio.write_nl('term and log', '')
+ end
+ }%
+ }
\fi
% \end{macrocode}
%
@@ -1366,47 +1592,69 @@
local insert_node_after = node.insert_after
local remove_node = node.remove
% \end{macrocode}
+%
+%\changes{v3.4a}{2018/01/26}{Global `FBsp' table added; local function
+% `get\_glue' changed into global `FBget\_glue'.}
+%
% Commands |\FBthinspace|, |\FBcolonspace| and |\FBguillspace| are
-% converted `AtBeginDocument’ into toks |\FBthinsp|, |\FBcolonsp|
-% and |\FBguillsp|;
-% 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|.
-% \hlabel{lua-scaling}
+% converted `AtBeginDocument’ by the next function |FBget_glue| into
+% tables of three values which are fractions of |\fontdimen2|,
+% |\fontdimen3| and |\fontdimen4|. \hlabel{lua-scaling}
+% If parsing fails due to unexpected syntax, the function returns
+% \textit{nil} instead of a table.
% \begin{macrocode}
-local function get_glue(toks)
+function FBget_glue(toks)
local t = nil
- local f = string.match(toks, "\\hskip%s*([%d%.]*)%s*\\fontdimen 2")
+ local f = string.match(toks,
+ "[^%w]hskip%s*([%d%.]*)%s*[^%w]fontdimen 2")
if f == "" then f = 1 end
if tonumber(f) then
t = {tonumber(f), 0, 0}
- f = string.match(toks, "plus%s*([%d%.]*)%s*\\fontdimen 3")
+ f = string.match(toks, "plus%s*([%d%.]*)%s*[^%w]fontdimen 3")
if f == "" then f = 1 end
if tonumber(f) then
t[2] = tonumber(f)
- f = string.match(toks, "minus%s*([%d%.]*)%s*\\fontdimen 4")
+ f = string.match(toks, "minus%s*([%d%.]*)%s*[^%w]fontdimen 4")
if f == "" then f = 1 end
if tonumber(f) then
t[3] = tonumber(f)
end
end
- elseif string.match(toks, "\\F?B?thinspace") then
+ elseif string.match(toks, "[^%w]F?B?thinspace") then
t = {0.5, 0, 0}
- elseif string.match(toks, "\\space") then
+ elseif string.match(toks, "[^%w]space") then
t = {1, 1, 1}
end
return t
end
-local colngl = get_glue(tex.toks['FBcolonsp']) or {1, 1, 1}
-local thingl = get_glue(tex.toks['FBthinsp']) or {.5, 0, 0}
-local guilgl = get_glue(tex.toks['FBguillsp']) or {.8, .3, .8}
% \end{macrocode}
-% The next function converts glue sizes returned in fontdimens
-% by function |get_glue| into sp for the current font;
-% beware of null values for fid, see |\nullfont| in TikZ, and of
-% special fonts like lcircle1.pfb for which |font.getfont(fid)|
-% does not return a proper font table, in such cases the function
-% returns |nil|.
+% Let’s initialize the global LuaTeX table |FBsp|: it holds the
+% characteristics of the glues used in French and Acadian for
+% high punctuation and quotes and the corresponding no-breaking
+% space characters for option \fbo{UnicodeNoBreakSpaces}.
+% \begin{macrocode}
+FBsp = {}
+FBsp.thin = {}
+FBsp.thin.gl = {}
+FBsp.thin.gl.fr = {.5, 0, 0} ; FBsp.thin.gl.ac = {}
+FBsp.thin.ch = {}
+FBsp.thin.ch.fr = 0x202F ; FBsp.thin.ch.ac = nil
+FBsp.colon = {}
+FBsp.colon.gl = {}
+FBsp.colon.gl.fr = { 1, 1, 1} ; FBsp.colon.gl.ac = {}
+FBsp.colon.ch = {}
+FBsp.colon.ch.fr = 0xA0 ; FBsp.colon.ch.ac = nil
+FBsp.guill = {}
+FBsp.guill.gl = {}
+FBsp.guill.gl.fr = {.8, .3, .8} ; FBsp.guill.gl.ac = {}
+FBsp.guill.ch = {}
+FBsp.guill.ch.fr = 0xA0 ; FBsp.guill.ch.ac = nil
+% \end{macrocode}
+% The next function converts the glue table returned by function
+% |FBget_glue| into sp for the current font; beware of null values
+% for fid, see |\nullfont| in TikZ, and of special fonts like
+% lcircle1.pfb for which |font.getfont(fid)| does not return a proper
+% font table, in such cases the function returns |nil|.
%
% \changes{v3.1l}{2016/02/13}{font.getfont(fid) possibly
% returns nil even for a positive fid (i.e. AMS lcircle1.pfb).
@@ -1414,7 +1662,7 @@
%
% \changes{v3.1m}{2016/02/16}{new\_glue\_scaled returns
% nil in case of invalid font table (i.e. lcircle1.pfb). In such
-% cases frenchb leaves the node list unchanged.}
+% cases babel-french leaves the node list unchanged.}
%
% \changes{v3.2b}{2016/04/18}{glue\_spec removed;
% starting with LuaTeX 0.95, glue specifications fit in glue.}
@@ -1422,7 +1670,7 @@
% \begin{macrocode}
local font_table = {}
local function new_glue_scaled (fid,table)
- if fid > 0 then
+ if fid > 0 and table[1] then
local fp = font_table[fid]
if not fp then
local ft = font.getfont(fid)
@@ -1452,6 +1700,7 @@
local addDPspace = luatexbase.attributes['FB at addDPspace']
local addGUILspace = luatexbase.attributes['FB at addGUILspace']
local FBucsNBSP = luatexbase.attributes['FB at ucsNBSP']
+local FBdialect = luatexbase.attributes['FB at dialect']
local has_attribute = node.has_attribute
% \end{macrocode}
% The following function will be added to |kerning| callback.
@@ -1462,8 +1711,8 @@
% 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|). Constant |FR=lang.id(french)| is defined by
-% command |\activate at luatexpunct|.
+% next one (|next|). Constants |FR_fr| (french) and |FR_ca|
+% (acadian) are defined by command |\activate at luatexpunct|.
%
% \changes{v3.1b}{2014/09/16}{Add a check for null fid
% in french\_punctuation (Tikz \cs{nullfont}).
@@ -1479,27 +1728,15 @@
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 FRdialect = has_attribute(item, FBdialect)
+ FRdialect = FRdialect and FRdialect > 0
local SIG = has_attribute(item, addGUILspace)
SIG = SIG and SIG >0
- if lang == FR and FRspacing and
- FB_punct_left[char] and fid > 0 then
+ if lang ~= FR_fr and lang ~= FR_ca then
+ FRspacing = nil
+ end
+ local nbspace = new_node("glyph")
+ if FRspacing and FB_punct_left[char] and fid > 0 then
local prev = item.prev
local prev_id, prev_subtype, prev_char
if prev then
@@ -1579,14 +1816,25 @@
end
end
local fbglue
- local nbspace
+ local t
if FB_punct_thick[char] then
- fbglue = new_glue_scaled(fid,colngl)
- nbspace = NBcolnspace
+ if FRdialect then
+ t = FBsp.colon.gl.ac
+ nbspace.char = FBsp.colon.ch.ac
+ else
+ t = FBsp.colon.gl.fr
+ nbspace.char = FBsp.colon.ch.fr
+ end
else
- fbglue = new_glue_scaled(fid,thingl)
- nbspace = NBthinspace
+ if FRdialect then
+ t = FBsp.thin.gl.ac
+ nbspace.char = FBsp.thin.ch.ac
+ else
+ t = FBsp.thin.gl.fr
+ nbspace.char = FBsp.thin.ch.fr
+ end
end
+ fbglue = new_glue_scaled(fid, t)
% \end{macrocode}
% In case |new_glue_scaled| fails (returns |nil|) the node list
% remains unchanged.
@@ -1596,6 +1844,7 @@
head = remove_node(head,prev,true)
end
if (FRucsNBSP) then
+ nbspace.font = fid
insert_node_before(head, item, copy_node(nbspace))
else
insert_node_before(head, item, copy_node(nobreak))
@@ -1636,13 +1885,20 @@
if is_glue and glue_wd <= 1 then
addgl = false
end
- local fbglue = new_glue_scaled(fid,guilgl)
+ local t = FBsp.guill.gl.fr
+ nbspace.char = FBsp.guill.ch.fr
+ if FRdialect then
+ t = FBsp.guill.gl.ac
+ nbspace.char = FBsp.guill.ch.ac
+ end
+ local fbglue = new_glue_scaled(fid, t)
if addgl and fbglue then
if is_glue then
head = remove_node(head,prev,true)
end
if (FRucsNBSP) then
- insert_node_before(head, item, copy_node(NBguilspace))
+ nbspace.font = fid
+ 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))
@@ -1667,8 +1923,8 @@
% a null glue (i.e. springs).}
%
% \begin{macrocode}
- if lang == FR and FRspacing and FB_punct_right[char]
- and fid > 0 and SIG then
+ if FRspacing and FB_punct_right[char]
+ and fid > 0 and SIG then
local next = item.next
local next_id, next_subtype, next_char, nextnext, kern_wd
if next then
@@ -1710,13 +1966,20 @@
addgl = false
end
local fid = item.font
- local fbglue = new_glue_scaled(fid,guilgl)
+ local t = FBsp.guill.gl.fr
+ nbspace.char = FBsp.guill.ch.fr
+ if FRdialect then
+ t = FBsp.guill.gl.ac
+ nbspace.char = FBsp.guill.ch.ac
+ end
+ local fbglue = new_glue_scaled(fid, t)
if addgl and fbglue then
if is_glue then
head = remove_node(head,next,true)
end
if (FRucsNBSP) then
- insert_node_after(head, item, copy_node(NBguilspace))
+ nbspace.font = fid
+ insert_node_after(head, item, copy_node(nbspace))
else
insert_node_after(head, item, copy_node(fbglue))
insert_node_after(head, item, copy_node(nobreak))
@@ -1735,11 +1998,12 @@
% \fi
%
% \begin{macro}{\FB at luatex@punct at french}
-% As a language tag is part of glyph nodes in LuaTeX, nothing needs
-% to be added to |\extrasfrench| and |\noextrasfrench|; we will just
-% redefine |\shorthandoff| and |\shorthandon| in French to issue a
-% warning reminding the user that active characters are no longer
-% used in French with recent LuaTeX engines.
+% As a language tag is part of glyph nodes in LuaTeX, no more
+% switching has to be done in |\extrasfrench|, setting the dialect
+% attribute has already be done (see above, p.~\pageref{extrapunct}).
+% We will just redefine |\shorthandoff| and |\shorthandon| in French
+% to issue a warning reminding the user that active characters are no
+% longer used in French with recent LuaTeX engines.
%
% \changes{v3.1l}{2016/02/07}{Use \cs{babel at save} to save and restore
% \cs{shorthandon} and \cs{shorthandoff}.}
@@ -1747,8 +2011,8 @@
% \begin{macrocode}
\ifFB at luatex@punct
\newcommand*{\FB at luatex@punct at french}{%
- \babel at save{\shorthandon}%
- \babel at save{\shorthandoff}%
+ \babel at save\shorthandon
+ \babel at save\shorthandoff
\def\shorthandoff##1{%
\ifx\PackageWarning\@undefined
\fb at warning{\noexpand\shorthandoff{;:!?} is helpless with
@@ -1761,7 +2025,7 @@
\fi}%
\def\shorthandon##1{}%
}
- \FB at addto{extras}{\FB at luatex@punct at french}
+ \addto\extrasfrench{\FB at luatex@punct at french}
% \end{macrocode}
% \end{macro}
%
@@ -1773,17 +2037,13 @@
% 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| at the end of the |kerning| callback
-% (no priority).
+% The next definition will be used to activate Lua punctuation: it
+% loads \file{frenchb.lua} and adds function |french_punctuation|
+% at the end of the |kerning| callback (no priority).
% \begin{macrocode}
\def\activate at luatexpunct{%
\directlua{%
- FR = \the\l at french
+ FR_fr = \the\l at french ; FR_ca = \the\l at acadian ;
local path = kpse.find_file("frenchb.lua", "lua")
if path then
local f = dofile(path)
@@ -2036,7 +2296,7 @@
{`\{,`\,,`\.,`\-,`\),`\],`\},`\%,"22,"27,"60,"2019}%
{\XeTeXcharclass\FB at char=\z@}%
}
- \FB at addto{extras}{\FB at xetex@punct at french}
+ \addto\extrasfrench{\FB at xetex@punct at french}
% \end{macrocode}
% \end{macro}
%
@@ -2139,7 +2399,7 @@
% We specify that the French group of shorthands should be used when
% switching to French.
% \begin{macrocode}
- \FB at addto{extras}{\languageshorthands{french}%
+ \addto\extrasfrench{\languageshorthands{french}%
% \end{macrocode}
% These characters are `turned on’ once, later their definition may
% vary. Don’t misunderstand the following code: they keep being
@@ -2148,7 +2408,7 @@
\bbl at activate{:}\bbl at activate{;}%
\bbl at activate{!}\bbl at activate{?}%
}
- \FB at addto{noextras}{%
+ \addto\noextrasfrench{%
\bbl at deactivate{:}\bbl at deactivate{;}%
\bbl at deactivate{!}\bbl at deactivate{?}%
}
@@ -2333,46 +2593,37 @@
% \end{macro}
% \end{macro}
%
+% \changes{v3.4a}{2018/01/18}{New \cs{FBgspchar} to customise the
+% space character to be used for \cs{og} and\cs{fg} with the
+% UnicodeNoBreakSpaces option.}
+%
+% \begin{macro}{\FBgspchar}
% \begin{macro}{\FB at og}
% \begin{macro}{\FB at fg}
-% \begin{macro}{\FBguillspace}
% The next step is to provide correct spacing after `«’ and before
% `»’; no line break is allowed neither \emph{after} the opening
% one, nor \emph{before} the closing one.
-% |\FBguillspace| which does the spacing, has been fine tuned by
-% Thierry Bouche to 80\% of an inter-word space with reduced
-% stretchability. French quotes (including spacing) are printed by
-% |\FB at og| and |\FB at fg|, the expansion of the top level commands
-% |\og| and |\og| is different in and outside French.
+% French quotes (including spacing) are printed by |\FB at og| and
+% |\FB at fg|, the expansion of the top level commands |\og| and |\og|
+% is different in and outside French.
%
% \changes{v3.0a}{2014/01/10}{Definitions of \cs{FB at og} and \cs{FB at fg}
% now depend on punctuation handling (LuaTeX / XeTeX / active).}
%
-% \changes{v3.3a}{2016/04/30}{Skip \cs{FBguillskip} for LuaTeX
-% replaced by toks \cs{FBguillsp}.}
-%
-% LuaTeX requires toks; |\FBguillsp| will be computed from
-% |\FBguillspace| `AtBeginDocument’, its dimensions will
-% be scaled by \file{frenchb.lua} for the current font and used
-% after `«’ and before `»’.
-% \begin{macrocode}
-\newcommand*{\FBguillspace}{\hskip.8\fontdimen2\font
- plus.3\fontdimen3\font
- minus.8\fontdimen4\font \relax}
-\newcommand*{\FB at guillspace}{\penalty\@M\FBguillspace}
-\newtoks\FBguillsp
-% \end{macrocode}
% The definitions of |\FB at og| and |\FB at fg| need some engine-dependent
% tuning: for LuaTeX, |\FB at spacing| is set to~0 locally to prevent
% the quotes characters from adding space when option
% \fbo{og=«, fg=»} is set.
% \begin{macrocode}
+\newcommand*{\FB at guillspace}{\penalty\@M\FBguillspace}
+\newcommand*{\FBgspchar}{\char"A0\relax}
+\newif\ifFBucsNBSP
\ifFB at luatex@punct
\DeclareRobustCommand*{\FB at og}{\leavevmode
\bgroup\FB at spacing=0 \guillemotleft\egroup
- \FB at guillspace}
+ \ifFBucsNBSP\FBgspchar\else\FB at guillspace\fi}
\DeclareRobustCommand*{\FB at fg}{\ifdim\lastskip>\z@\unskip\fi
- \FB at guillspace
+ \ifFBucsNBSP\FBgspchar\else\FB at guillspace\fi
\bgroup\FB at spacing=0 \guillemotright\egroup}
\fi
% \end{macrocode}
@@ -2454,7 +2705,7 @@
% use \cs{babel at save} instead.}
%
% \begin{macrocode}
-\FB at addto{extras}{\babel at save\og \babel at save\fg \bbl at frenchguillemets}
+\addto\extrasfrench{\babel at save\og \babel at save\fg \bbl at frenchguillemets}
% \end{macrocode}
%
% \changes{v3.1a}{2014/05/20}{New command \cs{frquote} for imbedded or
@@ -2599,11 +2850,16 @@
% \subsection{Date in French}
% \label{sssec-date}
%
+% \begin{macro}{\frenchtoday}
+% \begin{macro}{\frenchdate}
% \begin{macro}{\datefrench}
-% The macro |\datefrench| redefines the command |\today| to
-% produce French dates. This new implementation requires \babel~3.9i
-% or newer but, as of 3.9k, doesn’t work with Plain based formats,
-% so |\date\CurrentOption| is defined the old way for these formats.
+% The following code creates a macro |\datefrench| which in turn
+% defines commands |\frenchdate| and |\frenchtoday| to produce French
+% dates (|\today| is defined as |\frenchtoday| in French).
+% The corresponding commands for the French dialect, |\dateacadian|,
+% |\acadiandate| and |\acadiantoday| are also created btw.
+% This new implementation relies on commands |\SetString| and
+% |\SetStringLoop|, therefore requires \babel~3.10 or newer.
%
% \changes{v2.0}{2006/11/06}{2 `\cs{relax}’ added in
% \cs{today}’s definition.}
@@ -2614,47 +2870,47 @@
% \changes{v3.0a}{2014/02/18}{Take advantage of babel’s \cs{SetString}
% commands for \cs{datefrench}. Doesn’t work with Plain (yet?).}
%
-% \changes{v3.0c}{2014/03/26}{\cs{SetString} still does not work for
-% Plain with babel 3.9k. Need to define \cs{datefrench}.}
+% \changes{v3.4a}{2017/12/14}{Creates new command \cs{frenchdate}.}
%
+% \changes{v3.4a}{2018/01/04}{Specific code for Plain finally removed
+% (babel bug reported).}
+%
+% Explicitly defining |\BabelLanguages| as the list of all French
+% dialects defines \emph{both} |\datefrench| and |\dateacadian|;
+% this is required as \file{french.ldf} is read only once even if
+% both language options \Lopt{french} and \Lopt{acadian} are supplied
+% to \babel. Note that coding |\StartBabelCommands*{french,acadian}|
+% would \emph{only} define |\csname date\CurrentOption\endcsname|,
+% leaving the second language undefined in \babel's sens.
% \begin{macrocode}
-\ifLaTeXe
- \def\BabelLanguages{french,acadian}
- \StartBabelCommands*{\BabelLanguages}{date}
- [unicode, fontenc=EU1 EU2, charset=utf8]
- \SetString\monthiiname{février}
- \SetString\monthviiiname{août}
- \SetString\monthxiiname{décembre}
- \StartBabelCommands*{\BabelLanguages}{date}
- \SetStringLoop{month#1name}{%
- janvier,f\'evrier,mars,avril,mai,juin,juillet,%
- ao\^ut,septembre,octobre,novembre,d\'ecembre}
- \SetString\today{{\number\day}\ifnum1=\day {\ier}\fi\space
- \csname month\romannumeral\month name\endcsname \space
- \number\year
- }
- \EndBabelCommands
-\else
- \ifFBunicode
- \@namedef{date\CurrentOption}{%
- \def\today{{\number\day}\ifnum1=\day {\ier}\fi \space
- \ifcase\month
- \or janvier\or février\or mars\or avril\or mai\or
- juin\or juillet\or août\or septembre\or
- octobre\or novembre\or décembre\fi
- \space \number\year}}
- \else
- \@namedef{date\CurrentOption}{%
- \def\today{{\number\day}\ifnum1=\day {\ier}\fi \space
- \ifcase\month
- \or janvier\or f\'evrier\or mars\or avril\or mai\or
- juin\or juillet\or ao\^ut\or septembre\or
- octobre\or novembre\or d\'ecembre\fi
- \space \number\year}}
- \fi
-\fi
+\def\BabelLanguages{french,acadian}
+\StartBabelCommands*{\BabelLanguages}{date}
+ [unicode, fontenc=TU EU1 EU2, charset=utf8]
+ \SetString\monthiiname{février}
+ \SetString\monthviiiname{août}
+ \SetString\monthxiiname{décembre}
+\StartBabelCommands*{\BabelLanguages}{date}
+ \SetStringLoop{month#1name}{%
+ janvier,f\'evrier,mars,avril,mai,juin,juillet,%
+ ao\^ut,septembre,octobre,novembre,d\'ecembre}
+ \SetString\date{\FBdatebox\FB at date}
+ \SetString\today{\FB at date{\year}{\month}{\day}}
+\EndBabelCommands
% \end{macrocode}
+% |\frenchdate| (which produces an unbreakable string) and
+% |\frenchtoday| (breakable) both rely on |\FB at date|, the inner
+% group is needed for |\hbox|.
+% \begin{macrocode}
+\newcommand*{\FB at date}[3]{%
+ {{\number#3}\ifnum1=#3{\ier}\fi\FBdatespace
+ \csname month\romannumeral#2name\endcsname
+ \ifx#1\@empty\else\FBdatespace\number#1\fi}}
+\newcommand*{\FBdatebox}{\hbox}
+\newcommand*{\FBdatespace}{\space}
+% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsection{Extra utilities}
%
@@ -3066,19 +3322,19 @@
\fi
\newcommand*{\DecimalMathComma}{%
\ifFBfrench\dec at math@comma\fi
- \ifFB at icomma\else\FB at addto{extras}{\dec at math@comma}\fi
+ \ifFB at icomma\else\addto\extrasfrench{\dec at math@comma}\fi
}
\newcommand*{\StandardMathComma}{%
\std at math@comma
- \ifFB at icomma\else\FB at addto{extras}{\std at math@comma}\fi
+ \ifFB at icomma\else\addto\extrasfrench{\std at math@comma}\fi
}
\ifLaTeXe
\AtBeginDocument{\@ifpackageloaded{icomma}%
{\FB at icommatrue}%
- {\FB at addto{noextras}{\std at math@comma}}%
+ {\addto\noextrasfrench{\std at math@comma}}%
}
\else
- \FB at addto{noextras}{\std at math@comma}
+ \addto\noextrasfrench{\std at math@comma}
\fi
% \end{macrocode}
% \end{macro}
@@ -3102,29 +3358,34 @@
% \end{macrocode}
% \end{macro}
%
-% The next definitions only make sense for \LaTeXe.
-% For Plain based formats, let’s activate LuaTeX punctuation if
-% necessary, then cleanup and exit. Temporary fix: |\l at french| is
-% not properly set by \babel~3.9h with Plain LuaTeX format.
+% Let’s activate LuaTeX punctuation if necessary (LaTeX or Plain)
+% so that |\FBsetspaces| commands can be used in the preamble,
+% then cleanup and exit without loading any \file{.cfg} file
+% in case of Plain formats.
%
% \begin{macrocode}
+\ifFB at luatex@punct
+ \activate at luatexpunct
+\fi
\let\FBstop at here\relax
-\def\FBclean at on@exit{\let\ifLaTeXe\undefined
- \let\LaTeXetrue\undefined
- \let\LaTeXefalse\undefined}
+\def\FBclean at on@exit{%
+ \let\ifLaTeXe\undefined
+ \let\LaTeXetrue\undefined
+ \let\LaTeXefalse\undefined
+ \let\FB at llc\loadlocalcfg
+ \let\loadlocalcfg\@gobble}
\ifx\magnification\@undefined
\else
- \def\FBstop at here{\ifFB at luatex@punct
- \activate at luatexpunct
- \fi
- \FBclean at on@exit
- \ldf at quit\CurrentOption\endinput}
+ \def\FBstop at here{%
+ \FBclean at on@exit
+ \ldf at finish\CurrentOption
+ \let\loadlocalcfg\FB at llc
+ \endinput}
\fi
\FBstop at here
% \end{macrocode}
%
-% What follows is for \LaTeXe{} \emph{only}; as all \LaTeXe{}
-% based formats include \eTeX, we can use |\ifdefined| now.
+% What follows is for \LaTeXe{} \emph{only}.
% We redefine |\nombre| for \LaTeXe. A warning is issued
% at the first call of |\nombre| if |\numprint| is not
% defined, suggesting what to do. The package \pkg{numprint}
@@ -3152,11 +3413,14 @@
}
% \end{macrocode}
%
-% \changes{v3.3c}{2017/00/10}{New command \cs{FBthousandsep} to
+% \changes{v3.3c}{2017/08/10}{New command \cs{FBthousandsep} to
% customise numprint.}
%
+% \changes{v3.4a}{2017/12/29}{Shrink/stretch removed in
+% \cs{FBthousandsep}.}
+%
% \begin{macrocode}
-\newcommand*{\FBthousandsep}{~}
+\newcommand*{\FBthousandsep}{\kern \fontdimen2\font \relax}
% \end{macrocode}
%
% \changes{v2.0c}{2007/06/25}{There is no need to define here
@@ -3192,18 +3456,19 @@
% \changes{v3.3a}{2017/04/30}{Commands \cs{frenchpartfirst},
% \cs{frenchpartsecond} and \cs{frenchpartnameord} added.}
%
-% 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
+% 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
% \fbsetup{SmallCapsFigTabCaptions=false}).
% \begin{macrocode}
-\ifx\FBfigtabshape\@undefined \let\FBfigtabshape\scshape \fi
+\providecommand*{\FBfigtabshape}{\scshape}
% \end{macrocode}
%
-% New implementation for caption names (requires \babel’s~3.9 or up).
+% New implementation for caption names( requires \babel’s~3.10 or
+% newer).
% \begin{macrocode}
\StartBabelCommands*{\BabelLanguages}{captions}
- [unicode, fontenc=EU1 EU2 TU, charset=utf8]
+ [unicode, fontenc=TU EU1 EU2, charset=utf8]
\SetString{\refname}{Références}
\SetString{\abstractname}{Résumé}
\SetString{\prefacename}{Préface}
@@ -3248,7 +3513,7 @@
\SetString{\partsecond}{Deuxi\`eme}
\SetString{\partnameord}{partie}
\SetStringLoop{ordinal#1}{%
- \frenchpartfirst,\frenchpartsecond,Troisi\`eme,Quatri\`eme,%
+ \partfirst,\partsecond,Troisi\`eme,Quatri\`eme,%
Cinqui\`eme,Sixi\`eme,Septi\`eme,Huiti\`eme,Neuvi\`eme,Dixi\`eme,%
Onzi\`eme,Douzi\`eme,Treizi\`eme,Quatorzi\`eme,Quinzi\`eme,%
Seizi\`eme,Dix-septi\`eme,Dix-huiti\`eme,Dix-neuvi\`eme,%
@@ -3258,7 +3523,7 @@
\DeclareRobustCommand*{\FB at partname}{%
\ifFBPartNameFull
\csname ordinal\romannumeral\value{part}\endcsname\space
- \frenchpartnameord\FB at emptypart
+ \partnameord\FB at emptypart
\else
Partie%
\fi}%
@@ -3266,29 +3531,6 @@
\SetString{\partname}{\FB at 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 at koma| will be defined and set later on
-% (see p.~\pageref{ifFB at koma}).
-% \begin{macrocode}
-\AtEndOfPackage{%
- \ifFB at koma
- \ifdefined\partformat
- \FB at addto{captions}{%
- \ifFBPartNameFull
- \babel at save\partformat
- \renewcommand*{\partformat}{\partname}%
- \fi}%
- \fi
- \fi
-}
-% \end{macrocode}
% \end{macro}
%
% \changes{v3.0a}{2014/02/28}{Merging of \cs{captionsfrenchb},
@@ -3489,7 +3731,7 @@
\def\FBCaption at Separator{\ifFBfrench\space\fi : }%
\fi
\ifFBCustomiseFigTabCaptions
- \ifx\bbl at main@language\FB at french
+ \ifFB at mainlanguage@FR
\def\FBCaption at Separator{\CaptionSeparator}%
\fi
\fi
@@ -3589,7 +3831,7 @@
\ifdefined\mdots@\else\let\Mdots@\mathellipsis\fi
}
\def\bbl at frenchdots{\babel at save\Tdots@ \let\Tdots@\FBtextellipsis}
-\FB at addto{extras}{\bbl at frenchdots}
+\addto\extrasfrench{\bbl at frenchdots}
% \end{macrocode}
% \end{macro}
%
@@ -3758,7 +4000,7 @@
% \changes{v3.3a}{2017/04/30}{\cs{frenchbsetup} is now an alias for
% \cs{frenchsetup}.}
%
-% \changes{v3.3a}{2017/04/30}{Options INGuillSpace, ThinColonSPace no
+% \changes{v3.3a}{2017/04/30}{Options INGuillSpace, ThinColonSpace no
% longer delayed AtBeginDocument.}
%
% \begin{macrocode}
@@ -3801,8 +4043,6 @@
\newif\ifFBSmallCapsFigTabCaptions \FBSmallCapsFigTabCaptionstrue
\newif\ifFBSuppressWarning
\newif\ifFBINGuillSpace
-\newif\ifFBucsNBSP
-
% \end{macrocode}
%
% The defaults values of these flags have been choosen so that
@@ -3809,11 +4049,12 @@
% \frenchb{} does not change anything regarding the global layout.
% |\bbl at main@language|, set by the last option of \babel, controls
% the global layout of the document. `AtEndOfPackage’ we check the
-% main language in |\bbl at main@language|; if it is French,
-% the values of some flags have to be changed to ensure a French
-% looking layout for the whole document (even in parts written in
-% languages other than French); the end-user will then be able to
-% customise the values of all these flags with \fbsetup{}.
+% main language in |\bbl at main@language|; if it is French (or a
+% French dialect) the values of some flags have to be changed to
+% ensure a French looking layout for the whole document (even in
+% parts written in languages other than French); the end-user will
+% then be able to customise the values of all these flags with
+% \fbsetup{}.
%
% \changes{v2.5b}{2010/10/30}{Do not use the
% test \cs{iflanguage}\{french\} to check whether French is the
@@ -3823,6 +4064,29 @@
% In this case \cs{l at french} and \cs{l at english} are 0.
% Pointed out by Günter Milde.}
%
+% \changes{v3.1g}{2015/05/10}{Bug fix for koma-scripts classes:
+% a spurious dot was added by the \cs{partformat} command.}
+%
+% \changes{v3.4a}{2018/01/07}{Patch for koma-script classes moved here,
+% after \cs{ifFBPartNameFull} is defined, so that it applies to
+% \cs{extrasacadian} too: \cs{AtEndOfPackage} is too late.}
+%
+% The following patch is for koma-script classes: the |\partformat|
+% command, defined as |\partname~\thepart\autodot|, is incompatible
+% with our redefinition of |\partname|.
+% \begin{macrocode}
+\ifFB at koma
+ \ifdefined\partformat
+ \def\FB at partformat@fix{%
+ \ifFBPartNameFull
+ \babel at save\partformat
+ \renewcommand*{\partformat}{\partname}%
+ \fi}
+ \addto\extrasfrench{\FB at partformat@fix}%
+ \fi
+\fi
+% \end{macrocode}
+%
% \changes{v3.0c}{2014/03/30}{No list customisation when beamer
% class is loaded.}
%
@@ -3844,9 +4108,14 @@
% compatible with the \pkg{beamerarticle} package.
%
% \begin{macrocode}
-\edef\FB at french{\CurrentOption}
+\def\FB at french{french}
+\def\FB at acadian{acadian}
+\newif\ifFB at mainlanguage@FR
\AtEndOfPackage{%
- \ifx\bbl at main@language\FB at french
+ \ifx\bbl at main@language\FB at french \FB at mainlanguage@FRtrue
+ \else \ifx\bbl at main@language\FB at acadian \FB at mainlanguage@FRtrue \fi
+ \fi
+ \ifFB at mainlanguage@FR
\FBGlobalLayoutFrenchtrue
\@ifclassloaded{beamer}%
{\PackageInfo{french.ldf}{%
@@ -3912,7 +4181,7 @@
% is set to true while the main language is \emph{not} French.
% \begin{macrocode}
\ifFBGlobalLayoutFrench
- \ifx\bbl at main@language\FB at french
+ \ifFB at mainlanguage@FR
\else
\FBGlobalLayoutFrenchfalse
\PackageWarning{french.ldf}%
@@ -3983,7 +4252,7 @@
{\csname FBThinColonSpace#1\endcsname
\ifFBThinColonSpace
\renewcommand*{\FBcolonspace}{\FBthinspace}%
- \fi}%
+ \fi}%
\define at key{FB}{ThinSpaceInFrenchNumbers}[true]%
{\csname FBThinSpaceInFrenchNumbers#1\endcsname}%
\define at key{FB}{FrenchSuperscripts}[true]%
@@ -3996,13 +4265,13 @@
{\csname FBCustomiseFigTabCaptions#1\endcsname}%
\define at key{FB}{OldFigTabCaptions}[true]%
{\csname FBOldFigTabCaptions#1\endcsname
-% \end{macrocode}
-% |\CurrentOption| no longer defined. It’s value has been saved
-% in |\FB at CurOpt| while reading \file{french.ldf}.
-% \begin{macrocode}
\ifFBOldFigTabCaptions
- \FB at addto{extras}{\babel at save\FBCaption at Separator
- \def\FBCaption at Separator{\CaptionSeparator}}%
+ \def\FB at capsep@fix{\babel at save\FBCaption at Separator
+ \def\FBCaption at Separator{\CaptionSeparator}}%
+ \addto\extrasfrench{\FB at capsep@fix}%
+ \ifdefined\extrasacadian
+ \addto\extrasacadian{\FB at capsep@fix}%
+ \fi
\fi}%
\define at key{FB}{SmallCapsFigTabCaptions}[true]%
{\csname FBSmallCapsFigTabCaptions#1\endcsname
@@ -4325,7 +4594,7 @@
% now in case French is the main language: \hlabel{FB at ufl}
% \begin{macrocode}
\def\FB at ufl{\update at frenchlists}
- \ifx\bbl at main@language\FB at french
+ \ifFB at mainlanguage@FR
\update at frenchlists
\fi
% \end{macrocode}
@@ -4408,7 +4677,7 @@
% is set to false.}
%
% \changes{v3.1f}{2015/05/31}{Bug fix for the beamer class:
-% figure and table captions are now consistent with frenchb’s
+% figure and table captions are now consistent with babel-french’s
% documentation. Pointed out by Denis Bitouzé.}
%
% Unless \fbo{CustomiseFigTabCaptions} has been set to \fbo{false},
@@ -4449,8 +4718,8 @@
% \begin{macrocode}
\ifFBShowOptions
\GenericWarning{* }{%
- * **** List of possible options for frenchb ****\MessageBreak
- [Default values between brackets when frenchb is loaded *LAST*]%
+ ***** List of possible options for babel-french ****\MessageBreak
+ [Default values between brackets when french is loaded *LAST*]%
\MessageBreak
ShowOptions=true [false]\MessageBreak
StandardLayout=true [false]\MessageBreak
@@ -4560,24 +4829,11 @@
% \begin{macrocode}
\FBprocess at options
% \end{macrocode}
-% The final definitions of commands ruling spacing in French
-% been known, let’s reset the corresponding toks for LuaTeX
-% and load file \file{frenchb.lua} (LuaTeX only).
-% \begin{macrocode}
- \ifFB at luatex@punct
- \FBcolonsp=\expandafter{\meaning\FBcolonspace}%
- \FBthinsp= \expandafter{\meaning\FBthinspace}%
- \FBguillsp=\expandafter{\meaning\FBguillspace}%
- \activate at 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|.
+% (LuaLaTeX only) we need to redefine |\FBmedkern|, |\FBthickkern|
+% and |\FBthousandsep| as Unicode characters.
% \begin{macrocode}
\ifFBucsNBSP
- \renewcommand*{\FBguillspace}{\char"A0\relax}%
\renewcommand*{\FBmedkern}{\char"202F\relax}%
\renewcommand*{\FBthickkern}{\char"A0\relax}%
\ifFBThinSpaceInFrenchNumbers
@@ -4975,7 +5231,7 @@
\FB at ufl
\fi
}
-\FB at addto{extras}{\bbl at frenchlistlayout}
+\addto\extrasfrench{\bbl at frenchlistlayout}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -5013,8 +5269,8 @@
\@afterindenttrue
\fi
\fi}
-\FB at addto{extras}{\bbl at frenchindent}
-\FB at addto{noextras}{\bbl at nonfrenchindent}
+\addto\extrasfrench{\bbl at frenchindent}
+\addto\noextrasfrench{\bbl at nonfrenchindent}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -5055,7 +5311,7 @@
\AtBeginDocument{\@ifpackageloaded{bigfoot}%
{\PackageInfo{french.ldf}%
{bigfoot package in use.\MessageBreak
- frenchb will NOT customise footnotes;%
+ babel-french will NOT customise footnotes;%
\MessageBreak reported}}%
{\let\@footnotemarkORI\@footnotemark
\def\@footnotemarkFB{\leavevmode\unskip\unkern
@@ -5301,8 +5557,8 @@
% instead of frenchb.cfg. NO NEED for .cfg files in French anyway.}
%
% \changes{v3.1h}{2015/08/19}{french.cfg from e-french conflicts with
-% frenchb. Do NOT load it (no need for .cfg files with frenchb
-% anyway).}
+% babel-french. Do NOT load it (no need for .cfg files with
+% babel-french anyway).}
%
% Final cleaning.
% The macro |\ldf at finish| takes care for setting the main language
@@ -5312,8 +5568,6 @@
% French.
% \begin{macrocode}
\FBclean at on@exit
-\let\FB at llc\loadlocalcfg
-\let\loadlocalcfg\@gobble
\ldf at finish\CurrentOption
\let\loadlocalcfg\FB at llc
% \end{macrocode}
@@ -5339,6 +5593,12 @@
% \Lopt{francais} being deprecated and force recommended options
% \Lopt{acadian} or \Lopt{french}.
% \begin{macrocode}
+%<*acadian>
+\PackageInfo{acadian.ldf}%
+ {`acadian' dialect is currently\MessageBreak
+ *absolutely identical* to the\MessageBreak
+ `french' language; reported}
+%</acadian>
%<*canadien>
\PackageWarning{canadien.ldf}%
{Option `canadien' for Babel is *deprecated*,\MessageBreak
@@ -5398,6 +5658,8 @@
\fi
%</frenchb>
%<acadian|canadien|frenchb|francais>\input french.ldf\relax
+%<acadian|canadien>\let\extrasacadian\extrasfrench
+%<acadian|canadien>\let\noextrasacadian\noextrasfrench
% \end{macrocode}
%
% \Finale
Modified: trunk/Master/texmf-dist/source/generic/babel-french/frenchb.ins
===================================================================
--- trunk/Master/texmf-dist/source/generic/babel-french/frenchb.ins 2018-01-30 21:04:11 UTC (rev 46492)
+++ trunk/Master/texmf-dist/source/generic/babel-french/frenchb.ins 2018-01-30 21:04:29 UTC (rev 46493)
@@ -2,7 +2,7 @@
%% This file will generate fast loadable files and documentation driver
%% files from the doc files in this package when run through LuaTeX.
%%
-%% Copyright 2001-2017 Daniel Flipo. All rights reserved.
+%% Copyright 2001-2018 Daniel Flipo. All rights reserved.
%%
%% This is a generated file part of the the babel-french bundle
%% to be used with the Babel system.
Modified: trunk/Master/texmf-dist/tex/generic/babel-french/acadian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel-french/acadian.ldf 2018-01-30 21:04:11 UTC (rev 46492)
+++ trunk/Master/texmf-dist/tex/generic/babel-french/acadian.ldf 2018-01-30 21:04:29 UTC (rev 46493)
@@ -24,8 +24,14 @@
%% Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
%%
\ProvidesLanguage{acadian}
- [2017/10/19 v3.3d French support from the babel system]
+ [2018/01/30 v3.4a French support from the babel system]
+\PackageInfo{acadian.ldf}%
+ {`acadian' dialect is currently\MessageBreak
+ *absolutely identical* to the\MessageBreak
+ `french' language; reported}
\input french.ldf\relax
+\let\extrasacadian\extrasfrench
+\let\noextrasacadian\noextrasfrench
%%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
Modified: trunk/Master/texmf-dist/tex/generic/babel-french/canadien.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel-french/canadien.ldf 2018-01-30 21:04:11 UTC (rev 46492)
+++ trunk/Master/texmf-dist/tex/generic/babel-french/canadien.ldf 2018-01-30 21:04:29 UTC (rev 46493)
@@ -24,7 +24,7 @@
%% Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
%%
\ProvidesLanguage{canadien}
- [2017/10/19 v3.3d French support from the babel system]
+ [2018/01/30 v3.4a 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
@@ -32,6 +32,8 @@
\let\l at canadien\l at acadian
\def\CurrentOption{acadian}
\input french.ldf\relax
+\let\extrasacadian\extrasfrench
+\let\noextrasacadian\noextrasfrench
%%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
Modified: trunk/Master/texmf-dist/tex/generic/babel-french/francais.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel-french/francais.ldf 2018-01-30 21:04:11 UTC (rev 46492)
+++ trunk/Master/texmf-dist/tex/generic/babel-french/francais.ldf 2018-01-30 21:04:29 UTC (rev 46493)
@@ -24,7 +24,7 @@
%% Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
%%
\ProvidesLanguage{francais}
- [2017/10/19 v3.3d French support from the babel system]
+ [2018/01/30 v3.4a 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
Modified: trunk/Master/texmf-dist/tex/generic/babel-french/french.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel-french/french.ldf 2018-01-30 21:04:11 UTC (rev 46492)
+++ trunk/Master/texmf-dist/tex/generic/babel-french/french.ldf 2018-01-30 21:04:29 UTC (rev 46493)
@@ -24,39 +24,13 @@
%% Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
%%
\ProvidesLanguage{french}
- [2017/10/19 v3.3d French support from the babel system]
+ [2018/01/30 v3.4a French support from the babel system]
%%
%% Babel package for LaTeX version 2e
-%% Copyright © 1996 - 2017
+%% Copyright © 1996-2018
%% by Daniel Flipo <daniel (dot) flipo (at) free (dot) fr>
%%
-\LdfInit\CurrentOption\captionsfrench
-\def\FB at nopatterns{%
- \ifx\l at nohyphenation\@undefined
- \edef\bbl at nulllanguage{\string\language=0}%
- \adddialect\l at french0
- \else
- \adddialect\l at french\l at nohyphenation
- \edef\bbl at nulllanguage{\string\language=nohyphenation}%
- \fi
- \@nopatterns{French}}
-\ifx\l at french\@undefined
- \FB at nopatterns
-\fi
-\newif\ifLaTeXe
-\let\bbl at tempa\relax
-\ifx\magnification\@undefined
- \ifx\@compatibilitytrue\@undefined
- \PackageError{french.ldf}
- {LaTeX-2.09 format is no longer supported.\MessageBreak
- Aborting here}
- {Please upgrade to LaTeX2e!}
- \let\bbl at tempa\endinput
- \else
- \LaTeXetrue
- \fi
-\fi
-\bbl at tempa
+\LdfInit\CurrentOption{FBclean at on@exit}
\def\fb at error#1#2{%
\begingroup
\newlinechar=`\^^J
@@ -76,42 +50,70 @@
\wlog{#1}%
\endgroup}
\let\bbl at tempa\relax
-\ifx\babeltags\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname eTeXversion\endcsname\relax
+ \let\bbl at tempa\endinput
+ \fb at error{babel-french requires eTeX.\\
+ Aborting here}
+ {Orignal PlainTeX is not supported,\\
+ please use LuaTeX or XeTeX engines.}
+\fi
+\bbl at tempa
+\let\bbl at tempa\relax
+\ifdefined\babeltags
+\else
\let\bbl at tempa\endinput
- \ifLaTeXe
+ \ifdefined\PackageError
\PackageError{french.ldf}
- {frenchb requires babel v.3.9i.\MessageBreak
+ {babel-french requires babel v.3.16.\MessageBreak
Aborting here}
{Please upgrade Babel!}
\else
- \fb at error{frenchb requires babel v.3.9i.\\
+ \fb at error{babel-french requires babel v.3.16.\\
Aborting here}
{Please upgrade Babel!}
\fi
\fi
\bbl at tempa
-\def\bbl at tempa{acadian}
-\ifx\CurrentOption\bbl at tempa
- \ifx\l at acadian\@undefined
- \adddialect\l at acadian\l at french
- \fi
+\def\FB at nopatterns{%
+ \ifdefined\l at nohyphenation
+ \adddialect\l at french\l at nohyphenation
+ \edef\bbl at nulllanguage{\string\language=nohyphenation}%
+ \else
+ \edef\bbl at nulllanguage{\string\language=0}%
+ \adddialect\l at french0
+ \fi
+ \@nopatterns{French}}
+\ifdefined\l at french \else \FB at nopatterns \fi
+\ifdefined\l at acadian \else \adddialect\l at acadian\l at french \fi
+\providehyphenmins{french}{\tw@\thr@@}
+\providehyphenmins{acadian}{\tw@\thr@@}
+\newif\ifLaTeXe
+\let\bbl at tempa\relax
+\ifdefined\magnification
+\else
+ \ifdefined\@compatibilitytrue
+ \LaTeXetrue
+ \else
+ \PackageError{french.ldf}
+ {LaTeX-2.09 format is no longer supported.\MessageBreak
+ Aborting here}
+ {Please upgrade to LaTeX2e!}
+ \let\bbl at tempa\endinput
+ \fi
\fi
-\expandafter\providehyphenmins\expandafter{\CurrentOption}{\tw@\thr@@}
+\bbl at tempa
\newif\ifFBunicode
\newif\ifFBLuaTeX
\newif\ifFBXeTeX
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname luatexversion\endcsname\relax
-\else
+\ifdefined\luatexversion
\FBunicodetrue \FBLuaTeXtrue
\fi
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname XeTeXrevision\endcsname\relax
-\else
+\ifdefined\XeTeXrevision
\FBunicodetrue \FBXeTeXtrue
\fi
\newif\ifFBfrench
-\@namedef{extras\CurrentOption}{%
+\def\extrasfrench{%
\FBfrenchtrue
\babel at savevariable{\lccode`\'}%
\ifFBunicode
@@ -121,12 +123,9 @@
\lccode`\'=`\'
\fi
}
-\@namedef{noextras\CurrentOption}{\FBfrenchfalse}
-\let\FB at CurOpt\CurrentOption
-\newcommand*{\FB at addto}[2]{%
- \expandafter\addto\csname #1\FB at CurOpt\endcsname{#2}}
-\FB at addto{extras}{\bbl at frenchspacing}
-\FB at addto{noextras}{\bbl at nonfrenchspacing}
+\def\noextrasfrench{\FBfrenchfalse}
+\addto\extrasfrench{\bbl at frenchspacing}
+\addto\noextrasfrench{\bbl at nonfrenchspacing}
\newif\ifFB at active@punct \FB at active@puncttrue
\newif\ifFB at luatex@punct
\ifFBLuaTeX
@@ -133,13 +132,14 @@
\ifnum\luatexversion<95
\ifx\PackageWarning\@undefined
\fb at warning{Please upgrade LuaTeX to version 0.95 or above!\\%
- frenchb will make high punctuation characters (;:!?) active\\%
- with LuaTeX < 0.95.}%
+ babel-french will make high punctuation characters (;:!?)\\%
+ active with LuaTeX < 0.95.}%
\else
\PackageWarning{french.ldf}{Please upgrade LuaTeX
to version 0.95 or above!\MessageBreak
- frenchb will make high punctuation characters\MessageBreak
- (;:!?) active with LuaTeX < 0.95;\MessageBreak reported}%
+ babel-french will make high punctuation characters%
+ \MessageBreak (;:!?) active with LuaTeX < 0.95;%
+ \MessageBreak reported}%
\fi
\else
\FB at luatex@puncttrue\FB at active@punctfalse
@@ -147,9 +147,7 @@
\fi
\newcount\FB at nonchar
\newif\ifFB at xetex@punct
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname XeTeXinterchartokenstate\endcsname\relax
-\else
+\ifdefined\XeTeXinterchartokenstate
\FB at xetex@puncttrue\FB at active@punctfalse
\ifdim\the\XeTeXversion\XeTeXrevision pt<0.99994pt
\FB at nonchar=255 \relax
@@ -157,10 +155,69 @@
\FB at nonchar=4095 \relax
\fi
\fi
+\newcommand*{\FBguillspace}{\hskip .8\fontdimen2\font
+ plus .3\fontdimen3\font
+ minus .8\fontdimen4\font \relax}
\newcommand*{\FBcolonspace}{\space}
-\newcommand*{\FBthinspace}{\hskip.5\fontdimen2\font \relax}
-\newtoks\FBcolonsp
-\newtoks\FBthinsp
+\newcommand*{\FBthinspace}{\hskip .5\fontdimen2\font \relax}
+\ifLaTeXe
+ \newcommand*{\FBsetspaces}[5][french]{%
+ \def\bbl at tempa{french}\def\bbl at tempb{#1}%
+ \ifx\bbl at tempa\bbl at tempb \def\bbl at tempb{}\fi
+ \@namedef{\bbl at tempb FB#2space}{\hskip #3\fontdimen2\font
+ plus #4\fontdimen3\font
+ minus #5\fontdimen4\font \relax}%
+ \ifFB at luatex@punct
+ \ifx\bbl at tempb\FB at acadian
+ \directlua{
+ FBsp.#2.gl.ac[1] = #3
+ FBsp.#2.gl.ac[2] = #4
+ FBsp.#2.gl.ac[3] = #5
+ if #3 > 0.6 then
+ FBsp.#2.ch.ac = 0xA0
+ elseif #3 > 0.2 then
+ FBsp.#2.ch.ac = 0x202F
+ else
+ FBsp.#2.ch.ac = 0x200B
+ end
+ }%
+ \fi
+ \fi
+ }
+ \@onlypreamble\FBsetspaces
+\fi
+\ifLaTeXe
+ \addto\extrasfrench{%
+ \ifFB at luatex@punct
+ \edef\bbl at tempa{\detokenize\expandafter{\languagename}}%
+ \edef\bbl at tempb{\detokenize{french}}%
+ \ifx\bbl at tempa\bbl at tempb \FB at dialect=0 \relax
+ \else \FB at dialect=1 \relax
+ \fi
+ \ifdefined\FB at once\else
+ \set at glue@table{FBcolonspace}{colon}%
+ \set at glue@table{FBthinspace}{thin}%
+ \set at glue@table{FBguillspace}{guill}%
+ \def\FB at once{}%
+ \fi
+ \fi
+ \ifcsname\languagename FBthinspace\endcsname
+ \babel at save\FBthinspace
+ \renewcommand*{\FBthinspace}{%
+ \csname\languagename FBthinspace\endcsname}%
+ \fi
+ \ifcsname\languagename FBcolonspace\endcsname
+ \babel at save\FBcolonspace
+ \renewcommand*{\FBcolonspace}{%
+ \csname\languagename FBcolonspace\endcsname}%
+ \fi
+ \ifcsname\languagename FBguillspace\endcsname
+ \babel at save\FBguillspace
+ \renewcommand*{\FBguillspace}{%
+ \csname\languagename FBguillspace\endcsname}%
+ \fi
+ }
+\fi
\newif\ifFB at spacing \FB at spacingtrue
\newcommand*{\FB at spacing@on}{%
\ifFB at luatex@punct
@@ -175,8 +232,7 @@
\FB at spacingfalse
\fi}
\ifFB at luatex@punct
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname newluafunction\endcsname\relax
+ \ifdefined\newluafunction\else
\input ltluatex.tex
\fi
\newattribute\FB at spacing \FB at spacing=1 \relax
@@ -183,6 +239,7 @@
\newattribute\FB at addDPspace \FB at addDPspace=1 \relax
\newattribute\FB at addGUILspace \FB at addGUILspace=0 \relax
\newattribute\FB at ucsNBSP \FB at ucsNBSP=0 \relax
+ \newattribute\FB at dialect \FB at dialect=0 \relax
\ifLaTeXe
\PackageInfo{french.ldf}{No need for active punctuation
characters\MessageBreak with this version
@@ -191,11 +248,43 @@
\fb at info{No need for active punctuation characters\\
with this version of LuaTeX!}
\fi
+ \newcommand*{\set at glue@table}[2]{%
+ \directlua {
+ local s = token.get_meaning("#1")
+ local t = FBget_glue(s)
+ if t then
+ FBsp.#2.gl.fr = t
+ if not FBsp.#2.gl.ac[1] then
+ FBsp.#2.gl.ac = t
+ end
+ if FBsp.#2.gl.fr[1] > 0.6 then
+ FBsp.#2.ch.fr = 0xA0
+ elseif FBsp.#2.gl.fr[1] > 0.2 then
+ FBsp.#2.ch.fr = 0x202F
+ else
+ FBsp.#2.ch.fr = 0x200B
+ end
+ if not FBsp.#2.ch.ac then
+ FBsp.#2.ch.ac = FBsp.#2.ch.fr
+ end
+ else
+ texio.write_nl('term and log', '')
+ texio.write_nl('term and log',
+ '*** french.ldf warning: Unexpected syntax in FB#2space,')
+ texio.write_nl('term and log',
+ '*** french.ldf warning: LuaTeX table FBsp unchanged.')
+ texio.write_nl('term and log',
+ '*** french.ldf warning: Consider using FBsetspaces to ')
+ texio.write('term and log', 'customise FB#2space.')
+ texio.write_nl('term and log', '')
+ end
+ }%
+ }
\fi
\ifFB at luatex@punct
\newcommand*{\FB at luatex@punct at french}{%
- \babel at save{\shorthandon}%
- \babel at save{\shorthandoff}%
+ \babel at save\shorthandon
+ \babel at save\shorthandoff
\def\shorthandoff##1{%
\ifx\PackageWarning\@undefined
\fb at warning{\noexpand\shorthandoff{;:!?} is helpless with
@@ -208,10 +297,10 @@
\fi}%
\def\shorthandon##1{}%
}
- \FB at addto{extras}{\FB at luatex@punct at french}
+ \addto\extrasfrench{\FB at luatex@punct at french}
\def\activate at luatexpunct{%
\directlua{%
- FR = \the\l at french
+ FR_fr = \the\l at french ; FR_ca = \the\l at acadian ;
local path = kpse.find_file("frenchb.lua", "lua")
if path then
local f = dofile(path)
@@ -316,7 +405,7 @@
{`\{,`\,,`\.,`\-,`\),`\],`\},`\%,"22,"27,"60,"2019}%
{\XeTeXcharclass\FB at char=\z@}%
}
- \FB at addto{extras}{\FB at xetex@punct at french}
+ \addto\extrasfrench{\FB at xetex@punct at french}
\fi
\ifFB at active@punct
\initiate at active@char{:}%
@@ -371,11 +460,11 @@
\declare at shorthand{system}{!}{\string!}
\declare at shorthand{system}{?}{\string?}
\declare at shorthand{system}{;}{\string;}
- \FB at addto{extras}{\languageshorthands{french}%
+ \addto\extrasfrench{\languageshorthands{french}%
\bbl at activate{:}\bbl at activate{;}%
\bbl at activate{!}\bbl at activate{?}%
}
- \FB at addto{noextras}{%
+ \addto\noextrasfrench{%
\bbl at deactivate{:}\bbl at deactivate{;}%
\bbl at deactivate{!}\bbl at deactivate{?}%
}
@@ -426,17 +515,15 @@
\fi
\let\xspace\relax
\fi
-\newcommand*{\FBguillspace}{\hskip.8\fontdimen2\font
- plus.3\fontdimen3\font
- minus.8\fontdimen4\font \relax}
\newcommand*{\FB at guillspace}{\penalty\@M\FBguillspace}
-\newtoks\FBguillsp
+\newcommand*{\FBgspchar}{\char"A0\relax}
+\newif\ifFBucsNBSP
\ifFB at luatex@punct
\DeclareRobustCommand*{\FB at og}{\leavevmode
\bgroup\FB at spacing=0 \guillemotleft\egroup
- \FB at guillspace}
+ \ifFBucsNBSP\FBgspchar\else\FB at guillspace\fi}
\DeclareRobustCommand*{\FB at fg}{\ifdim\lastskip>\z@\unskip\fi
- \FB at guillspace
+ \ifFBucsNBSP\FBgspchar\else\FB at guillspace\fi
\bgroup\FB at spacing=0 \guillemotright\egroup}
\fi
\ifFB at xetex@punct
@@ -469,7 +556,7 @@
\def\og{\textquotedblleft}
\def\fg{\ifdim\lastskip>\z@\unskip\fi\textquotedblright}
\fi
-\FB at addto{extras}{\babel at save\og \babel at save\fg \bbl at frenchguillemets}
+\addto\extrasfrench{\babel at save\og \babel at save\fg \bbl at frenchguillemets}
\newcommand*{\ogi}{\FB at og}
\newcommand*{\fgi}{\FB at fg}
\newcommand*{\ogii}{\textquotedblleft}
@@ -543,41 +630,25 @@
\ifx\FBeverylineguill\FBguillnone\else\localleftbox{}\fi
\ifx\FBeveryparguill\FBguillnone\else\everypar=\FB at everypar\fi
}
-\ifLaTeXe
- \def\BabelLanguages{french,acadian}
- \StartBabelCommands*{\BabelLanguages}{date}
- [unicode, fontenc=EU1 EU2, charset=utf8]
- \SetString\monthiiname{février}
- \SetString\monthviiiname{août}
- \SetString\monthxiiname{décembre}
- \StartBabelCommands*{\BabelLanguages}{date}
- \SetStringLoop{month#1name}{%
- janvier,f\'evrier,mars,avril,mai,juin,juillet,%
- ao\^ut,septembre,octobre,novembre,d\'ecembre}
- \SetString\today{{\number\day}\ifnum1=\day {\ier}\fi\space
- \csname month\romannumeral\month name\endcsname \space
- \number\year
- }
- \EndBabelCommands
-\else
- \ifFBunicode
- \@namedef{date\CurrentOption}{%
- \def\today{{\number\day}\ifnum1=\day {\ier}\fi \space
- \ifcase\month
- \or janvier\or février\or mars\or avril\or mai\or
- juin\or juillet\or août\or septembre\or
- octobre\or novembre\or décembre\fi
- \space \number\year}}
- \else
- \@namedef{date\CurrentOption}{%
- \def\today{{\number\day}\ifnum1=\day {\ier}\fi \space
- \ifcase\month
- \or janvier\or f\'evrier\or mars\or avril\or mai\or
- juin\or juillet\or ao\^ut\or septembre\or
- octobre\or novembre\or d\'ecembre\fi
- \space \number\year}}
- \fi
-\fi
+\def\BabelLanguages{french,acadian}
+\StartBabelCommands*{\BabelLanguages}{date}
+ [unicode, fontenc=TU EU1 EU2, charset=utf8]
+ \SetString\monthiiname{février}
+ \SetString\monthviiiname{août}
+ \SetString\monthxiiname{décembre}
+\StartBabelCommands*{\BabelLanguages}{date}
+ \SetStringLoop{month#1name}{%
+ janvier,f\'evrier,mars,avril,mai,juin,juillet,%
+ ao\^ut,septembre,octobre,novembre,d\'ecembre}
+ \SetString\date{\FBdatebox\FB at date}
+ \SetString\today{\FB at date{\year}{\month}{\day}}
+\EndBabelCommands
+\newcommand*{\FB at date}[3]{%
+ {{\number#3}\ifnum1=#3{\ier}\fi\FBdatespace
+ \csname month\romannumeral#2name\endcsname
+ \ifx#1\@empty\else\FBdatespace\number#1\fi}}
+\newcommand*{\FBdatebox}{\hbox}
+\newcommand*{\FBdatespace}{\space}
\newif\ifFB at poorman
\newdimen\FB at Mht
\ifLaTeXe
@@ -730,33 +801,39 @@
\fi
\newcommand*{\DecimalMathComma}{%
\ifFBfrench\dec at math@comma\fi
- \ifFB at icomma\else\FB at addto{extras}{\dec at math@comma}\fi
+ \ifFB at icomma\else\addto\extrasfrench{\dec at math@comma}\fi
}
\newcommand*{\StandardMathComma}{%
\std at math@comma
- \ifFB at icomma\else\FB at addto{extras}{\std at math@comma}\fi
+ \ifFB at icomma\else\addto\extrasfrench{\std at math@comma}\fi
}
\ifLaTeXe
\AtBeginDocument{\@ifpackageloaded{icomma}%
{\FB at icommatrue}%
- {\FB at addto{noextras}{\std at math@comma}}%
+ {\addto\noextrasfrench{\std at math@comma}}%
}
\else
- \FB at addto{noextras}{\std at math@comma}
+ \addto\noextrasfrench{\std at math@comma}
\fi
\newcommand*{\nombre}[1]{{#1}\fb at warning{*** \noexpand\nombre
no longer formats numbers\string! ***}}
+\ifFB at luatex@punct
+ \activate at luatexpunct
+\fi
\let\FBstop at here\relax
-\def\FBclean at on@exit{\let\ifLaTeXe\undefined
- \let\LaTeXetrue\undefined
- \let\LaTeXefalse\undefined}
+\def\FBclean at on@exit{%
+ \let\ifLaTeXe\undefined
+ \let\LaTeXetrue\undefined
+ \let\LaTeXefalse\undefined
+ \let\FB at llc\loadlocalcfg
+ \let\loadlocalcfg\@gobble}
\ifx\magnification\@undefined
\else
- \def\FBstop at here{\ifFB at luatex@punct
- \activate at luatexpunct
- \fi
- \FBclean at on@exit
- \ldf at quit\CurrentOption\endinput}
+ \def\FBstop at here{%
+ \FBclean at on@exit
+ \ldf at finish\CurrentOption
+ \let\loadlocalcfg\FB at llc
+ \endinput}
\fi
\FBstop at here
\renewcommand*{\nombre}[1]{\Warning at nombre{#1}}
@@ -774,10 +851,10 @@
{#1}%
\fi
}
-\newcommand*{\FBthousandsep}{~}
-\ifx\FBfigtabshape\@undefined \let\FBfigtabshape\scshape \fi
+\newcommand*{\FBthousandsep}{\kern \fontdimen2\font \relax}
+\providecommand*{\FBfigtabshape}{\scshape}
\StartBabelCommands*{\BabelLanguages}{captions}
- [unicode, fontenc=EU1 EU2 TU, charset=utf8]
+ [unicode, fontenc=TU EU1 EU2, charset=utf8]
\SetString{\refname}{Références}
\SetString{\abstractname}{Résumé}
\SetString{\prefacename}{Préface}
@@ -816,7 +893,7 @@
\SetString{\partsecond}{Deuxi\`eme}
\SetString{\partnameord}{partie}
\SetStringLoop{ordinal#1}{%
- \frenchpartfirst,\frenchpartsecond,Troisi\`eme,Quatri\`eme,%
+ \partfirst,\partsecond,Troisi\`eme,Quatri\`eme,%
Cinqui\`eme,Sixi\`eme,Septi\`eme,Huiti\`eme,Neuvi\`eme,Dixi\`eme,%
Onzi\`eme,Douzi\`eme,Treizi\`eme,Quatorzi\`eme,Quinzi\`eme,%
Seizi\`eme,Dix-septi\`eme,Dix-huiti\`eme,Dix-neuvi\`eme,%
@@ -826,7 +903,7 @@
\DeclareRobustCommand*{\FB at partname}{%
\ifFBPartNameFull
\csname ordinal\romannumeral\value{part}\endcsname\space
- \frenchpartnameord\FB at emptypart
+ \partnameord\FB at emptypart
\else
Partie%
\fi}%
@@ -833,17 +910,6 @@
}
\SetString{\partname}{\FB at partname}
\EndBabelCommands
-\AtEndOfPackage{%
- \ifFB at koma
- \ifdefined\partformat
- \FB at addto{captions}{%
- \ifFBPartNameFull
- \babel at save\partformat
- \renewcommand*{\partformat}{\partname}%
- \fi}%
- \fi
- \fi
-}
\newcommand{\FBWarning}[1]{\PackageWarning{french.ldf}{#1}}
\bgroup
\catcode`:=12 \catcode`>=12 \relax
@@ -899,7 +965,7 @@
\def\FBCaption at Separator{\ifFBfrench\space\fi : }%
\fi
\ifFBCustomiseFigTabCaptions
- \ifx\bbl at main@language\FB at french
+ \ifFB at mainlanguage@FR
\def\FBCaption at Separator{\CaptionSeparator}%
\fi
\fi
@@ -950,7 +1016,7 @@
\ifdefined\mdots@\else\let\Mdots@\mathellipsis\fi
}
\def\bbl at frenchdots{\babel at save\Tdots@ \let\Tdots@\FBtextellipsis}
-\FB at addto{extras}{\bbl at frenchdots}
+\addto\extrasfrench{\bbl at frenchdots}
\ifFB at active@punct
\@ifpackageloaded{listings}
{\AtBeginDocument{%
@@ -1013,11 +1079,24 @@
\newif\ifFBSmallCapsFigTabCaptions \FBSmallCapsFigTabCaptionstrue
\newif\ifFBSuppressWarning
\newif\ifFBINGuillSpace
-\newif\ifFBucsNBSP
-
-\edef\FB at french{\CurrentOption}
+\ifFB at koma
+ \ifdefined\partformat
+ \def\FB at partformat@fix{%
+ \ifFBPartNameFull
+ \babel at save\partformat
+ \renewcommand*{\partformat}{\partname}%
+ \fi}
+ \addto\extrasfrench{\FB at partformat@fix}%
+ \fi
+\fi
+\def\FB at french{french}
+\def\FB at acadian{acadian}
+\newif\ifFB at mainlanguage@FR
\AtEndOfPackage{%
- \ifx\bbl at main@language\FB at french
+ \ifx\bbl at main@language\FB at french \FB at mainlanguage@FRtrue
+ \else \ifx\bbl at main@language\FB at acadian \FB at mainlanguage@FRtrue \fi
+ \fi
+ \ifFB at mainlanguage@FR
\FBGlobalLayoutFrenchtrue
\@ifclassloaded{beamer}%
{\PackageInfo{french.ldf}{%
@@ -1067,7 +1146,7 @@
\define at key{FB}{GlobalLayoutFrench}[true]%
{\csname FBGlobalLayoutFrench#1\endcsname
\ifFBGlobalLayoutFrench
- \ifx\bbl at main@language\FB at french
+ \ifFB at mainlanguage@FR
\else
\FBGlobalLayoutFrenchfalse
\PackageWarning{french.ldf}%
@@ -1138,7 +1217,7 @@
{\csname FBThinColonSpace#1\endcsname
\ifFBThinColonSpace
\renewcommand*{\FBcolonspace}{\FBthinspace}%
- \fi}%
+ \fi}%
\define at key{FB}{ThinSpaceInFrenchNumbers}[true]%
{\csname FBThinSpaceInFrenchNumbers#1\endcsname}%
\define at key{FB}{FrenchSuperscripts}[true]%
@@ -1152,8 +1231,12 @@
\define at key{FB}{OldFigTabCaptions}[true]%
{\csname FBOldFigTabCaptions#1\endcsname
\ifFBOldFigTabCaptions
- \FB at addto{extras}{\babel at save\FBCaption at Separator
- \def\FBCaption at Separator{\CaptionSeparator}}%
+ \def\FB at capsep@fix{\babel at save\FBCaption at Separator
+ \def\FBCaption at Separator{\CaptionSeparator}}%
+ \addto\extrasfrench{\FB at capsep@fix}%
+ \ifdefined\extrasacadian
+ \addto\extrasacadian{\FB at capsep@fix}%
+ \fi
\fi}%
\define at key{FB}{SmallCapsFigTabCaptions}[true]%
{\csname FBSmallCapsFigTabCaptions#1\endcsname
@@ -1354,7 +1437,7 @@
reported}%
\fi}{}%
\def\FB at ufl{\update at frenchlists}
- \ifx\bbl at main@language\FB at french
+ \ifFB at mainlanguage@FR
\update at frenchlists
\fi
\ifFBAutoSpacePunctuation
@@ -1415,8 +1498,8 @@
\fi
\ifFBShowOptions
\GenericWarning{* }{%
- * **** List of possible options for frenchb ****\MessageBreak
- [Default values between brackets when frenchb is loaded *LAST*]%
+ ***** List of possible options for babel-french ****\MessageBreak
+ [Default values between brackets when french is loaded *LAST*]%
\MessageBreak
ShowOptions=true [false]\MessageBreak
StandardLayout=true [false]\MessageBreak
@@ -1493,14 +1576,7 @@
}%
\fi
\FBprocess at options
- \ifFB at luatex@punct
- \FBcolonsp=\expandafter{\meaning\FBcolonspace}%
- \FBthinsp= \expandafter{\meaning\FBthinspace}%
- \FBguillsp=\expandafter{\meaning\FBguillspace}%
- \activate at luatexpunct
- \fi
\ifFBucsNBSP
- \renewcommand*{\FBguillspace}{\char"A0\relax}%
\renewcommand*{\FBmedkern}{\char"202F\relax}%
\renewcommand*{\FBthickkern}{\char"A0\relax}%
\ifFBThinSpaceInFrenchNumbers
@@ -1665,7 +1741,7 @@
\FB at ufl
\fi
}
-\FB at addto{extras}{\bbl at frenchlistlayout}
+\addto\extrasfrench{\bbl at frenchlistlayout}
\def\bbl at frenchindent{%
\ifFBGlobalLayoutFrench
\else
@@ -1681,12 +1757,12 @@
\@afterindenttrue
\fi
\fi}
-\FB at addto{extras}{\bbl at frenchindent}
-\FB at addto{noextras}{\bbl at nonfrenchindent}
+\addto\extrasfrench{\bbl at frenchindent}
+\addto\noextrasfrench{\bbl at nonfrenchindent}
\AtBeginDocument{\@ifpackageloaded{bigfoot}%
{\PackageInfo{french.ldf}%
{bigfoot package in use.\MessageBreak
- frenchb will NOT customise footnotes;%
+ babel-french will NOT customise footnotes;%
\MessageBreak reported}}%
{\let\@footnotemarkORI\@footnotemark
\def\@footnotemarkFB{\leavevmode\unskip\unkern
@@ -1796,8 +1872,6 @@
\newcommand*{\FrenchFootnotes}{\FBFrenchFootnotestrue}
\newcommand*{\StandardFootnotes}{\FBFrenchFootnotesfalse}
\FBclean at on@exit
-\let\FB at llc\loadlocalcfg
-\let\loadlocalcfg\@gobble
\ldf at finish\CurrentOption
\let\loadlocalcfg\FB at llc
%%
Modified: trunk/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf 2018-01-30 21:04:11 UTC (rev 46492)
+++ trunk/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf 2018-01-30 21:04:29 UTC (rev 46493)
@@ -24,7 +24,7 @@
%% Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
%%
\ProvidesLanguage{frenchb}
- [2017/10/19 v3.3d French support from the babel system]
+ [2018/01/30 v3.4a French support from the babel system]
\def\bbl at tempa{frenchb}
\ifx\CurrentOption\bbl at tempa
\let\l at frenchb\l at french
Modified: trunk/Master/texmf-dist/tex/generic/babel-french/frenchb.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel-french/frenchb.lua 2018-01-30 21:04:11 UTC (rev 46492)
+++ trunk/Master/texmf-dist/tex/generic/babel-french/frenchb.lua 2018-01-30 21:04:29 UTC (rev 46493)
@@ -1,7 +1,7 @@
--[[
File `frenchb.lua’ generated from frenchb.dtx
- [2017/10/19 v3.3d French support from the babel system]
- Copyright © 2014-2017 Daniel Flipo
+ [2018/01/30 v3.4a French support from the babel system]
+ Copyright © 2014-2018 Daniel Flipo
<daniel (dot) flipo (at) free (dot) fr>
License LPPL: see french.ldf.
--]]
@@ -45,35 +45,49 @@
local insert_node_before = node.insert_before
local insert_node_after = node.insert_after
local remove_node = node.remove
-local function get_glue(toks)
+function FBget_glue(toks)
local t = nil
- local f = string.match(toks, "\\hskip%s*([%d%.]*)%s*\\fontdimen 2")
+ local f = string.match(toks,
+ "[^%w]hskip%s*([%d%.]*)%s*[^%w]fontdimen 2")
if f == "" then f = 1 end
if tonumber(f) then
t = {tonumber(f), 0, 0}
- f = string.match(toks, "plus%s*([%d%.]*)%s*\\fontdimen 3")
+ f = string.match(toks, "plus%s*([%d%.]*)%s*[^%w]fontdimen 3")
if f == "" then f = 1 end
if tonumber(f) then
t[2] = tonumber(f)
- f = string.match(toks, "minus%s*([%d%.]*)%s*\\fontdimen 4")
+ f = string.match(toks, "minus%s*([%d%.]*)%s*[^%w]fontdimen 4")
if f == "" then f = 1 end
if tonumber(f) then
t[3] = tonumber(f)
end
end
- elseif string.match(toks, "\\F?B?thinspace") then
+ elseif string.match(toks, "[^%w]F?B?thinspace") then
t = {0.5, 0, 0}
- elseif string.match(toks, "\\space") then
+ elseif string.match(toks, "[^%w]space") then
t = {1, 1, 1}
end
return t
end
-local colngl = get_glue(tex.toks['FBcolonsp']) or {1, 1, 1}
-local thingl = get_glue(tex.toks['FBthinsp']) or {.5, 0, 0}
-local guilgl = get_glue(tex.toks['FBguillsp']) or {.8, .3, .8}
+FBsp = {}
+FBsp.thin = {}
+FBsp.thin.gl = {}
+FBsp.thin.gl.fr = {.5, 0, 0} ; FBsp.thin.gl.ac = {}
+FBsp.thin.ch = {}
+FBsp.thin.ch.fr = 0x202F ; FBsp.thin.ch.ac = nil
+FBsp.colon = {}
+FBsp.colon.gl = {}
+FBsp.colon.gl.fr = { 1, 1, 1} ; FBsp.colon.gl.ac = {}
+FBsp.colon.ch = {}
+FBsp.colon.ch.fr = 0xA0 ; FBsp.colon.ch.ac = nil
+FBsp.guill = {}
+FBsp.guill.gl = {}
+FBsp.guill.gl.fr = {.8, .3, .8} ; FBsp.guill.gl.ac = {}
+FBsp.guill.ch = {}
+FBsp.guill.ch.fr = 0xA0 ; FBsp.guill.ch.ac = nil
local font_table = {}
local function new_glue_scaled (fid,table)
- if fid > 0 then
+ if fid > 0 and table[1] then
local fp = font_table[fid]
if not fp then
local ft = font.getfont(fid)
@@ -99,6 +113,7 @@
local addDPspace = luatexbase.attributes['FB at addDPspace']
local addGUILspace = luatexbase.attributes['FB at addGUILspace']
local FBucsNBSP = luatexbase.attributes['FB at ucsNBSP']
+local FBdialect = luatexbase.attributes['FB at dialect']
local has_attribute = node.has_attribute
local function french_punctuation (head)
for item in node.traverse_id(GLYPH, head) do
@@ -109,27 +124,15 @@
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 FRdialect = has_attribute(item, FBdialect)
+ FRdialect = FRdialect and FRdialect > 0
local SIG = has_attribute(item, addGUILspace)
SIG = SIG and SIG >0
- if lang == FR and FRspacing and
- FB_punct_left[char] and fid > 0 then
+ if lang ~= FR_fr and lang ~= FR_ca then
+ FRspacing = nil
+ end
+ local nbspace = new_node("glyph")
+ if FRspacing and FB_punct_left[char] and fid > 0 then
local prev = item.prev
local prev_id, prev_subtype, prev_char
if prev then
@@ -167,19 +170,31 @@
end
end
local fbglue
- local nbspace
+ local t
if FB_punct_thick[char] then
- fbglue = new_glue_scaled(fid,colngl)
- nbspace = NBcolnspace
+ if FRdialect then
+ t = FBsp.colon.gl.ac
+ nbspace.char = FBsp.colon.ch.ac
+ else
+ t = FBsp.colon.gl.fr
+ nbspace.char = FBsp.colon.ch.fr
+ end
else
- fbglue = new_glue_scaled(fid,thingl)
- nbspace = NBthinspace
+ if FRdialect then
+ t = FBsp.thin.gl.ac
+ nbspace.char = FBsp.thin.ch.ac
+ else
+ t = FBsp.thin.gl.fr
+ nbspace.char = FBsp.thin.ch.fr
+ end
end
+ fbglue = new_glue_scaled(fid, t)
if (realglue or auto) and fbglue then
if realglue then
head = remove_node(head,prev,true)
end
if (FRucsNBSP) then
+ nbspace.font = fid
insert_node_before(head, item, copy_node(nbspace))
else
insert_node_before(head, item, copy_node(nobreak))
@@ -195,13 +210,20 @@
if is_glue and glue_wd <= 1 then
addgl = false
end
- local fbglue = new_glue_scaled(fid,guilgl)
+ local t = FBsp.guill.gl.fr
+ nbspace.char = FBsp.guill.ch.fr
+ if FRdialect then
+ t = FBsp.guill.gl.ac
+ nbspace.char = FBsp.guill.ch.ac
+ end
+ local fbglue = new_glue_scaled(fid, t)
if addgl and fbglue then
if is_glue then
head = remove_node(head,prev,true)
end
if (FRucsNBSP) then
- insert_node_before(head, item, copy_node(NBguilspace))
+ nbspace.font = fid
+ 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))
@@ -209,8 +231,8 @@
end
end
end
- if lang == FR and FRspacing and FB_punct_right[char]
- and fid > 0 and SIG then
+ if FRspacing and FB_punct_right[char]
+ and fid > 0 and SIG then
local next = item.next
local next_id, next_subtype, next_char, nextnext, kern_wd
if next then
@@ -243,13 +265,20 @@
addgl = false
end
local fid = item.font
- local fbglue = new_glue_scaled(fid,guilgl)
+ local t = FBsp.guill.gl.fr
+ nbspace.char = FBsp.guill.ch.fr
+ if FRdialect then
+ t = FBsp.guill.gl.ac
+ nbspace.char = FBsp.guill.ch.ac
+ end
+ local fbglue = new_glue_scaled(fid, t)
if addgl and fbglue then
if is_glue then
head = remove_node(head,next,true)
end
if (FRucsNBSP) then
- insert_node_after(head, item, copy_node(NBguilspace))
+ nbspace.font = fid
+ insert_node_after(head, item, copy_node(nbspace))
else
insert_node_after(head, item, copy_node(fbglue))
insert_node_after(head, item, copy_node(nobreak))
More information about the tex-live-commits
mailing list