diff options
author | Karl Berry <karl@freefriends.org> | 2016-05-18 21:58:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-05-18 21:58:47 +0000 |
commit | fd4db2fd78326629cdaa61f2bbca86682fa2819e (patch) | |
tree | 8ce47b799786f854d1f4a66efa0661f244671e9c /Master/texmf-dist/tex | |
parent | 17ee5a848b1f535a07aad806695a5c41841bd3dd (diff) |
babel-french (18may16)
git-svn-id: svn://tug.org/texlive/trunk@41244 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/frenchb.ldf | 151 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/frenchb.lua | 15 |
2 files changed, 94 insertions, 72 deletions
diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf b/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf index eb0939c313f..0e068808aad 100644 --- a/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf +++ b/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf @@ -33,7 +33,7 @@ %% extension .ins) which are part of the distribution. %% \ProvidesLanguage{frenchb} - [2016/04/18 v3.2b French support from the babel system] + [2016/05/14 v3.2c French support from the babel system] %% %% File `frenchb.ldf' %% Babel package for LaTeX version 2e @@ -168,13 +168,10 @@ \expandafter\addto\csname #1\FB@CurOpt\endcsname{#2}} \FB@addto{extras}{\bbl@frenchspacing} \FB@addto{noextras}{\bbl@nonfrenchspacing} -\newif\ifFBAutoSpaceGuill \FBAutoSpaceGuilltrue -\newif\ifFB@active@punct \FB@active@puncttrue +\newif\ifFB@active@punct \FB@active@puncttrue \newif\ifFB@luatex@punct \ifFBLuaTeX - \ifnum\luatexversion>94 - \FB@luatex@puncttrue\FB@active@punctfalse - \else + \ifnum\luatexversion<95 \ifx\PackageWarning\@undefined \fb@warning{Please upgrade LuaTeX to version 0.95 or above!\\% frenchb will make high punctuation characters (;:!?) active\\% @@ -185,6 +182,8 @@ frenchb will make high punctuation characters\MessageBreak (;:!?) active with LuaTeX < 0.95;\MessageBreak reported}% \fi + \else + \FB@luatex@puncttrue\FB@active@punctfalse \fi \fi \newcount\FB@nonchar @@ -193,24 +192,38 @@ \expandafter\ifx\csname XeTeXinterchartokenstate\endcsname\relax \else \FB@xetex@puncttrue\FB@active@punctfalse - \ifdim\the\XeTeXversion\XeTeXrevision pt<0.99996pt + \ifdim\the\XeTeXversion\XeTeXrevision pt<0.99994pt \FB@nonchar=255 \relax \else \FB@nonchar=4095 \relax \fi \fi \newcommand*{\FBcolonspace}{\space} -\newcommand*{\FBthinspace}{\hskip .16667em \relax} +\newcommand*{\FBthinspace}{\hskip.5\fontdimen2\font \relax} \newskip\FBcolonskip \FBcolonskip=3.33pt plus 1.665pt minus 1.11pt \relax \newskip\FBthinskip \FBthinskip=1.66672pt \relax +\newif\ifFB@spacing \FB@spacingtrue +\newcommand*{\FB@spacing@on}{% + \ifFB@luatex@punct + \FB@spacing=1 \relax + \else + \FB@spacingtrue + \fi} +\newcommand*{\FB@spacing@off}{% + \ifFB@luatex@punct + \FB@spacing=0 \relax + \else + \FB@spacingfalse + \fi} \ifFB@luatex@punct \directlua{tex.enableprimitives("", tex.extraprimitives("omega"))} \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname newluafunction\endcsname\relax \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 \ifLaTeXe @@ -299,42 +312,46 @@ \XeTeXinterchartokenstate=1 \XeTeXcharclass `\: = \FB@punctthick \XeTeXinterchartoks \z@ \FB@punctthick = {% - \ifhmode\FDP@colonspace\fi}% + \ifFB@spacing\ifhmode\FDP@colonspace\fi\fi}% \XeTeXinterchartoks \FB@guilf \FB@punctthick = {% - \FDP@colonspace}% + \ifFB@spacing\FDP@colonspace\fi}% \XeTeXinterchartoks \FB@nonchar \FB@punctthick = {% - \ifhmode - \ifdim\lastskip>1sp - \unskip\penalty\@M\FBcolonspace - \else - \FDP@colonspace - \fi - \fi}% + \ifFB@spacing + \ifhmode + \ifdim\lastskip>1sp + \unskip\penalty\@M\FBcolonspace + \else + \FDP@colonspace + \fi + \fi + \fi}% \bbl@for\FB@char {`\;,`\!,`\?}% {\XeTeXcharclass\FB@char=\FB@punctthin}% \XeTeXinterchartoks \z@ \FB@punctthin = {% - \ifhmode\FDP@thinspace\fi}% + \ifFB@spacing\ifhmode\FDP@thinspace\fi\fi}% \XeTeXinterchartoks \FB@guilf \FB@punctthin = {% - \FDP@thinspace}% + \ifFB@spacing\FDP@thinspace\fi}% \XeTeXinterchartoks \FB@nonchar \FB@punctthin = {% - \ifhmode - \ifdim\lastskip>1sp - \unskip\penalty\@M\FBthinspace - \else - \FDP@thinspace - \fi - \fi}% + \ifFB@spacing + \ifhmode + \ifdim\lastskip>1sp + \unskip\penalty\@M\FBthinspace + \else + \FDP@thinspace + \fi + \fi + \fi}% \XeTeXinterchartoks \FB@guilo \z@ = {% - \ifFBAutoSpaceGuill\FBguillspace\fi}% + \ifFB@spacing\FBguillspace\fi}% \XeTeXinterchartoks \FB@guilo \FB@nonchar = {% - \ifFBAutoSpaceGuill\FBguillspace\ignorespaces\fi}% + \ifFB@spacing\FBguillspace\ignorespaces\fi}% \XeTeXinterchartoks \z@ \FB@guilf = {% - \ifFBAutoSpaceGuill\FBguillspace\fi}% + \ifFB@spacing\FBguillspace\fi}% \XeTeXinterchartoks \FB@punctthin \FB@guilf = {% - \ifFBAutoSpaceGuill\FBguillspace\fi}% + \ifFB@spacing\FBguillspace\fi}% \XeTeXinterchartoks \FB@nonchar \FB@guilf = {% - \ifFBAutoSpaceGuill\unskip\FBguillspace\fi}% + \ifFB@spacing\unskip\FBguillspace\fi}% \bbl@for\FB@char {`\[,`\(,"A0,"202F}% {\XeTeXcharclass\FB@char=\FB@punctnul}% @@ -350,6 +367,7 @@ \initiate@active@char{!}% \initiate@active@char{?}% \declare@shorthand{french}{;}{% + \ifFB@spacing \ifhmode \ifdim\lastskip>1sp \unskip\penalty\@M\FBthinspace @@ -357,8 +375,10 @@ \FDP@thinspace \fi \fi - \string;} + \fi + \string;} \declare@shorthand{french}{!}{% + \ifFB@spacing \ifhmode \ifdim\lastskip>1sp \unskip\penalty\@M\FBthinspace @@ -366,8 +386,10 @@ \FDP@thinspace \fi \fi - \string!} + \fi + \string!} \declare@shorthand{french}{?}{% + \ifFB@spacing \ifhmode \ifdim\lastskip>1sp \unskip\penalty\@M\FBthinspace @@ -375,8 +397,10 @@ \FDP@thinspace \fi \fi - \string?} + \fi + \string?} \declare@shorthand{french}{:}{% + \ifFB@spacing \ifhmode \ifdim\lastskip>1sp \unskip\penalty\@M\FBcolonspace @@ -384,7 +408,8 @@ \FDP@colonspace \fi \fi - \string:} + \fi + \string:} \declare@shorthand{system}{:}{\string:} \declare@shorthand{system}{!}{\string!} \declare@shorthand{system}{?}{\string?} @@ -419,33 +444,13 @@ \AutoSpaceBeforeFDP \fi \ifLaTeXe - \DeclareRobustCommand\ttfamilyFB{% - \FBAutoSpaceGuillfalse - \ifFB@luatex@punct\FB@addGUILspace=0 \fi - \noautospace@beforeFDP\ttfamilyORI}% - \DeclareRobustCommand\rmfamilyFB{% - \FBAutoSpaceGuilltrue - \ifFB@luatex@punct\FB@addGUILspace=1 \fi - \ifFBAutoSpacePunctuation - \autospace@beforeFDP - \else - \noautospace@beforeFDP - \fi - \rmfamilyORI}% - \DeclareRobustCommand\sffamilyFB{% - \FBAutoSpaceGuilltrue - \ifFB@luatex@punct\FB@addGUILspace=1 \fi - \ifFBAutoSpacePunctuation - \autospace@beforeFDP - \else - \noautospace@beforeFDP - \fi - \sffamilyORI}% + \DeclareRobustCommand\ttfamilyFB{\FB@spacing@off \ttfamilyORI} + \DeclareRobustCommand\rmfamilyFB{\FB@spacing@on \rmfamilyORI} + \DeclareRobustCommand\sffamilyFB{\FB@spacing@on \sffamilyORI} \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 +\DeclareRobustCommand*{\NoAutoSpacing}{% + \FB@spacing@off + \ifFB@active@punct\shorthandoff{;:!?}\fi } \ifLaTeXe \else @@ -471,17 +476,19 @@ minus.8\fontdimen4\font} \ifFB@luatex@punct \DeclareRobustCommand*{\FB@og}{\leavevmode - \bgroup\FB@addGUILspace=1 \guillemotleft\egroup} + \bgroup\FB@spacing=0 \guillemotleft\egroup + \FBguillspace} \DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi - \bgroup\FB@addGUILspace=1 \guillemotright\egroup} + \FBguillspace + \bgroup\FB@spacing=0 \guillemotright\egroup} \fi \ifFB@xetex@punct \DeclareRobustCommand*{\FB@og}{\leavevmode - \bgroup\FBAutoSpaceGuillfalse\guillemotleft\egroup + \bgroup\FB@spacingfalse\guillemotleft\egroup \FBguillspace} \DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi \FBguillspace - \bgroup\FBAutoSpaceGuillfalse\guillemotright\egroup} + \bgroup\FB@spacingfalse\guillemotright\egroup} \fi \ifFB@active@punct \DeclareRobustCommand*{\FB@og}{\leavevmode @@ -1169,10 +1176,15 @@ \XeTeXcharclass"A0 = \FB@guilnul \XeTeXcharclass"202F = \FB@guilnul \fi + \ifFB@active@punct + \FBWarning{frenchb.ldf}% + {Option og=« not supported with this version + of\MessageBreak LuaTeX/XeTeX; reported}% + \fi \else \newcommand*{\FB@@og}{% \iflanguage{french}% - {\ifFBAutoSpaceGuill\FB@og\ignorespaces + {\ifFB@spacing\FB@og\ignorespaces \else\guillemotleft \fi}% {\guillemotleft}}% @@ -1210,10 +1222,15 @@ \XeTeXcharclass"A0 = \FB@guilnul \XeTeXcharclass"202F = \FB@guilnul \fi + \ifFB@active@punct + \FBWarning{frenchb.ldf}% + {Option fg=» not supported with this version + of\MessageBreak LuaTeX/XeTeX; reported}% + \fi \else \newcommand*{\FB@@fg}{% \iflanguage{french}% - {\ifFBAutoSpaceGuill\FB@fg + {\ifFB@spacing\FB@fg \else\guillemotright \fi}% {\guillemotright}}% diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua index cbc79319e72..f759ef2e499 100644 --- a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua +++ b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua @@ -1,5 +1,5 @@ -- --- File `frenchb.lua' generated from frenchb.dtx [2016/04/18 v3.2b] +-- File `frenchb.lua' generated from frenchb.dtx [2016/05/14 v3.2c] -- -- Copyright © 2014-2016 Daniel Flipo -- <daniel (dot) flipo (at) free (dot) fr> @@ -81,6 +81,7 @@ local function new_glue_scaled (fid,width,stretch,shrink) return nil end end +local FBspacing = luatexbase.attributes['FB@spacing'] local addDPspace = luatexbase.attributes['FB@addDPspace'] local addGUILspace = luatexbase.attributes['FB@addGUILspace'] local has_attribute = node.has_attribute @@ -89,8 +90,12 @@ local function french_punctuation (head) local lang = item.lang local char = item.char local fid = item.font + local FRspacing = has_attribute(item, FBspacing) + FRspacing = FRspacing and FRspacing > 0 local SIG = has_attribute(item, addGUILspace) - if lang == FR and FB_punct_left[char] and fid > 0 then + SIG = SIG and SIG >0 + if lang == FR and FRspacing and + FB_punct_left[char] and fid > 0 then local prev = item.prev local prev_id, prev_subtype, prev_char if prev then @@ -130,7 +135,7 @@ local function french_punctuation (head) insert_node_before(head, item, copy_node(nobreak)) insert_node_before(head, item, copy_node(fbglue)) end - elseif SIG and SIG > 0 then + elseif SIG then local addgl = (prev_char and not FB_guil_null[prev_char]) or (not prev_char and prev_id ~= TEMP and @@ -149,8 +154,8 @@ local function french_punctuation (head) end end end - if lang == FR and FB_punct_right[char] and fid > 0 - and SIG and SIG > 0 then + if lang == FR and 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 |