summaryrefslogtreecommitdiff
path: root/macros/latex/required
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-02-29 03:02:30 +0000
committerNorbert Preining <norbert@preining.info>2020-02-29 03:02:30 +0000
commit4736ac744a8c914e0d5ced1d157e017a385bbf43 (patch)
treecc6b754ea0d704573dfffffdbf327e14057ce864 /macros/latex/required
parent02193cc5ca03abf234d3bc9d77b4821d85f58c62 (diff)
CTAN sync 202002290302
Diffstat (limited to 'macros/latex/required')
-rw-r--r--macros/latex/required/babel/base/README.md17
-rw-r--r--macros/latex/required/babel/base/babel.dtx276
-rw-r--r--macros/latex/required/babel/base/babel.ins4
-rw-r--r--macros/latex/required/babel/base/babel.pdfbin755671 -> 763419 bytes
-rw-r--r--macros/latex/required/babel/base/bbcompat.dtx2
5 files changed, 252 insertions, 47 deletions
diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md
index 9b15c73a61..3fb49b3d49 100644
--- a/macros/latex/required/babel/base/README.md
+++ b/macros/latex/required/babel/base/README.md
@@ -1,4 +1,4 @@
-## Babel 3.40
+## Babel 3.41
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -7,9 +7,9 @@ lualatex out of the box. A few even work with plain formats.
The latest stable version is available on <https://ctan.org/pkg/babel>.
-Changes in version 3.40 are described in:
+Changes in version 3.41 are described in:
-https://github.com/latex3/babel/wiki/What's-new-in-babel-3.40
+https://github.com/latex3/babel/wiki/What's-new-in-babel-3.41
Included is a set of ini files for about 200 languages.
@@ -44,14 +44,23 @@ respective authors.
### Latest changes
```
+3.41 2020-02-27
+ - Counters and numerals added in some ini files, based on those
+ defined in CSS (Abjad, Alphabetic Hebrew, Japanese, etc.).
+ - Fix - A bug in the fix for #47, because \@elt was not reset
+ (#51).
+ - Fix - Error when french was loaded and an ini file read (#50).
+ - Fix - A typo in Greek files: Miriad must read Myriad.
+
3.40 2020-02-14
- New ini files for Latin and Greek (xe/lua).
- Add 'other' characters used in hyphenation patters (eg,
apostrophes).
- Fix - Old Plain TeX and Plain XeTeX raised an error.
- Fix - Option T1 in fontenc was not recognized to set
- \latinencoding with LaTeX 2020-02-02.
+ \latinencoding with LaTeX 2020-02-02 (#47)
- Fix - Locale names were hardcoded in some babel-...tex files.
+See https://github.com/latex3/babel/wiki/What's-new-in-babel-3.40
3.39 2020-02-03
- Languages can now be loaded on the fly (via \babelprovide).
diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx
index d0c45fd23c..37f4e71835 100644
--- a/macros/latex/required/babel/base/babel.dtx
+++ b/macros/latex/required/babel/base/babel.dtx
@@ -31,7 +31,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2020/02/14 v3.40 The Babel package]
+\ProvidesFile{babel.dtx}[2020/02/28 v3.41 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -1981,23 +1981,29 @@ also the package \textsf{combofont} for a complementary approach.}
\Describe\babelfont{\oarg{language-list}\marg{font-family}%
\oarg{font-options}\marg{font-name}}
-The main purpose of |\babelfont| is to define at once in a multilingual
-document the fonts required by the different languages, with their
-corresponding language systems (script and language). So, if you load,
-say, 4 languages, |\babelfont{rm}{FreeSerif}| defines 4 fonts (with their
-variants, of course), which are switched with the language by \babel.
-It is a tool to make things easier and transparent to the user.
+The main purpose of |\babelfont| is to define at once in a
+multilingual document the fonts required by the different languages,
+with their corresponding language systems (script and language). So, if
+you load, say, 4 languages, |\babelfont{rm}{FreeSerif}| defines 4 fonts
+(with their variants, of course), which are switched with the language
+by \babel. It is a tool to make things easier and transparent to the
+user.
Here \textit{font-family} is |rm|, |sf| or |tt| (or newly defined
ones, as explained below), and \textit{font-name} is the same as in
\textsf{fontspec} and the like.
If no language is given, then it is considered the default font for
-the family, activated when a language is selected. On the other hand,
-if there is one or more languages in the optional argument, the font
-will be assigned to them, overriding the default. Alternatively, you
-may set a font for a script -- just precede its name (lowercase) with
-a star (eg, |*devanagari|).
+the family, activated when a language is selected.
+
+On the other hand, if there is one or more languages in the optional
+argument, the font will be assigned to them, overriding the default one.
+Alternatively, you may set a font for a script -- just precede its name
+(lowercase) with a star (eg, |*devanagari|). With this optional
+argument, the font is \textit{not} yet defined, but just predeclared.
+This means you may define as many fonts as you want ‘just in case’,
+because if the language is never selected, the corresponding
+|\babelfont| declaration is just ignored.
\Babel{} takes care of the font language and the font script when
languages are selected (as well as the writing direction); see the
@@ -2384,7 +2390,7 @@ Currently used only in Southeast Asian scrips, like Thai. Ignored if 0
|ini|-based languages).
\end{note}
-\subsection{Digits}
+\subsection{Digits and counters}
\New{3.20} About thirty |ini| files define a field named
|digits.native|. When it is present, two macros are created:
@@ -2408,12 +2414,42 @@ _\telugucounter{section}_
\end{document}
\end{verbatim}
-Languages providing native digits in all or some variants are Arabic,
-Assamese, Bangla, Tibetar, Bodo, Central Kurdish, Dzongkha, Persian,
-Gujarati, Hindi, Khmer, Kannada, Konkani, Kashmiri, Lao, Northern Luri,
-Malayalam, Marathi, Burmese, Mazanderani, Nepali, Odia, Punjabi,
-Pashto, Tamil, Telugu, Thai, Uyghur, Urdu, Uzbek, Vai, Cantonese,
-Chinese.
+Languages providing native digits in all or some variants are:
+\begin{multicols}{5}
+Arabic\\
+Assamese\\
+Bangla\\
+Tibetar\\
+Bodo\\
+Central Kurdish\\
+Dzongkha\\
+Persian\\
+Gujarati\\
+Hindi\\
+Khmer\\
+Kannada\\
+Konkani\\
+Kashmiri\\
+Lao\\
+Northern Luri\\
+Malayalam\\
+Marathi\\
+Burmese\\
+Mazanderani\\
+Nepali\\
+Odia\\
+Punjabi\\
+Pashto\\
+Tamil\\
+Telugu\\
+Thai\\
+Uyghur\\
+Urdu\\
+Uzbek\\
+Vai\\
+Cantonese\\
+Chinese
+\end{multicols}
\New{3.30} With \luatex{} there is an alternative approach for mapping
digits, namely, |mapdigits|. Conversion is based on the language and it
@@ -2423,6 +2459,71 @@ bidi and fonts are processed (ie, to the node list as generated by the
bidirectional behavior (unlike |Numbers=Arabic| in \textsf{fontspec},
which is not recommended).
+\New{4.41} Many `ini` locale files has been extended with information about
+non-positional numerical systems, based on those predefined in CSS.
+They only work with \xetex{} and \luatex{} and are fully expendable (even
+inside an |\edef|). Currently, they are limited to numbers below 10000.
+
+There are several ways to use them (for the availabe styles in each
+language, see the list below):
+
+\begin{itemize}
+\item |\localenumeral|\marg{style}\marg{number}, like
+ |\localenumeral{abjad}{15}|
+\item |\localecounter|\marg{style}\marg{counter}, like
+ |\localecounter{lower}{section}|
+\item In |\babelprovide|, as an argument to the keys |alph| and |Alph|,
+which redefine what |\alph| and |\Alph| print. For example:
+\begin{verbatim}
+\babelprovide[alph=alphabetic]{thai}
+\end{verbatim}
+\end{itemize}
+
+The styles are:
+\begin{description}
+\itemsep=-\parskip
+\item[Ancient Greek] |lower.ancient|, |upper.ancient|
+
+\item[Arabic] |abjad|, |maghrebi.abjad|
+
+\item[Belarusan, Bulgarian, Macedonian, Serbian] |lower|, |upper|
+
+\item[Hebrew] |letters| (neither geresh nor gershayim yet)
+
+\item[Hindi] |alphabetic|
+
+\item[Armenian] |lower|, |upper|
+
+\item[Japanese] |hiragana|, |hiragana.iroha|, |katakana|,
+|katakana.iroha|, |circled.katakana|, |informal|, |formal|,
+|cjk-earthly-branch|, |cjk-heavenly-stem|, f|ullwidth.lower.alpha|,
+|fullwidth.upper.alpha|
+
+\item[Georgian] |letters|
+
+\item[Greek] |lower.modern|, |upper.modern|, |lower.ancient|,
+|upper.ancient| (all with keraia)
+
+\item[Khmer] |consonant|
+
+\item[Korean] |consonant|, |syllabe|, |hanja.informal|,
+|hanja.formal|, |hangul.formal|, |cjk-earthly-branch|,
+|cjk-heavenly-stem|, |fullwidth.lower.alpha|, |fullwidth.upper.alpha|
+
+\item[Persian] |abjad|, |alphabetic|
+
+\item[Russian] |lower|, |lower.full|, |upper|, |upper.full|
+
+\item[Tamil] |ancient|
+
+\item[Thai] |alphabetic|
+
+\item[Ukrainian] |lower| , |lower.full|, |upper| , |upper.full|
+
+\item[Chinese] |cjk-earthly-branch|, |cjk-heavenly-stem|,
+|fullwidth.lower.alpha|, |fullwidth.upper.alpha|
+\end{description}
+
\subsection{Accessing language info}
\Describe{\languagename}{}
@@ -4327,8 +4428,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.40>>
-%<<date=2020/02/14>>
+%<<version=3.41>>
+%<<date=2020/02/28>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -6833,13 +6934,17 @@ help from Bernd Raichle, for which I am grateful.
% \end{macro}
%
% \begin{macro}{\babel@save}
+% \begin{macro}{\babel@savevariable}
+%
% The macro |\babel@save|\meta{csname} saves the current meaning of
% the control sequence \meta{csname} to
-% |\originalTeX|\footnote{\cs{originalTeX} has to be
-% expandable, i.\,e.\ you shouldn't let it to \cs{relax}.}.
-% To do this, we let the current meaning to a temporary control
-% sequence, the restore commands are appended to |\originalTeX| and
-% the counter is incremented.
+% |\originalTeX|\footnote{\cs{originalTeX} has to be expandable,
+% i.\,e.\ you shouldn't let it to \cs{relax}.}. To do this, we let
+% the current meaning to a temporary control sequence, the restore
+% commands are appended to |\originalTeX| and the counter is
+% incremented. The macro |\babel@savevariable|\meta{variable} saves
+% the value of the variable. \meta{variable} can be anything allowed
+% after the |\the| primitive.
%
% \begin{macrocode}
\def\babel@save#1{%
@@ -6848,23 +6953,13 @@ help from Bernd Raichle, for which I am grateful.
\bbl@exp{%
\def\\\originalTeX{\the\toks@\<babel@\number\babel@savecnt>\relax}}%
\advance\babel@savecnt\@ne}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\babel@savevariable}
-%
-% The macro |\babel@savevariable|\meta{variable} saves the value of
-% the variable. \meta{variable} can be anything allowed after the
-% |\the| primitive.
-%
-% \begin{macrocode}
\def\babel@savevariable#1{%
\toks@\expandafter{\originalTeX #1=}%
\bbl@exp{\def\\\originalTeX{\the\toks@\the#1\relax}}}
% \end{macrocode}
%
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bbl@frenchspacing}
% \begin{macro}{\bbl@nonfrenchspacing}
@@ -7992,7 +8087,8 @@ help from Bernd Raichle, for which I am grateful.
\let\bbl@KVP@intraspace\@nil
\let\bbl@KVP@intrapenalty\@nil
\let\bbl@KVP@onchar\@nil
- \let\bbl@KVP@chargroups\@nil
+ \let\bbl@KVP@alph\@nil
+ \let\bbl@KVP@Alph\@nil
\bbl@forkv{#1}{% TODO - error handling
\in@{/}{##1}%
\ifin@
@@ -8037,7 +8133,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@ifunset{bbl@lname@#2}%
{\def\BabelBeforeIni##1##2{%
\begingroup
- \catcode`\[=12 \catcode`\]=12 \catcode`\==12 %
+ \catcode`\[=12 \catcode`\]=12 \catcode`\==12 \catcode`\;=12 %
\let\bbl@ini@captions@aux\@gobbletwo
\def\bbl@inidate ####1.####2.####3.####4\relax ####5####6{}%
\bbl@read@ini{##1}{basic data}%
@@ -8215,6 +8311,32 @@ help from Bernd Raichle, for which I am grateful.
}}%
\fi
\fi
+ % == alph, Alph ==
+ % What if extras<lang> contains a \babel@save\@alph? It won't be
+ % restored correctly when exiting the language, so we ignore
+ % this change with the \bbl@alph@saved trick.
+ \ifx\bbl@KVP@alph\@nil\else
+ \toks@\expandafter\expandafter\expandafter{%
+ \csname extras\languagename\endcsname}%
+ \bbl@exp{%
+ \def\<extras\languagename>{%
+ \let\\\bbl@alph@saved\\\@alph
+ \the\toks@
+ \let\\\@alph\\\bbl@alph@saved
+ \\\babel@save\\\@alph
+ \let\\\@alph\<bbl@cntr@\bbl@KVP@alph @\languagename>}}%
+ \fi
+ \ifx\bbl@KVP@Alph\@nil\else
+ \toks@\expandafter\expandafter\expandafter{%
+ \csname extras\languagename\endcsname}%
+ \bbl@exp{%
+ \def\<extras\languagename>{%
+ \let\\\bbl@Alph@saved\\\@Alph
+ \the\toks@
+ \let\\\@Alph\\\bbl@Alph@saved
+ \\\babel@save\\\@Alph
+ \let\\\@Alph\<bbl@cntr@\bbl@KVP@Alph @\languagename>}}%
+ \fi
% == require.babel in ini ==
% To load or reaload the babel-*.tex, if require.babel in ini
\bbl@ifunset{bbl@rqtex@\languagename}{}%
@@ -8511,6 +8633,24 @@ help from Bernd Raichle, for which I am grateful.
\let\bbl@inikv@typography\bbl@inikv
\let\bbl@inikv@characters\bbl@inikv
\let\bbl@inikv@numbers\bbl@inikv
+\def\bbl@inikv@counters#1=#2\@@{%
+ \def\bbl@tempc{#1}%
+ \bbl@trim@def{\bbl@tempb*}{#2}%
+ \in@{.1$}{#1$}%
+ \ifin@
+ \bbl@replace\bbl@tempc{.1}{}%
+ \bbl@csarg\xdef{cntr@\bbl@tempc @\languagename}{%
+ \noexpand\bbl@alphnumeral{\bbl@tempc}}%
+ \fi
+ \in@{.F.}{#1}%
+ \ifin@\else\in@{.S.}{#1}\fi
+ \ifin@
+ \bbl@csarg\xdef{cntr@#1@\languagename}{\bbl@tempb*}%
+ \else
+ \toks@{}% Required by \bbl@buildifcase, which returns \bbl@tempa
+ \expandafter\bbl@buildifcase\bbl@tempb* \\ % Space after \\
+ \bbl@csarg{\global\expandafter\let}{cntr@#1@\languagename}\bbl@tempa
+ \fi}
\def\bbl@after@ini{%
\bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}%
\bbl@exportkey{rgthm}{typography.righthyphenmin}{3}%
@@ -8680,13 +8820,67 @@ help from Bernd Raichle, for which I am grateful.
\def\BabelBeforeIni##1##2{%
\begingroup
\bbl@add\bbl@secpost@identification{\closein\bbl@readstream }%
- \catcode`\[=12 \catcode`\]=12 \catcode`\==12 %
+ \catcode`\[=12 \catcode`\]=12 \catcode`\==12 \catcode`\;=12 %
\bbl@read@ini{##1}{font and identification data}%
\endinput % babel- .tex may contain onlypreamble's
\endgroup}% boxed, to avoid extra spaces:
{\setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}}}
% \end{macrocode}
%
+% Alphabetic counters must be converted from a space separated list to
+% an |\ifcase| structure.
+%
+% \begin{macrocode}
+\def\bbl@buildifcase#1 {% Returns \bbl@tempa, requires \toks@={}
+ \ifx\\#1% % \\ before, in case #1 is multiletter
+ \bbl@exp{%
+ \def\\\bbl@tempa####1{%
+ \<ifcase>####1\space\the\toks@\<else>\\\@ctrerr\<fi>}}%
+ \else
+ \toks@\expandafter{\the\toks@\or #1}%
+ \expandafter\bbl@buildifcase
+ \fi}
+% \end{macrocode}
+%
+% The code for additive counters is somewhat tricky and it's based on
+% the fact the arguments just before |\@@| collects digits which have
+% been left ‘unused’ in previous arguments, the first of them being the
+% number of digits in the number to be converted. This explains the
+% reverse set |76543210|. Digits above 10000 are not handled yet. When
+% the key contains the subkey |.F.|, the number after is treated as an
+% special case. for a fixed form (see |babel-he.ini|, for example).
+%
+% \begin{macrocode}
+\newcommand\localenumeral[2]{\@nameuse{bbl@cntr@#1@\languagename}{#2}}
+\def\bbl@localecntr#1#2{\localenumeral{#2}{#1}}
+\newcommand\localecounter[2]{%
+ \expandafter\bbl@localecntr\csname c@#2\endcsname{#1}}
+\def\bbl@alphnumeral#1#2{%
+ \expandafter\bbl@alphnumeral@i\number#2 76543210\@@{#1}}
+\def\bbl@alphnumeral@i#1#2#3#4#5#6#7#8\@@#9{%
+ \ifcase\@car#8\@nil\or % Currenty <10000, but prepared for bigger
+ \bbl@alphnumeral@ii{#9}000000#1\or
+ \bbl@alphnumeral@ii{#9}00000#1#2\or
+ \bbl@alphnumeral@ii{#9}0000#1#2#3\or
+ \bbl@alphnumeral@ii{#9}000#1#2#3#4\else
+ \bbl@alphnum@invalid{>9999}%
+ \fi}
+\def\bbl@alphnumeral@ii#1#2#3#4#5#6#7#8{%
+ \bbl@ifunset{bbl@cntr@#1.F.\number#5#6#7#8@\languagename}%
+ {\@nameuse{bbl@cntr@#1.4@\languagename}#5%
+ \@nameuse{bbl@cntr@#1.3@\languagename}#6%
+ \@nameuse{bbl@cntr@#1.2@\languagename}#7%
+ \@nameuse{bbl@cntr@#1.1@\languagename}#8%
+ \ifnum#6#7#8>\z@ % An ad hod rule for Greek. Ugly. To be fixed.
+ \bbl@ifunset{bbl@cntr@#1.S.321@\languagename}{}%
+ {\@nameuse{bbl@cntr@#1.S.321@\languagename}}%
+ \fi}%
+ {\@nameuse{bbl@cntr@#1.F.\number#5#6#7#8@\languagename}}}
+\def\bbl@alphnum@invalid#1{%
+ \bbl@error{Alphabetic numeral too large (#1)}%
+ {Currently this is the limit.}}
+% \end{macrocode}
+%
% The information in the identification section can be useful, so the
% following macro just exposes it with a user command.
%
@@ -9521,6 +9715,7 @@ help from Bernd Raichle, for which I am grateful.
\else
\def\@elt#1{,#1,}%
\edef\bbl@tempa{\expandafter\@gobbletwo\@fontenc@load@list}%
+ \let\@elt\relax
\bbl@xin@{,T1,}\bbl@tempa
\ifin@
\xdef\latinencoding{\bbl@t@one}%
@@ -11822,6 +12017,7 @@ help from Bernd Raichle, for which I am grateful.
\endgroup
\bbl@trace{Macros for reading patterns files}
\def\bbl@get@enc#1:#2:#3\@@@{\def\bbl@hyph@enc{#2}}
+% TODO - Harcoded value:
\ifx\babelcatcodetablenum\@undefined
\def\babelcatcodetablenum{5211}
\fi
diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins
index ad993d6a1e..be654b14b1 100644
--- a/macros/latex/required/babel/base/babel.ins
+++ b/macros/latex/required/babel/base/babel.ins
@@ -3,7 +3,7 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright 2012-2019 Javier Bezos and Johannes L. Braams.
+%% Copyright 2012-2020 Javier Bezos and Johannes L. Braams.
%% Copyright 1989-2008 Johannes L. Braams and any individual authors
%% listed elsewhere in this file. All rights reserved.
%%
@@ -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/02/14}
+\def\filedate{2020/02/28}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/macros/latex/required/babel/base/babel.pdf b/macros/latex/required/babel/base/babel.pdf
index d511adc135..b71e60883c 100644
--- a/macros/latex/required/babel/base/babel.pdf
+++ b/macros/latex/required/babel/base/babel.pdf
Binary files differ
diff --git a/macros/latex/required/babel/base/bbcompat.dtx b/macros/latex/required/babel/base/bbcompat.dtx
index be409112ab..2a943ee42b 100644
--- a/macros/latex/required/babel/base/bbcompat.dtx
+++ b/macros/latex/required/babel/base/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2020/02/14 v3.40]
+\ProvidesFile{bbcompat.dtx}[2020/02/28 v3.41]
%</dtx>
%
%% File 'bbcompat.dtx'