[latex3-commits] [git/LaTeX3-latex3-babel] master: Bump to 3.51. (69919c4)

Javier email at dante.de
Tue Oct 27 12:06:08 CET 2020


Repository : https://github.com/latex3/babel
On branch  : master
Link       : https://github.com/latex3/babel/commit/69919c4d2db2bc67c3d541370c70a1bcd60495e6

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

commit 69919c4d2db2bc67c3d541370c70a1bcd60495e6
Author: Javier <email at localhost>
Date:   Tue Oct 27 12:06:08 2020 +0100

    Bump to 3.51.


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

69919c4d2db2bc67c3d541370c70a1bcd60495e6
 README.md    |  12 ++-
 babel.dtx    | 235 +++++++++++++++++++++++++++++++++++++++--------------------
 babel.ins    |   2 +-
 babel.pdf    | Bin 812783 -> 814930 bytes
 bbcompat.dtx |   2 +-
 5 files changed, 168 insertions(+), 83 deletions(-)

diff --git a/README.md b/README.md
index 56103d8..39be13e 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.50.2166
+## Babel 3.51
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages.  Many
@@ -43,15 +43,19 @@ respective authors.
 
 ### Latest changes
 ```
-3.51   2020-10-??
-       - Common interface to redefine captions (with \babelprovide).
+3.51   2020-10-27
+       - Common interface to (re)define captions (with
+         \setlocalecaption).
        - frenchspacing filled in many ini files.
+       - A new internal macro (for ldf files) named \babel at texpdf, to
+         ease interoperativity with hyperref in shorthands.
        - Fixes:
          - Error when loading a language on the fly in tabular (#97).
          - 'hyphenrules' raised an error with 'base' option (#59).
          - Better handling of autoloaded languages (eg, catcodes).
          - An error was raised with CJK and a null font (#99).
-         - ??? #92 Bold + Small Caps [still testing] 
+         - language.tag.bcp47 and tag.ini in \localeinfo didn't work
+           (#102).
 
 3.50   2020-10-06
        - Fixes:
diff --git a/babel.dtx b/babel.dtx
index 8edd764..b6b77a3 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2020/10/20 v3.50.2166 The Babel package]
+\ProvidesFile{babel.dtx}[2020/10/27 v3.51 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -261,7 +261,9 @@ possible issues can be caught in the development phase.
 help in some forums like \textsf{tex.stackexchange}, but if you have
 found a bug, I strongly beg you to report it in
 \href{https://github.com/latex3/babel/issues}{GitHub}, which is much
-better than just complaining on an e-mail list or a web forum.
+better than just complaining on an e-mail list or a web forum. Remember
+\textit{warnings are not errors} by themselves, they just warn about
+possible problems or incompatibilities.
 
 \item[\sffamily\color{messages}How can I contribute a new
 language?] See section \ref{contribute} for contributing a language.
@@ -2279,40 +2281,57 @@ to select fonts in addition to the three basic families.
 
 \subsection{Modifying a language}
 
-Modifying the behavior of a language (say, the chapter “caption”), is
-sometimes necessary, but not always trivial.
-\begin{itemize}
-\item The old way, still valid for many languages, to redefine a
-  caption is the following:
+Modifying the behavior of a language (say, the chapter
+“caption”), is sometimes necessary, but not always trivial. In the case
+of caption names a specific macro is provided, because this is perhaps
+the most frequent change:
+
+\Describe{\setlocalecaption}{%
+  \marg{language-name}\marg{caption-name}\marg{string}}
+
+\New{3.51} Here \textit{caption-name} is the name as string without the
+trailing |name|. An example, which also shows caption names are often a
+stylistic choice, is:
 \begin{verbatim}
-\addto\captionsenglish{%
-  \renewcommand\contentsname{Foo}%
-}
+\setlocalecaption{english}{contents}{Table of Contents}
 \end{verbatim}
-As of 3.15, there is no need to hide spaces with \texttt{\%%
-} (\babel{} removes them), but it is advisable to do so.
-\item The new way, which is found in |bulgarian|, |azerbaijani|,
-  |spanish|, |french|, |turkish|, |icelandic|, |vietnamese| and a few
-  more, as well as in languages created with |\babelprovide| and its
-  key |import|, is:
+This works not only with existing caption names, because it also serves to
+define new ones by setting the \textit{caption-name} to the name of
+your choice (|name| will be postpended). Captions so defined or
+redefined behave with the ‘new way’ described in the following note.
+
+\begin{note}
+  There are a few alternative methods:
+  \begin{itemize}
+\item With data |import|’ed from |ini| files, you can modify the values
+  of specific keys, like:
 \begin{verbatim}
-\renewcommand\spanishchaptername{Foo}
+\babelprovide[import, _captions/listtable = Lista de tablas_]{spanish}
 \end{verbatim}
-\item Macros to be run when a language is selected can be add to
-  |\extras|\m{lang}:
+  (In this particular case, instead of the |captions| group you may need
+  to modify the |captions.licr| one.)
+  
+\item The ‘old way’, still valid for many languages, to redefine a
+    caption is the following:
 \begin{verbatim}
-\addto\extrasrussian{\mymacro}
+\addto\captionsenglish{%
+  \renewcommand\contentsname{Foo}%
+}
 \end{verbatim}
-There is a counterpart for code to be run when a language is
-unselected: |\noextras|\m{lang}.
-\item With data |import|’ed from |ini| files, you can modify the values
-of specific keys, like:
+  As of 3.15, there is no need to hide spaces with \texttt{\%%
+  } (\babel{} removes them), but it is advisable to do so. This
+  redefinition is not activated until the language is selected.
+
+\item The ‘new way’, which is found in |bulgarian|, |azerbaijani|,
+    |spanish|, |french|, |turkish|, |icelandic|, |vietnamese| and a few
+    more, as well as in languages created with |\babelprovide| and its
+    key |import|, is:
 \begin{verbatim}
-\babelprovide[import, _captions/listtable = Lista de tablas_]{spanish}
+\renewcommand\spanishchaptername{Foo}
 \end{verbatim}
-(In this particular case, instead of the |captions| group you may need
-to modify the |captions.licr| one.)
+This redefinition is immediate.
 \end{itemize}
+\end{note}
 
 \begin{note} Do \textit{not} redefine a caption in the following way:
 \begin{verbatim}
@@ -2322,6 +2341,14 @@ The changes may be discarded with a language selector, and the original
 value restored.
 \end{note}
 
+Macros to be run when a language is selected can be add to
+  |\extras|\m{lang}:
+\begin{verbatim}
+\addto\extrasrussian{\mymacro}
+\end{verbatim}
+There is a counterpart for code to be run when a language is
+unselected: |\noextras|\m{lang}.
+
 \begin{note}
   These macros (|\captions|\m{lang}, |\extras|\m{lang}) may be
   redefined, but \textit{must not} be used as such -- they just pass
@@ -3354,18 +3381,19 @@ bidirectional (with both R and L paragraphs) documents in \luatex{}.
   required in \xetex{} and \pdftex{} in some styles (support for the
   latter two engines is still experimental) \New{3.18}.
 
-\item[tabular] required in \luatex{} for R |tabular| (it has been
-  tested only with simple tables, so expect some readjustments in the
-  future); ignored in \pdftex{} or \xetex{} (which will not support a
-  similar option in the short term). It patches an internal command, so
-  it might be ignored by some packages and classes (or even raise an
-  error). \New{3.18}.
+\item[tabular] required in \luatex{} for R |tabular|, so that the first
+  column is the right one (it has been tested only with simple tables,
+  so expect some readjustments in the future); ignored in \pdftex{} or
+  \xetex{} (which will not support a similar option in the short term).
+  It patches an internal command, so it might be ignored by some
+  packages and classes (or even raise an error). \New{3.18}.
   
 \item[graphics] modifies the |picture| environment so that the whole
-  figure is L but the text is R. It \textit{does not} work with the
-  standard |picture|, and \textit{pict2e} is required if you want
-  sloped lines. It attempts to do the same for \textsf{pgf/tikz}.
-  Somewhat experimental. \New{3.32}.
+figure is L but the text is R. It \textit{does not} work with the
+standard |picture|, and \textit{pict2e} is required if you want sloped
+lines \textbf{(With recent versions of \LaTeX, this feature has
+stopped working)}. It attempts to do the same for \textsf{pgf/tikz}.
+Somewhat experimental. \New{3.32}.
 
 \item[extras] is used for miscellaneous readjustments which do not fit into
   the previous groups. Currently redefines in \luatex{} |\underline| and
@@ -3822,6 +3850,15 @@ version of |\foreignlanguage|).
 For old an deprecated functions, see the wiki.
 
 \medskip
+\textbf{Options for locales loaded on the fly}
+
+\New{3.51} |\babeladjust{ autoload.options = ... }| sets the options
+when a language is loaded on the fly (by default, no options). A
+typical value would be |import|, which defines captions, date,
+numerals, etc., but ignores the code in the |tex| file (for example,
+extended numerals in Greek).
+
+\medskip
 \textbf{Labels}
 
 \New{3.48} There is some work in progress for \babel{} to deal with
@@ -4778,8 +4815,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.50.2166>>
-%<<date=2020/10/20>>
+%<<version=3.51>>
+%<<date=2020/10/27>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -5374,16 +5411,12 @@ help from Bernd Raichle, for which I am grateful.
 \DeclareOption{provide=*}{\chardef\bbl at iniflag\@ne}    % main -> +1
 \DeclareOption{provide+=*}{\chardef\bbl at iniflag\tw@}   % add = 2
 \DeclareOption{provide*=*}{\chardef\bbl at iniflag\thr@@} % add + main
+% A separate option
+\let\bbl at autoload@options\@empty
+\DeclareOption{provide@=*}{\def\bbl at autoload@options{import}}
 % Don't use. Experimental. TODO.
 \newif\ifbbl at single
 \DeclareOption{selectors=off}{\bbl at singletrue}
-\let\bbl at autoload@options\@empty
-% autoload with cat @=letter
-\DeclareOption{provide@=*}{\def\bbl at autoload@options{import}}
-\makeatother
-\DeclareOption{provide@=*}% autoload with cat @=other
-  {\expandafter\def\csname bbl at autoload@options\endcsname{import}}
-\makeatletter
 <@More package options@>
 %    \end{macrocode}
 %
@@ -8755,13 +8788,23 @@ help from Bernd Raichle, for which I am grateful.
 %    \item the code to be executed when the shorthand is encountered.
 %    \end{enumerate}
 %
+% The auxiliary macro |\babel at texpdf| improves the interoperativity with
+% \textsf{hyperref} and takes 4 arguments: (1) The \TeX{} code in text
+% mode, (2) the string for \textsf{hyperref}, (3) the \TeX{} code in
+% math mode, and (4), which is currently ignored, but it's meant for a
+% string in math mode, like a minus sign instead of an hyphen
+% (currently \textsf{hyperref} doesn't discriminate the mode). This
+% macro may be used in |ldf| files.
+
 %    \begin{macrocode}
-\def\bbl at texormathorpdf#1#2#3{%
+\def\babel at texpdf#1#2#3#4{%
   \ifx\texorpdfstring\@undefined
     \textormath{#1}{#2}%
   \else
-    \texorpdfstring{\textormath{#1}{#2}}{#3}%
+    \texorpdfstring{\textormath{#1}{#3}}{#2}%
+    % \texorpdfstring{\textormath{#1}{#3}}{\textormath{#2}{#4}}%
   \fi}
+%
 \def\declare at shorthand#1#2{\@decl at short{#1}#2\@nil}
 \def\@decl at short#1#2#3\@nil#4{%
   \def\bbl at tempa{#3}%
@@ -9946,6 +9989,64 @@ help from Bernd Raichle, for which I am grateful.
   \fi}
 %    \end{macrocode}
 %
+% This sections ends with a general tool for resetting the caption
+% names with a unique interface. With the old way, which mixes the
+% switcher and the string, we convert it to the new one, which
+% separates these two steps.
+%
+%    \begin{macrocode}
+\newcommand\setlocalecaption{%  TODO. Catch typos. What about ensure?
+  \@ifstar\bbl at setcaption@s\bbl at setcaption@x}
+\def\bbl at setcaption@x#1#2#3{%  language caption-name string
+  \edef\bbl at tempa{#1}%
+  \edef\bbl at tempd{%
+    \expandafter\expandafter\expandafter
+    \strip at prefix\expandafter\meaning\csname captions#1\endcsname}%
+  \bbl at xin@
+    {\expandafter\string\csname #2name\endcsname}%
+    {\bbl at tempd}%
+  \ifin@ % Renew caption
+    \bbl at xin@{\string\bbl at scset}{\bbl at tempd}% 
+    \ifin@
+      \bbl at exp{%
+        \\\bbl at ifsamestring{\bbl at tempa}{\languagename}%
+          {\\\bbl at scset\<#2name>\<#1#2name>}%
+          {}}%
+    \else % Old way converts to new way
+      \bbl at ifunset{#1#2name}%
+        {\bbl at exp{%
+          \\\bbl at add\<captions#1>{\def\<#2name>{\<#1#2name>}}%
+          \\\bbl at ifsamestring{\bbl at tempa}{\languagename}%
+            {\def\<#2name>{\<#1#2name>}}%
+            {}}}%
+        {}%
+    \fi
+  \else
+    \bbl at xin@{\string\bbl at scset}{\bbl at tempd}% New
+    \ifin@ % New way
+      \bbl at exp{%
+        \\\bbl at add\<captions#1>{\\\bbl at scset\<#2name>\<#1#2name>}%
+        \\\bbl at ifsamestring{\bbl at tempa}{\languagename}%
+          {\\\bbl at scset\<#2name>\<#1#2name>}%
+          {}}%
+    \else  % Old way, but defined in the new way
+      \bbl at exp{%
+        \\\bbl at add\<captions#1>{\def\<#2name>{\<#1#2name>}}%      
+        \\\bbl at ifsamestring{\bbl at tempa}{\languagename}%
+          {\def\<#2name>{\<#1#2name>}}%
+          {}}%
+    \fi%
+  \fi
+  \@namedef{#1#2name}{#3}%
+  \toks@\expandafter{\bbl at captionslist}%
+  \bbl at exp{\\\in@{\<#2name>}{\the\toks@}}%
+  \ifin@\else
+    \bbl at exp{\\\bbl at add\\\bbl at captionslist{\<#2name>}}%
+    \bbl at toglobal\bbl at captionslist
+  \fi}
+% \def\bbl at setcaption@s#1#2#3{}  % Not yet implemented
+%    \end{macrocode}
+%
 % \subsection{Macros common to a number of languages}
 %
 %  \begin{macro}{\set at low@box}
@@ -10507,7 +10608,6 @@ help from Bernd Raichle, for which I am grateful.
     \else
       \bbl at csarg\def{KVP@##1}{##2}%
     \fi}%
-  \let\bbl at saverenew@captions\bbl at renew@captions
   % == import, captions ==
   \ifx\bbl at KVP@import\@nil\else
     \bbl at exp{\\\bbl at ifblank{\bbl at KVP@import}}%
@@ -10755,7 +10855,7 @@ help from Bernd Raichle, for which I am grateful.
   \fi
   % == require.babel in ini ==
   % To load or reaload the babel-*.tex, if require.babel in ini
-  \ifx\bbl at beforestart\relax\else  % But only in preamble
+  \ifx\bbl at beforestart\relax\else  % But not in doc aux or body
     \bbl at ifunset{bbl at rqtex@\languagename}{}%
       {\expandafter\ifx\csname bbl at rqtex@\languagename\endcsname\@empty\else
          \let\BabelBeforeIni\@gobbletwo
@@ -10766,16 +10866,6 @@ help from Bernd Raichle, for which I am grateful.
          \let\atcatcode\relax
        \fi}%
   \fi
-  % == caption redefinition ==
-  \ifx\bbl at KVP@captions\@nil
-    \def\bbl at elt##1##2{%
-      \bbl at ifunset{\languagename ##1name}%
-        {\toks@{##2}%
-         \bbl at exp{%
-           \\\bbl at add\<captions\languagename>{\def\<##1name>{\the\toks@}}}}%
-        {\@namedef{\languagename##1name}{##2}}}%
-    \@nameuse{bbl at saverenew@captions}%
-  \fi
   % == main ==
   \ifx\bbl at KVP@main\@nil  % Restore only if not 'main'
     \let\languagename\bbl at savelangname
@@ -11011,7 +11101,7 @@ help from Bernd Raichle, for which I am grateful.
     \repeat
   \fi}
 \def\bbl at read@ini#1#2{%
-  \bbl at csarg\edef{lini@\languagename}{#1}%
+  \bbl at csarg\xdef{lini@\languagename}{#1}%
   \let\bbl at section\@empty
   \let\bbl at savestrings\@empty
   \let\bbl at savetoday\@empty
@@ -11141,7 +11231,8 @@ help from Bernd Raichle, for which I am grateful.
   \bbl at exportkey{elname}{identification.name.english}{}%
   \bbl at exp{\\\bbl at exportkey{lname}{identification.name.opentype}%
     {\csname bbl at elname@\languagename\endcsname}}%
-  \bbl at exportkey{lbcp}{identification.tag.bcp47}{}% TODO
+  \bbl at exportkey{tbcp}{identification.tag.bcp47}{}%
+  \bbl at exportkey{lbcp}{identification.language.tag.bcp47}{}%
   \bbl at exportkey{lotf}{identification.tag.opentype}{dflt}%
   \bbl at exportkey{esname}{identification.script.name}{}%
   \bbl at exp{\\\bbl at exportkey{sname}{identification.script.name.opentype}%
@@ -11149,7 +11240,7 @@ help from Bernd Raichle, for which I am grateful.
   \bbl at exportkey{sbcp}{identification.script.tag.bcp47}{}%
   \bbl at exportkey{sotf}{identification.script.tag.opentype}{DFLT}%
   \ifbbl at bcptoname
-    \bbl at csarg\xdef{bcp at map@\bbl at cl{lbcp}}{\languagename}%
+    \bbl at csarg\xdef{bcp at map@\bbl at cl{tbcp}}{\languagename}%
   \fi}
 %    \end{macrocode}
 %
@@ -11672,7 +11763,8 @@ help from Bernd Raichle, for which I am grateful.
 \@namedef{bbl at info@tag.ini}{lini}
 \@namedef{bbl at info@name.english}{elname}
 \@namedef{bbl at info@name.opentype}{lname}
-\@namedef{bbl at info@tag.bcp47}{lbcp} % TODO
+\@namedef{bbl at info@tag.bcp47}{tbcp}
+\@namedef{bbl at info@language.tag.bcp47}{lbcp}
 \@namedef{bbl at info@tag.opentype}{lotf}
 \@namedef{bbl at info@script.name}{esname}
 \@namedef{bbl at info@script.name.opentype}{sname}
@@ -12351,7 +12443,7 @@ help from Bernd Raichle, for which I am grateful.
     \bbl at ifunset{bbl@##1dflt@\languagename}%
       {\bbl at cs{famrst@##1}%
        \global\bbl at csarg\let{famrst@##1}\relax}%
-      {\bbl at exp{% order is relevant
+      {\bbl at exp{% order is relevant. TODO: but sometimes wrong!
          \\\bbl at add\\\originalTeX{%
            \\\bbl at font@rst{\bbl at cl{##1dflt}}%
                           \<##1default>\<##1family>{##1}}%
@@ -12405,17 +12497,6 @@ help from Bernd Raichle, for which I am grateful.
 % font is defined.
 %
 %    \begin{macrocode}
-\ifx\AddToHook\@undefined\else
-  \AddToHook{rmfamily}{\bbl at set@fontseries\bfseries at rm@kernel}
-  \AddToHook{sffamily}{\bbl at set@fontseries\bfseries at sf@kernel}
-  \AddToHook{ttfamily}{\bbl at set@fontseries\bfseries at tt@kernel}
-  \def\bbl at set@fontseries#1{%
-    \ifx#1\@undefined\else
-      \expandafter
-      \in@\expandafter{\f at family}{cmr,cmss,cmtt,lcmss,lcmtt,lmr,lmss,lmtt}%
-      \ifin@\let\bfdefault#1\else\def\bfdefault{b}\fi
-    \fi}
-\fi
 \def\bbl at font@set#1#2#3{% eg \bbl at rmdflt@lang \rmdefault \rmfamily
   \bbl at xin@{<>}{#1}%
   \ifin@
@@ -12619,7 +12700,7 @@ help from Bernd Raichle, for which I am grateful.
       \fi
       \bbl at exp{%
         \\\bbl at add\<extras\languagename>{%
-          \XeTeXlinebreaklocale "\bbl at cl{lbcp}"%
+          \XeTeXlinebreaklocale "\bbl at cl{tbcp}"%
           \<bbl at xeisp@\languagename>%
           \<bbl at xeipn@\languagename>}%
         \\\bbl at toglobal\<extras\languagename>%
diff --git a/babel.ins b/babel.ins
index d88cabf..3bdf670 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/20}
+\def\filedate{2020/10/27}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 19abcd6..0ed7a10 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 89cb64e..1aabf3a 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2020/10/20 v3.50.2166]
+\ProvidesFile{bbcompat.dtx}[2020/10/27 v3.51]
 %</dtx>
 %
 %% File 'bbcompat.dtx'





More information about the latex3-commits mailing list.