[latex3-commits] [latex3/babel] main: Lazy locale loading: import by default. (e2d2670)

github at latex-project.org github at latex-project.org
Sun Nov 24 11:01:11 CET 2024


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

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

commit e2d2670a1c8d9cd97f6566b53e2ecb0cd128d63b
Author: Javier <email at localhost>
Date:   Sun Nov 24 11:01:11 2024 +0100

    Lazy locale loading: import by default.


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

e2d2670a1c8d9cd97f6566b53e2ecb0cd128d63b
 README.md            |  37 ++++++++++++++-------
 babel-code.pdf       | Bin 732981 -> 732864 bytes
 babel.dtx            |  91 +++++++++++++++++++++++++++++++++++++++------------
 babel.ins            |   2 +-
 babel.pdf            | Bin 519536 -> 521052 bytes
 bbcompat.dtx         |   2 +-
 samples/lua-thai.pdf | Bin 42443 -> 36905 bytes
 7 files changed, 98 insertions(+), 34 deletions(-)

diff --git a/README.md b/README.md
index afbc13b..396f153 100644
--- a/README.md
+++ b/README.md
@@ -1,20 +1,30 @@
-## Babel 24.13
+## Babel 24.13.69442
 
-2024-11-08
+(dev)
 
-`babel` is the multilingual framework to localize documents in
-LaTeX, LuaLaTeX, XeLaTeX. It manages culturally-determined
-typographical (and other) rules for about 170 to 300 languages,
-depending on the engine, with several levels of coverage. A few
-languages even work with Plain formats.
+`Babel` is the multilingual framework to localize documents in LaTeX,
+LuaLaTeX, XeLaTeX. A few languages even work with Plain formats.
+
+Its aim is to provide a localization framework for different languages,
+scripts, and cultures based on the latest advances in Unicode
+(including the CLDR, Common Language Repository Data), the W3C (where
+applicable) and other technologies, as well as on international
+standards.
+
+Babel supports approximately from 170 to 300 languages, depending on
+the engine (with various levels of coverage), across about 45 scripts,
+including complex and RTL ones. Its high-level interface with
+`fontscpec` allows for seamless integration with OpenType technologies
+in `xetex` and `luatex`, enabling the use of advanced typographic
+features.
 
 The latest stable version is available on <https://ctan.org/pkg/babel>.
 
-Changes in version 24.13 are described in:
+Changes in version 24.14 are described in:
 
-https://latex3.github.io/babel/news/whats-new-in-babel-24.13.html
+https://latex3.github.io/babel/news/whats-new-in-babel-24.14.html
 
-Apart from the manual, you can find information on some aspects of babel at:
+Apart from the manual, you can find information and examples in:
 
 https://latex3.github.io/babel/
 
@@ -43,11 +53,16 @@ You may also report them to the current maintainer more informally on:
 
    https://latex3.github.io/babel/contact.html
 
-Bugs related to specific languages are best reported to theirs
+Bugs related to specific languages are best reported to their
 respective authors.
 
 ### Summary of latest changes
 ```
+24.14  (dev)
+       * [not yet] Harfbuzz in the default renderer with \babelfont in many (but
+         not all) scripts (lua).
+       * Now lazy locale loading sets 'import'.
+       
 24.13  2024-11-08
        * French: Added ‘transform values’ for punctuation.space.
        * Pashto: Persian and Islamic calendar (which fixes an error,
diff --git a/babel-code.pdf b/babel-code.pdf
index d5e651b..12da0c8 100644
Binary files a/babel-code.pdf and b/babel-code.pdf differ
diff --git a/babel.dtx b/babel.dtx
index 08e6133..4a8840c 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -37,7 +37,7 @@
   lang       = en-001,
 }
 \ProvidesFile{babel.dtx}%
-  [2024/11/08 v24.13
+  [2024/11/24 v24.13.69442
    The multilingual framework for pdfLaTeX, LuaLaTeX and XeLaTeX] 
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
@@ -388,12 +388,17 @@ Basically, what you need is typically:
 \begin{itemize}
 \bfseries
 \item Tell \babel{} which language or languages are required.
-\item With non-Latin scripts and Unicode engines (\luatex is the
+\item With non-Latin scripts and Unicode engines (\luatex{} is the
 preferred one), select a suitable font (sec.~\ref{fonts})
 \item In multilingual documents, switch the language in the text body
 (sec.~\ref{selectors}).
 \end{itemize}
 
+You can find basic info and minimal \luatex{} example files for about
+300 locales in the
+\href{https://latex3.github.io/babel/guides/index-locale.html}{GitHub
+repository}.
+
 \subsection{Monolingual documents: the ‘classical’ way}
 
 In most cases, a single language is required, and then all you need in
@@ -797,8 +802,9 @@ Vietnamese: \prefacename, \alsoname, \today.
 
 If lazy loading is not enough for your purposes, you can still tell
 which languages should be loaded as either class or package options.
-However, there are three options to set which method you want, which
-cover the most typical cases:
+You can combine the ‘classical’ and the ‘modern’ ways with three
+options to set which method you want, which cover the most typical
+cases:
 \begin{itemize}
 \item |provide=*| is the option explained above for monolingual
   documents. If there are more languages, it applies only to the main
@@ -806,8 +812,10 @@ cover the most typical cases:
 \item |provide+=*| loads the main language in the ‘classical’ way,
   and the rest in the ‘modern’ one.
 \item |provide*=*| is the same for all languages, ie, main and
-  secondary  ones are loaded in the ‘modern’ way.
+  secondary ones are all loaded in the ‘modern’ way.
 \end{itemize}
+More complex combinations can be handled with |\babelprovide|,
+explained below.
 
 \begin{example}
 Your document is written in Thai with large chunks in Dutch and German,
@@ -816,14 +824,26 @@ need their shorthands. The font is Norasi, which covers the three
 languages:
 \setengine{luatex/xetex}
 \begin{verbatim}
-\usepackage[dutch,ngerman,thai,provide=*]{babel}
+\usepackage[dutch,ngerman,thai,_provide=*_]{babel}
 \babelfont{rm}{Norasi}
 \end{verbatim}
+This will load |dutch| and |ngerman| in the classical |ldf| mode, but
+|thai| in the modern |ini| mode. Other options are:
+\begin{verbatim}
+  \usepackage[dutch,ngerman,thai]{babel}
+\end{verbatim}
+which will use the classical mode for in languages (as decribed in the
+previous section, but note |thai.ldf| is not supported in Unicode
+engines), and:
+\begin{verbatim}
+  \usepackage[dutch,german,thai,_provide*=*_]{babel}
+\end{verbatim}
+which will use the modern mode in all languages (note the correct name
+here is |german|. (The option
+|\usepackage||[dutch,ngerman,thai,provide+=*]||{babel}| doesn’t make
+much sense in this case.)
 \end{example}
 
-More complex combinations can be handled with |\babelprovide|,
-explained below.
-
 \subsection{Languages supported by \babel{} in the ‘classical’ mode}
 
 (To be updated.) In the following table most of the languages supported
@@ -1019,6 +1039,10 @@ files, with |\babelprovide| (or |provide=|). With these languages,
 |\babelprovide| with a valueless |import|, which will load the |ini|
 file with the tag given in parenthesis.
 
+Following the current common practice (for example, the Unicode CLDR),
+all locales are organized in a flat structure. This eases their
+identification and customization.
+
 Many locale are quite usable, provided captions and dates are
 not required (which is a very frequent case, particularly in ancient
 languages). So, they are included in the default \babel{} distribution.
@@ -1646,6 +1670,15 @@ but you may add further key/value pairs if necessary.
 write its name instead of |rm|, |sf| or |tt|. This is the preferred way
 to select fonts in addition to the three basic families.
 
+\begin{note}
+  As \babel{} sets the font language system, the following setup is
+  redundant, so avoid it and use only the first line:
+\begin{verbatim}
+\babelfont{rm}{DejaVu Serif}
+\babelfont[armenian]{rm}[Script=Armenian, Language=Armenian]{DejaVu Serif} 
+\end{verbatim}
+\end{note}
+
 \begin{example}
   Usage in most cases is very simple. Let us assume you are setting up
   a document in Swedish, with some words in Hebrew, with a font suited
@@ -2646,11 +2679,28 @@ stylistic choice, is:
 \begin{verbatim}
 \setlocalecaption{english}{contents}{Table of Contents}
 \end{verbatim}
-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
+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.
 
+Note the string should not contain a language selector or changes in
+the text direction, which is done by \babel{} when necessary. With
+|arabic|, all you need is:
+\begingroup
+% If you are looking at the code to see how it has been written, you
+% will be disappointed :-). The following example is built ad hoc to
+% emulate the final result to avoid dependencies, and therefore it's
+% not "real" code.
+\setmonofont[Scale=.86, FakeStretch=.97,Script=Arabic]{DejaVu Sans Mono}
+\catcode`@=13
+\def@#1{\ifcase#1\relax \egroup \or \bgroup\textdir TLT \else
+\bgroup\textdir TRT \pardir TRT \fi}
+\begin{verbatim}
+\setlocalecaption{arabic}{part}{@2القسم@0}
+\end{verbatim}
+\endgroup
+
 \begin{note}
   There are a few alternative methods:
   \begin{itemize}
@@ -5971,8 +6021,8 @@ wouldn’t exist.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=24.13>>
-%<<date=2024/11/08>>
+%<<version=24.13.69442>>
+%<<date=2024/11/24>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -6567,12 +6617,9 @@ wouldn’t exist.
 \DeclareOption{silent}{}
 \DeclareOption{shorthands=off}{\bbl at tempa shorthands=\bbl at tempa}
 \chardef\bbl at iniflag\z@
-\DeclareOption{provide=*}{\chardef\bbl at iniflag\@ne}    % main -> +1
+\DeclareOption{provide=*}{\chardef\bbl at iniflag\@ne}    % main = 1
 \DeclareOption{provide+=*}{\chardef\bbl at iniflag\tw@}   % second = 2
 \DeclareOption{provide*=*}{\chardef\bbl at iniflag\thr@@} % second + 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}
@@ -11676,6 +11723,7 @@ wouldn’t exist.
 %    \begin{macrocode}
 \newif\ifbbl at bcpallowed
 \bbl at bcpallowedfalse
+\def\bbl at autoload@options{import}
 \def\bbl at provide@locale{%
   \ifx\babelprovide\@undefined
     \bbl at error{base-on-the-fly}{}{}{}%
@@ -13859,9 +13907,9 @@ wouldn’t exist.
   \let\bbl at mapselect\bbl at tempe}%
 %    \end{macrocode}
 %
-% font at rst and famrst are only used when there is no global settings,
-% to save and restore de previous families. Not really necessary, but
-% done for optimization.
+% |font at rst| and |famrst| are only used when there are no global
+% settings, to save and restore de previous families. Not really
+% necessary, but done for optimization.
 %
 %    \begin{macrocode}
 \def\bbl at font@rst#1#2#3#4{%
@@ -16405,7 +16453,8 @@ end
      {\AddToHook{cmd/diagbox at pict/before}{\let\bbl at pictsetdir\@gobble}%
       \ifx\pgfpicture\@undefined\else % TODO. Allow deactivate?
         \AddToHook{env/pgfpicture/begin}{\bbl at pictsetdir\@ne}%
-        \bbl at add\pgfinterruptpicture{\bbl at pictresetdir}%
+        \bbl at add\pgfinterruptpicture{%
+          \bbl at ifsamestring{\@currenvir}{axis}{}\bbl at pictresetdir}%
         \bbl at add\pgfsys at beginpicture{\bbl at pictsetdir\z@}%
       \fi
       \ifx\tikzpicture\@undefined\else
diff --git a/babel.ins b/babel.ins
index a268eb3..557d940 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{2024/11/08}
+\def\filedate{2024/11/24}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 3d13d2f..0c090a1 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 3fe6559..46d2835 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2024/11/08 v24.]
+\ProvidesFile{bbcompat.dtx}[2024/11/24 v24.]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/samples/lua-thai.pdf b/samples/lua-thai.pdf
index d627f75..56230f6 100644
Binary files a/samples/lua-thai.pdf and b/samples/lua-thai.pdf differ





More information about the latex3-commits mailing list.