texlive[48768] Master/texmf-dist: babel (26sep18)

commits+karl at tug.org commits+karl at tug.org
Wed Sep 26 22:48:48 CEST 2018


Revision: 48768
          http://tug.org/svn/texlive?view=revision&revision=48768
Author:   karl
Date:     2018-09-26 22:48:48 +0200 (Wed, 26 Sep 2018)
Log Message:
-----------
babel (26sep18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/babel/README.md
    trunk/Master/texmf-dist/doc/latex/babel/babel.pdf
    trunk/Master/texmf-dist/source/latex/babel/babel.dtx
    trunk/Master/texmf-dist/source/latex/babel/babel.ins
    trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx
    trunk/Master/texmf-dist/source/latex/babel/locale.zip
    trunk/Master/texmf-dist/tex/generic/babel/babel.def
    trunk/Master/texmf-dist/tex/generic/babel/babel.sty
    trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg
    trunk/Master/texmf-dist/tex/generic/babel/locale/km/babel-km.ini
    trunk/Master/texmf-dist/tex/generic/babel/locale/lo/babel-lo.ini
    trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-th.ini
    trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-thai.tex
    trunk/Master/texmf-dist/tex/generic/babel/luababel.def
    trunk/Master/texmf-dist/tex/generic/babel/nil.ldf
    trunk/Master/texmf-dist/tex/generic/babel/switch.def

Modified: trunk/Master/texmf-dist/doc/latex/babel/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/babel/README.md	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/doc/latex/babel/README.md	2018-09-26 20:48:48 UTC (rev 48768)
@@ -1,4 +1,4 @@
-## Babel 3.23
+## Babel 3.24
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages.  Many
@@ -7,21 +7,6 @@
 
 The latest stable version is available on <https://ctan.org/pkg/babel>.
 
-Version 3.9a fixed lots of bugs and added some new features, intended
-mainly to make it compatible somehow with Unicode engines. Some bugs
-have not been fixed to avoid backward incompatibilities, but they have
-been documented. Most of the new features (like package options) were
-intended to overcome issues in previous releases without changing
-significantly the behaviour of Babel.
-
-Current development is focused on Unicode engines (XeTeX and LuaTeX).
-New features related to font selection, bidi writing and the like will
-be added incrementally. Versions numbers drop the letter and now 3.10,
-3.11, etc., will be used instead. So, 3.9t is the last in the former
-series.
-
-Included is a set of ini files for about 200 languages.
-
 Languages are not part of the Babel core any more; in particular, it
 shall be no longer necessary to synchronize Babel core releases with
 releases of Babel language files. See CONTRIB for further details
@@ -29,6 +14,8 @@
 improve the existing ones -- it's a trivial task (no programming
 skills required at all), but don't hesitate to ask for help.
 
+Included is a set of ini files for about 200 languages.
+
 The best way to install and/or update it is with the help of package
 managers.
 
@@ -64,6 +51,7 @@
 ### Latest changes
 
 ```
+3.24   - Prelimimary support for Thai interword spacing with luatex.
 3.23   - After extensive tests and fixing some issues, bidi=basic is 
          not experimental any longer.
        - import in \babelprovide does not require a language code if
@@ -122,5 +110,5 @@
 ```
 
 Javier Bezos
-2018/09/02
+2018/09/26
 

Modified: trunk/Master/texmf-dist/doc/latex/babel/babel.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/babel/babel.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/babel.dtx	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/source/latex/babel/babel.dtx	2018-09-26 20:48:48 UTC (rev 48768)
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2018/09/02 v3.23 The Babel package]
+\ProvidesFile{babel.dtx}[2018/09/26 v3.24 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -2071,6 +2071,35 @@
 the value in the |ini| file. Not so important, but sometimes still
 relevant.
 
+\bigskip
+
+A few options (only \luatex) set some properties of the writing system
+used by the language. These properties are \textit{always} applied to
+the script, no matter which language is active. Although somewhat
+inconsistent, this makes setting a language up easier in most typical
+cases.
+
+\Describe{mapfont=}{\texttt{direction}}
+Assigns the font for the writing direction of this language. More
+precisely, what |mapfont=direction| means is, ‘when a character has the
+same direction as the script for the “provided” language, then change
+its font to that set for this language’. There are 3 directions,
+following the bidi Unicode algorithm, namely, Arabic-like, Hebrew-like
+and left to right.\footnote{In future realeases an new value 
+(\texttt{script}) will be added.} So, there should be at most 3 
+directives of this kind.
+
+\Describe{intraspace=}{\meta{base} \meta{shrink} \meta{stretch}}
+Sets the interword space for the writing system of the language, in em
+units (so, |0 .1 0| is |0em plus .1em|). Like |\spaceskip|, the em unit
+applied is that of the current text (more precisely, the previous 
+glyph). Currently used only in Southeast Asian scrips, like Thai.
+
+\Describe{intrapenalty}{\meta{penalty}}
+Sets the interword penalty for the writing system of this language.
+Currently used only in Southeast Asian scrips, like Thai. Ignored if 0
+(which is the default value).
+
 \begin{note}
   (1) If you need shorthands, you can use |\useshorthands| and
   |\defineshorthand| as described above. (2) Captions and |\today| are
@@ -2216,7 +2245,14 @@
 LICR. Of course, it also works without the LICR if the input and the
 font encodings are the same, like in Unicode based engines.
 
-\Describe\babelpatterns{\texttt{[}\langlist\texttt{]}%
+\begin{note}
+  Using |\babelhyphenation| with Southeast Asian scripts is mostly
+  pointless. But with |\babelpatterns| (below) you may fine-tune line
+  breaking (only \luatex). Even if there are no pattern for the
+  language, you can add at least some typical cases.
+\end{note}
+
+\Describe{\babelpatterns}{\texttt{[}\langlist\texttt{]}%
     \marg{patterns}}
 
 \New{3.9m} \textit{In \textsf{luatex} only},\footnote{With
@@ -2400,12 +2436,10 @@
   \end{document}
   \end{verbatim}
   \endgroup
-  What |mapfont=direction| means is, ‘when a character has the same
-  direction as the script for the “provided” language (|arabic| in
-  this case), then change its font to that set for this language’ (here
-  defined via |*arabic|, because Crimson does not provide Arabic
-  letters). Note Hebrew and Arabic, following the Unicode rules, have
-  different directions (internally ‘r’ and ‘al’, respectively).
+  In this example, and thanks to |mapfont=direction|, any Arabic letter
+  (because the language is |arabic|) changes its font to that set for
+  this language (here defined via |*arabic|, because Crimson does not
+  provide Arabic letters).
 \end{example}
 
 \begin{note}
@@ -2859,55 +2893,6 @@
 (lists, footnotes, tables, column order), page and section numbering,
 and maybe kashida justification.
 
-As to Thai line breaking, here is the basic idea of what \luatex{} can
-do for us, with the Thai patterns and a little script (the final
-version will not be so little, of course). It replaces each
-discretionary by the equivalent to ZWJ.
-
-\begingroup
-\catcode`\_=13 \def_{\string_}
-\begin{verbatim}
-\documentclass{article}
-
-\usepackage{babel}
-
-\babelprovide[import, main]{thai}
-
-\babelfont{rm}{FreeSerif}
-
-\directlua{
-local GLYF = node.id'glyph'
-function insertsp (head)
-  local size = 0
-  for item in node.traverse(head) do
-    local i = item.id
-    if i == GLYF then
-      f = font.getfont(item.font)
-      size = f.size
-    elseif i == 7 then
-      local n = node.new(12, 0)
-      node.setglue(n, 0, size * 1) % 1 is a factor
-      node.insert_before(head, item, n)
-      node.remove(head, item)
-    end
-  end
-end
-
-luatexbase.add_to_callback('hyphenate',
-  function (head, tail)
-    lang.hyphenate(head)
-    insertsp(head)
-  end, 'insertsp')
-}
-
-\begin{document}
-
-(Thai text.)
-
-\end{document}
-\end{verbatim}
-\endgroup
-
 Useful additions would be, for example, time, currency, addresses and
 personal names.\footnote{See for example POSIX, ISO 14652 and the
 Unicode Common Locale Data Repository (CLDR). Those system, however,
@@ -2925,6 +2910,13 @@
 
 \subsection{Tentative and experimental code}
 
+\textbf{Southeast Asian interword spacing}
+
+There is some preliminary interword spacing for Thai, Lao and Khemer
+in \luatex{} (provided there are hyphenation patters). It is activated
+automatically if a language with of one of these scripts are loaded
+with |\babelprovide|. See the sample on the \babel{} repository.
+
 \medskip
 \textbf{Old stuff}
 
@@ -3865,8 +3857,8 @@
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.23>>
-%<<date=2018/09/02>>
+%<<version=3.24>>
+%<<date=2018/09/26>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -4435,6 +4427,7 @@
 \DeclareOption{noconfigs}{}
 \DeclareOption{showlanguages}{}
 \DeclareOption{silent}{}
+\DeclareOption{mono}{}
 \DeclareOption{shorthands=off}{\bbl at tempa shorthands=\bbl at tempa}
 <@More package options@>
 %    \end{macrocode}
@@ -6744,6 +6737,7 @@
 %    \end{macrocode}
 %
 %  \end{macro}
+%
 % \subsection{Multiencoding strings}
 %
 % \changes{babel~3.9a}{2012/09/05}{Added tentative code for string
@@ -7714,12 +7708,10 @@
 %
 % \subsection{Creating languages}
 %
-% |\babelprovide| is a general purpose tool for creating
-% languages. Currently it just creates the language infrastructure,
-% but in the future it will be able to read data from |ini| files, as
-% well as to create variants. Unlike the \textsf{nil} pseudo-language,
-% captions are defined, but with a warning to invite the user to
-% provide the real string.
+% |\babelprovide| is a general purpose tool for creating and modifying
+% languages. It creates the language infrastructure, and
+% loads, if requested, an |ini| file. It may be used in conjunction to
+% previouly loaded |ldf| files.
 %
 % \changes{3.10}{2017/05/19}{Added \cs{babelprovide}}
 % \changes{3.13}{2017/08/30}{Added \cs{import}, which also reads
@@ -7759,6 +7751,7 @@
   \ifx\bbl at KVP@captions\@nil
     \let\bbl at KVP@captions\bbl at KVP@import
   \fi
+  % Load ini
   \bbl at ifunset{date#2}%
     {\bbl at provide@new{#2}}%
     {\bbl at ifblank{#1}%
@@ -7769,6 +7762,7 @@
          import=lang-tag}%
         {Use this macro as documented}}%
       {\bbl at provide@renew{#2}}}%
+  % Post tasks
   \bbl at exp{\\\babelensure[exclude=\\\today]{#2}}%
   \bbl at ifunset{bbl at ensure@\languagename}%
     {\bbl at exp{%
@@ -7804,6 +7798,33 @@
     \fi
     \bbl at exp{\\\bbl at add\\\bbl at mapselect{\\\bbl at mapdir{\languagename}}}%
   \fi
+  \ifcase\bbl at engine\or
+    \bbl at ifunset{bbl at intsp@\languagename}{}%
+      {\expandafter\ifx\csname bbl at intsp@\languagename\endcsname\@empty\else
+        \bbl at seaintraspace
+        \ifx\bbl at KVP@intraspace\@nil
+           \bbl at exp{%
+             \\\bbl at intraspace\bbl at cs{intsp@\languagename}\\\@@}%
+        \fi
+        \directlua{
+           Babel = Babel or {}
+           Babel.sea_ranges = Babel.sea_ranges or {}
+           Babel.set_chranges('\bbl at cs{sbcp@\languagename}', 
+                              '\bbl at cs{chrng@\languagename}')
+        }
+        \ifx\bbl at KVP@intrapenalty\@nil
+          \bbl at intrapenalty0\@@
+        \fi
+      \fi
+      \ifx\bbl at KVP@intraspace\@nil\else % We may override the ini
+        \expandafter\bbl at intraspace\bbl at KVP@intraspace\@@
+      \fi
+      \ifx\bbl at KVP@intrapenalty\@nil\else
+        \expandafter\bbl at intrapenalty\bbl at KVP@intrapenalty\@@
+      \fi}%
+  \or 
+    %% TODO - xetex
+  \fi
   \ifcase\bbl at engine\else
     \bbl at ifunset{bbl at dgnat@\languagename}{}%
       {\expandafter\ifx\csname bbl at dgnat@\languagename\endcsname\@empty\else
@@ -7820,6 +7841,15 @@
         \fi
       \fi}%
   \fi
+  \bbl at ifunset{bbl at rqtex@\languagename}{}%
+    {\expandafter\ifx\csname bbl at rqtex@\languagename\endcsname\@empty\else
+       \let\BabelBeforeIni\@gobbletwo
+       \chardef\atcatcode=\catcode`\@
+       \catcode`\@=11\relax
+       \InputIfFileExists{babel-\bbl at cs{rqtex@\languagename}.tex}{}{}%
+       \catcode`\@=\atcatcode
+       \let\atcatcode\relax
+     \fi}%
   \let\languagename\bbl at savelangname}
 \def\bbl at setdigits#1#2#3#4#5{%
   \bbl at exp{%
@@ -8034,12 +8064,17 @@
   \bbl at exportkey{sbcp}{identification.script.tag.bcp47}{}%
   \bbl at exportkey{sotf}{identification.script.tag.opentype}{DFLT}}
 \let\bbl at secline@typography\bbl at inikv
+\let\bbl at secline@characters\bbl at inikv
 \let\bbl at secline@numbers\bbl at inikv
 \def\bbl at after@ini{%
   \bbl at exportkey{lfthm}{typography.lefthyphenmin}{2}%
   \bbl at exportkey{rgthm}{typography.righthyphenmin}{3}%
   \bbl at exportkey{hyphr}{typography.hyphenrules}{}%
+  \bbl at exportkey{intsp}{typography.intraspace}{}%
+  \bbl at exportkey{jstfy}{typography.justify}{w}%
+  \bbl at exportkey{chrng}{characters.ranges}{}%
   \bbl at exportkey{dgnat}{numbers.digits.native}{}%
+  \bbl at exportkey{rqtex}{identification.require.babel}{}%
   \bbl at xin@{0.5}{\@nameuse{bbl@@kv at identification.version}}%
   \ifin@
     \bbl at warning{%
@@ -8149,7 +8184,7 @@
        range 0-9999.}%
       {There is little you can do. Sorry.}%
   \fi\fi\fi\fi}}
-\newcommand\BabelDateyyyy[1]{{\number#1}}
+\newcommand\BabelDateyyyy[1]{{\number#1}} % FIXME - add leading 0
 \def\bbl at replace@finish at iii#1{%
   \bbl at exp{\def\\#1####1####2####3{\the\toks@}}}
 \def\bbl at TG@@date{%
@@ -8182,7 +8217,7 @@
   \bbl at csarg\bbl at add@list{lsys@#1}{Script=\bbl at cs{sname@#1}}%
   \bbl at ifunset{bbl at lname@#1}{}%
     {\bbl at csarg\bbl at add@list{lsys@#1}{Language=\bbl at cs{lname@#1}}}%
-  \bbl at csarg\bbl at toglobal{lsys@#1}%}%
+  \bbl at csarg\bbl at toglobal{lsys@#1}%
   \bbl at exp{% TODO - should be global, but even local does its job
            % I'm still not sure -- must investigate 
     \<keys_if_exist:nnF>{fontspec-opentype}{Script/\bbl at cs{sname@#1}}%
@@ -8471,25 +8506,21 @@
 %  \end{macro}
 %
 %  \begin{macro}{\bibcite}
-%    The macro that is used in the |.aux| file to define citation
-%    labels. When packages such as \pkg{natbib} or \pkg{cite} are not
-%    loaded its second argument is used to typeset the citation
-%    label. In that case, this second argument can contain active
-%    characters but is used in an environment where
-%    |\@safe at activestrue| is in effect. This switch needs to be reset
-%    inside the |\hbox| which contains the citation label. In order to
-%    determine during \file{.aux} file processing which definition of
-%    |\bibcite| is needed we define |\bibcite| in such a way that it
-%    redefines itself with the proper definition.
+%  The macro that is used in the |.aux| file to
+%  define citation labels. When packages such as \pkg{natbib} or
+%  \pkg{cite} are not loaded its second argument is used to typeset the
+%  citation label. In that case, this second argument can contain
+%  active characters but is used in an environment where
+%  |\@safe at activestrue| is in effect. This switch needs to be reset
+%  inside the |\hbox| which contains the citation label. In order to
+%  determine during \file{.aux} file processing which definition of
+%  |\bibcite| is needed we define |\bibcite| in such a way that it
+%  redefines itself with the proper definition. We call
+%  |\bbl at cite@choice| to select the proper definition for |\bibcite|.
+%  This new definition is then activated.
 %
 %    \begin{macrocode}
   \bbl at redefine\bibcite{%
-%    \end{macrocode}
-%
-%    We call |\bbl at cite@choice| to select the proper definition for
-%    |\bibcite|. This new definition is then activated.
-%
-%    \begin{macrocode}
     \bbl at cite@choice
     \bibcite}
 %    \end{macrocode}
@@ -8509,28 +8540,19 @@
 %
 %  \begin{macro}{\bbl at cite@choice}
 %    The macro |\bbl at cite@choice| determines which definition of
-%    |\bibcite| is needed.
+%    |\bibcite| is needed. First we give |\bibcite| its default
+%    definition.
 %
 %    \begin{macrocode}
   \def\bbl at cite@choice{%
-%    \end{macrocode}
-%
-%    First we give |\bibcite| its default definition.
-%
-%    \begin{macrocode}
     \global\let\bibcite\bbl at bibcite
 %    \end{macrocode}
 %
 %    Then, when \pkg{natbib} is loaded we restore the original
-%    definition of |\bibcite|.
+%    definition of |\bibcite|. For \pkg{cite} we do the same.
 %
 %    \begin{macrocode}
     \@ifpackageloaded{natbib}{\global\let\bibcite\org at bibcite}{}%
-%    \end{macrocode}
-%
-%    For \pkg{cite} we do the same.
-%
-%    \begin{macrocode}
     \@ifpackageloaded{cite}{\global\let\bibcite\org at bibcite}{}%
 %    \end{macrocode}
 %
@@ -10153,6 +10175,13 @@
     it in the preamble with something like:\\%
     \string\renewcommand\@backslashchar#2{..}\\%
     Reported}}
+\def\bbl at tentative{\protect\bbl at tentative@i}
+\def\bbl at tentative@i#1{%
+  \bbl at warning{%
+    Some functions in '#1' are tentative.\\%
+    They might not work as expected and their behavior\\%
+    could change in the future.\\%
+    Reported}}
 \def\@nolanerr#1{%
   \bbl at error
     {You haven't defined the language #1\space yet}%
@@ -11498,6 +11527,93 @@
 %    \end{macrocode}
 %  \end{macro}
 %
+% \section{Southeast Asian scripts}
+%
+% \changes{babel~3.24}{2018/09/24}{Lua code for interword spacing
+%   in Southeast Asian scripts.}
+%
+% \textit{In progress.} Replace regular (ie, implicit) discretionaries
+% by spaceskips, based on the previous glyph (which I think makes
+% sense, because the hyphen and the previous char go always together).
+% Other discretionaries are not touched.
+%
+% For the moment, only 3 SA languages are 
+% activated by default (see Unicode UAX 14).
+%
+%    \begin{macrocode}
+\def\bbl at intraspace#1 #2 #3\@@{%
+  \directlua{
+    Babel = Babel or {}
+    Babel.intraspaces = Babel.intraspaces or {}
+    Babel.intraspaces['\csname bbl at sbcp@\languagename\endcsname'] = %
+       {b = #1, p = #2, m = #3}
+  }}
+\def\bbl at intrapenalty#1\@@{%
+  \directlua{
+    Babel = Babel or {}
+    Babel.intrapenalties = Babel.intrapenalties or {}
+    Babel.intrapenalties['\csname bbl at sbcp@\languagename\endcsname'] = #1
+  }}
+\begingroup
+\catcode`\%=12
+\catcode`\^=14
+\catcode`\'=12
+\catcode`\~=12
+\gdef\bbl at seaintraspace{^
+  \let\bbl at seaintraspace\relax
+  \directlua{
+    Babel = Babel or {}
+    Babel.sea_ranges = Babel.sea_ranges or {}
+    function Babel.set_chranges (script, chrng) 
+      local c = 0
+      for s, e in string.gmatch(chrng..' ', '(.-)%.%.(.-)%s') do
+        Babel.sea_ranges[script..c]={tonumber(s,16), tonumber(e,16)}
+        c = c + 1
+      end
+    end
+    function Babel.sea_disc_to_space (head)
+      local sea_ranges = Babel.sea_ranges
+      local last_char = nil
+      local quad = 655360      ^^ 10 pt = 655360 = 10 * 65536
+      for item in node.traverse(head) do
+        local i = item.id
+        if i == node.id'glyph' then
+          last_char = item
+        elseif i == 7 and item.subtype == 3 and last_char 
+            and last_char.char > 0x0C99 then
+          quad = font.getfont(last_char.font).size
+          for lg, rg in pairs(sea_ranges) do
+            if last_char.char > rg[1] and last_char.char < rg[2] then
+              lg = lg:sub(1, 4)
+              local intraspace = Babel.intraspaces[lg]
+              local intrapenalty = Babel.intrapenalties[lg]
+              local n
+              if intrapenalty ~= 0 then
+                n = node.new(14, 0)     ^^ penalty
+                n.penalty = intrapenalty
+                node.insert_before(head, item, n)
+              end    
+              n = node.new(12, 13)      ^^ (glue, spaceskip)
+              node.setglue(n, intraspace.b * quad,
+                              intraspace.p * quad,
+                              intraspace.m * quad)
+              node.insert_before(head, item, n)
+              node.remove(head, item)
+            end
+          end
+        end
+      end
+    end
+    luatexbase.add_to_callback('hyphenate',
+      function (head, tail)
+        lang.hyphenate(head)
+        Babel.sea_disc_to_space(head)
+      end,
+      'Babel.sea_disc_to_space')
+}}
+\endgroup
+%    \end{macrocode}
+%
 % Common stuff.
 %
 %    \begin{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/babel/babel.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/babel.ins	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/source/latex/babel/babel.ins	2018-09-26 20:48:48 UTC (rev 48768)
@@ -26,7 +26,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %%
-\def\filedate{2018/09/02}
+\def\filedate{2018/09/26}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 

Modified: trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx	2018-09-26 20:48:48 UTC (rev 48768)
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2018/09/02 v3.23]
+\ProvidesFile{bbcompat.dtx}[2018/09/26 v3.24]
 %</dtx>
 %
 %% File 'bbcompat.dtx'

Modified: trunk/Master/texmf-dist/source/latex/babel/locale.zip
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/generic/babel/babel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/babel.def	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/tex/generic/babel/babel.def	2018-09-26 20:48:48 UTC (rev 48768)
@@ -41,7 +41,7 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{babel.def}[2018/09/02 3.23 Babel common definitions]
+\ProvidesFile{babel.def}[2018/09/26 3.24 Babel common definitions]
 \ifx\AtBeginDocument\@undefined
   \input plain.def\relax
 \fi
@@ -1326,6 +1326,7 @@
   \ifx\bbl at KVP@captions\@nil
     \let\bbl at KVP@captions\bbl at KVP@import
   \fi
+  % Load ini
   \bbl at ifunset{date#2}%
     {\bbl at provide@new{#2}}%
     {\bbl at ifblank{#1}%
@@ -1336,6 +1337,7 @@
          import=lang-tag}%
         {Use this macro as documented}}%
       {\bbl at provide@renew{#2}}}%
+  % Post tasks
   \bbl at exp{\\\babelensure[exclude=\\\today]{#2}}%
   \bbl at ifunset{bbl at ensure@\languagename}%
     {\bbl at exp{%
@@ -1371,6 +1373,33 @@
     \fi
     \bbl at exp{\\\bbl at add\\\bbl at mapselect{\\\bbl at mapdir{\languagename}}}%
   \fi
+  \ifcase\bbl at engine\or
+    \bbl at ifunset{bbl at intsp@\languagename}{}%
+      {\expandafter\ifx\csname bbl at intsp@\languagename\endcsname\@empty\else
+        \bbl at seaintraspace
+        \ifx\bbl at KVP@intraspace\@nil
+           \bbl at exp{%
+             \\\bbl at intraspace\bbl at cs{intsp@\languagename}\\\@@}%
+        \fi
+        \directlua{
+           Babel = Babel or {}
+           Babel.sea_ranges = Babel.sea_ranges or {}
+           Babel.set_chranges('\bbl at cs{sbcp@\languagename}',
+                              '\bbl at cs{chrng@\languagename}')
+        }
+        \ifx\bbl at KVP@intrapenalty\@nil
+          \bbl at intrapenalty0\@@
+        \fi
+      \fi
+      \ifx\bbl at KVP@intraspace\@nil\else % We may override the ini
+        \expandafter\bbl at intraspace\bbl at KVP@intraspace\@@
+      \fi
+      \ifx\bbl at KVP@intrapenalty\@nil\else
+        \expandafter\bbl at intrapenalty\bbl at KVP@intrapenalty\@@
+      \fi}%
+  \or
+    %% TODO - xetex
+  \fi
   \ifcase\bbl at engine\else
     \bbl at ifunset{bbl at dgnat@\languagename}{}%
       {\expandafter\ifx\csname bbl at dgnat@\languagename\endcsname\@empty\else
@@ -1387,6 +1416,15 @@
         \fi
       \fi}%
   \fi
+  \bbl at ifunset{bbl at rqtex@\languagename}{}%
+    {\expandafter\ifx\csname bbl at rqtex@\languagename\endcsname\@empty\else
+       \let\BabelBeforeIni\@gobbletwo
+       \chardef\atcatcode=\catcode`\@
+       \catcode`\@=11\relax
+       \InputIfFileExists{babel-\bbl at cs{rqtex@\languagename}.tex}{}{}%
+       \catcode`\@=\atcatcode
+       \let\atcatcode\relax
+     \fi}%
   \let\languagename\bbl at savelangname}
 \def\bbl at setdigits#1#2#3#4#5{%
   \bbl at exp{%
@@ -1552,12 +1590,17 @@
   \bbl at exportkey{sbcp}{identification.script.tag.bcp47}{}%
   \bbl at exportkey{sotf}{identification.script.tag.opentype}{DFLT}}
 \let\bbl at secline@typography\bbl at inikv
+\let\bbl at secline@characters\bbl at inikv
 \let\bbl at secline@numbers\bbl at inikv
 \def\bbl at after@ini{%
   \bbl at exportkey{lfthm}{typography.lefthyphenmin}{2}%
   \bbl at exportkey{rgthm}{typography.righthyphenmin}{3}%
   \bbl at exportkey{hyphr}{typography.hyphenrules}{}%
+  \bbl at exportkey{intsp}{typography.intraspace}{}%
+  \bbl at exportkey{jstfy}{typography.justify}{w}%
+  \bbl at exportkey{chrng}{characters.ranges}{}%
   \bbl at exportkey{dgnat}{numbers.digits.native}{}%
+  \bbl at exportkey{rqtex}{identification.require.babel}{}%
   \bbl at xin@{0.5}{\@nameuse{bbl@@kv at identification.version}}%
   \ifin@
     \bbl at warning{%
@@ -1640,7 +1683,7 @@
        range 0-9999.}%
       {There is little you can do. Sorry.}%
   \fi\fi\fi\fi}}
-\newcommand\BabelDateyyyy[1]{{\number#1}}
+\newcommand\BabelDateyyyy[1]{{\number#1}} % FIXME - add leading 0
 \def\bbl at replace@finish at iii#1{%
   \bbl at exp{\def\\#1####1####2####3{\the\toks@}}}
 \def\bbl at TG@@date{%
@@ -1665,7 +1708,7 @@
   \bbl at csarg\bbl at add@list{lsys@#1}{Script=\bbl at cs{sname@#1}}%
   \bbl at ifunset{bbl at lname@#1}{}%
     {\bbl at csarg\bbl at add@list{lsys@#1}{Language=\bbl at cs{lname@#1}}}%
-  \bbl at csarg\bbl at toglobal{lsys@#1}%}%
+  \bbl at csarg\bbl at toglobal{lsys@#1}%
   \bbl at exp{% TODO - should be global, but even local does its job
            % I'm still not sure -- must investigate
     \<keys_if_exist:nnF>{fontspec-opentype}{Script/\bbl at cs{sname@#1}}%

Modified: trunk/Master/texmf-dist/tex/generic/babel/babel.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/babel.sty	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/tex/generic/babel/babel.sty	2018-09-26 20:48:48 UTC (rev 48768)
@@ -33,7 +33,7 @@
 %%
 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\ProvidesPackage{babel}[2018/09/02 3.23 The Babel package]
+\ProvidesPackage{babel}[2018/09/26 3.24 The Babel package]
 \@ifpackagewith{babel}{debug}
   {\providecommand\bbl at trace[1]{\message{^^J[ #1 ]}}%
    \let\bbl at debug\@firstofone}
@@ -253,6 +253,7 @@
 \DeclareOption{noconfigs}{}
 \DeclareOption{showlanguages}{}
 \DeclareOption{silent}{}
+\DeclareOption{mono}{}
 \DeclareOption{shorthands=off}{\bbl at tempa shorthands=\bbl at tempa}
 \DeclareOption{math=active}{}
 \DeclareOption{math=normal}{\def\bbl at mathnormal{\noexpand\textormath}}

Modified: trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg	2018-09-26 20:48:48 UTC (rev 48768)
@@ -37,7 +37,7 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{hyphen.cfg}[2018/09/02 3.23 Babel hyphens]
+\ProvidesFile{hyphen.cfg}[2018/09/26 3.24 Babel hyphens]
 \xdef\bbl at format{\jobname}
 \ifx\AtBeginDocument\@undefined
   \def\@empty{}

Modified: trunk/Master/texmf-dist/tex/generic/babel/locale/km/babel-km.ini
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/locale/km/babel-km.ini	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/tex/generic/babel/locale/km/babel-km.ini	2018-09-26 20:48:48 UTC (rev 48768)
@@ -11,8 +11,8 @@
 
 [identification]
 charset = utf8
-version = 1.1
-date = 2018-04-11
+version = 1.2
+date = 2018-09-07
 name.local = ខ្មែរ
 name.english = Khmer
 name.babel = khmer
@@ -26,27 +26,27 @@
 derivate = no
 
 [captions]
-preface = 
-ref = 
-abstract = 
-bib = 
-chapter = 
-appendix = 
-contents = 
-listfigure = 
-listtable = 
-index = 
-figure = 
-table = 
-part = 
-encl = 
-cc = 
-headto = 
-page = 
-see = 
-also = 
-proof = 
-glossary = 
+preface = អារម្ភកថា
+ref = ឯកសារយោង
+abstract = សង្ខេប
+bib = គន្ថនិទ្ទេស
+chapter = ជំពូក
+appendix = សេចក្ដីបន្ថែម
+contents = មាតិការ
+listfigure = បញ្ជីរូបភាព
+listtable = បញ្ជីតារាង
+index = សន្ទស្សន៍
+figure = រូប
+table = តារាង
+part = ផ្នែក
+encl = ឯកសារភ្ជាប់
+cc = ចម្លងជួន
+headto = ផ្ញើរទៅ
+page = ទំព័រ
+see = មើល
+also = មើលបន្ថែម
+proof = សម្រាយ
+glossary = សទានុក្រម
 
 [captions.licr]
 preface = 
@@ -142,8 +142,11 @@
 preexhyphenchar = 
 postexhyphenchar = 
 hyphenationmin = 
+justify = s
+intraspace = 0 .1 0
 
 [characters]
+ranges = 1780..17FF
 delimiters.quotes = “”‘’
 auxiliary = [\u17B4\u17B5\u200B \u17CC \u17CE \u17CF \u17D1 ឝ ឞ]
 exemplarCharacters = [\u17D0 ៈ \u17CB \u17C9 \u17CA \u17CD ក ខ គ ឃ ង ច ឆ ជ ឈ ញ ដ ឋ ឌ ឍ ណ ត ថ ទ ធ ន ប ផ ព ភ ម យ រ ឫ ឬ ល ឭ ឮ វ ស ហ ឡ អ {អា} ឥ ឦ ឧ {ឧក} ឩ ឪ ឯ ឰ ឱ ឲ ឳ ា \u17B7 \u17B8 \u17B9 \u17BA \u17BB \u17BC \u17BD ើ ឿ ៀ េ ែ ៃ ោ ៅ \u17C6 ះ \u17D2]

Modified: trunk/Master/texmf-dist/tex/generic/babel/locale/lo/babel-lo.ini
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/locale/lo/babel-lo.ini	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/tex/generic/babel/locale/lo/babel-lo.ini	2018-09-26 20:48:48 UTC (rev 48768)
@@ -11,8 +11,8 @@
 
 [identification]
 charset = utf8
-version = 1.1
-date = 2018-04-11
+version = 1.2
+date = 2018-09-07
 name.local = ລາວ
 name.english = Lao
 name.babel = lao
@@ -119,8 +119,11 @@
 preexhyphenchar = 
 postexhyphenchar = 
 hyphenationmin = 
+justify = s
+intraspace = 0 .1 0
 
 [characters]
+ranges = 0E80..0EFF
 delimiters.quotes = “”‘’
 auxiliary = [\u200B ໐ ໑ ໒ ໓ ໔ ໕ ໖ ໗ ໘ ໙]
 exemplarCharacters = [\u0EC8 \u0EC9 \u0ECA \u0ECB \u0ECC \u0ECD ໆ ກ ຂ ຄ ງ ຈ ສ ຊ ຍ ດ ຕ ຖ ທ ນ ບ ປ ຜ ຝ ພ ຟ ມ ຢ ຣ ລ ວ ຫ ໜ ໝ ອ ຮ ຯ ະ \u0EB1 າ ຳ \u0EB4 \u0EB5 \u0EB6 \u0EB7 \u0EB8 \u0EB9 \u0EBB \u0EBC ຽ ເ ແ ໂ ໃ ໄ]

Modified: trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-th.ini
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-th.ini	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-th.ini	2018-09-26 20:48:48 UTC (rev 48768)
@@ -11,8 +11,8 @@
 
 [identification]
 charset = utf8
-version = 1.1
-date = 2018-04-11
+version = 1.2
+date = 2018-09-07
 name.local = ไทย
 name.english = Thai
 name.babel = thai
@@ -24,6 +24,7 @@
 level = 1
 encodings = 
 derivate = no
+require.babel = thai
 
 [captions]
 preface = คำนำ
@@ -72,7 +73,8 @@
 glossary = 
 
 [date.gregorian]
-date.long = [d] [MMMM] [G] [y]
+; Should be [G] instead of พ.ศ.
+date.long = [d] [MMMM] พ.ศ. [y]
 date.short = [d]/[M]/[yy]
 months.wide.1 = มกราคม
 months.wide.2 = กุมภาพันธ์
@@ -156,8 +158,11 @@
 preexhyphenchar = 
 postexhyphenchar = 
 hyphenationmin = 
+justify = s
+intraspace = 0 .1 0
 
 [characters]
+ranges = 0E00..0E7F
 delimiters.quotes = “”‘’
 auxiliary = [\u200B]
 exemplarCharacters = [ฯ ๆ \u0E4E \u0E4C \u0E47 \u0E48 \u0E49 \u0E4A \u0E4B ก ข ฃ ค ฅ ฆ ง จ ฉ ช ซ ฌ ญ ฎ ฏ ฐ ฑ ฒ ณ ด ต ถ ท ธ น บ ป ผ ฝ พ ฟ ภ ม ย ร ฤ ล ฦ ว ศ ษ ส ห ฬ อ ฮ \u0E4D ะ \u0E31 า ๅ ำ \u0E34 \u0E35 \u0E36 \u0E37 \u0E38 \u0E39 เ แ โ ใ ไ \u0E3A]

Modified: trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-thai.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-thai.tex	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-thai.tex	2018-09-26 20:48:48 UTC (rev 48768)
@@ -9,4 +9,19 @@
 \fi
 \BabelBeforeIni{th}{%
 }
+
+\addto\datethai{%
+  \babel at save\BabelDatey
+  \def\BabelDatey#1{{\number\numexpr#1+543}}}
+
+\ifcase\bbl at engine\or\or
+  \bbl at tentative{thai}%
+  % \XeTeXlinebreakskip should be reset with \fontsize
+  \addto\extrasthai{%
+    \XeTeXlinebreaklocale "th"
+    \XeTeXlinebreakskip 0em plus .1em}
+  \addto\noextrasthai{%
+    \XeTeXlinebreaklocale "en"}
+\fi
+
 \endinput
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/generic/babel/luababel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/luababel.def	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/tex/generic/babel/luababel.def	2018-09-26 20:48:48 UTC (rev 48768)
@@ -306,6 +306,77 @@
               {\csname bbl at patterns@\bbl at tempa\endcsname\space}%
             #2}}}%
     \fi}}
+\def\bbl at intraspace#1 #2 #3\@@{%
+  \directlua{
+    Babel = Babel or {}
+    Babel.intraspaces = Babel.intraspaces or {}
+    Babel.intraspaces['\csname bbl at sbcp@\languagename\endcsname'] = %
+       {b = #1, p = #2, m = #3}
+  }}
+\def\bbl at intrapenalty#1\@@{%
+  \directlua{
+    Babel = Babel or {}
+    Babel.intrapenalties = Babel.intrapenalties or {}
+    Babel.intrapenalties['\csname bbl at sbcp@\languagename\endcsname'] = #1
+  }}
+\begingroup
+\catcode`\%=12
+\catcode`\^=14
+\catcode`\'=12
+\catcode`\~=12
+\gdef\bbl at seaintraspace{^
+  \let\bbl at seaintraspace\relax
+  \directlua{
+    Babel = Babel or {}
+    Babel.sea_ranges = Babel.sea_ranges or {}
+    function Babel.set_chranges (script, chrng)
+      local c = 0
+      for s, e in string.gmatch(chrng..' ', '(.-)%.%.(.-)%s') do
+        Babel.sea_ranges[script..c]={tonumber(s,16), tonumber(e,16)}
+        c = c + 1
+      end
+    end
+    function Babel.sea_disc_to_space (head)
+      local sea_ranges = Babel.sea_ranges
+      local last_char = nil
+      local quad = 655360      ^^ 10 pt = 655360 = 10 * 65536
+      for item in node.traverse(head) do
+        local i = item.id
+        if i == node.id'glyph' then
+          last_char = item
+        elseif i == 7 and item.subtype == 3 and last_char
+            and last_char.char > 0x0C99 then
+          quad = font.getfont(last_char.font).size
+          for lg, rg in pairs(sea_ranges) do
+            if last_char.char > rg[1] and last_char.char < rg[2] then
+              lg = lg:sub(1, 4)
+              local intraspace = Babel.intraspaces[lg]
+              local intrapenalty = Babel.intrapenalties[lg]
+              local n
+              if intrapenalty ~= 0 then
+                n = node.new(14, 0)     ^^ penalty
+                n.penalty = intrapenalty
+                node.insert_before(head, item, n)
+              end
+              n = node.new(12, 13)      ^^ (glue, spaceskip)
+              node.setglue(n, intraspace.b * quad,
+                              intraspace.p * quad,
+                              intraspace.m * quad)
+              node.insert_before(head, item, n)
+              node.remove(head, item)
+            end
+          end
+        end
+      end
+    end
+    luatexbase.add_to_callback('hyphenate',
+      function (head, tail)
+        lang.hyphenate(head)
+        Babel.sea_disc_to_space(head)
+      end,
+      'Babel.sea_disc_to_space')
+}}
+\endgroup
 \AddBabelHook{luatex}{loadkernel}{%
   \begingroup
       % Reset chars "80-"C0 to category "other", no case mapping:

Modified: trunk/Master/texmf-dist/tex/generic/babel/nil.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/nil.ldf	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/tex/generic/babel/nil.ldf	2018-09-26 20:48:48 UTC (rev 48768)
@@ -32,7 +32,7 @@
 %% extension |.ins|) which are part of the distribution.
 %%
 
-\ProvidesLanguage{nil}[2018/09/02 3.23 Nil language]
+\ProvidesLanguage{nil}[2018/09/26 3.24 Nil language]
 \LdfInit{nil}{datenil}
 \ifx\l at nohyphenation\@undefined
    \@nopatterns{nil}

Modified: trunk/Master/texmf-dist/tex/generic/babel/switch.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/switch.def	2018-09-26 20:47:50 UTC (rev 48767)
+++ trunk/Master/texmf-dist/tex/generic/babel/switch.def	2018-09-26 20:48:48 UTC (rev 48768)
@@ -37,7 +37,7 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{switch.def}[2018/09/02 3.23 Babel switching mechanism]
+\ProvidesFile{switch.def}[2018/09/26 3.24 Babel switching mechanism]
 \ifx\AtBeginDocument\@undefined
   \input plain.def\relax
 \fi
@@ -58,8 +58,8 @@
   \countdef\last at language=19
   \def\addlanguage{\alloc at 9\language\chardef\@cclvi}
 \fi
-\def\bbl at version{3.23}
-\def\bbl at date{2018/09/02}
+\def\bbl at version{3.24}
+\def\bbl at date{2018/09/26}
 \def\adddialect#1#2{%
   \global\chardef#1#2\relax
   \bbl at usehooks{adddialect}{{#1}{#2}}%
@@ -394,6 +394,13 @@
     it in the preamble with something like:\\%
     \string\renewcommand\@backslashchar#2{..}\\%
     Reported}}
+\def\bbl at tentative{\protect\bbl at tentative@i}
+\def\bbl at tentative@i#1{%
+  \bbl at warning{%
+    Some functions in '#1' are tentative.\\%
+    They might not work as expected and their behavior\\%
+    could change in the future.\\%
+    Reported}}
 \def\@nolanerr#1{%
   \bbl at error
     {You haven't defined the language #1\space yet}%



More information about the tex-live-commits mailing list