[latex3-commits] [latex3/babel] main: Close #284. Typo (puntuation) in french. Experimental \localebox. (e25bf9b)
github at latex-project.org
github at latex-project.org
Fri Mar 8 19:25:29 CET 2024
Repository : https://github.com/latex3/babel
On branch : main
Link : https://github.com/latex3/babel/commit/e25bf9bd686605211927b74a69e1b55ede9f315f
>---------------------------------------------------------------
commit e25bf9bd686605211927b74a69e1b55ede9f315f
Author: Javier <email at localhost>
Date: Fri Mar 8 19:25:29 2024 +0100
Close #284. Typo (puntuation) in french. Experimental \localebox.
>---------------------------------------------------------------
e25bf9bd686605211927b74a69e1b55ede9f315f
README.md | 6 ++-
babel-code.pdf | Bin 647075 -> 647508 bytes
babel.dtx | 94 +++++++++++++++++++++++---------------
babel.ins | 2 +-
babel.pdf | Bin 421738 -> 422183 bytes
bbcompat.dtx | 2 +-
locale/fr/babel-french-canada.tex | 15 +++---
locale/fr/babel-french.tex | 18 ++++----
8 files changed, 79 insertions(+), 58 deletions(-)
diff --git a/README.md b/README.md
index 1469c5b..9a413ef 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-## Babel 24.2
+## Babel 24.2.43377
-2024-02-07
+(dev)
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -48,6 +48,8 @@ respective authors.
### Summary of latest changes
```
+24.3 (dev)
+
24.2 2024-02-07
* Cleaned up some language names.
* Mosty internal changes and minor fixes.
diff --git a/babel-code.pdf b/babel-code.pdf
index fa0a798..47eae2d 100644
Binary files a/babel-code.pdf and b/babel-code.pdf differ
diff --git a/babel.dtx b/babel.dtx
index ea14d38..2a0a9c5 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2024/02/07 v24.2 The Babel package]
+\ProvidesFile{babel.dtx}[2024/03/08 v24.2.43377 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -785,15 +785,18 @@ This command can be used as environment, too.
rarely happens, but if it were the case, you must use
|otherlanguage| instead.
\item In addition, this macro inserts a |\write| in vertical mode,
- which may break the vertical spacing in some cases (for example,
- between lists). \New{3.64} The behavior can be adjusted with
- |\babeladjust{select.write=|\m{mode}|}|, where \m{mode} is |shift|
- (which shifts the skips down and adds a |\penalty|); |keep| (the
- default -- with it the |\write| and the skips are kept in the order
- they are written), and |omit| (which may seem a too drastic solution,
- because nothing is written, but more often than not this command is
- applied to more or less shorts texts with no sectioning or similar
- commands and therefore no language synchronization is necessary).
+ which may break the vertical spacing in some cases (for example,
+ between lists or at the beginning of a table cell). \New{3.64} The
+ behavior can be adjusted with
+ |\babeladjust{select.write=|\m{mode}|}|, where \m{mode} is |shift|
+ (which shifts the skips down and adds a |\penalty|); |keep| (the
+ default -- with it the |\write| and the skips are kept in the order
+ they are written), and |omit| (which may seem a too drastic
+ solution, because nothing is written, but more often than not this
+ command is applied to more or less shorts texts with no sectioning
+ or similar commands, and therefore no language synchronization is
+ necessary). In a table cell, a |\leavevmode| just before the
+ selector may be enough.
\end{itemize}
\end{warning}
@@ -853,6 +856,12 @@ environment with an additional grouping, like braces |{}|.
Spaces after the environment are ignored.
+\begin{warning}
+ Being similar to |\selectlanguage|, the warning above about the
+ internal |\write| also applies here. The current mode (vertical or
+ horizonal) is also not changed.
+\end{warning}
+
\Describe{\begin\menv{otherlanguage*}}%
{\oarg{option-list}\marg{language}\Eenv{otherlanguage*}}
@@ -889,9 +898,10 @@ group.
|\textcolor| and many others). The same applies to environments,
because |arabic| conflicts with |\arabic|. Furthermore, and because of
this overloading, detecting the language of a chunk of text by
- external tools can become unfeasible. Except if there is a reason for
+ external tools can become unfeasible (is |\textga| the locale for the
+ African language Gã or something else?). Except if there is a reason for
this ‘syntactical sugar’, the best option is to stick to the default
- selectors or to define your own alternatives.
+ selectors or even to define your own alternatives.
\end{warning}
\begin{example}
@@ -2258,19 +2268,11 @@ to select fonts in addition to the three basic families.
\babelfont[hindi]{rm}{Shobhika}
\end{verbatim}
This makes sure the OpenType script for Devanagari is |deva| and not
- |dev2|, in case it is not detected correctly. You may also pass some
- options to \textsf{fontspec}: with |silent|, the warnings about
- unavailable scripts or languages are not shown (they are only really
- useful when the document format is being set up).
-\end{note}
-
-\begin{note}
- Directionality is a property affecting margins, indentation, column
- order, etc., not just text. Therefore, it is under the direct control
- of the language, which applies both the script and the direction to
- the text. As a consequence, there is no need to set \texttt{Script}
- when declaring a font with |\babelfont| (nor \texttt{Language}). In
- fact, it is even discouraged.
+ |dev2|, in case it is not detected correctly.
+% You may also pass some
+% options to \textsf{fontspec}: with |silent|, the warnings about
+% unavailable scripts or languages are not shown (they are only really
+% useful when the document format is being set up).
\end{note}
\begin{note}
@@ -2284,6 +2286,15 @@ to select fonts in addition to the three basic families.
“lower-level” font selection is useful.
\end{note}
+\begin{note}
+ Directionality is a property affecting margins, indentation, column
+ order, etc., not just text. Therefore, it is under the direct control
+ of the language, which applies both the script and the direction to
+ the text. As a consequence, there is no need to set \texttt{Script}
+ when declaring a font with |\babelfont| (nor \texttt{Language}). In
+ fact, it is even discouraged.
+\end{note}
+
\begin{note}
The keys |Language| and |Script| just pass these values to the
\textit{font}, and do \textit{not} set the script for the
@@ -5427,8 +5438,8 @@ wouldn’t exist.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=24.2>>
-%<<date=2024/02/07>>
+%<<version=24.2.43377>>
+%<<date=2024/03/08>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -6814,14 +6825,10 @@ wouldn’t exist.
% \end{macrocode}
%
% \begin{environment}{otherlanguage}
-% The \Lenv{otherlanguage} environment can be used as an
-% alternative to using the |\selectlanguage| declarative
-% command. When you are typesetting a document which mixes
-% left-to-right and right-to-left typesetting you have to use this
-% environment in order to let things work as you expect them to.
-%
-% The |\ignorespaces| command is necessary to hide the environment
-% when it is entered in horizontal mode.
+% The \Lenv{otherlanguage} environment can be used as an alternative to
+% using the |\selectlanguage| declarative command. The |\ignorespaces|
+% command is necessary to hide the environment when it is entered in
+% horizontal mode.
%
% \begin{macrocode}
\long\def\otherlanguage#1{%
@@ -15540,9 +15547,14 @@ end
local d = node.new(node.id'dir')
d.dir = '+TRT'
node.insert_before(head, node.has_glyph(head), d)
+ local inmath = false
for item in node.traverse(head) do
- node.set_attribute(item,
- Babel.attr_dir, token.get_macro('bbl at thedir'))
+ if item.id == 11 then
+ inmath = (item.subtype == 0)
+ elseif not inmath then
+ node.set_attribute(item,
+ Babel.attr_dir, token.get_macro('bbl at thedir'))
+ end
end
end
end
@@ -15554,6 +15566,14 @@ end
\fi
% \end{macrocode}
%
+% Experimental. Tentative name.
+%
+% \begin{macrocode}
+\DeclareRobustCommand\localebox[1]{%
+ {\def\bbl at insidemath{0}%
+ \mbox{\foreignlanguage{\languagename}{#1}}}}
+% \end{macrocode}
+%
% \subsection{Layout}
%
% Unlike \xetex{}, \luatex{} requires only minimal changes for
diff --git a/babel.ins b/babel.ins
index 4b85731..019c770 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/02/07}
+\def\filedate{2024/03/08}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/babel.pdf b/babel.pdf
index 21d664d..c63128b 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 8d45882..c971a09 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2024/02/07 v24.2]
+\ProvidesFile{bbcompat.dtx}[2024/03/08 v24.2.43377]
%</dtx>
%
%% File 'bbcompat.dtx'
diff --git a/locale/fr/babel-french-canada.tex b/locale/fr/babel-french-canada.tex
index 43351e1..c12481c 100644
--- a/locale/fr/babel-french-canada.tex
+++ b/locale/fr/babel-french-canada.tex
@@ -10,11 +10,10 @@
\BabelBeforeIni{fr-CA}{%
}
-
\ifcase\bbl at engine\or\or % XeTeX
% Partly based on babel-french, by Daniel Flipo
-\IfBabelIntercharT{puntuation.space}{%
+\IfBabelIntercharT{punctuation.space}{%
\providecommand{\BabelFrenchGuillemetSpace}{%
\leavevmode\nobreak\hskip.8\fontdimen2\font
plus.3\fontdimen3\font
@@ -26,19 +25,19 @@
\babelcharclass{\CurrentOption}{rightguillemet}{»}%
\babelcharclass{\CurrentOption}{opening}{([\{}% just make != default
%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{default, rightguillemet}{colon}{\BabelFrenchColonSpace}%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{leftguillemet}{default}{\BabelFrenchGuillemetSpace}%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{default}{rightguillemet}{\BabelFrenchGuillemetSpace}%
%
% Here boundary means essentialy space:
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{boundary}{colon}{\ifhmode\unskip\nobreak\fi\BabelFrenchColonSpace}%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{leftguillemet}{boundary}{\BabelFrenchGuillemetSpace\ignorespaces}%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{boundary}{rightguillemet}{\ifhmode\unskip\fi\BabelFrenchGuillemetSpace}%
}
diff --git a/locale/fr/babel-french.tex b/locale/fr/babel-french.tex
index a53769b..5650253 100644
--- a/locale/fr/babel-french.tex
+++ b/locale/fr/babel-french.tex
@@ -13,7 +13,7 @@
\ifcase\bbl at engine\or\or % XeTeX
% Partly based on babel-french, by Daniel Flipo
-\IfBabelIntercharT{puntuation.space}{%
+\IfBabelIntercharT{punctuation.space}{%
\providecommand{\BabelFrenchGuillemetSpace}{%
\leavevmode\nobreak\hskip.8\fontdimen2\font
plus.3\fontdimen3\font
@@ -28,23 +28,23 @@
\babelcharclass{\CurrentOption}{rightguillemet}{»}%
\babelcharclass{\CurrentOption}{opening}{([\{}% just make != default
%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{default, rightguillemet, high, colon}{high}{\BabelFrenchHighSpace}%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{default, rightguillemet, high}{colon}{\BabelFrenchColonSpace}%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{leftguillemet}{default}{\BabelFrenchGuillemetSpace}%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{default, high}{rightguillemet}{\BabelFrenchGuillemetSpace}%
%
% Here boundary means essentialy space:
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{boundary}{high}{\ifhmode\unskip\nobreak\fi\BabelFrenchHighSpace}%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{boundary}{colon}{\ifhmode\unskip\nobreak\fi\BabelFrenchColonSpace}%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{leftguillemet}{boundary}{\BabelFrenchGuillemetSpace\ignorespaces}%
- \babelinterchar[label=puntuation.space]{\CurrentOption}%
+ \babelinterchar[label=punctuation.space]{\CurrentOption}%
{boundary}{rightguillemet}{\ifhmode\unskip\fi\BabelFrenchGuillemetSpace}%
}
More information about the latex3-commits
mailing list.