summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-01-30 21:04:29 +0000
committerKarl Berry <karl@freefriends.org>2018-01-30 21:04:29 +0000
commit26b507ff1e2b1d8acaaf4bb212f149f39c436821 (patch)
tree42a8b9f981c489b6a1055e1eb30438981114bf6b /Master/texmf-dist/tex
parent27a29325fbe6a50247f1eb60f8a9d46509c11531 (diff)
babel-french (30jan18)
git-svn-id: svn://tug.org/texlive/trunk@46493 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/generic/babel-french/acadian.ldf8
-rw-r--r--Master/texmf-dist/tex/generic/babel-french/canadien.ldf4
-rw-r--r--Master/texmf-dist/tex/generic/babel-french/francais.ldf2
-rw-r--r--Master/texmf-dist/tex/generic/babel-french/french.ldf408
-rw-r--r--Master/texmf-dist/tex/generic/babel-french/frenchb.ldf2
-rw-r--r--Master/texmf-dist/tex/generic/babel-french/frenchb.lua113
6 files changed, 324 insertions, 213 deletions
diff --git a/Master/texmf-dist/tex/generic/babel-french/acadian.ldf b/Master/texmf-dist/tex/generic/babel-french/acadian.ldf
index f63fb203c91..37370ec4d77 100644
--- a/Master/texmf-dist/tex/generic/babel-french/acadian.ldf
+++ b/Master/texmf-dist/tex/generic/babel-french/acadian.ldf
@@ -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
diff --git a/Master/texmf-dist/tex/generic/babel-french/canadien.ldf b/Master/texmf-dist/tex/generic/babel-french/canadien.ldf
index 2964357b86b..7d6094dc33d 100644
--- a/Master/texmf-dist/tex/generic/babel-french/canadien.ldf
+++ b/Master/texmf-dist/tex/generic/babel-french/canadien.ldf
@@ -24,7 +24,7 @@
%% Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
%%
\ProvidesLanguage{canadien}
- [2017/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@canadien\l@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
diff --git a/Master/texmf-dist/tex/generic/babel-french/francais.ldf b/Master/texmf-dist/tex/generic/babel-french/francais.ldf
index 51cd44b61dd..0cd6945199c 100644
--- a/Master/texmf-dist/tex/generic/babel-french/francais.ldf
+++ b/Master/texmf-dist/tex/generic/babel-french/francais.ldf
@@ -24,7 +24,7 @@
%% Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
%%
\ProvidesLanguage{francais}
- [2017/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
diff --git a/Master/texmf-dist/tex/generic/babel-french/french.ldf b/Master/texmf-dist/tex/generic/babel-french/french.ldf
index c15b624580b..94b40ae1a01 100644
--- a/Master/texmf-dist/tex/generic/babel-french/french.ldf
+++ b/Master/texmf-dist/tex/generic/babel-french/french.ldf
@@ -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@nopatterns{%
- \ifx\l@nohyphenation\@undefined
- \edef\bbl@nulllanguage{\string\language=0}%
- \adddialect\l@french0
- \else
- \adddialect\l@french\l@nohyphenation
- \edef\bbl@nulllanguage{\string\language=nohyphenation}%
- \fi
- \@nopatterns{French}}
-\ifx\l@french\@undefined
- \FB@nopatterns
-\fi
-\newif\ifLaTeXe
-\let\bbl@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@tempa\endinput
- \else
- \LaTeXetrue
- \fi
-\fi
-\bbl@tempa
+\LdfInit\CurrentOption{FBclean@on@exit}
\def\fb@error#1#2{%
\begingroup
\newlinechar=`\^^J
@@ -76,42 +50,70 @@
\wlog{#1}%
\endgroup}
\let\bbl@tempa\relax
-\ifx\babeltags\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname eTeXversion\endcsname\relax
+ \let\bbl@tempa\endinput
+ \fb@error{babel-french requires eTeX.\\
+ Aborting here}
+ {Orignal PlainTeX is not supported,\\
+ please use LuaTeX or XeTeX engines.}
+\fi
+\bbl@tempa
+\let\bbl@tempa\relax
+\ifdefined\babeltags
+\else
\let\bbl@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@error{frenchb requires babel v.3.9i.\\
+ \fb@error{babel-french requires babel v.3.16.\\
Aborting here}
{Please upgrade Babel!}
\fi
\fi
\bbl@tempa
-\def\bbl@tempa{acadian}
-\ifx\CurrentOption\bbl@tempa
- \ifx\l@acadian\@undefined
- \adddialect\l@acadian\l@french
- \fi
+\def\FB@nopatterns{%
+ \ifdefined\l@nohyphenation
+ \adddialect\l@french\l@nohyphenation
+ \edef\bbl@nulllanguage{\string\language=nohyphenation}%
+ \else
+ \edef\bbl@nulllanguage{\string\language=0}%
+ \adddialect\l@french0
+ \fi
+ \@nopatterns{French}}
+\ifdefined\l@french \else \FB@nopatterns \fi
+\ifdefined\l@acadian \else \adddialect\l@acadian\l@french \fi
+\providehyphenmins{french}{\tw@\thr@@}
+\providehyphenmins{acadian}{\tw@\thr@@}
+\newif\ifLaTeXe
+\let\bbl@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@tempa\endinput
+ \fi
\fi
-\expandafter\providehyphenmins\expandafter{\CurrentOption}{\tw@\thr@@}
+\bbl@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@savevariable{\lccode`\'}%
\ifFBunicode
@@ -121,25 +123,23 @@
\lccode`\'=`\'
\fi
}
-\@namedef{noextras\CurrentOption}{\FBfrenchfalse}
-\let\FB@CurOpt\CurrentOption
-\newcommand*{\FB@addto}[2]{%
- \expandafter\addto\csname #1\FB@CurOpt\endcsname{#2}}
-\FB@addto{extras}{\bbl@frenchspacing}
-\FB@addto{noextras}{\bbl@nonfrenchspacing}
+\def\noextrasfrench{\FBfrenchfalse}
+\addto\extrasfrench{\bbl@frenchspacing}
+\addto\noextrasfrench{\bbl@nonfrenchspacing}
\newif\ifFB@active@punct \FB@active@puncttrue
\newif\ifFB@luatex@punct
\ifFBLuaTeX
\ifnum\luatexversion<95
\ifx\PackageWarning\@undefined
\fb@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@luatex@puncttrue\FB@active@punctfalse
@@ -147,9 +147,7 @@
\fi
\newcount\FB@nonchar
\newif\ifFB@xetex@punct
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname XeTeXinterchartokenstate\endcsname\relax
-\else
+\ifdefined\XeTeXinterchartokenstate
\FB@xetex@puncttrue\FB@active@punctfalse
\ifdim\the\XeTeXversion\XeTeXrevision pt<0.99994pt
\FB@nonchar=255 \relax
@@ -157,10 +155,69 @@
\FB@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@tempa{french}\def\bbl@tempb{#1}%
+ \ifx\bbl@tempa\bbl@tempb \def\bbl@tempb{}\fi
+ \@namedef{\bbl@tempb FB#2space}{\hskip #3\fontdimen2\font
+ plus #4\fontdimen3\font
+ minus #5\fontdimen4\font \relax}%
+ \ifFB@luatex@punct
+ \ifx\bbl@tempb\FB@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@luatex@punct
+ \edef\bbl@tempa{\detokenize\expandafter{\languagename}}%
+ \edef\bbl@tempb{\detokenize{french}}%
+ \ifx\bbl@tempa\bbl@tempb \FB@dialect=0 \relax
+ \else \FB@dialect=1 \relax
+ \fi
+ \ifdefined\FB@once\else
+ \set@glue@table{FBcolonspace}{colon}%
+ \set@glue@table{FBthinspace}{thin}%
+ \set@glue@table{FBguillspace}{guill}%
+ \def\FB@once{}%
+ \fi
+ \fi
+ \ifcsname\languagename FBthinspace\endcsname
+ \babel@save\FBthinspace
+ \renewcommand*{\FBthinspace}{%
+ \csname\languagename FBthinspace\endcsname}%
+ \fi
+ \ifcsname\languagename FBcolonspace\endcsname
+ \babel@save\FBcolonspace
+ \renewcommand*{\FBcolonspace}{%
+ \csname\languagename FBcolonspace\endcsname}%
+ \fi
+ \ifcsname\languagename FBguillspace\endcsname
+ \babel@save\FBguillspace
+ \renewcommand*{\FBguillspace}{%
+ \csname\languagename FBguillspace\endcsname}%
+ \fi
+ }
+\fi
\newif\ifFB@spacing \FB@spacingtrue
\newcommand*{\FB@spacing@on}{%
\ifFB@luatex@punct
@@ -175,14 +232,14 @@
\FB@spacingfalse
\fi}
\ifFB@luatex@punct
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname newluafunction\endcsname\relax
+ \ifdefined\newluafunction\else
\input ltluatex.tex
\fi
\newattribute\FB@spacing \FB@spacing=1 \relax
\newattribute\FB@addDPspace \FB@addDPspace=1 \relax
\newattribute\FB@addGUILspace \FB@addGUILspace=0 \relax
\newattribute\FB@ucsNBSP \FB@ucsNBSP=0 \relax
+ \newattribute\FB@dialect \FB@dialect=0 \relax
\ifLaTeXe
\PackageInfo{french.ldf}{No need for active punctuation
characters\MessageBreak with this version
@@ -191,11 +248,43 @@
\fb@info{No need for active punctuation characters\\
with this version of LuaTeX!}
\fi
+ \newcommand*{\set@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@luatex@punct
\newcommand*{\FB@luatex@punct@french}{%
- \babel@save{\shorthandon}%
- \babel@save{\shorthandoff}%
+ \babel@save\shorthandon
+ \babel@save\shorthandoff
\def\shorthandoff##1{%
\ifx\PackageWarning\@undefined
\fb@warning{\noexpand\shorthandoff{;:!?} is helpless with
@@ -208,10 +297,10 @@
\fi}%
\def\shorthandon##1{}%
}
- \FB@addto{extras}{\FB@luatex@punct@french}
+ \addto\extrasfrench{\FB@luatex@punct@french}
\def\activate@luatexpunct{%
\directlua{%
- FR = \the\l@french
+ FR_fr = \the\l@french ; FR_ca = \the\l@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@char=\z@}%
}
- \FB@addto{extras}{\FB@xetex@punct@french}
+ \addto\extrasfrench{\FB@xetex@punct@french}
\fi
\ifFB@active@punct
\initiate@active@char{:}%
@@ -371,11 +460,11 @@
\declare@shorthand{system}{!}{\string!}
\declare@shorthand{system}{?}{\string?}
\declare@shorthand{system}{;}{\string;}
- \FB@addto{extras}{\languageshorthands{french}%
+ \addto\extrasfrench{\languageshorthands{french}%
\bbl@activate{:}\bbl@activate{;}%
\bbl@activate{!}\bbl@activate{?}%
}
- \FB@addto{noextras}{%
+ \addto\noextrasfrench{%
\bbl@deactivate{:}\bbl@deactivate{;}%
\bbl@deactivate{!}\bbl@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@guillspace}{\penalty\@M\FBguillspace}
-\newtoks\FBguillsp
+\newcommand*{\FBgspchar}{\char"A0\relax}
+\newif\ifFBucsNBSP
\ifFB@luatex@punct
\DeclareRobustCommand*{\FB@og}{\leavevmode
\bgroup\FB@spacing=0 \guillemotleft\egroup
- \FB@guillspace}
+ \ifFBucsNBSP\FBgspchar\else\FB@guillspace\fi}
\DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi
- \FB@guillspace
+ \ifFBucsNBSP\FBgspchar\else\FB@guillspace\fi
\bgroup\FB@spacing=0 \guillemotright\egroup}
\fi
\ifFB@xetex@punct
@@ -469,7 +556,7 @@
\def\og{\textquotedblleft}
\def\fg{\ifdim\lastskip>\z@\unskip\fi\textquotedblright}
\fi
-\FB@addto{extras}{\babel@save\og \babel@save\fg \bbl@frenchguillemets}
+\addto\extrasfrench{\babel@save\og \babel@save\fg \bbl@frenchguillemets}
\newcommand*{\ogi}{\FB@og}
\newcommand*{\fgi}{\FB@fg}
\newcommand*{\ogii}{\textquotedblleft}
@@ -543,41 +630,25 @@
\ifx\FBeverylineguill\FBguillnone\else\localleftbox{}\fi
\ifx\FBeveryparguill\FBguillnone\else\everypar=\FB@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@date}
+ \SetString\today{\FB@date{\year}{\month}{\day}}
+\EndBabelCommands
+\newcommand*{\FB@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@poorman
\newdimen\FB@Mht
\ifLaTeXe
@@ -730,33 +801,39 @@
\fi
\newcommand*{\DecimalMathComma}{%
\ifFBfrench\dec@math@comma\fi
- \ifFB@icomma\else\FB@addto{extras}{\dec@math@comma}\fi
+ \ifFB@icomma\else\addto\extrasfrench{\dec@math@comma}\fi
}
\newcommand*{\StandardMathComma}{%
\std@math@comma
- \ifFB@icomma\else\FB@addto{extras}{\std@math@comma}\fi
+ \ifFB@icomma\else\addto\extrasfrench{\std@math@comma}\fi
}
\ifLaTeXe
\AtBeginDocument{\@ifpackageloaded{icomma}%
{\FB@icommatrue}%
- {\FB@addto{noextras}{\std@math@comma}}%
+ {\addto\noextrasfrench{\std@math@comma}}%
}
\else
- \FB@addto{noextras}{\std@math@comma}
+ \addto\noextrasfrench{\std@math@comma}
\fi
\newcommand*{\nombre}[1]{{#1}\fb@warning{*** \noexpand\nombre
no longer formats numbers\string! ***}}
+\ifFB@luatex@punct
+ \activate@luatexpunct
+\fi
\let\FBstop@here\relax
-\def\FBclean@on@exit{\let\ifLaTeXe\undefined
- \let\LaTeXetrue\undefined
- \let\LaTeXefalse\undefined}
+\def\FBclean@on@exit{%
+ \let\ifLaTeXe\undefined
+ \let\LaTeXetrue\undefined
+ \let\LaTeXefalse\undefined
+ \let\FB@llc\loadlocalcfg
+ \let\loadlocalcfg\@gobble}
\ifx\magnification\@undefined
\else
- \def\FBstop@here{\ifFB@luatex@punct
- \activate@luatexpunct
- \fi
- \FBclean@on@exit
- \ldf@quit\CurrentOption\endinput}
+ \def\FBstop@here{%
+ \FBclean@on@exit
+ \ldf@finish\CurrentOption
+ \let\loadlocalcfg\FB@llc
+ \endinput}
\fi
\FBstop@here
\renewcommand*{\nombre}[1]{\Warning@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,24 +903,13 @@
\DeclareRobustCommand*{\FB@partname}{%
\ifFBPartNameFull
\csname ordinal\romannumeral\value{part}\endcsname\space
- \frenchpartnameord\FB@emptypart
+ \partnameord\FB@emptypart
\else
Partie%
\fi}%
}
\SetString{\partname}{\FB@partname}
\EndBabelCommands
-\AtEndOfPackage{%
- \ifFB@koma
- \ifdefined\partformat
- \FB@addto{captions}{%
- \ifFBPartNameFull
- \babel@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@Separator{\ifFBfrench\space\fi : }%
\fi
\ifFBCustomiseFigTabCaptions
- \ifx\bbl@main@language\FB@french
+ \ifFB@mainlanguage@FR
\def\FBCaption@Separator{\CaptionSeparator}%
\fi
\fi
@@ -950,7 +1016,7 @@
\ifdefined\mdots@\else\let\Mdots@\mathellipsis\fi
}
\def\bbl@frenchdots{\babel@save\Tdots@ \let\Tdots@\FBtextellipsis}
-\FB@addto{extras}{\bbl@frenchdots}
+\addto\extrasfrench{\bbl@frenchdots}
\ifFB@active@punct
\@ifpackageloaded{listings}
{\AtBeginDocument{%
@@ -1013,11 +1079,24 @@
\newif\ifFBSmallCapsFigTabCaptions \FBSmallCapsFigTabCaptionstrue
\newif\ifFBSuppressWarning
\newif\ifFBINGuillSpace
-\newif\ifFBucsNBSP
-
-\edef\FB@french{\CurrentOption}
+\ifFB@koma
+ \ifdefined\partformat
+ \def\FB@partformat@fix{%
+ \ifFBPartNameFull
+ \babel@save\partformat
+ \renewcommand*{\partformat}{\partname}%
+ \fi}
+ \addto\extrasfrench{\FB@partformat@fix}%
+ \fi
+\fi
+\def\FB@french{french}
+\def\FB@acadian{acadian}
+\newif\ifFB@mainlanguage@FR
\AtEndOfPackage{%
- \ifx\bbl@main@language\FB@french
+ \ifx\bbl@main@language\FB@french \FB@mainlanguage@FRtrue
+ \else \ifx\bbl@main@language\FB@acadian \FB@mainlanguage@FRtrue \fi
+ \fi
+ \ifFB@mainlanguage@FR
\FBGlobalLayoutFrenchtrue
\@ifclassloaded{beamer}%
{\PackageInfo{french.ldf}{%
@@ -1067,7 +1146,7 @@
\define@key{FB}{GlobalLayoutFrench}[true]%
{\csname FBGlobalLayoutFrench#1\endcsname
\ifFBGlobalLayoutFrench
- \ifx\bbl@main@language\FB@french
+ \ifFB@mainlanguage@FR
\else
\FBGlobalLayoutFrenchfalse
\PackageWarning{french.ldf}%
@@ -1138,7 +1217,7 @@
{\csname FBThinColonSpace#1\endcsname
\ifFBThinColonSpace
\renewcommand*{\FBcolonspace}{\FBthinspace}%
- \fi}%
+ \fi}%
\define@key{FB}{ThinSpaceInFrenchNumbers}[true]%
{\csname FBThinSpaceInFrenchNumbers#1\endcsname}%
\define@key{FB}{FrenchSuperscripts}[true]%
@@ -1152,8 +1231,12 @@
\define@key{FB}{OldFigTabCaptions}[true]%
{\csname FBOldFigTabCaptions#1\endcsname
\ifFBOldFigTabCaptions
- \FB@addto{extras}{\babel@save\FBCaption@Separator
- \def\FBCaption@Separator{\CaptionSeparator}}%
+ \def\FB@capsep@fix{\babel@save\FBCaption@Separator
+ \def\FBCaption@Separator{\CaptionSeparator}}%
+ \addto\extrasfrench{\FB@capsep@fix}%
+ \ifdefined\extrasacadian
+ \addto\extrasacadian{\FB@capsep@fix}%
+ \fi
\fi}%
\define@key{FB}{SmallCapsFigTabCaptions}[true]%
{\csname FBSmallCapsFigTabCaptions#1\endcsname
@@ -1354,7 +1437,7 @@
reported}%
\fi}{}%
\def\FB@ufl{\update@frenchlists}
- \ifx\bbl@main@language\FB@french
+ \ifFB@mainlanguage@FR
\update@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@options
- \ifFB@luatex@punct
- \FBcolonsp=\expandafter{\meaning\FBcolonspace}%
- \FBthinsp= \expandafter{\meaning\FBthinspace}%
- \FBguillsp=\expandafter{\meaning\FBguillspace}%
- \activate@luatexpunct
- \fi
\ifFBucsNBSP
- \renewcommand*{\FBguillspace}{\char"A0\relax}%
\renewcommand*{\FBmedkern}{\char"202F\relax}%
\renewcommand*{\FBthickkern}{\char"A0\relax}%
\ifFBThinSpaceInFrenchNumbers
@@ -1665,7 +1741,7 @@
\FB@ufl
\fi
}
-\FB@addto{extras}{\bbl@frenchlistlayout}
+\addto\extrasfrench{\bbl@frenchlistlayout}
\def\bbl@frenchindent{%
\ifFBGlobalLayoutFrench
\else
@@ -1681,12 +1757,12 @@
\@afterindenttrue
\fi
\fi}
-\FB@addto{extras}{\bbl@frenchindent}
-\FB@addto{noextras}{\bbl@nonfrenchindent}
+\addto\extrasfrench{\bbl@frenchindent}
+\addto\noextrasfrench{\bbl@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@on@exit
-\let\FB@llc\loadlocalcfg
-\let\loadlocalcfg\@gobble
\ldf@finish\CurrentOption
\let\loadlocalcfg\FB@llc
%%
diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf b/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf
index c81e0f58666..e36542d717b 100644
--- a/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf
+++ b/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf
@@ -24,7 +24,7 @@
%% Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
%%
\ProvidesLanguage{frenchb}
- [2017/10/19 v3.3d French support from the babel system]
+ [2018/01/30 v3.4a French support from the babel system]
\def\bbl@tempa{frenchb}
\ifx\CurrentOption\bbl@tempa
\let\l@frenchb\l@french
diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua
index 1e706920577..76c8d5bda35 100644
--- a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua
+++ b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua
@@ -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 @@ nobreak.penalty = 10000
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 FBspacing = luatexbase.attributes['FB@spacing']
local addDPspace = luatexbase.attributes['FB@addDPspace']
local addGUILspace = luatexbase.attributes['FB@addGUILspace']
local FBucsNBSP = luatexbase.attributes['FB@ucsNBSP']
+local FBdialect = luatexbase.attributes['FB@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 @@ local function french_punctuation (head)
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 @@ local function french_punctuation (head)
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 @@ local function french_punctuation (head)
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 @@ local function french_punctuation (head)
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 @@ local function french_punctuation (head)
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))