diff options
author | Karl Berry <karl@freefriends.org> | 2015-06-29 00:16:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-06-29 00:16:05 +0000 |
commit | 88a21c4ecabb7189313eff7c114276bde11072be (patch) | |
tree | 241d77c828caa802bf6674539a71ed37ee587cf0 /Master/texmf-dist/tex/generic/babel-french | |
parent | d3fb2a6dc958e53b3b9d4e9282794904d32c590c (diff) |
babel-french (27jun15)
git-svn-id: svn://tug.org/texlive/trunk@37701 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel-french')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/frenchb.ldf | 106 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/frenchb.lua | 31 |
2 files changed, 71 insertions, 66 deletions
diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf b/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf index 132b4049a6d..b5e4134f4d8 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} - [2015/05/31 v3.1f French support from the babel system] + [2015/06/26 v3.1g French support from the babel system] %% %% File `frenchb.ldf' %% Babel package for LaTeX version 2e @@ -241,17 +241,15 @@ FR = \the\l@french local path = kpse.find_file("frenchb.lua", "lua") if path then - local f = dofile(path) - luatexbase.add_to_callback("pre_linebreak_filter", - f, "frenchb.french_punctuation",1) - luatexbase.add_to_callback("hpack_filter", - f, "frenchb.french_punctuation",1) + local f = dofile(path) + luatexbase.add_to_callback("kerning", + f, "frenchb.french_punctuation") else - texio.write_nl('') - texio.write_nl('*****************************') - texio.write_nl('Error: frenchb.lua not found.') - texio.write_nl('*****************************') - texio.write_nl('') + texio.write_nl('') + texio.write_nl('*****************************') + texio.write_nl('Error: frenchb.lua not found.') + texio.write_nl('*****************************') + texio.write_nl('') end }% } @@ -266,26 +264,6 @@ \fb@info{No need for active punctuation characters\\ with this version of XeTeX!} \fi - \ifx\@for\@undefined - \def\@nnil{\@nil}% - \def\@empty{}% - \def\@fornoop#1\@@#2#3{}% - \long\def\@for#1:=#2\do#3{% - \expandafter\def\expandafter\@fortmp\expandafter{#2}% - \ifx\@fortmp\@empty \else - \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi}% - \long\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else - #5\def#4{#2}\ifx #4\@nnil \else#5\@iforloop #3\@@#4{#5}\fi\fi}% - \long\def\@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil - \expandafter\@fornoop \else - #4\relax\expandafter\@iforloop\fi#2\@@#3{#4}}% - \def\@tfor#1:={\@tf@r#1 }% - \long\def\@tf@r#1#2\do#3{\def\@fortmp{#2}\ifx\@fortmp\space\else - \@tforloop#2\@nil\@nil\@@#1{#3}\fi}% - \long\def\@tforloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil - \expandafter\@fornoop \else - #4\relax\expandafter\@tforloop\fi#2\@@#3{#4}}% - \fi \newXeTeXintercharclass\FB@punctthick \newXeTeXintercharclass\FB@punctthin \newXeTeXintercharclass\FB@punctnul @@ -299,10 +277,11 @@ \newcommand*{\FB@xetex@punct@french}{% \ifx\FB@charclassesORI\empty \FB@interchartokenstateORI=\XeTeXinterchartokenstate - \@for\FB@char:={`\:,`\;,`\!,`\?,"AB,"BB,% - `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% - `\%,"22,"27,"60,"2019,"A0,"202F}\do - {\edef\FB@charclassesORI{\FB@charclassesORI% + \bbl@for\FB@char + {`\:,`\;,`\!,`\?,"AB,"BB,% + `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% + `\%,"22,"27,"60,"2019,"A0,"202F}% + {\edef\FB@charclassesORI{\FB@charclassesORI% \the\XeTeXcharclass\FB@char,}}% \let\shorthandonORI\shorthandon \let\shorthandoffORI\shorthandoff @@ -315,8 +294,9 @@ \FDP@colonspace}% \XeTeXinterchartoks 255 \FB@punctthick = {% \ifhmode\unskip\penalty\@M\FBcolonspace\fi}% - \@for\FB@char:={`\;,`\!,`\?}\do - {\XeTeXcharclass\FB@char=\FB@punctthin}% + \bbl@for\FB@char + {`\;,`\!,`\?}% + {\XeTeXcharclass\FB@char=\FB@punctthin}% \XeTeXinterchartoks \z@ \FB@punctthin = {% \ifhmode\FDP@thinspace\fi}% \XeTeXinterchartoks \FB@guilf \FB@punctthin = {% @@ -333,11 +313,12 @@ \ifFBAutoSpaceGuill\FBguillspace\fi}% \XeTeXinterchartoks 255 \FB@guilf = {% \ifFBAutoSpaceGuill\unskip\FBguillspace\fi}% - \@for\FB@char:={`\[,`\(,"A0,"202F}\do - {\XeTeXcharclass\FB@char=\FB@punctnul}% - \@for\FB@char:={`\{,`\,,`\.,`\-,`\),`\],`\},`\%,% - "22,"27,"60,"2019}\do - {\XeTeXcharclass\FB@char=\z@}% + \bbl@for\FB@char + {`\[,`\(,"A0,"202F}% + {\XeTeXcharclass\FB@char=\FB@punctnul}% + \bbl@for\FB@char + {`\{,`\,,`\.,`\-,`\),`\],`\},`\%,"22,"27,"60,"2019}% + {\XeTeXcharclass\FB@char=\z@}% \def\shorthandoff##1{% \ifx\PackageWarning\@undefined \fb@warning{\noexpand\shorthandoff{;:!?} is helpless with @@ -353,11 +334,12 @@ \newcommand*{\FB@xetex@punct@nonfrench}{% \ifx\FB@charclassesORI\empty \else - \@for\FB@char:={`\:,`\;,`\!,`\?,"AB,"BB,% - `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% - `\%,"22,"27,"60,"2019,"A0,"202F}\do - {\expandafter\FB@parse\FB@charclassesORI\endparse - \XeTeXcharclass\FB@char=\FB@class}% + \bbl@for\FB@char + {`\:,`\;,`\!,`\?,"AB,"BB,% + `\(,`\[,`\{,`\,,`\.,`\-,`\),`\],`\},% + `\%,"22,"27,"60,"2019,"A0,"202F}% + {\expandafter\FB@parse\FB@charclassesORI\endparse + \XeTeXcharclass\FB@char=\FB@class}% \def\FB@charclassesORI{}% \XeTeXinterchartokenstate=\FB@interchartokenstateORI \let\shorthandon\shorthandonORI @@ -847,12 +829,27 @@ Dix-septi\`eme,Dix-huiti\`eme,Dix-neuvi\`eme,Vingti\`eme} \AfterBabelCommands{% \DeclareRobustCommand*{\FB@emptypart}{\def\thepart{}}% - \DeclareRobustCommand*{\FB@Rpart}{\def\thepart{\Roman{part}}}% + \DeclareRobustCommand*{\FB@partname}{% + \ifFBPartNameFull + \csname ordinal\romannumeral\value{part}\endcsname\space + partie\FB@emptypart + \else + Partie% + \fi}% } - \SetString{\partname}{% - \csname ordinal\romannumeral\value{part}\endcsname\space - partie\FB@emptypart} + \SetString{\partname}{\FB@partname} \EndBabelCommands +\AtEndOfPackage{% + \ifFB@koma + \ifdefined\partformat + \FB@addto{captions}{% + \ifFBPartNameFull + \babel@save\partformat + \renewcommand*{\partformat}{\partname}% + \fi}% + \fi + \fi +} \bgroup \catcode`:=12 \catcode`>=12 \relax \long\gdef\STD@makecaption#1#2{% @@ -1124,12 +1121,7 @@ \define@key{FB}{LowercaseSuperscripts}[true]% {\csname FBLowercaseSuperscripts#1\endcsname} \define@key{FB}{PartNameFull}[true]% - {\csname FBPartNameFull#1\endcsname - \ifFBPartNameFull - \else - \FB@addto{captions}{% - \def\partname{Partie\protect\FB@Rpart}}% - \fi}% + {\csname FBPartNameFull#1\endcsname}% \define@key{FB}{CustomiseFigTabCaptions}[true]% {\csname FBCustomiseFigTabCaptions#1\endcsname}% \define@key{FB}{OldFigTabCaptions}[true]% diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua index 172fb8eb82d..685ce072e07 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 [2015/04/10 v3.1e] +-- File `frenchb.lua' generated from frenchb.dtx [2015/06/26 v3.1g] -- -- Copyright (C) 2014-2015 Daniel Flipo -- <daniel (dot) flipo (at) free (dot) fr> @@ -34,6 +34,8 @@ local FB_guil_null = local new_node = node.new local copy_node = node.copy local node_id = node.id +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") @@ -107,7 +109,8 @@ local function french_punctuation (head) if auto then if (prev_char and FB_punct_null[prev_char]) or (glue and glue_wd <= 1) or - (prev_id == 0 and prev_subtype == 3) then + (prev_id == HLIST and prev_subtype == 3) or + (prev_id == TEMP) then auto = false end end @@ -126,8 +129,14 @@ local function french_punctuation (head) end elseif SIG and SIG > 0 then local addgl = (prev_char and not FB_guil_null[prev_char]) or - (not prev_char) - if glue or addgl then + (not prev_char and + prev_id ~= TEMP and + not (prev_id == HLIST and prev_subtype == 3) + ) + if glue and glue_wd <= 1 then + addgl = false + end + if addgl then if glue then head = remove_node(head,prev,true) end @@ -140,7 +149,7 @@ local function french_punctuation (head) if lang == FR and FB_punct_right[char] and fid > 0 and SIG and SIG > 0 then local next = item.next - local next_id, next_subtype, next_char, kern_wd, nextnext + local next_id, next_subtype, next_char, nextnext, kern_wd if next then next_id = next.id next_subtype = next.subtype @@ -154,7 +163,9 @@ local function french_punctuation (head) next = nextnext next_id = nextnext.id next_subtype = nextnext.subtype - next_char = nextnext.char + if next_id == GLYPH then + next_char = nextnext.char + end end end end @@ -164,10 +175,12 @@ local function french_punctuation (head) glue_spec = next.spec glue_wd = glue_spec.width end - glue = glue and glue_wd > 0 local addgl = (next_char and not FB_guil_null[next_char]) or - (not next_char) - if glue or addgl then + (next and not next_char) + if glue and glue_wd == 0 then + addgl = false + end + if addgl then if glue then head = remove_node(head,next,true) end |