[latex3-commits] [git/LaTeX3-latex3-babel] master: Fix #105. Also https://github.com/latex3/babel/issues/102#issuecomment-720148995 (9815e19)

Javier email at dante.de
Wed Nov 18 17:22:08 CET 2020


Repository : https://github.com/latex3/babel
On branch  : master
Link       : https://github.com/latex3/babel/commit/9815e19eb40261504222df2f9dbf9630d0ac1f2f

>---------------------------------------------------------------

commit 9815e19eb40261504222df2f9dbf9630d0ac1f2f
Author: Javier <email at localhost>
Date:   Wed Nov 18 17:22:08 2020 +0100

    Fix #105. Also https://github.com/latex3/babel/issues/102#issuecomment-720148995


>---------------------------------------------------------------

9815e19eb40261504222df2f9dbf9630d0ac1f2f
 README.md    |   6 +++++-
 babel.dtx    |  56 +++++++++++++++++++++++++++++++++++++-------------------
 babel.ins    |   2 +-
 babel.pdf    | Bin 814930 -> 815841 bytes
 bbcompat.dtx |   2 +-
 5 files changed, 44 insertions(+), 22 deletions(-)

diff --git a/README.md b/README.md
index 39be13e..5970533 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.51
+## Babel 3.51.2195
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages.  Many
@@ -43,6 +43,10 @@ respective authors.
 
 ### Latest changes
 ```
+3.52   2020-12-??
+       - Fixes:
+         - A couple of issues with \localeinfo and \getlocaleproperty
+           (#102, #105).
 3.51   2020-10-27
        - Common interface to (re)define captions (with
          \setlocalecaption).
diff --git a/babel.dtx b/babel.dtx
index b6b77a3..1e8d76e 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2020/10/27 v3.51 The Babel package]
+\ProvidesFile{babel.dtx}[2020/11/18 v3.51.2195 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -420,6 +420,14 @@ Package babel Warning: No hyphenation patterns were preloaded for
 This is not currently done by \babel{} and you must set it by hand.
 \end{note}
 
+\begin{note}
+  Although it has been customary to recommend placing |\title|,
+  |\author| and other elements printed by |\maketitle| after
+  |\begin{document}|, mainly because of shorthands, it is advisable to
+  keep them in the preamble. Currently there is no real need to use
+  shorthands in those macros.
+\end{note}
+
 \subsection{Multilingual documents}
 
 In multilingual documents, just use a list of the required languages as
@@ -4815,8 +4823,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.51>>
-%<<date=2020/10/27>>
+%<<version=3.51.2195>>
+%<<date=2020/11/18>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -6686,7 +6694,7 @@ help from Bernd Raichle, for which I am grateful.
   \IfFileExists{\CurrentOption.ldf}%
     {\bbl at load@language{\CurrentOption}}%
     {#1\bbl at load@language{#2}#3}}
-\DeclareOption{afrikaans}{\bbl at try@load at lang{}{dutch}{}}
+% \DeclareOption{afrikaans}{\bbl at try@load at lang{}{dutch}{}}
 \DeclareOption{hebrew}{%
   \input{rlbabel.def}%
   \bbl at load@language{hebrew}}
@@ -8049,17 +8057,17 @@ help from Bernd Raichle, for which I am grateful.
   \def\bbl at tempa##1,#3=##2,##3\@empty{\def\bbl at tempb{##2}}%
   \expandafter\bbl at tempa\bbl at evargs,#3=,\@empty
   \bbl at ifunset{bbl at ev@#2@#3@#1}%
-    {\bbl at csarg\bbl at add{ev@#3@#1}{\bbl at elt{#2}}}%
+    {\bbl at csarg\bbl at add{ev@#3@#1}{\bbl at elth{#2}}}%
     {\bbl at csarg\let{ev@#2@#3@#1}\relax}%
   \bbl at csarg\newcommand{ev@#2@#3@#1}[\bbl at tempb]}
 \newcommand\EnableBabelHook[1]{\bbl at csarg\let{hk@#1}\@firstofone}
 \newcommand\DisableBabelHook[1]{\bbl at csarg\let{hk@#1}\@gobble}
 \def\bbl at usehooks#1#2{%
-  \def\bbl at elt##1{%
+  \def\bbl at elth##1{%
     \bbl at cs{hk@##1}{\bbl at cs{ev@##1@#1@}#2}}%
   \bbl at cs{ev@#1@}%
   \ifx\languagename\@undefined\else % Test required for Plain (?)
-    \def\bbl at elt##1{%
+    \def\bbl at elth##1{%
       \bbl at cs{hk@##1}{\bbl at cl{ev@##1@#1}#2}}%
     \bbl at cl{ev@#1}%
   \fi}
@@ -11085,7 +11093,7 @@ help from Bernd Raichle, for which I am grateful.
       {Fix the name or reinstall babel.}%
   \else
     \catcode`\[=12 \catcode`\]=12 \catcode`\==12 \catcode`\&=12
-    \catcode`\;=12 \catcode`\|=12 \catcode`\%=14
+    \catcode`\;=12 \catcode`\|=12 \catcode`\%=14 \catcode`\-=12
     \bbl at info{Importing
                 \ifcase#2 \or font and identification \or basic \fi
                 data for \languagename\\%
@@ -13050,7 +13058,7 @@ help from Bernd Raichle, for which I am grateful.
 \endinput\fi
   % Here stops reading code for hyphen.cfg
   % The following is read the 2nd time it's loaded
-\begingroup
+\begingroup  % TODO - to a lua file
 \catcode`\%=12
 \catcode`\'=12
 \catcode`\"=12
@@ -13204,12 +13212,10 @@ help from Bernd Raichle, for which I am grateful.
 % \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).
+% Other discretionaries are not touched. See Unicode UAX 14.
 %
 %    \begin{macrocode}
+% TODO - to a lua file
 \directlua{
   Babel = Babel or {}
   Babel.linebreaking = Babel.linebreaking or {}
@@ -13456,6 +13462,7 @@ help from Bernd Raichle, for which I am grateful.
 % skipped and discretionaries are handled in a special way.
 %
 %    \begin{macrocode}
+% TODO - to a lua file
 \directlua{
 Babel.script_blocks = {
   ['Arab'] = {{0x0600, 0x06FF}, {0x08A0, 0x08FF}, {0x0750, 0x077F},
@@ -13640,7 +13647,7 @@ end
 % to be matched.
 %  
 %    \begin{macrocode}
-\begingroup
+\begingroup % TODO - to a lua file
 \catcode`\#=12
 \catcode`\%=12
 \catcode`\&=14
@@ -13667,12 +13674,13 @@ end
     return head
   end
 
-  function Babel.fetch_word(head, funct)
+  function Babel.fetch_word(head, mode)
     local word_string = ''
     local word_nodes = {}
     local lang
     local item = head
     local inmath = false
+    local mode = 0 &% 'word' -- first steps in merging with subtext
 
     while item do
 
@@ -13685,21 +13693,28 @@ end
         word_string = word_string .. unicode.utf8.char(item.char)
         word_nodes[#word_nodes+1] = item
 
-      elseif item.id == 7 and item.subtype == 2 and not inmath then
+      elseif item.id == 7 and item.subtype == 2
+             and not inmath and mode == 0 then
         word_string = word_string .. '='
         word_nodes[#word_nodes+1] = item
 
-      elseif item.id == 7 and item.subtype == 3 and not inmath then
+      elseif item.id == 7 and item.subtype == 3
+             and not inmath and mode == 0 then
         word_string = word_string .. '|'       
         word_nodes[#word_nodes+1] = item
 
       elseif item.id == 11 and item.subtype == 0 then
         inmath = true
         
+      elseif mode > 0 and item.id == 12 and item.subtype == 13 then
+        word_string = word_string .. '|'       
+        word_nodes[#word_nodes+1] = item
+
       elseif word_string == '' then
         &% pass
 
       else
+        tex.write_nl(word_string)
         return word_string, word_nodes, item, lang
       end
 
@@ -13720,10 +13735,12 @@ end
         break
       end
 
+      &% For every pattern
       for k=1, #lbkr[lang] do
         local p = lbkr[lang][k].pattern 
         local r = lbkr[lang][k].replace
 
+        &% For every match
         while true do
           local matches = { u.match(w, p) }
           if #matches < 2 then break end
@@ -13818,7 +13835,7 @@ end
   &%%%
   &% Preliminary code for \babelprehyphenation
   &% TODO. Copypaste pattern. Merge with fetch_word
-  function Babel.fetch_subtext(head, funct)
+  function Babel.fetch_subtext(head)
     local word_string = ''
     local word_nodes = {}
     local lang
@@ -13914,6 +13931,8 @@ end
             elseif crep == nil then
               changed = changed + 1
               node.remove(head, char_node)
+            elseif crep and crep.insert then
+              &% print(crep.insert)
             elseif crep and crep.string then
               changed = changed + 1
               local str = crep.string(matches)
@@ -14039,7 +14058,6 @@ end
       end
       patt = string.gsub(patt, '%(%)%^', '^()')
       patt = string.gsub(patt, '%$%(%)', '()$')
-      texio.write('***************' .. patt)
       patt = u.gsub(patt, '{(.)}', 
                 function (n)
                   return '%' .. (tonumber(n) and (tonumber(n)+1) or n)
diff --git a/babel.ins b/babel.ins
index 3bdf670..766c673 100644
--- a/babel.ins
+++ b/babel.ins
@@ -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{2020/10/27}
+\def\filedate{2020/11/18}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 0ed7a10..d92e113 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 1aabf3a..05140e9 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2020/10/27 v3.51]
+\ProvidesFile{bbcompat.dtx}[2020/11/18 v3.51.2195]
 %</dtx>
 %
 %% File 'bbcompat.dtx'





More information about the latex3-commits mailing list.