From 6bb8f06468e4c4b7717cce9e4227e7465431506d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 21 Oct 2017 21:38:12 +0000 Subject: babel-french (21oct17) git-svn-id: svn://tug.org/texlive/trunk@45567 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/generic/babel-french/frenchb.dtx | 79 ++++++++++++++++------ 1 file changed, 59 insertions(+), 20 deletions(-) (limited to 'Master/texmf-dist/source/generic/babel-french/frenchb.dtx') diff --git a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx index 61afd11a004..03bbe841547 100644 --- a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx +++ b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx @@ -13,7 +13,7 @@ %\ProvidesLanguage{frenchb} %--[[ % File `frenchb.lua’ generated from frenchb.dtx - [2017/09/07 v3.3c French support from the babel system] + [2017/10/19 v3.3d French support from the babel system] %<*internal> \iffalse % @@ -191,10 +191,15 @@ % \begin{enumerate} % \item French hyphenation patterns are made active; % \item `high punctuation’ characters (|:| |;| |!| |?|) -% automatically add correct spacing in French; this is -% achieved using callbacks in Lua(La)TeX or `XeTeXinterchar’ -% mechanism in Xe(La)TeX; with TeX’82 and pdf(La)TeX these -% four characters are made active in the whole document; +% automatically add correct spacing% +% \footnote{Well, the automatic insertion may add unwanted +% spaces in some cases, for correction see +% \fbo{AutoSpacePunctuation} option and \cs{NoAutoSpacing} +% command p.~\pageref{autospacepunctuation}.} +% in French; this is achieved using callbacks in Lua(La)TeX +% or `XeTeXinterchar’ mechanism in Xe(La)TeX; with TeX’82 and +% pdf(La)TeX these four characters are made active in the +% whole document; % \item |\today| prints the date in French; % \item the caption names are translated into French % (\LaTeX{} only). For customisation of caption names see @@ -442,6 +447,7 @@ % before 2008 without changes: by default |\up| now relies on % |\fup| designed to produce better looking superscripts. % \item [AutoSpacePunctuation=false (true)]; in French, the user +% \hlabel{autospacepunctuation} % \emph{should} input a space before the four characters `|:;!?|’ % but as many people forget about it (even among native French % writers!), the default behaviour of \frenchb{} is to @@ -451,9 +457,10 @@ % `|:|’; the defaults follow the French `Imprimerie Nationale’s % recommendations. This is convenient in most cases but can lead % to addition of spurious spaces in URLs, in MS-DOS paths or in -% timetables (10:55), except if they are typed in |\texttt| or -% verbatim mode. When the current font is a monospaced -% (typewriter) font, no spurious space is added in that case% +% timetables (10:55) ---this no longer occurs with LuaTeX---, +% except if they are typed in |\texttt| or verbatim mode. +% When the current font is a monospaced (typewriter) font, +% no spurious space is added in that case% % \footnote{Unless option \fbo{OriginalTypewriter} is set, % \cs{ttfamily} is redefined in French to switch off space % tuning, see below.}, @@ -462,11 +469,16 @@ % % Choosing \fbo{AutoSpacePunctuation=false} will ensure that % a proper space is added before `|:;!?|’ \emph{if and only if} -% a (normal) space has been typed in. Those who are unsure -% about their typing in this area should stick to the default -% option and use the provided |\NoAutoSpacing| command +% a (normal) space has been typed in. This option gives full +% control on space insertion before `|:;!?|’. Those who are +% unsure about their typing in this area should stick to the +% default option and use the provided |\NoAutoSpacing| command % inside a group in case an unwanted space is added by \frenchb{} -% (i.e.\ |{\NoAutoSpacing 10:55}|). +% (i.e.\ |{\NoAutoSpacing http://mysite}|% +% \footnote{Actually, this is needed only with the XeTeX and +% pdfTeX engines. LuaTeX no longer inserts any space in strings +% like http://mysite, C:\textbackslash Foo, 10:55…} +% or |{\NoAutoSpacing ???}| (needed for pdfTeX only). % \item [ThinColonSpace=true (false)] changes the inter-word % non-breaking space added before the colon `:’ to a thin space, % so that the same amount of space is added before any of the @@ -664,6 +676,13 @@ % % \subsubsection*{What’s new in version 3.3?} % +% In version~3.3d the automatic insertion of non-breaking spaces +% before the colon character has been improved \emph{with engine +% LuaTeX only}: a spurious space is no longer inserted in strings +% like http://mysite, C:\textbackslash Program Files or 10:55. +% Unfortunately, my attempts to do the same with XeTeX or pdfTeX +% were unsuccessful. +% % A few internal changes have been made in version~3.3c to improve % the convertion into HTML of non-breaking spaces added by \frenchb. % Usage of \exe{lwarp} (v.0.37 and up) is recommended for HTML @@ -1500,7 +1519,7 @@ local function french_punctuation (head) % (v3.0c) did not work properly. Fixed now (I hope!). % Pointed out by Jacques André.} % -% If the previous item is a glue, check its natural width, only +% If the previous node is a glue, check its natural width, only % positive glues (actually glues > 1 sp, for tabular `l’ % columns) are to be replaced by a non-breaking space. % \begin{macrocode} @@ -1511,6 +1530,11 @@ local function french_punctuation (head) end local realglue = is_glue and glue_wd > 1 % \end{macrocode} +% +% \changes{v3.3d}{2017/10/17}{In default mode, for `:’ only, check +% if next node is a glyph or not. If it is, turn the `auto’ flag +% to false (avoids spurious spaces in URLs, MSDOS paths or 10:35).} +% % For characters for which |FB_punct_thin| or |FB_punct_thick| is % \emph{true}, the amount of spacing to be typeset before them % is controlled by commands |\FBthinspace| and |\FBcolonspace| @@ -1520,17 +1544,32 @@ local function french_punctuation (head) % nobreak penalty and the required \emph{glue}. % Otherwise (|auto| option), the penalty and the required % \emph{glue} are inserted if attribute |\FB@addDPspace| is set, -% unless one of these three conditions is met: -% a) the previous character is part of type |FB_punct_null| (this -% avoids spurious spaces in strings like |(!)| or |??|), -% b) a null glue (actually glues <= 1 sp for tabulars) preceeds the -% punctuation character, -% c) the punctuation character starts a paragraph or an |\hbox{}|. -% +% unless any of these four conditions is met: +% a) node is `:’ and the next one is of type GLYPH (avoids spurious +% spaces in http://mysite, C:\textbackslash{} or 10:35); +% b) the previous character is part of type |FB_punct_null| +% (avoids spurious spaces in strings like |(!)| or |??|); +% c) a null glue (actually glues <= 1 sp for tabulars) preceeds +% the punctuation character (for tabulars and listings); +% d) the punctuation character starts a paragraph or an |\hbox{}|. +% +% When option \fbo{UnicodeNoBreakSpaces} is set to \fbo{true}, +% a Unicode character U+00A0 or U+202F is inserted instead of +% penalty and glue. % \begin{macrocode} if FB_punct_thin[char] or FB_punct_thick[char] then local SBDP = has_attribute(item, addDPspace) local auto = SBDP and SBDP > 0 + if FB_punct_thick[char] and auto then + local next = item.next + local next_id + if next then + next_id = next.id + end + if next_id and next_id == GLYPH then + auto = false + end + end if auto then if (prev_char and FB_punct_null[prev_char]) or (is_glue and glue_wd <= 1) or -- cgit v1.2.3