[latex3-commits] [latex3/babel] main: Casing alternatives. (49b3032)
github at latex-project.org
github at latex-project.org
Sun Dec 3 16:41:59 CET 2023
Repository : https://github.com/latex3/babel
On branch : main
Link : https://github.com/latex3/babel/commit/49b303210e6416dcaece528739bb5abe093e88cc
>---------------------------------------------------------------
commit 49b303210e6416dcaece528739bb5abe093e88cc
Author: Javier <email at localhost>
Date: Sun Dec 3 16:41:59 2023 +0100
Casing alternatives.
>---------------------------------------------------------------
49b303210e6416dcaece528739bb5abe093e88cc
README.md | 6 +--
babel-code.pdf | Bin 641802 -> 641766 bytes
babel.dtx | 82 ++++++++++++++++++++++++-------------
babel.ins | 2 +-
babel.pdf | Bin 417650 -> 417651 bytes
bbcompat.dtx | 2 +-
locale/la/babel-classicallatin.tex | 4 --
locale/la/babel-la-x-classic.ini | 6 ++-
8 files changed, 63 insertions(+), 39 deletions(-)
diff --git a/README.md b/README.md
index bd0b70e..8692ce9 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-## Babel 3.97.33650
+## Babel 3.97.33765
-2023-02-02
+**Development**
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -48,7 +48,7 @@ respective authors.
### Summary of latest changes
```
-3.98 2023-11-30
+3.98 (dev)
* New: \ShowLocaleProperties.
* Case mappings in ini files.
diff --git a/babel-code.pdf b/babel-code.pdf
index cecd093..60f3b46 100644
Binary files a/babel-code.pdf and b/babel-code.pdf differ
diff --git a/babel.dtx b/babel.dtx
index fd5cf0f..a709fd6 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2023/12/02 v3.97.33650 The Babel package]
+\ProvidesFile{babel.dtx}[2023/12/03 v3.97.33765 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -5646,8 +5646,8 @@ wouldn’t exist.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.97.33650>>
-%<<date=2023/12/02>>
+%<<version=3.97.33765>>
+%<<date=2023/12/03>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -9452,11 +9452,24 @@ wouldn’t exist.
%
% \paragraph{Case mapping}
%
-% The command |\SetCase| is deprecated, with a dummy definition.
+% The command |\SetCase| is deprecated. Currently it consists in a
+% definition with a hack just for backward compatibility in the macro
+% mapping.
%
% \begin{macrocode}
%<<*Macros local to BabelCommands>>
- \newcommand\SetCase[3][]{}%
+ \newcommand\SetCase[3][]{%
+ \def\bbl at tempa####1####2{%
+ \ifx####1\@empty\else
+ \bbl at carg\bbl at add{extras\CurrentOption}{%
+ \bbl at carg\babel at save{c__text_uppercase_\string####1_tl}%
+ \bbl at carg\def{c__text_uppercase_\string####1_tl}{####2}%
+ \bbl at carg\babel at save{c__text_lowercase_\string####2_tl}%
+ \bbl at carg\def{c__text_lowercase_\string####2_tl}{####1}}%
+ \expandafter\bbl at tempa
+ \fi}%
+ \bbl at tempa##1\@empty\@empty
+ \bbl at carg\bbl at toglobal{extras\CurrentOption}}
%<</Macros local to BabelCommands>>
% \end{macrocode}
%
@@ -10157,6 +10170,7 @@ wouldn’t exist.
Alph,labels,labels*,calendar,date,casing}%
{\bbl at csarg\let{KVP@##1}\@nnil}%
\global\let\bbl at release@transforms\@empty
+ \global\let\bbl at release@casing\@empty
\let\bbl at calendars\@empty
\global\let\bbl at inidata\@empty
\global\let\bbl at extend@ini\@gobble
@@ -10469,9 +10483,10 @@ wouldn’t exist.
\let\\\@Alph\<bbl at cntr@\bbl at KVP@Alph @\languagename>}}%
\fi
% == Casing ==
+ \bbl at release@casing
\ifx\bbl at KVP@casing\@nnil\else
\bbl at csarg\xdef{casing@\languagename}%
- {\@nameuse{bbl at casing@\languagename}-x-\bbl at KVP@casing}%
+ {\@nameuse{bbl at casing@\languagename}\bbl at maybextx\bbl at KVP@casing}%
\fi
% == Calendars ==
\ifx\bbl at KVP@calendar\@nnil
@@ -10491,11 +10506,6 @@ wouldn’t exist.
\ifx\bbl at tempb\@empty\else
,variant=\bbl at tempb
\fi}%
- % == Case mapping ==
- \bbl at ifunset{bbl at casng@\languagename}{}%
- {\expandafter\ifx\csname bbl at casng@\languagename\endcsname\@empty\else
- \bbl at exp{\\\SetCaseMapping{\languagename}{\[bbl at casng@\languagename]}}%
- \fi}%
% == engine specific extensions ==
% Defined in XXXbabel.def
\bbl at provide@extra{#2}%
@@ -10924,6 +10934,7 @@ wouldn’t exist.
Reported }}}
%
\let\bbl at release@transforms\@empty
+\let\bbl at release@casing\@empty
\def\bbl at ini@exports#1{%
% Identification always exported
\bbl at iniwarning{}%
@@ -10939,7 +10950,7 @@ wouldn’t exist.
\bbl at exp{\\\bbl at exportkey{lname}{identification.name.opentype}%
{\csname bbl at elname@\languagename\endcsname}}%
\bbl at exportkey{tbcp}{identification.tag.bcp47}{}%
- % Somewhat hackish. TODO
+ % Somewhat hackish. TODO:
\bbl at exportkey{casing}{identification.tag.bcp47}{}%
\bbl at exportkey{lbcp}{identification.language.tag.bcp47}{}%
\bbl at exportkey{lotf}{identification.tag.opentype}{dflt}%
@@ -10975,7 +10986,6 @@ wouldn’t exist.
\bbl at exportkey{intsp}{typography.intraspace}{}%
\bbl at exportkey{frspc}{typography.frenchspacing}{u}%
\bbl at exportkey{chrng}{characters.ranges}{}%
- \bbl at exportkey{casng}{characters.casing}{}%
\bbl at exportkey{quote}{characters.delimiters.quotes}{}%
\bbl at exportkey{dgnat}{numbers.digits.native}{}%
\ifnum#1=\tw@ % only (re)new
@@ -11003,10 +11013,31 @@ wouldn’t exist.
\let\bbl at inikv@identification\bbl at inikv
\let\bbl at inikv@date\bbl at inikv
\let\bbl at inikv@typography\bbl at inikv
-\let\bbl at inikv@characters\bbl at inikv
\let\bbl at inikv@numbers\bbl at inikv
% \end{macrocode}
%
+% The |characters| section also stores the values, but |casing| is
+% treated in a different fashion.
+%
+% \begin{macrocode}
+\def\bbl at maybextx{-\bbl at csarg\ifx{extx@\languagename}\@empty x-\fi}
+\def\bbl at inikv@characters#1#2{%
+ \bbl at ifsamestring{#1}{casing}%
+ {\bbl at exp{%
+ \\\g at addto@macro\\\bbl at release@casing{%
+ \\\SetCaseMapping{\languagename}{\unexpanded{#2}}}}}%
+ {\in@{$casing.}{$#1}%
+ \ifin@
+ \lowercase{\def\bbl at tempb{#1}}%
+ \bbl at replace\bbl at tempb{casing.}{}%
+ \bbl at exp{\\\g at addto@macro\\\bbl at release@casing{%
+ \\\SetCaseMapping
+ [\\\bbl at maybextx\bbl at tempb]{\languagename}{\unexpanded{#2}}}}%
+ \else
+ \bbl at inikv{#1}{#2}%
+ \fi}}
+% \end{macrocode}
+%
% Additive numerals require an additional definition. When |.1| is
% found, two macros are defined -- the basic one, without |.1| called
% by |\localenumeral|, and another one preserving the trailing |.1| for
@@ -11341,7 +11372,6 @@ wouldn’t exist.
% \textbf{Transforms.}
%
% \begin{macrocode}
-\let\bbl at release@transforms\@empty
\bbl at csarg\let{inikv at transforms.prehyphenation}\bbl at inikv
\bbl at csarg\let{inikv at transforms.posthyphenation}\bbl at inikv
\def\bbl at transforms@aux#1#2#3#4,#5\relax{%
@@ -11632,15 +11662,14 @@ wouldn’t exist.
\DeclareTitlecaseMapping[\@nameuse{bbl at casing@#1}]{#2}{#3}}
\newcommand\BabelLowercaseMapping[3]{%
\DeclareLowercaseMapping[\@nameuse{bbl at casing@#1}]{#2}{#3}}
-% WIP. Tentative and incomplete. To be used by 'ini' files (with a new
-% key).
-\def\SetCaseMapping#1#2{%
+% WIP.
+\newcommand\SetCaseMapping[3][]{%
\def\bbl at tempa##1 ##2{%
\bbl at casemapping{##1}%
\ifx\@empty##2\else\bbl at afterfi\bbl at tempa##2\fi}%
- \edef\bbl at templ{#1}% Language
+ \edef\bbl at templ{\@nameuse{bbl at casing@#2}#1}% Language code
\def\bbl at tempe{0}% Mode (upper/lower...)
- \def\bbl at tempc{#2 }% Casing list
+ \def\bbl at tempc{#3 }% Casing list
\expandafter\bbl at tempa\bbl at tempc\@empty}
\def\bbl at casemapping#1{%
\def\bbl at tempb{#1}%
@@ -11658,17 +11687,14 @@ wouldn’t exist.
\if#2u1 \else\if#2l2 \else\if#2t3 \else\if#2m4 \fi\fi\fi\fi}%
\else
\ifcase\bbl at tempe\relax
- \BabelUppercaseMapping{\bbl at templ}{\bbl at utftocode{#1}}{#2}%
- \BabelLowercaseMapping{\bbl at templ}{\bbl at utftocode{#2}}{#1}%
- \or
- \BabelUppercaseMapping{\bbl at templ}{\bbl at utftocode{#1}}{#2}%
+ \DeclareUppercaseMapping[\bbl at templ]{\bbl at utftocode{#1}}{#2}%
+ \DeclareLowercaseMapping[\bbl at templ]{\bbl at utftocode{#2}}{#1}%
\or
- \BabelLowercaseMapping{\bbl at templ}{\bbl at utftocode{#1}}{#2}%
+ \DeclareUppercaseMapping[\bbl at templ]{\bbl at utftocode{#1}}{#2}%
\or
- \BabelTitlecaseMapping{\bbl at templ}{\bbl at utftocode{#1}}{#2}%
+ \DeclareLowercaseMapping[\bbl at templ]{\bbl at utftocode{#1}}{#2}%
\or
- \@namedef{c__text_uppercase_\string#1_tl}{#2}%
- \@namedef{c__text_lowercase_\string#2_tl}{#1}%
+ \DeclareTitlecaseMapping[\bbl at templ]{\bbl at utftocode{#1}}{#2}%
\fi
\fi}
% \end{macrocode}
diff --git a/babel.ins b/babel.ins
index 5a16d02..c7c578b 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/12/02}
+\def\filedate{2023/12/03}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/babel.pdf b/babel.pdf
index 6debc75..04dc5d7 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index f4fb9af..b9c3b64 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2023/12/02 v3.97.33650]
+\ProvidesFile{bbcompat.dtx}[2023/12/03 v3.97.33765]
%</dtx>
%
%% File 'bbcompat.dtx'
diff --git a/locale/la/babel-classicallatin.tex b/locale/la/babel-classicallatin.tex
index 6efe099..f3df2a7 100644
--- a/locale/la/babel-classicallatin.tex
+++ b/locale/la/babel-classicallatin.tex
@@ -18,8 +18,4 @@
\SetHyphenMap{\BabelLower{`V}{`u}}
\EndBabelCommands
-% TODO. Must be defined somehow in the ini file:
-\BabelUppercaseMapping{\languagename}{`u}{V}
-\BabelLowercaseMapping{\languagename}{`v}{U}
-
\endinput
\ No newline at end of file
diff --git a/locale/la/babel-la-x-classic.ini b/locale/la/babel-la-x-classic.ini
index 06a95c8..df7497e 100644
--- a/locale/la/babel-la-x-classic.ini
+++ b/locale/la/babel-la-x-classic.ini
@@ -9,8 +9,8 @@
[identification]
charset = utf8
-version = 1.6
-date = 2023-06-25
+version = 1.7
+date = 2023-12-03
name.english = Classical Latin
name.babel = classicallatin
tag.bcp47 = la-x-classic
@@ -148,6 +148,8 @@ hyphenationmin =
[characters]
delimiters.quotes =
+casing = uV
+casing.Nouv = uU vV
[counters]
More information about the latex3-commits
mailing list.