[latex3-commits] [git/LaTeX3-latex3-babel] main: Info shown with 'main='. Fix: some settings ignored with 'onchar'. (0356340)

Javier email at dante.de
Tue Feb 22 17:52:50 CET 2022


Repository : https://github.com/latex3/babel
On branch  : main
Link       : https://github.com/latex3/babel/commit/03563402b404dc7549758c9f760a9dcc63aab691

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

commit 03563402b404dc7549758c9f760a9dcc63aab691
Author: Javier <email at localhost>
Date:   Tue Feb 22 17:52:50 2022 +0100

    Info shown with 'main='. Fix: some settings ignored with 'onchar'.
    
    * And more on amsmath.


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

03563402b404dc7549758c9f760a9dcc63aab691
 README.md    |  14 +++---
 babel.dtx    | 161 +++++++++++++++++++++++++++++------------------------------
 babel.ins    |   2 +-
 babel.pdf    | Bin 853420 -> 855660 bytes
 bbcompat.dtx |   2 +-
 5 files changed, 88 insertions(+), 91 deletions(-)

diff --git a/README.md b/README.md
index 9e7dac4..df29535 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-## Babel 3.71.2651
+## Babel 3.71.2656
 
-(Development.)
+*(Development.)*
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages. Many
@@ -10,9 +10,9 @@ is a set of ini files for about 250 languages.
 
 The latest stable version is available on <https://ctan.org/pkg/babel>.
 
-Changes in version 3.71 are described in:
+Changes in version 3.72 are described in:
 
-https://latex3.github.io/babel/news/whats-new-in-babel-3.71.html
+https://latex3.github.io/babel/news/whats-new-in-babel-3.72.html
 
 Apart from the manual, you can find information on some aspects of babel at:
 
@@ -49,8 +49,10 @@ respective authors.
 ### Summary of Latest changes
 ```
 3.72   2022-02-?? (dev)
-       * Advances in amsmath
-       * Fix: captions in Thai.
+       * Advances in amsmath (lua).
+       * Fixes:
+         - Captions in Thai.
+         - Some settings sometimes ignored with 'onchar' (lua).
 
 3.71   2022-02-13
        * IAST transliteration for Sanskrit (by Maximilian Mehner).
diff --git a/babel.dtx b/babel.dtx
index 3628b32..aa01267 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2022/02/17 v3.71.2651 The Babel package]
+\ProvidesFile{babel.dtx}[2022/02/22 v3.71.2656 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -2567,20 +2567,22 @@ line breking mode that allows spaces to be stretched to arbitrary amounts.
 (thus overriding that set when \babel\ is loaded). Only in newly defined
 languages.
 \begin{example}
-  Let's assume your document is mainly in Polytonic Greek, but with some
-  sections in Italian. Then, the first attempt should be:
+  Let's assume your document (\xetex{} or \luatex{}) is mainly in
+  Polytonic Greek with but with some sections in Italian. Then, the
+  first attempt should be:
 \begin{verbatim}
 \usepackage[italian, greek.polutonic]{babel}
 \end{verbatim}
-  But if, say, accents in Greek are not shown correctly, you can try: 
+  But if, say, accents in Greek are not shown correctly, you can try
 \begin{verbatim}
-\usepackage[italian]{babel}
-\babelprovide[import, main]{polytonicgreek}
+\usepackage[italian, polytonicgreek, provide=*]{babel}
 \end{verbatim}
 Remerber there is an alternative syntax for the latter:
 \begin{verbatim}
-\usepackage[italian, polytonicgreek, provide=*]{babel}
+\usepackage[italian]{babel}
+\babelprovide[import, main]{polytonicgreek}
 \end{verbatim}
+
 Finally, also remember you might not need to load |italian| at all if
 there are only a few word in this language (see~\ref{mostlymono}).
 
@@ -3813,13 +3815,14 @@ options are also used (eg, |\ProsodicMarksOn| in \textsf{latin}).
 events. Some hooks are predefined when \luatex{} and \xetex{} are
 used.
 
-% \New{3.62} This is not the only way to inject code at those points. The
-% events listed below can be used as a hook name in |\AddToHook| in the
-% form |babel/|\marg{name}, but there is a limitation, because the
-% parameters passed with the \babel{} mechanism are not allowed. The
-% |\AddToHook| mechanism does \textit{not} replace the current one in
-% `babel`. Its main advantage is you can reconfigure `babel` even before
-% loading it. See the example below.
+\New{3.64} This is not the only way to inject code at those points. The
+events listed below can be used as a hook name in |\AddToHook| in the
+form |babel/|\marg{language}\/\\marg{name} (with |*| it’s applied to
+all languages), but there is a limitation, because the parameters
+passed with the \babel{} mechanism are not allowed. The |\AddToHook|
+mechanism does \textit{not} replace the current one in `babel`. Its
+main advantage is you can reconfigure `babel` even before loading it.
+See the example below.
 
 \Describe{\AddBabelHook}{\oarg{lang}\marg{name}\marg{event}\marg{code}}
 
@@ -3903,26 +3906,26 @@ ones, they only have a single hook and replace a default definition.
   file. Used by \file{luababel.def}.
 \end{description}
 
-% \begin{example}
-% The generic unlocalized \LaTeX{} hooks are predefined, so that you can
-% write:
-% \begin{verbatim}
-% \AddToHook{babel/afterextras}{\frenchspacing} 
-% \end{verbatim}
-% which is executed always after the extras for the language being
-% selected (and just before the non-localized hooks defined with
-% |\AddBabelHook|).
-
-% In addition, locale-specific hooks in the form
-% |babel/|\marg{hook-name}|/|\marg{language-name} are \textit{recognized}
-% (executed just before the localized \babel{} hooks), but they are \textit{not
-% predefined}. You have to do it yourself. For example, to set
-% |\frenchspacing| only in |bengali|:
-% \begin{verbatim}
-% \ProvideHook{babel/afterextras/bengali}
-% \AddToHook{babel/afterextras/bengali}{\frenchspacing}
-% \end{verbatim}
-% \end{example}
+\begin{example}
+The generic unlocalized \LaTeX{} hooks are predefined, so that you can
+write:
+\begin{verbatim}
+\AddToHook{babel/*/afterextras}{\frenchspacing} 
+\end{verbatim}
+which is executed always after the extras for the language being
+selected (and just before the non-localized hooks defined with
+|\AddBabelHook|).
+
+In addition, locale-specific hooks in the form
+|babel/|\marg{language-name}|/|\marg{hook-name} are \textit{recognized}
+(executed just before the localized \babel{} hooks), but they are
+\textit{not predefined}. You have to do it yourself. For example, to
+set |\frenchspacing| only in |bengali|:
+\begin{verbatim}
+\ActivateGenericHook{babel/bengali/afterextras}
+\AddToHook{babel/bengali/afterextras}{\frenchspacing}
+\end{verbatim}
+\end{example}
 
 \Describe{\BabelContentsFiles}{}
 \New{3.9a} This macro contains a list of ``toc'' types
@@ -4096,7 +4099,7 @@ direction with |bidi.text|).
    mappings. Unfortunately, \cs{savinghyphcodes} is not a solution
    either, because lccodes for hyphenation are frozen in the format
    and cannot be changed.} So, if you write a chunk of French text
-   with |\foreinglanguage|, the apostrophes might not be taken into
+   with |\foreignlanguage|, the apostrophes might not be taken into
    account. This is a limitation of \TeX, not of
    \babel. Alternatively, you may use |\useshorthands| to activate |'|
    and |\defineshorthand|, or redefine |\textquoteright| (the latter
@@ -5100,8 +5103,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.71.2651>>
-%<<date=2022/02/17>>
+%<<version=3.71.2656>>
+%<<date=2022/02/22>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -5364,7 +5367,7 @@ help from Bernd Raichle, for which I am grateful.
 %    \end{macrocode}
 % \end{macro}
 %
-% Two further tools.  |\bbl at samestring| first expand its arguments and
+% Two further tools.  |\bbl at ifsamestring| first expand its arguments and
 % then compare their expansion (sanitized, so that the catcodes do not
 % matter). |\bbl at engine| takes the following values: 0 is pdf\TeX, 1
 % is \luatex, and 2 is \xetex. You may use the latter it in your
@@ -9735,6 +9738,8 @@ help from Bernd Raichle, for which I am grateful.
    % == onchar ==
   \ifx\bbl at KVP@onchar\@nil\else
     \bbl at luahyphenate
+    \bbl at exp{%
+      \\\AddToHook{env/document/before}{{\\\select at language{#2}{}}}}%
     \directlua{
       if Babel.locale_mapped == nil then
         Babel.locale_mapped = true
@@ -12133,6 +12138,10 @@ help from Bernd Raichle, for which I am grateful.
         \fi
       \fi}%
   \fi
+\else
+  \bbl at info{Main language set with 'main='. Except if you have\\%
+            problems, prefer the default mechanism for setting\\%
+            the main language. Reported}
 \fi
 %    \end{macrocode}
 %
@@ -14560,35 +14569,34 @@ end
       \fi
     \else % amstex
       \ifx\bbl at noamsmath\@undefined
-        \edef\bbl at tempa{%
-          \catcode58=\the\catcode58\relax
-          \catcode95=\the\catcode95\relax}%
-        \catcode58=11
-        \catcode95=11
+        \@ifpackagewith{amsmath}{leqno}%
+          {\let\bbl at ams@lap\hbox}% = leqno
+          {\let\bbl at ams@lap\llap}% = default
+        \ExplSyntaxOn
         \bbl at sreplace\intertext@{\normalbaselines}%
           {\normalbaselines
            \ifx\bbl at eqnodir\relax\else\bbl at pardir\@ne\bbl at eqnodir\fi}%
-        \bbl at tempa
-        \def\bbl at ams@tagbox#1#2{#1{\bbl at eqnodir#2}}% #1=\hbox|ams at lap
-        \def\bbl at ams@eqtagbox#1{%
-          \setbox\z@\hbox{\bbl at eqnodir#1}%
-          \hbox to 0.01pt{%
-            \ifx\bbl at ams@lap\hbox % leqno
-              \hss\hbox to\displaywidth{\box\z@\hss}%
-            \else % eqno
-              \hbox to\displaywidth{\hss\box\z@}\hss
-            \fi}}%
+        \ExplSyntaxOff
+        \def\bbl at ams@tagbox#1#2{#1{\bbl at eqnodir#2}}% #1=hbox|@lap|flip
+        \ifx\bbl at ams@lap\hbox % leqno
+          \def\bbl at ams@flip#1{%
+            \hbox to 0.01pt{\hss\hbox to\displaywidth{{#1}\hss}}}%
+        \else % eqno
+          \def\bbl at ams@flip#1{%
+            \hbox to 0.01pt{\hbox to\displaywidth{\hss{#1}}\hss}}%
+        \fi
         \def\bbl at ams@preset#1{%
           \ifnum\bbl at thetextdir>\z@
             \edef\bbl at eqnodir{\noexpand\bbl at textdir{\the\bbl at thetextdir}}%
-            \chardef\bbl at thetextdir\z@ % necessary? doesn’t hurt
             \bbl at sreplace\textdef@{\hbox}{\bbl at ams@tagbox\hbox}%
             \bbl at sreplace\maketag@@@{\hbox}{\bbl at ams@tagbox#1}%
-          \fi}
-        \@ifpackagewith{amsmath}{leqno}%
-          {\let\bbl at ams@lap\hbox}% = leqno
-          {\let\bbl at ams@lap\llap}% = default
-        % 
+          \fi}%
+        \AddToHook{env/equation/begin}{%
+          \ifnum\bbl at thetextdir>\z@
+            \ifx\bbl at ams@lap\llap\hrule\@height\z@\fi
+            \bbl at ams@preset\bbl at ams@flip
+          \fi}%
+        \AddToHook{env/equation*/begin}{\bbl at ams@preset\bbl at ams@flip}%
         \AddToHook{env/cases/begin}{\bbl at ams@preset\bbl at ams@lap}%
         \AddToHook{env/multline/begin}{\bbl at ams@preset\hbox}%
         \AddToHook{env/gather/begin}{\bbl at ams@preset\bbl at ams@lap}%
@@ -14596,34 +14604,21 @@ end
         \AddToHook{env/align/begin}{\bbl at ams@preset\bbl at ams@lap}%
         \AddToHook{env/align*/begin}{\bbl at ams@preset\bbl at ams@lap}%
         \AddToHook{env/eqnalign/begin}{\bbl at ams@preset\hbox}%
-        % Hackish, for proper alignment-don’t ask me why it works! :-)
-        \bbl at exp{%
-          \\\AddToHook{env/align*/end}{\<iftag@>\<else>\\\tag*{}\<fi>}}%
+        % Hackish, for proper alignment. Don’t ask me why it works!:
+        \AddToHook{env/align*/end}{\iftag@\else\tag*{}\fi}%
         \AddToHook{env/flalign/begin}{\bbl at ams@preset\hbox}%
         \AddToHook{env/split/before}{%
           \ifnum\bbl at thetextdir>\z@
-            \def\bbl at tempa{equation}%
-            \ifx\@currenvir\bbl at tempa
-              \def\bbl at ams@eqtagbox#1{%
-                \ifx\bbl at ams@lap\hbox
-                  \hbox to0.01pt{\bbl at eqnodir\hss#1}% leqno
-                \else
-                  \hbox to0.01pt{\bbl at eqnodir#1\hss}% eqno
-                \fi}
-            \fi
-          \fi}
-        \AddToHook{env/equation/begin}{%
-          \ifnum\bbl at thetextdir>\z@
-            \ifx\bbl at ams@lap\llap\hrule\@height\z@\fi
-            \edef\bbl at eqnodir{\noexpand\bbl at textdir{\the\bbl at thetextdir}}%
-            \bbl at sreplace\maketag@@@{\hbox}{\bbl at ams@eqtagbox}%
+            \bbl at ifsamestring\@currenvir{equation}%
+              {\ifx\bbl at ams@lap\hbox % leqno
+                 \def\bbl at ams@flip#1{%
+                   \hbox to 0.01pt{\hbox to\displaywidth{{#1}\hss}\hss}}%
+               \else
+                 \def\bbl at ams@flip#1{%
+                   \hbox to 0.01pt{\hss\hbox to\displaywidth{\hss{#1}}}}%
+               \fi}%
+             {}%
           \fi}%
-        \AddToHook{env/equation*/begin}{%
-          \ifnum\bbl at thetextdir>\z@
-            \edef\bbl at eqnodir{\noexpand\bbl at textdir{\the\bbl at thetextdir}}%
-            \bbl at sreplace\maketag@@@{\hbox}{\bbl at ams@eqtagbox}%
-          \fi}%
-        \fi
       \fi}
 \fi
 \ifx\bbl at opt@layout\@nnil\endinput\fi  % if no layout
diff --git a/babel.ins b/babel.ins
index 639787d..dac5323 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{2022/02/17}
+\def\filedate{2022/02/22}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 502975b..c91c4c1 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index b8373ec..0abb83c 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/02/17 v3.71.2651]
+\ProvidesFile{bbcompat.dtx}[2022/02/22 v3.71.2656]
 %</dtx>
 %
 %% File 'bbcompat.dtx'





More information about the latex3-commits mailing list.