[latex3-commits] [latex3/babel] main: Select main language at begindocument/before. (b050709)
github at latex-project.org
github at latex-project.org
Sat May 13 08:57:43 CEST 2023
Repository : https://github.com/latex3/babel
On branch : main
Link : https://github.com/latex3/babel/commit/b050709f587891a8d8f5c3187fcfe1cf9260fcde
>---------------------------------------------------------------
commit b050709f587891a8d8f5c3187fcfe1cf9260fcde
Author: Javier <email at localhost>
Date: Sat May 13 08:57:43 2023 +0200
Select main language at begindocument/before.
>---------------------------------------------------------------
b050709f587891a8d8f5c3187fcfe1cf9260fcde
README.md | 9 ++++++---
babel-code.pdf | Bin 592226 -> 592849 bytes
babel.dtx | 19 +++++++++++++++----
babel.ins | 2 +-
babel.pdf | Bin 399234 -> 399434 bytes
bbcompat.dtx | 2 +-
6 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index f419868..e01dfe0 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-## Babel 3.89
+## Babel 3.89.13335
-2023-05-11
+*Development.*
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -48,9 +48,12 @@ respective authors.
### Summary of latest changes
```
+3.90 (dev)
+ * Main language selected at begindocument/before.
+
3.89 2023-05-11
* Deprecating \SetCase, \aliasshorthands, and 'strings' package
- options in the manual.
+ option in the manual.
* The manual has been split in two documents: 'babel.pdf' is the
user guide, and 'babel-code.pdf' is the code.
* Alternative syntax to pass 'modifiers' to babel languages.
diff --git a/babel-code.pdf b/babel-code.pdf
index afec13d..cacec93 100644
Binary files a/babel-code.pdf and b/babel-code.pdf differ
diff --git a/babel.dtx b/babel.dtx
index bc6e15c..2f75ce6 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2023/05/11 v3.89 The Babel package]
+\ProvidesFile{babel.dtx}[2023/05/13 v3.89.13335 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -437,7 +437,12 @@ Package babel Warning: No hyphenation patterns were preloaded for
\begin{verbatim}
\usepackage[_pdflang=es-MX_]{hyperref}
\end{verbatim}
-This is not currently done by \babel{} and you must set it by hand.
+This is not currently done by \babel{} and you must set it by hand. The
+document language can be also set with |\DocumentMetadata|, before
+|\documentclass|; for example:
+\begin{verbatim}
+\DocumentMetadata{_lang=es-MX_}
+\end{verbatim}
\end{note}
\begin{note}
@@ -5264,8 +5269,8 @@ wouldn’t exist.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.89>>
-%<<date=2023/05/11>>
+%<<version=3.89.13335>>
+%<<date=2023/05/13>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -7476,12 +7481,18 @@ wouldn’t exist.
\string\providecommand\string\babel at aux[2]{}}%
\immediate\write\@mainaux{\string\@nameuse{bbl at beforestart}}%
\fi
+%<-package>
\expandafter\selectlanguage\expandafter{\bbl at main@language}%
+%<+package>
\ifbbl at single % must go after the line above.
\renewcommand\selectlanguage[1]{}%
\renewcommand\foreignlanguage[2]{#2}%
\global\let\babel at aux\@gobbletwo % Also as flag
\fi}
+%<-core>
+\AddToHook{begindocument/before}{%
+ \expandafter\selectlanguage\expandafter{\bbl at main@language}}
+%<+core>
\ifcase\bbl at engine\or
\AtBeginDocument{\pagedir\bodydir} % TODO - a better place
\fi
diff --git a/babel.ins b/babel.ins
index 3706b2c..dc3f972 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{2023/05/11}
+\def\filedate{2023/05/13}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/babel.pdf b/babel.pdf
index cdc413d..e32651a 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index cf05944..3f808c7 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2023/05/11 v3.89]
+\ProvidesFile{bbcompat.dtx}[2023/05/13 v3.89.13335]
%</dtx>
%
%% File 'bbcompat.dtx'
More information about the latex3-commits
mailing list.