summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-05-03 00:02:32 +0000
committerKarl Berry <karl@freefriends.org>2016-05-03 00:02:32 +0000
commitaa8cd19f05a7e49e3b95f7d46750a85e80fa6e8b (patch)
tree6a0fbf43684b6e15df2fac3000b470de5f229459 /Master/texmf-dist/source
parent07d14d88e9e67dacfd1d8955fc7fdb16aea0b324 (diff)
babel-french
git-svn-id: svn://tug.org/texlive/trunk@40853 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/generic/babel-french/frenchb.dtx335
1 files changed, 126 insertions, 209 deletions
diff --git a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx
index 5356626c9e6..3d3d55e8e75 100644
--- a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx
+++ b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx
@@ -1,4 +1,4 @@
-%\CheckSum{3306}
+%\CheckSum{3320}
%
%\iffalse
% Tell the \LaTeX\ system who we are and write an entry on the
@@ -13,14 +13,14 @@
%<ldf>\ProvidesLanguage{frenchb}
%\ProvidesFile{frenchb.dtx}
%<*!lua>
- [2016/03/18 v3.2a French support from the babel system]
+ [2016/04/18 v3.2b French support from the babel system]
%</!lua>
%<*internal>
\iffalse
%</internal>
%<*lua>
--
--- File `frenchb.lua' generated from frenchb.dtx [2016/03/18 v3.2a]
+-- File `frenchb.lua' generated from frenchb.dtx [2016/04/18 v3.2b]
--
-- Copyright © 2014-2016 Daniel Flipo
-- <daniel (dot) flipo (at) free (dot) fr>
@@ -63,7 +63,7 @@
\usepackage{url}
\usepackage[colorlinks,urlcolor=blue,unicode]{hyperref}
\newcommand*\babel{\textsf{babel}}
-\newcommand*\frenchb{\textsf{frenchb}}
+\newcommand*\frenchb{\textsf{babel-french}}
\newcommand*\Lopt[1]{\texttt{#1}}
\newcommand*\opt[1]{\texttt{#1}}
\newcommand*\file[1]{\texttt{#1}}
@@ -629,6 +629,19 @@
% |\FB@fg| to |\fg|; |\frquote{}| now works properly when the
% \pkg{xspace} package is loaded.
%
+% Version 3.2b is the first one designed to work with LuaTeX
+% v.~0.95 as included in TeXLive 2016 (LuaTeX's new glue node
+% structure is not compatible with previous versions).
+%
+% \textbf{Warning to Lua(La)TeX users:} the lua code included in
+% \file{frenchb.lua} v.~3.2b will \emph{not work} on older
+% installations (TL2015 f.i.), so \frenchb{} reverts to active
+% characters while handling high punctuation with LuaTeX engines
+% older than 0.95!
+% The best way to go is to upgrade to TL2016 or equivalent asap.
+% Xe(La)TeX and pdf(La)TeX users can safely use \frenchb{} v.~3.2b
+% on older installations too.
+%
% \subsubsection*{What's new in version 3.1?}
%
% New command |\frquote{}| meant to enter French quotations,
@@ -661,8 +674,10 @@
% \item The last but not least change affects the (recent)
% LuaTeX-based engines, (this means version 0.76 as included in
% TL2013 and up): active characters are no longer used in French
-% for `high punctuation'. Functionalities and user interface
-% are unchanged.
+% for `high punctuation'%
+% \footnote{The current \frenchb{} version requires LuaTeX
+% v.~0.95 as included in TL2016, see above.}.
+% Functionalities and user interface are unchanged.
%
% Many thanks to Paul Isambert who provided the basis for the
% lua code (see his presentation at GUT'2010) and kindly
@@ -677,141 +692,6 @@
% (\fbo{INGuillSpace}) to follow French `Imprimerie Nationale'
% recommendations regarding quotes' spacing.
%
-% \subsubsection*{What's new in version 2.6?}
-%
-% The way \frenchb{} handles list environments has been completely
-% redesigned in version~2.6 due to a long standing bug affecting
-% enumerate lists inside itemize lists. Horizontal indentation of
-% itemize, enumerate and description lists differs now from
-% previous versions, an option for backward compatibility is
-% provided: \fbsetup{ListOldLayout}.
-%
-% \frenchb{} is now compatible with the \pkg{paralist} package.
-%
-% Regarding the layout of figures' and tables' captions, version
-% 2.6c is now fully compatible with AMS and koma-script classes
-% and with \file{caption} and \pkg{floatrow} packages.
-% Starting with version 2.6c, the \file{frenchb.cfg} file is no
-% longer generated from \file{frenchb.dtx}, but it is still loaded
-% (if found) for backward compatibility.
-%
-% \subsubsection*{What's new in version 2.5?}
-%
-% The main change is that active characters are no longer used
-% in French with (recent) XeTeX-based engines (they still are
-% with TeX-based engines). All the functionalities (automatic
-% insertion of missing spaces before |:;!?| or bare replacement
-% of typed spaces with suitable unbreabable ones, tuning of the
-% spaces width) remain available and the user interface is
-% unchanged. The use of active characters is replaced by the
-% |\XeTeXinterchartoks| mechanism (adapted from the
-% \pkg{polyglossia} package).
-%
-% A new command |\NoAutoSpacing| has been added. It should be used
-% \emph{inside a group} instead of |\shorthandoff{;:!?}| whenever
-% active characters or automatic spacing of French punctuation or
-% quote characters conflict with other packages; it is designed to
-% work with TeX-, LuaTeX- and XeTeX-based engines.
-%
-% Bug corrections: |\frenchspacing| and |\nonfrenchspacing| are no
-% longer messed up by \file{frenchb.ldf}.
-%
-% \subsubsection*{What's new in version 2.4?}
-%
-% A new option \fbo{SuppressWarning} has been added (desactivated
-% by default) to suppress warnings if |\@makecaption| has been
-% redefined or if the \pkg{bigfoot} package is in use.
-%
-% French hyphenation patterns are now coded in Unicode, see file
-% \file{hyph-fr.tex}. Extra code has been added to deal with
-% hyphenation of the French ``apostrophe'' with XeTeX and LuaTeX
-% engines.
-%
-% Better compatibility with the \pkg{enumitem} package.
-%
-% When typewriter fonts are in use (hence in verbatim mode) no
-% space is added after `«' and before `»' when they are entered as
-% characters (see \fbsetup{}).
-%
-% \subsubsection*{What's new in version 2.3?}
-%
-% Starting with version~2.3a, \frenchb{} no longer inserts spaces
-% automatically before `|:;!?|' when a typewriter font is in use;
-% this was suggested by Yannis Haralambous to prevent
-% spurious spaces in computer source code or expressions like
-% \texttt{C\string:/foo}, \texttt{http\string://foo.bar},
-% etc. An option (\fbo{OriginalTypewriter}) is provided to get
-% back to the former behaviour of \frenchb{}.
-%
-% Another probably invisible change: lowercase conversion in
-% |\up{}| is now achieved by the \LaTeX{} command |\MakeLowercase|
-% instead of \TeX's |\lowercase| command. This prevents error
-% messages when diacritics are used inside |\up{}| (diacritics
-% should \emph{never} be used in superscripts though!).
-%
-% \subsubsection*{What's new in version 2.2?}
-%
-% Starting with version~2.2a, \frenchb{} alters the layout of
-% lists, footnotes, and the indentation of first paragraphs of
-% sections) \emph{only if} French is the ``main language''
-% (i.e. \babel's last language option). The layout is global for
-% the whole document: lists, etc.\ look the same in French and in
-% other languages, everything is typeset ``à la française''
-% if French is the ``main language'', otherwise \frenchb{} doesn't
-% change anything regarding lists, footnotes, and indentation of
-% paragraphs.
-%
-% \subsubsection*{What's new in version 2.1?}
-%
-% A new command |\fup| is provided to typeset better looking
-% superscripts; it was designed using ideas from Jacques André,
-% Thierry Bouche and René Fritz, thanks to all of them!
-% Former command |\up| is now defined as |\fup|, an option
-% \fbo{FrenchSuperscripts=false} is provided for
-% backward compatibility.
-%
-% \subsubsection*{What's new in version 2.0?}
-%
-% Here is the list of all changes:
-% \begin{itemize}
-% \item Support for \LaTeX-2.09 and for \LaTeXe{} in compatibility
-% mode has been dropped. This version is meant for \LaTeXe{} and
-% Plain based formats (like \file{bplain}). \LaTeXe{} formats
-% based on ml\TeX{} are no longer supported either (plenty of
-% good 8-bits fonts are available now, so T1 encoding should
-% be preferred for typesetting in French). A warning is issued
-% when OT1 encoding is in use at the |\begin{document}|.
-% \item Customisation should now be handled only by command
-% \fbsetup{}, \file{frenchb.cfg} (kept for compatibility)
-% should no longer be used. See section~\ref{ssec-custom} for
-% the list of available options.
-% \item Captions in figures and tables have changed in French: former
-% abbreviations ``Fig.'' and ``Tab.'' have been replaced by full
-% names ``Figure'' and ``Table''. If this leads to formatting
-% problems in captions, you can add the following two commands to
-% your preamble (after loading \babel) to get the former captions\\
-% |\addto\captionsfrench{\def\figurename{{\scshape Fig.}}}|\\
-% |\addto\captionsfrench{\def\tablename{{\scshape Tab.}}}|.
-% \item The |\nombre| command is now provided by the \pkg{numprint}
-% package best loaded with the option |autolanguage| if number
-% formatting should depend on the current language.
-% \item The |\bsc| command no longer uses an |\hbox| to stop
-% hyphenation of names but a |\kern0pt| instead. This change
-% enables \file{microtype} to fine tune the length of the
-% argument of |\bsc|; as a side-effect, compound names like
-% Dupont-Durand can now be hyphenated on explicit hyphens.
-% You can get back to the former behaviour of |\bsc| by adding\\
-% |\renewcommand*{\bsc}[1]{\leavevmode\hbox{\scshape #1}}|\\
-% to the preamble of your document.
-% \item Footnotes are now displayed ``à la française'' for the
-% whole document, except with an explicit\\
-% \fbsetup{AutoSpaceFootnotes=false,FrenchFootnotes=false}.\\
-% Add this command if you want standard footnotes. It is still
-% possible to revert locally to the standard layout of footnotes
-% by adding |\StandardFootnotes| (inside a \env{minipage}
-% environment for instance).
-% \end{itemize}
-%
% \StopEventually{}
%
% \changes{v2.6c}{2013/05/20}{Dummy file frenchb.cfg is no longer
@@ -931,13 +811,13 @@
\begingroup
\newlinechar=`\^^J
\def\\{^^J(frenchb.ldf) }%
- \errhelp{#2}\errmessage{\\#1}%
+ \errhelp{#2}\errmessage{\\#1^^J}%
\endgroup}
\def\fb@warning#1{%
\begingroup
\newlinechar=`\^^J
\def\\{^^J(frenchb.ldf) }%
- \message{\\#1}%
+ \message{\\#1^^J}%
\endgroup}
\def\fb@info#1{%
\begingroup
@@ -1127,38 +1007,66 @@
% `high punctuation' management with LuaTeX engines.}
%
% \begin{macro}{\ifFB@active@punct}
-% \begin{macro}{\ifFB@xetex@punct}
+% \begin{macrocode}
+\newif\ifFB@active@punct \FB@active@puncttrue
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\ifFB@luatex@punct}
% Three internal flags are needed for the three different techniques
% used for `high punctuation' management.
%
-% With LuaTeX, starting with version 0.76, callbacks are used to
+% 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).
% \begin{macrocode}
-\newif\ifFB@active@punct \FB@active@puncttrue
\newif\ifFB@luatex@punct
\ifFBLuaTeX
- \ifnum\luatexversion>75
+ \ifnum\luatexversion>94
\FB@luatex@puncttrue\FB@active@punctfalse
+ \else
+ \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.}%
+ \else
+ \PackageWarning{frenchb.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}%
+ \fi
\fi
\fi
% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{\ifFB@xetex@punct}
% For XeTeX, the availability of |\XeTeXinterchartokenstate|
% decides whether the `high punctuation' characters (|;| |!| |?|
% and |:|) have to be made |\active| or not.
+%
+% \changes{v3.2b}{2016/04/18}{New counter \cs{FB@nonchar} needed for
+% non characters: it's value will be 4095 for new engines and 255
+% for older ones.}
+%
+% The number of available character classes was increased from 256
+% to 4096 in XeTeX v.~0.99996, the class for non characters is now
+% 4095 instead of 255.
% \begin{macrocode}
+\newcount\FB@nonchar
\newif\ifFB@xetex@punct
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname XeTeXinterchartokenstate\endcsname\relax
\else
\FB@xetex@puncttrue\FB@active@punctfalse
+ \ifdim\the\XeTeXversion\XeTeXrevision pt<0.99996pt
+ \FB@nonchar=255 \relax
+ \else
+ \FB@nonchar=4095 \relax
+ \fi
\fi
% \end{macrocode}
% \end{macro}
-% \end{macro}
-% \end{macro}
%
% \begin{macro}{\FBcolonspace}
% \begin{macro}{\FBthinspace}
@@ -1224,6 +1132,9 @@
% \changes{v3.1j}{2015/10/16}{Loading luatexbase.sty is no longer
% needed with LaTeX release 2015/10/01 or later.}
%
+% \changes{v3.2b}{2016/04/18}{Load ltluatex.tex for plain LuaTeX to
+% ensure \cs{newattribute} is defined.}
+%
% The following |\directlua| call ensures compatibility with LaTeX
% releases prior to 2015/10/01: the |\localleftbox| primitive%
% \footnote{used by \cs{frquote}, see p.~\pageref{cs:localleftbox}.}
@@ -1236,32 +1147,18 @@
%
% We define two LuaTeX attributes to control spacing in French
% for `high punctuation' and quotes, making sure that
-% |\newattribute| or former |\newluatexattribute| is defined.
+% |\newattribute| is defined.
% \begin{macrocode}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname newluafunction\endcsname\relax
% \end{macrocode}
-% This code is for Plain or LaTeX versions prior to 2015/10/01.
+% This code is for Plain: load\file{ltluatex.tex} if it hasn't been
+% loaded before \babel.
% \begin{macrocode}
- \ifLaTeXe
- \AtEndOfPackage{%
- \RequirePackage{luatexbase}%
- \newluatexattribute\FB@addDPspace \FB@addDPspace=1 \relax
- \newluatexattribute\FB@addGUILspace \FB@addGUILspace=0 \relax
- }
- \else
- \input luatexbase.sty
- \newluatexattribute\FB@addDPspace \FB@addDPspace=1 \relax
- \newluatexattribute\FB@addGUILspace \FB@addGUILspace=0 \relax
- \fi
- \else
-% \end{macrocode}
-% This code is for recent LaTeX versions (starting with 2015/10/01)
-% or Plain when \file{ltluatex.tex} has been loaded before \babel.
-% \begin{macrocode}
- \newattribute\FB@addDPspace \FB@addDPspace=1 \relax
- \newattribute\FB@addGUILspace \FB@addGUILspace=0 \relax
+ \input ltluatex.tex
\fi
+ \newattribute\FB@addDPspace \FB@addDPspace=1 \relax
+ \newattribute\FB@addGUILspace \FB@addGUILspace=0 \relax
\ifLaTeXe
\PackageInfo{frenchb.ldf}{No need for active punctuation
characters\MessageBreak with this version
@@ -1344,7 +1241,6 @@ local HLIST = node_id("hlist")
local TEMP = node_id("temp")
local KERN = node_id("kern")
local GLUE = node_id("glue")
-local GSPEC = node_id("glue_spec")
local GLYPH = node_id("glyph")
local PENALTY = node_id("penalty")
local nobreak = new_node(PENALTY)
@@ -1385,6 +1281,9 @@ local guilsh = guil10.shrink/65536/1.11
% nil in case of invalid font table (i.e. lcircle1.pfb). In such
% cases frenchb leaves the node list unchanged.}
%
+% \changes{v3.2b}{2016/04/18}{frenchb.lua: glue\_spec removed;
+% starting with LuaTeX 0.95, glue specifications fit in glue.}
+%
% \begin{macrocode}
local font_table = {}
local function new_glue_scaled (fid,width,stretch,shrink)
@@ -1398,12 +1297,10 @@ local function new_glue_scaled (fid,width,stretch,shrink)
end
end
local gl = new_node(GLUE,0)
- local gl_spec = new_node(GSPEC)
if fp then
- gl_spec.width = width * fp.space
- gl_spec.stretch = stretch * fp.space_stretch
- gl_spec.shrink = shrink * fp.space_shrink
- gl.spec = gl_spec
+ gl.width = width * fp.space
+ gl.stretch = stretch * fp.space_stretch
+ gl.shrink = shrink * fp.space_shrink
return gl
else
return nil
@@ -1467,13 +1364,12 @@ local function french_punctuation (head)
% positive glues (actually glues > 1 sp, for tabular `l'
% columns) are to be replaced by a nobreakspace.
% \begin{macrocode}
- local glue = prev_id == GLUE and prev_subtype == 0
+ local is_glue = prev_id == GLUE
local glue_wd
- if glue then
- glue_spec = prev.spec
- glue_wd = glue_spec.width
+ if is_glue then
+ glue_wd = prev.width
end
- local realglue = glue and glue_wd > 1
+ local realglue = is_glue and glue_wd > 1
% \end{macrocode}
% For characters for which |FB_punct_thin| or |FB_punct_thick| is
% \emph{true}, the amount of spacing to be typeset before them
@@ -1497,7 +1393,7 @@ local function french_punctuation (head)
local auto = SBDP and SBDP > 0
if auto then
if (prev_char and FB_punct_null[prev_char]) or
- (glue and glue_wd <= 1) or
+ (is_glue and glue_wd <= 1) or
(prev_id == HLIST and prev_subtype == 3) or
(prev_id == TEMP) then
auto = false
@@ -1551,12 +1447,12 @@ local function french_punctuation (head)
% Correction for tabular `c' (glue 0 plus 1 fil) and `l' (glue 1sp)
% columns:
% \begin{macrocode}
- if glue and glue_wd <= 1 then
+ if is_glue and glue_wd <= 1 then
addgl = false
end
local fbglue = new_glue_scaled(fid,guilwd,guilst,guilsh)
if addgl and fbglue then
- if glue then
+ if is_glue then
head = remove_node(head,prev,true)
end
insert_node_before(head, item, copy_node(nobreak))
@@ -1609,10 +1505,9 @@ local function french_punctuation (head)
end
end
end
- local glue = next_id == GLUE and next_subtype == 0
- if glue then
- glue_spec = next.spec
- glue_wd = glue_spec.width
+ local is_glue = next_id == GLUE
+ if is_glue then
+ glue_wd = next.width
end
local addgl = (next_char and not FB_guil_null[next_char]) or
(next and not next_char)
@@ -1621,13 +1516,13 @@ local function french_punctuation (head)
% `«' character needs to be coded as |\mbox{«}| for proper spacing
% (|\NoAutoSpacing| is another option).
% \begin{macrocode}
- if glue and glue_wd == 0 then
+ if is_glue and glue_wd == 0 then
addgl = false
end
local fid = item.font
local fbglue = new_glue_scaled(fid,guilwd,guilst,guilsh)
if addgl and fbglue then
- if glue then
+ if is_glue then
head = remove_node(head,next,true)
end
insert_node_after(head, item, copy_node(fbglue))
@@ -1725,7 +1620,7 @@ return french_punctuation
% \fbsetup{} (see section~\ref{ssec-keyval}).
%
% The default value for |\XeTeXcharclass| is 0 for characters tokens
-% and 255 for all other tokens (glues, kerns, math and box
+% and |\FB@nonchar| for all other tokens (glues, kerns, math and box
% boundaries, etc.).
% These defaults should not be changed otherwise the spacing before
% the `high punctuation' characters and inside quotes might not be
@@ -1746,6 +1641,7 @@ return french_punctuation
%
% The following part holds specific code for punctuation with XeTeX
% engines.
+%
% \begin{macrocode}
\ifFB@xetex@punct
\ifLaTeXe
@@ -1882,11 +1778,11 @@ return french_punctuation
% 0 plus 1 fil'' in tabular `c' columns or \env{lstlisting}
% environment should not trigger any extra space; they will still do
% when \fbo{AutoSpacePunctuation} is true: unfortunately
-% |\XeTeXcharclass|=255 isn't specific to glue tokens (this class
-% includes box and math boundaries f.i.), so the |\else| part cannot
-% be omitted.
+% |\XeTeXcharclass=\FB@nonchar| isn't specific to glue tokens (this
+% class includes box and math boundaries f.i.), so the |\else| part
+% cannot be omitted.
% \begin{macrocode}
- \XeTeXinterchartoks 255 \FB@punctthick = {%
+ \XeTeXinterchartoks \FB@nonchar \FB@punctthick = {%
\ifhmode
\ifdim\lastskip>1sp
\unskip\penalty\@M\FBcolonspace
@@ -1901,7 +1797,7 @@ return french_punctuation
\ifhmode\FDP@thinspace\fi}%
\XeTeXinterchartoks \FB@guilf \FB@punctthin = {%
\FDP@thinspace}%
- \XeTeXinterchartoks 255 \FB@punctthin = {%
+ \XeTeXinterchartoks \FB@nonchar \FB@punctthin = {%
\ifhmode
\ifdim\lastskip>1sp
\unskip\penalty\@M\FBthinspace
@@ -1911,13 +1807,13 @@ return french_punctuation
\fi}%
\XeTeXinterchartoks \FB@guilo \z@ = {%
\ifFBAutoSpaceGuill\FBguillspace\fi}%
- \XeTeXinterchartoks \FB@guilo 255 = {%
+ \XeTeXinterchartoks \FB@guilo \FB@nonchar = {%
\ifFBAutoSpaceGuill\FBguillspace\ignorespaces\fi}%
\XeTeXinterchartoks \z@ \FB@guilf = {%
\ifFBAutoSpaceGuill\FBguillspace\fi}%
\XeTeXinterchartoks \FB@punctthin \FB@guilf = {%
\ifFBAutoSpaceGuill\FBguillspace\fi}%
- \XeTeXinterchartoks 255 \FB@guilf = {%
+ \XeTeXinterchartoks \FB@nonchar \FB@guilf = {%
\ifFBAutoSpaceGuill\unskip\FBguillspace\fi}%
% \end{macrocode}
% This will avoid spurious spaces in (!), [?] and with Unicode
@@ -2166,16 +2062,25 @@ return french_punctuation
% suggested by MPG.}
%
% \begin{macro}{\NoAutoSpacing}
-% The following command will switch off active punctuation
-% characters (if any) and disable automatic spacing for French quote
-% characters. It is engine independent (works for TeX, LuaTeX and
+% The following command will disable automatic spacing for high
+% punctuation and French quote characters; it also switches off
+% active punctuation characters (if any).
+% It is engine independent (works for TeX, LuaTeX and
% XeTeX based engines) and is meant to be used inside a group.
%
+% \changes{v3.2b}{2016/04/18}{\cs{noautospace@beforeFDP} added to
+% \cs{NoAutoSpacing} in case of active punctuation.
+% \cs{NoAutoSpacing} made robust.}
+%
+% In case |\NoAutoSpacing| is used in moving arguments (footnotes,
+% headers, etc.) |\noautospace@beforeFDP| will do the job (catcode
+% changes are not taken into account, |\shorthandoff{;:!?}| does
+% nothing).
% \begin{macrocode}
-\newcommand*{\NoAutoSpacing}{\FBAutoSpaceGuillfalse
- \ifFB@active@punct\shorthandoff{;:!?}\fi
- \ifFB@xetex@punct\XeTeXinterchartokenstate=0 \fi
- \ifFB@luatex@punct\FB@addDPspace=0 \FB@addGUILspace=0 \fi
+\DeclareRobustCommand*{\NoAutoSpacing}{\FBAutoSpaceGuillfalse
+ \ifFB@active@punct\noautospace@beforeFDP\shorthandoff{;:!?}\fi
+ \ifFB@xetex@punct\XeTeXinterchartokenstate=0 \fi
+ \ifFB@luatex@punct\FB@addDPspace=0 \FB@addGUILspace=0 \fi
}
% \end{macrocode}
% \end{macro}
@@ -3188,10 +3093,6 @@ return french_punctuation
\egroup
% \end{macrocode}
%
-% The \pkg{caption} and \pkg{floatrow} packages are compatible
-% with \frenchb{} if they are loaded after \babel{} (a warning is
-% printed in the .log file when they are loaded too early).
-%
% No warning is issued for SMF and AMS classes as their layout of
% captions is compatible with French typographic standards.
%
@@ -3273,6 +3174,9 @@ return french_punctuation
% \changes{v2.6c}{2013/05/18}{Warning added when the caption
% or floatrow package is loaded before babel/frenchb.}
%
+% The \pkg{caption}, \pkg{subcaption} and \pkg{floatrow} packages are
+% compatible with \frenchb{} if they are loaded after \babel{}.
+%
% Check if package \pkg{caption} is loaded now (before
% \babel/\frenchb), then issue a warning advising to load it
% after \babel/\frenchb{} and disable the standard warning.
@@ -3285,7 +3189,20 @@ return french_punctuation
{}
% \end{macrocode}
%
-% Same for package \file{floatrow}.
+% \changes{v3.2b}{2016/03/30}{Warning added when the subcaption
+% package is loaded before babel/frenchb.}
+%
+% Same for package \pkg{subcaption}.
+% \begin{macrocode}
+\@ifpackageloaded{subcaption}
+ {\FBWarning{frenchb.ldf}%
+ {Please load the "subcaption" package\MessageBreak
+ AFTER babel/frenchb; reported}%
+ \@FBwarning@capsepfalse}%
+ {}
+% \end{macrocode}
+%
+% Same for package \pkg{floatrow}.
% \begin{macrocode}
\@ifpackageloaded{floatrow}
{\FBWarning{frenchb.ldf}%