diff options
author | Norbert Preining <norbert@preining.info> | 2023-07-10 03:02:05 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-07-10 03:02:05 +0000 |
commit | ab107e0f744efc9a2173da9b69e53fd83183988a (patch) | |
tree | eae382ec2f34423a83429e92ec81734bc621e376 /macros/latex/required/babel/base | |
parent | fb9a8ffb415de6aca48954ade22852bc93eb7f89 (diff) |
CTAN sync 202307100302
Diffstat (limited to 'macros/latex/required/babel/base')
-rw-r--r-- | macros/latex/required/babel/base/README.md | 28 | ||||
-rw-r--r-- | macros/latex/required/babel/base/babel-code.pdf | bin | 625101 -> 626873 bytes | |||
-rw-r--r-- | macros/latex/required/babel/base/babel.dtx | 92 | ||||
-rw-r--r-- | macros/latex/required/babel/base/babel.ins | 2 | ||||
-rw-r--r-- | macros/latex/required/babel/base/babel.pdf | bin | 404372 -> 404347 bytes | |||
-rw-r--r-- | macros/latex/required/babel/base/bbcompat.dtx | 2 |
6 files changed, 86 insertions, 38 deletions
diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md index 12e18a9aa3..d9e620c5a6 100644 --- a/macros/latex/required/babel/base/README.md +++ b/macros/latex/required/babel/base/README.md @@ -1,6 +1,6 @@ -## Babel 3.90 +## Babel 3.91 -2023-06-26 +2023-07-09 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 <https://ctan.org/pkg/babel>. -Changes in version 3.90 are described in: +Changes in version 3.91 are described in: -https://latex3.github.io/babel/news/whats-new-in-babel-3.90.html +https://latex3.github.io/babel/news/whats-new-in-babel-3.91.html Apart from the manual, you can find information on some aspects of babel at: @@ -48,18 +48,14 @@ respective authors. ### Summary of latest changes ``` -3.90 2023-06-26 - * Main language selected at begindocument/before (#240). - * Option to limit the number of inserted tatweel. - * New macros `\BabelUppercaseMapping` and - `\BabelLowercaseMapping`. - * Fix: line breaking was sometimes prevented when switching the - text direction (#213). - * Locale names (in ini files): - - `classicallatin` and `ecclesiasticallatin` now preferred to - `classiclatin` and `ecclesiasticlatin`. - - `farsi` is a synonymous for `persian`. - - `vietnam` removed - use `vietnamese`. +3.91 2023-07-09 + * Transform for transliterated Hebrew, based on cjhebrew. + * 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`. ``` ### Previous changes diff --git a/macros/latex/required/babel/base/babel-code.pdf b/macros/latex/required/babel/base/babel-code.pdf Binary files differindex 8ac14245b4..3308a56ba7 100644 --- a/macros/latex/required/babel/base/babel-code.pdf +++ b/macros/latex/required/babel/base/babel-code.pdf diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx index 1477fd0449..6f91f1141c 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/06/26 v3.90 The Babel package] +\ProvidesFile{babel.dtx}[2023/07/09 v3.91 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -2941,7 +2941,7 @@ Languages providing native digits in all or some variants are: Arabic\\ Assamese\\ Bangla\\ -Tibetar\\ +Tibetan\\ Bodo\\ Central Kurdish\\ Dzongkha\\ @@ -5466,8 +5466,8 @@ wouldn’t exist. % \section{Tools} % % \begin{macrocode} -%<<version=3.90>> -%<<date=2023/06/26>> +%<<version=3.91>> +%<<date=2023/07/09>> % \end{macrocode} % % \textbf{Do not use the following macros in \texttt{ldf} files. They @@ -14436,13 +14436,8 @@ end \gdef\bbl@arabicjust{% \let\bbl@arabicjust\relax \newattribute\bblar@kashida - \newattribute\bblar@kashida@aux % 0, 1=tatweel, 2=diacritics - \directlua{% WIP - Babel.attr_kashida = luatexbase.registernumber'bblar@kashida' - Babel.attr_kashida_aux = luatexbase.registernumber'bblar@kashida@aux' - }% + \directlua{ Babel.attr_kashida = luatexbase.registernumber'bblar@kashida' }% \bblar@kashida=\z@ - \bblar@kashida@aux=\z@ \bbl@patchfont{{\bbl@parsejalt}}% \directlua{ Babel.arabic.elong_map = Babel.arabic.elong_map or {} @@ -14904,7 +14899,6 @@ end \@ifnextchar[{\bbl@settransform{0}}{\bbl@settransform{0}[]}} \gdef\babelposthyphenation{&% \@ifnextchar[{\bbl@settransform{1}}{\bbl@settransform{1}[]}} -\gdef\bbl@postlinebreak{\bbl@settransform{2}[]} &% WIP \gdef\bbl@settransform#1[#2]#3#4#5{&% \ifcase#1 \bbl@activateprehyphen @@ -14985,7 +14979,7 @@ end local lbkr = Babel.linebreaking.replacements[#1] local u = unicode.utf8 local id, attr, label - if #1 == 0 or #1 == 2 then + if #1 == 0 then id = \the\csname bbl@id@@#3\endcsname\space else id = \the\csname l@#3\endcsname\space @@ -15000,7 +14994,7 @@ end \fi &% Convert pattern: local patt = string.gsub([==[#4]==], '%s', '') - if #1 == 0 or #1 == 2 then + if #1 == 0 then patt = string.gsub(patt, '|', ' ') end if not u.find(patt, '()', nil, true) then @@ -15081,6 +15075,19 @@ end }} % \end{macrocode} % +% The following experimental (and unfinished) macro applies the +% prehyphenation transforms for the current locale to a string +% (characters and spaces) and processes it in a fully expandable way +% (among other limitations, the string can’t contain |]==]|). The way +% it operates is admittedly rather cumbersome: it converts the string +% to a node list, processes it, and converts it back to a string. The +% lua code is in the lua file below. +% +% \begin{macrocode} +\newcommand\localeprehyphenation[1]{% + \directlua{ Babel.string_prehyphenation([==[#1]==], \the\localeid) }} +% \end{macrocode} +% % \subsection{Bidi} % % As a first step, add a handler for bidi and digits (and potentially @@ -15376,10 +15383,13 @@ end \AddToHook{env/gather*/begin}{\bbl@ams@preset\bbl@ams@lap}% \AddToHook{env/align/begin}{\bbl@ams@preset\bbl@ams@lap}% \AddToHook{env/align*/begin}{\bbl@ams@preset\bbl@ams@lap}% + \AddToHook{env/alignat/begin}{\bbl@ams@preset\bbl@ams@lap}% + \AddToHook{env/alignat*/begin}{\bbl@ams@preset\bbl@ams@lap}% \AddToHook{env/eqnalign/begin}{\bbl@ams@preset\hbox}% % Hackish, for proper alignment. Don’t ask me why it works!: \bbl@exp{% Avoid a 'visible' conditional - \\\AddToHook{env/align*/end}{\<iftag@>\<else>\\\tag*{}\<fi>}}% + \\\AddToHook{env/align*/end}{\<iftag@>\<else>\\\tag*{}\<fi>}% + \\\AddToHook{env/alignat*/end}{\<iftag@>\<else>\\\tag*{}\<fi>}}% \AddToHook{env/flalign/begin}{\bbl@ams@preset\hbox}% \AddToHook{env/split/before}{% \def\bbl@mathboxdir{\def\bbl@insidemath{1}}% @@ -15488,11 +15498,23 @@ end {}}% \fi} \fi +% \end{macrocode} +% +% Very likely the |\output| routine must be patched in a quite general +% way to make sure the |\bodydir| is set to |\pagedir|. Note outside +% |\output| they can be different (and often are). For the moment, two +% \textit{ad hoc} changes. +% +% \begin{macrocode} \AtBeginDocument{% \@ifpackageloaded{multicol}% {\toks@\expandafter{\multi@column@out}% \edef\multi@column@out{\bodydir\pagedir\the\toks@}}% - {}} + {}% + \@ifpackageloaded{paracol}% + {\edef\pcol@output{% + \bodydir\pagedir\unexpanded\expandafter{\pcol@output}}}% + {}}% \fi \ifx\bbl@opt@layout\@nnil\endinput\fi % if no layout % \end{macrocode} @@ -15684,9 +15706,12 @@ end % % \begin{macrocode} \IfBabelLayout{extras}% - {\let\bbl@OL@underline\underline - \bbl@sreplace\underline{$\@@underline}{\bbl@nextfake$\@@underline}% - \let\bbl@OL@LaTeX2e\LaTeX2e + {\bbl@ncarg\let\bbl@OL@underline{underline }% + \bbl@carg\bbl@sreplace{underline }% + {$\@@underline}{\bgroup\bbl@nextfake$\@@underline}% + \bbl@carg\bbl@sreplace{underline }% + {\m@th$}{\m@th$\egroup}% + \let\bbl@OL@LaTeXe\LaTeXe \DeclareRobustCommand{\LaTeXe}{\mbox{\m@th \if b\expandafter\@car\f@series\@nil\boldmath\fi \babelsublr{% @@ -15720,7 +15745,6 @@ end Babel.linebreaking.replacements = {} Babel.linebreaking.replacements[0] = {} -- pre Babel.linebreaking.replacements[1] = {} -- post -Babel.linebreaking.replacements[2] = {} -- post-line WIP -- Discretionaries contain strings as nodes function Babel.str_to_nodes(fn, matches, base) @@ -15872,7 +15896,6 @@ Babel.us_char = string.char(31) function Babel.hyphenate_replace(head, mode) local u = unicode.utf8 local lbkr = Babel.linebreaking.replacements[mode] - if mode == 2 then mode = 0 end -- WIP local word_head = head @@ -16203,6 +16226,35 @@ function Babel.capture_kashida(key, wt) end return 'kashida = ' .. wt end + +-- Experimental: applies prehyphenation transforms to a string (letters +-- and spaces). +function Babel.string_prehyphenation(str, locale) + local n, head, last, res + head = node.new(8, 0) -- dummy (hack just to start) + last = head + for s in string.utfvalues(str) do + if s == 20 then + n = node.new(12, 0) + else + n = node.new(29, 0) + n.char = s + end + node.set_attribute(n, Babel.attr_locale, locale) + last.next = n + last = n + end + head = Babel.hyphenate_replace(head, 0) + res = '' + for n in node.traverse(head) do + if n.id == 12 then + res = res .. ' ' + elseif n.id == 29 then + res = res .. unicode.utf8.char(n.char) + end + end + tex.print(res) +end %</transforms> % \end{macrocode} % diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins index 9aae84b337..0ecbabbcf5 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/06/26} +\def\filedate{2023/07/09} \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 Binary files differindex 1372db8c42..d6a75241db 100644 --- a/macros/latex/required/babel/base/babel.pdf +++ b/macros/latex/required/babel/base/babel.pdf diff --git a/macros/latex/required/babel/base/bbcompat.dtx b/macros/latex/required/babel/base/bbcompat.dtx index a75572297a..6aed1294ac 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/06/26 v3.90] +\ProvidesFile{bbcompat.dtx}[2023/07/09 v3.91] %</dtx> % %% File 'bbcompat.dtx' |