From 4fee29360f7566a474b6143951b0744fa151edc9 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 30 Aug 2023 03:01:17 +0000 Subject: CTAN sync 202308300301 --- macros/latex/required/babel/base/README.md | 30 ++-- macros/latex/required/babel/base/babel-code.pdf | Bin 626956 -> 632983 bytes macros/latex/required/babel/base/babel.dtx | 210 +++++++++++++++++++++--- macros/latex/required/babel/base/babel.ins | 3 +- macros/latex/required/babel/base/babel.pdf | Bin 404462 -> 406368 bytes macros/latex/required/babel/base/bbcompat.dtx | 2 +- 6 files changed, 198 insertions(+), 47 deletions(-) (limited to 'macros/latex/required/babel/base') diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md index f57a55cf41..a94ed0408f 100644 --- a/macros/latex/required/babel/base/README.md +++ b/macros/latex/required/babel/base/README.md @@ -1,6 +1,6 @@ -## Babel 3.92 +s## Babel 3.93 -2023-07-15 +2023-08-29 This package manages culturally-determined typographical (and other) rules, and hyphenation patterns for a wide range of languages. Many @@ -10,9 +10,9 @@ is a set of ini files for about 250 languages. The latest stable version is available on . -Changes in version 3.92 are described in: +Changes in version 3.93 are described in: -https://latex3.github.io/babel/news/whats-new-in-babel-3.92.html +https://latex3.github.io/babel/news/whats-new-in-babel-3.93.html Apart from the manual, you can find information on some aspects of babel at: @@ -48,21 +48,15 @@ respective authors. ### Summary of latest changes ``` -3.92 2023-07-15 - * The fix for #240 in version 3.90, related to `\normalsfcodes`, - broke the `onchar` mechanism in some cases and some other - things. A different fix has been devised. - * Weird behavior when declaring the same font for two families - (#178). - -3.91 2023-07-09 - * Transform for transliterated Hebrew, based on cjhebrew. +3.93 2023-08-29 + * More Hebrew numerals (also Yiddish). + * Chinese calendar. * Fixes: - - alignat and alignat* (amsmath) should now work in RTL mode (#208). - - The package option `layout=extras` was severely broken (#246). - - English and Arabic documents broken when using paracol (#241). - * Experimental: transforming strings with - `\localeprehyphenation`. + - Table with Arabic text corrupted when trying to colour cells (#252). + - Bold small caps were wrong in some cases (#92). + - Missing numerals in 'sanskri'`. + * Added a few ‘bare minimum locales’: Southern Altai, Divehi, + Ancient Egyptian, Egyptian Arabic, Phoenician, Newari. ``` ### Previous changes diff --git a/macros/latex/required/babel/base/babel-code.pdf b/macros/latex/required/babel/base/babel-code.pdf index 2c8615ff4e..1902f1390c 100644 Binary files a/macros/latex/required/babel/base/babel-code.pdf and b/macros/latex/required/babel/base/babel-code.pdf differ diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx index d7a77ac1de..55b6e0c26f 100644 --- a/macros/latex/required/babel/base/babel.dtx +++ b/macros/latex/required/babel/base/babel.dtx @@ -32,7 +32,7 @@ % % \iffalse %<*filedriver> -\ProvidesFile{babel.dtx}[2023/07/15 v3.92 The Babel package] +\ProvidesFile{babel.dtx}[2023/08/29 v3.93 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -2989,10 +2989,10 @@ which is not recommended). \Describe{\localenumeral}{\marg{style}\marg{number}} \DescribeOther{\localecounter}{\marg{style}\marg{counter}} -\New{3.41} Many `ini` locale files has been extended with information +\New{3.41} Many `ini` locale files provide 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 unprotected |\edef|). Currently, they are +expandable (even inside an unprotected |\edef|). Currently, they are limited to numbers below 10000. There are several ways to use them (for the availabe styles in each @@ -3044,7 +3044,8 @@ The styles are: \item[Greek] |lower.modern|, |upper.modern|, |lower.ancient|, |upper.ancient| (all with keraia) -\item[Hebrew] |letters| (neither geresh nor gershayim yet) +\item[Hebrew] |letters| (\New{3.93} if the language is loaded +explicitly, also |letters.plain|, |letters.gershayim|, |letters.final|) \item[Hindi] |alphabetic| @@ -3091,7 +3092,9 @@ with the following command. {\marg{year}\marg{month}\marg{day}}} By default the calendar is the Gregorian, but an |ini| file may define -strings for other calendars (currently |ar|, |ar-|*, |he|, |fa|, |hi|). +strings for other calendars: |am| (|ethiopic|), |ar| and +|ar-|* (|islamic|), |cop| (|coptic|), |fa| (|islamic|, |persian|), |he| +(|hebrew|), |hi| (|indian|), |th| (|buddhist|). In the latter case, the three arguments are the year, the month, and the day in those in the corresponding calendar. They are \textit{not} the Gregorian data to be converted (which means, say, 13 is a valid @@ -3103,6 +3106,32 @@ Even with a certain calendar there may be variants. In Kurmanji the default variant prints something like \textit{30. Çileya Pêşîn 2019}, but with |variant=izafa| it prints \textit{31’ê Çileya Pêşînê 2019}. +The default calendar for a language can be set in |\babelprovide|, with +the key |calendar| (an empty value is the same as |gregorian|). In this +case, |\today| always converts the date. Variants are preceded by a +dot, so that |calendar = .genitive| in |serbian| |\today| selects the +date in this variant (more explicitly is |gregorian.genitive|). + +\begin{example} + By default, |thai| prints the date with |\today| in the Buddhist + calendar, but if you need a date in the Gregorian one, write: +\begin{verbatim} + \localedate[calendar=gregorian]{\year}{\month}{\day} +\end{verbatim} +(Remember |\year|, |\month| and |\day| is the current Gregorian date, +so no conversion is necessary.) +\end{example} + +\begin{example} + On the other hand (and following the CLDR), the preferred calendar in + most locales for Arabic is |gregorian| (in |ar-SA| is + |islamic-umalqura|), so to set |islamic-civil| as the + default one: +\begin{verbatim} + \babelprovide[import, calendar=islamic-civil]{arabic} +\end{verbatim} +\end{example} + \Describe{\babelcalendar}{\oarg{date}% \marg{calendar}\marg{year-macro}\m{month-macro}\m{day-macro}} @@ -3111,12 +3140,12 @@ package should be able to, at least, generate correctly the current date in the way users would expect in their own culture. Currently, |\localedate| can print dates in a few calendars (provided the \textsf{ini} locale file has been imported), but year, month and day -had to be entered by hand, which is very inconvenient. With this macro, +had to be entered by hand, which is inconvenient. With this macro, the current date is converted and stored in the three last arguments, -which must be macros. -Allowed calendars are +which must be macros. Allowed calendars are: \begin{multicols}{4} |buddhist|\\ + |chinese| (strings in locales pending) \New{3.93}\\ |coptic|\\ |ethiopic|\\ |hebrew|\\ @@ -3124,10 +3153,10 @@ Allowed calendars are |islamic-umalqura|\\ |persian| \end{multicols} -The optional -argument converts the given date, in the form -‘\m{year}-\m{month}-\m{day}’. Please, refer to the page on the news for -3.76 in the \babel{} site for further details. +The optional argument converts the given date, in the form +‘\m{year}-\m{month}-\m{day}’, although for practical reasons most +calendars accept only a restricted range of years. Please, refer to the +page on the news for 3.76 in the \babel{} site for further details. \subsection{Accessing language info} @@ -3493,6 +3522,10 @@ convert the sigma at the end of a word (on purpose). This transforms does it. To prevent the conversion (an abbreviation, for example), write |"s|.} +\trans{Hebrew, Yiddish}{transliteration.cj}{A transliteration system +based on that devised by Christian Justen for `cjhebrew`. Final letters +are not converted, and the furtive patah is not shifted.} + \trans{Hindi, Sanskrit}{transliteration.hk}{The Harvard-Kyoto system to romanize Devanagari.} @@ -5466,8 +5499,8 @@ wouldn’t exist. % \section{Tools} % % \begin{macrocode} -%<> -%<> +%<> +%<> % \end{macrocode} % % \textbf{Do not use the following macros in \texttt{ldf} files. They @@ -13425,6 +13458,15 @@ wouldn’t exist. % |\bbl@mapselect| because |\selectfont| is called internally when a % font is defined. % +% For historical reasons, \LaTeX{} can select two different series +% (|bx| and |b|), for what is conceptually a single one. This can +% lead to problems when a single family requires several fonts, +% depending on the language, mainly because ‘subtitutions’ with some +% combinations are not done consistently -- sometimes |bx/sc| is the +% correct font, but sometimes points to |b/n|, even if |b/sc| exists. +% So, some subtitutions are redefined (in a somewhat hackish way, by +% inspecting if the variant declaration contains |>ssub*|). +% % \begin{macrocode} \def\bbl@font@set#1#2#3{% eg \bbl@rmdflt@lang \rmdefault \rmfamily \bbl@xin@{<>}{#1}% @@ -13467,7 +13509,17 @@ wouldn’t exist. \begingroup #4% \xdef#1{\f@family}% eg, \bbl@rmdflt@lang{FreeSerif(0)} - \endgroup + \endgroup % TODO. Find better tests: + \bbl@xin@{\string>\string s\string s\string u\string b\string*}% + {\expandafter\meaning\csname TU/#1/bx/sc\endcsname}% + \ifin@ + \global\bbl@ccarg\let{TU/#1/bx/sc}{TU/#1/b/sc}% + \fi + \bbl@xin@{\string>\string s\string s\string u\string b\string*}% + {\expandafter\meaning\csname TU/#1/bx/scit\endcsname}% + \ifin@ + \global\bbl@ccarg\let{TU/#1/bx/scit}{TU/#1/b/scit}% + \fi \let#4\bbl@temp@fam \bbl@exp{\let\<\bbl@stripslash#4\space>}\bbl@temp@pfam \let\bbl@mapselect\bbl@tempe}% @@ -14433,6 +14485,10 @@ end % % \subsection{Arabic justification} % +% WIP. |\bbl@arabicjust| is executed with both elongated an kashida. +% This must be fine tuned. The attribute kashida is set by transforms +% with |kashida|- +% % \begin{macrocode} \ifnum\bbl@bidimode>100 \ifnum\bbl@bidimode<200 \def\bblar@chars{% @@ -14461,13 +14517,17 @@ end luatexbase.add_to_callback('hpack_filter', Babel.arabic.justify_hbox, 'Babel.arabic.justify_hbox') }}% +% \end{macrocode} +% % Save both node lists to make replacement. TODO. Save also widths to -% make computations +% make computations. +% +% \begin{macrocode} \def\bblar@fetchjalt#1#2#3#4{% \bbl@exp{\\\bbl@foreach{#1}}{% \bbl@ifunset{bblar@JE@##1}% - {\setbox\z@\hbox{^^^^200d\char"##1#2}}% - {\setbox\z@\hbox{^^^^200d\char"\@nameuse{bblar@JE@##1}#2}}% + {\setbox\z@\hbox{\textdir TRT ^^^^200d\char"##1#2}}% + {\setbox\z@\hbox{\textdir TRT ^^^^200d\char"\@nameuse{bblar@JE@##1}#2}}% \directlua{% local last = nil for item in node.traverse(tex.box[0].head) do @@ -14477,10 +14537,14 @@ end end end Babel.arabic.#3['##1#4'] = last.char - }}} -% Brute force. No rules at all, yet. The ideal: look at jalt table. And -% perhaps other tables (falt?, cswh?). What about kaf? And diacritic -% positioning? + }}} +% \end{macrocode} +% +% Elongated forms. Brute force. No rules at all, yet. The ideal: look +% at jalt table. And perhaps other tables (falt?, cswh?). What about +% kaf? And diacritic positioning? +% +% \begin{macrocode} \gdef\bbl@parsejalt{% \ifx\addfontfeature\@undefined\else \bbl@xin@{/e}{/\bbl@cl{lnbrk}}% @@ -14516,7 +14580,11 @@ end end }% \endgroup} +% \end{macrocode} % +% The actual justification (inspired by \textsc{chickenize}). +% +% \begin{macrocode} \begingroup \catcode`#=11 \catcode`~=11 @@ -14644,6 +14712,9 @@ function Babel.arabic.justify_hlist(head, line, gc, size, pack) node.remove(line.head, new) % Better compute before break end + if Babel.fix_diacr then + Babel.fix_diacr(k_item.next) + end width = width_new end if k_curr == 1 then @@ -14685,7 +14756,7 @@ function Babel.arabic.justify_hlist(head, line, gc, size, pack) end } \endgroup -\fi\fi % Arabic just block +\fi\fi % ends Arabic just block: \ifnum\bbl@bidimode>100... % \end{macrocode} % % \subsection{Common stuff} @@ -15485,8 +15556,8 @@ end {\IfBabelLayout{notabular}% {\chardef\bbl@tabular@mode\z@}% {\chardef\bbl@tabular@mode\@ne}}% Mixed, with LTR cols -\ifnum\bbl@bidimode>\@ne % Any bidi= except default=1 - \ifnum\bbl@tabular@mode=\@ne +\ifnum\bbl@bidimode>\@ne % Any lua bidi= except default=1 + \ifcase\bbl@tabular@mode\or % 1 \let\bbl@parabefore\relax \AddToHook{para/before}{\bbl@parabefore} \AtBeginDocument{% @@ -15510,7 +15581,18 @@ end \\\bbl@sreplace\\\@classz {\\\do@row@strut\}{\\\do@row@strut\\egroup}}}% {}}% - \fi} + \fi}% + \or % 2 + \let\bbl@parabefore\relax + \AddToHook{para/before}{\bbl@parabefore}% + \AtBeginDocument{% + \@ifpackageloaded{colortbl}% + {\bbl@replace\@tabular{$}{$% + \def\bbl@insidemath{0}% + \def\bbl@parabefore{\localerestoredirs}}% + \bbl@sreplace\@classz + {\hbox\bgroup\bgroup}{\hbox\bgroup\bgroup\localerestoredirs}}% + {}}% \fi % \end{macrocode} % @@ -15576,7 +15658,10 @@ end \let\bbl@NL@@tabular\@tabular \AtBeginDocument{% \ifx\bbl@NL@@tabular\@tabular\else - \bbl@replace\@tabular{$}{\bbl@nextfake$}% + \bbl@exp{\\\in@{\\\bbl@nextfake}{\[@tabular]}}% + \ifin@\else + \bbl@replace\@tabular{$}{\bbl@nextfake$}% + \fi \let\bbl@NL@@tabular\@tabular \fi}} {} @@ -23997,6 +24082,77 @@ Babel.cjk_breaks = { \edef#5{#2}% \edef#6{#3}} % +% +% \subsection{Chinese} +% +% Brute force, with the Julian day of first day of each month. The +% table has been computed with the help of \textsf{python-lunardate} by +% Ricky Yeung, GPLv2 (but the code itself has not been used). The range +% is 2015-2044. +% +% \begin{macrocode} +%<*ca-chinese> +\ExplSyntaxOn +<@Compute Julian day@> +\def\bbl@ca@chinese#1-#2-#3\@@#4#5#6{% + \edef\bbl@tempd{\fp_eval:n{% + \bbl@cs@jd{#1}{#2}{#3} - 2457072.5 }}% + \count@\z@ + \@tempcnta=2015 + \bbl@foreach\bbl@cs@chinese@data{% + \ifnum##1>\bbl@tempd\else + \advance\count@\@ne + \ifnum\count@>12 + \count@\@ne + \advance\@tempcnta\@ne\fi + \bbl@xin@{,##1,}{,\bbl@cs@chinese@leap,}% + \ifin@ + \advance\count@\m@ne + \edef\bbl@tempe{\the\numexpr\count@+12\relax}% + \else + \edef\bbl@tempe{\the\count@}% + \fi + \edef\bbl@tempb{##1}% + \fi}% + \edef#4{\the\@tempcnta}% + \edef#5{\bbl@tempe}% + \edef#6{\the\numexpr\bbl@tempd-\bbl@tempb+1\relax}} +\def\bbl@cs@chinese@leap{% + 885,1920,2953,3809,4873,5906,6881,7825,8889,9893,10778} +\def\bbl@cs@chinese@data{0,29,59,88,117,147,176,206,236,266,295,325, + 354,384,413,443,472,501,531,560,590,620,649,679,709,738,% + 768,797,827,856,885,915,944,974,1003,1033,1063,1093,1122,% + 1152,1181,1211,1240,1269,1299,1328,1358,1387,1417,1447,1477,% + 1506,1536,1565,1595,1624,1653,1683,1712,1741,1771,1801,1830,% + 1860,1890,1920,1949,1979,2008,2037,2067,2096,2126,2155,2185,% + 2214,2244,2274,2303,2333,2362,2392,2421,2451,2480,2510,2539,% + 2569,2598,2628,2657,2687,2717,2746,2776,2805,2835,2864,2894,% + 2923,2953,2982,3011,3041,3071,3100,3130,3160,3189,3219,3248,% + 3278,3307,3337,3366,3395,3425,3454,3484,3514,3543,3573,3603,% + 3632,3662,3691,3721,3750,3779,3809,3838,3868,3897,3927,3957,% + 3987,4016,4046,4075,4105,4134,4163,4193,4222,4251,4281,4311,% + 4341,4370,4400,4430,4459,4489,4518,4547,4577,4606,4635,4665,% + 4695,4724,4754,4784,4814,4843,4873,4902,4931,4961,4990,5019,% + 5049,5079,5108,5138,5168,5197,5227,5256,5286,5315,5345,5374,% + 5403,5433,5463,5492,5522,5551,5581,5611,5640,5670,5699,5729,% + 5758,5788,5817,5846,5876,5906,5935,5965,5994,6024,6054,6083,% + 6113,6142,6172,6201,6231,6260,6289,6319,6348,6378,6408,6437,% + 6467,6497,6526,6556,6585,6615,6644,6673,6703,6732,6762,6791,% + 6821,6851,6881,6910,6940,6969,6999,7028,7057,7087,7116,7146,% + 7175,7205,7235,7264,7294,7324,7353,7383,7412,7441,7471,7500,% + 7529,7559,7589,7618,7648,7678,7708,7737,7767,7796,7825,7855,% + 7884,7913,7943,7972,8002,8032,8062,8092,8121,8151,8180,8209,% + 8239,8268,8297,8327,8356,8386,8416,8446,8475,8505,8534,8564,% + 8593,8623,8652,8681,8711,8740,8770,8800,8829,8859,8889,8918,% + 8948,8977,9007,9036,9066,9095,9124,9154,9183,9213,9243,9272,% + 9302,9331,9361,9391,9420,9450,9479,9508,9538,9567,9597,9626,% + 9656,9686,9715,9745,9775,9804,9834,9863,9893,9922,9951,9981,% + 10010,10040,10069,10099,10129,10158,10188,10218,10247,10277,% + 10306,10335,10365,10394,10423,10453,10483,10512,10542,10572,% + 10602,10631,10661,10690,10719,10749,10778,10807,10837,10866,% + 10896,10926,10956,10986,11015,11045,11074,11103} +\ExplSyntaxOff +% % \end{macrocode} % % \section{Support for Plain \TeX\ (\texttt{plain.def})} diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins index 0bd796ff02..e5cb9bcd5a 100644 --- a/macros/latex/required/babel/base/babel.ins +++ b/macros/latex/required/babel/base/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/07/15} +\def\filedate{2023/08/29} \def\batchfile{babel.ins} \input docstrip.tex @@ -167,6 +167,7 @@ \file{babel-ca-hebrew.tex}{\from{babel.dtx}{ca-hebrew}} \file{babel-ca-islamic.tex}{\from{babel.dtx}{ca-islamic}} \file{babel-ca-persian.tex}{\from{babel.dtx}{ca-persian}} + \file{babel-ca-chinese.tex}{\from{babel.dtx}{ca-chinese}} \file{xebabel.def}{\from{babel.dtx}{xetex}} \file{luababel.def}{\from{babel.dtx}{luatex}} \file{txtbabel.def}{\from{babel.dtx}{texxet}} diff --git a/macros/latex/required/babel/base/babel.pdf b/macros/latex/required/babel/base/babel.pdf index 39ea9b89e9..eea2d0ba2a 100644 Binary files a/macros/latex/required/babel/base/babel.pdf and b/macros/latex/required/babel/base/babel.pdf differ diff --git a/macros/latex/required/babel/base/bbcompat.dtx b/macros/latex/required/babel/base/bbcompat.dtx index 9f926505d5..0f958a13e2 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}[2023/07/15 v3.92] +\ProvidesFile{bbcompat.dtx}[2023/08/29 v3.93] % % %% File 'bbcompat.dtx' -- cgit v1.2.3