From 721b0492f150d59f61b504ab803c7ef1a9a67a0b Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 26 Oct 2023 03:01:46 +0000 Subject: CTAN sync 202310260301 --- macros/latex/required/babel/base/README.md | 20 ++-- macros/latex/required/babel/base/babel-code.pdf | Bin 634949 -> 635805 bytes macros/latex/required/babel/base/babel.dtx | 127 ++++++++++++++++-------- macros/latex/required/babel/base/babel.ins | 2 +- macros/latex/required/babel/base/babel.pdf | Bin 408600 -> 413338 bytes macros/latex/required/babel/base/bbcompat.dtx | 2 +- 6 files changed, 95 insertions(+), 56 deletions(-) (limited to 'macros/latex/required') diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md index f264ce4cc3..3373157bb6 100644 --- a/macros/latex/required/babel/base/README.md +++ b/macros/latex/required/babel/base/README.md @@ -1,6 +1,6 @@ -## Babel 3.95 +## Babel 3.96 -2023-09-29 +2023-10-25 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 275 languages. The latest stable version is available on . -Changes in version 3.95 are described in: +Changes in version 3.96 are described in: -https://latex3.github.io/babel/news/whats-new-in-babel-3.95.html +https://latex3.github.io/babel/news/whats-new-in-babel-3.96.html Apart from the manual, you can find information on some aspects of babel at: @@ -48,12 +48,12 @@ respective authors. ### Summary of latest changes ``` -3.95 2023-09-29 - * New locales: Cebuano, Chuvash, Dogri, Northern Frisian, - Hmong Njua, Maori, Manipuri, Santali, Sindhi, Sundanese, Tajik, - Tatar, Xhosa. - * Minimum locales: Awadhi, Gothic, Saraiki. - * Fix: added some missing native numbers and character ranges. +3.96 2023-10-25 + * Added LGI to non-ASCII encodings. + * New macro: \asciiencoding. + * Removed OT1 in some ini files. + * Improved support for Odia (thanks to @avisekjena). + * Transform 'hyphen.repeat' in Croatian. ``` ### Previous changes diff --git a/macros/latex/required/babel/base/babel-code.pdf b/macros/latex/required/babel/base/babel-code.pdf index 808fc80af8..7d0d603a36 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 d59e7655aa..8346f33f4b 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/09/29 v3.95 The Babel package] +\ProvidesFile{babel.dtx}[2023/10/25 v3.96 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -82,22 +82,33 @@ \usepackage{color,colortbl} \usepackage[linkcolor=blue,urlcolor=blue,colorlinks=true]{hyperref} \hypersetup{% - pdfsubject={LaTeX Multilingual documents and localization for pdfTeX, LuaTex and - XeTeX.}, - pdfauthor={Johannes Braams, Javier Bezos}, + pdfsubject={LaTeX Multilingual documents and localization for pdfTeX, + LuaTeX and XeTeX.}, + pdfauthor={Javier Bezos, Johannes Braams}, pdftitle={Babel}, pdfkeywords={TeX, LaTeX, pdfTeX, LuaTeX, XeTeX, internationalization, - localization}} + localization}} +\ExplSyntaxOn \newcommand\New[1]{% - \colorbox[rgb]{.92, .86, .73}{New #1}\enspace\ignorespaces} -\definecolor{thered} {rgb}{0.65,0.04,0.07} -\definecolor{thegrey} {gray}{0.8} + \regex_extract_once:nnN{(\d\d?)\.(\d\d)}{#1}\bbltempa + \seq_pop_right:NN\bbltempa\bbltempb + \seq_pop_right:NN\bbltempa\bbltempa + \colorbox[rgb]{.92, .86, .73}% + {New~#1% + \quark_if_no_value:NTF\bbltempb{}% + {~\ifnum\bbltempa>2 \ifnum\bbltempb>34 + \href{https://latex3.github.io/babel/news/% + whats-new-in-babel-\bbltempa.\bbltempb.html}% + {\raisebox{.15ex}{$\oplus$}}% + \fi\fi}}\enspace\ignorespaces} +\ExplSyntaxOff +\definecolor{thered}{rgb}{0.65,0.04,0.07} +\definecolor{thegrey}{gray}{0.8} \definecolor{shadecolor}{rgb}{1,1,0.97} \definecolor{messages}{rgb}{.66,.13,.27} \makeatletter \def\@begintheorem#1#2{% \list{}{}% - % \small \global\advance\@listdepth\m@ne \item[{\sffamily\bfseries\color{messages}\hspace*{1.3em}% \MakeUppercase{#1}}]}% @@ -2618,7 +2629,7 @@ with \babel. They are the equivalent of |\DeclareUppercaseMapping| and twofold: (1) a user-friendly way to declare them, because often BCP 47 tags are not known (and sometimes can be complex); (2) if for some reason the tag changes (eg, you decide to tag -`english` as `en-001` instead of `en-US`), the new mappings will be +|english| as |en-001| instead of |en-US|), the new mappings will be still assigned to that language. \begin{example} For Classical Latin (no need to know the tag is @@ -2631,7 +2642,7 @@ still assigned to that language. \begin{note} There are still some rough edges when declaring a mapping with the |x| extension, or when two \babel{} languages share the same BCP 47 - tag. These issues will be sorted out in future releases. + tag. These issues are expected be sorted out in future releases. \end{note} \subsection{Creating a language} @@ -2932,7 +2943,8 @@ It’s still somewhat experimental. Again, there is an explanation in the {\babel\ site}. \Describe{linebreaking=}{} -\New{3.59} Just a synonymous for \texttt{justification}. +\New{3.59} Just a synonymous for \texttt{justification}. Depending on +the language, this name can make more sense. \begin{note} (1) If you need shorthands, you can define them with |\useshorthands| @@ -3261,6 +3273,12 @@ expandable, and the available fields are: \New{3.75} \end{description} +\begin{note} + Currently, |x| is used for two separate functions, namely, + identifying a \babel{} locale without a BCP47 tag and setting an + alternative set of rules for casing. +\end{note} + \begin{warning} \New{3.46} As of version 3.46 |tag.bcp47| returns the full BCP 47 tag. Formerly it returned just the language subtag, which was clearly @@ -3538,7 +3556,7 @@ devised by Yannis Haralambous for \textsf{dad} (simple and recommended way to make these transformations (the best way is with OTF features), but it can get you out of a hurry.} -\trans{Czech, Polish, Portuguese, Slovak, +\trans{Croatian, Czech, Polish, Portuguese, Slovak, Spanish}{hyphen.repeat}{Explicit hyphens behave like |\string\babelhyphen|\allowbreak|\{repeat\}|.} @@ -3859,7 +3877,7 @@ backwards compatibility.} LICR-savvy encoding in the ASCII range. It is used to redefine |\TeX| and |\LaTeX| so that they are correctly typeset even with |LGR| or |X2| (the complete list is stored in |\BabelNonASCII|, which by default -is |LGR|, |X2|, |OT2|, |OT3|, |OT6|, |LHE|, |LWN|, |LMA|, |LMC|, +is |LGR|, |LGI|, |X2|, |OT2|, |OT3|, |OT6|, |LHE|, |LWN|, |LMA|, |LMC|, |LMS|, |LMU|, but you can modify it). So, in some sense it fixes the bug described in the previous paragraph. @@ -5545,8 +5563,8 @@ wouldn’t exist. % \section{Tools} % % \begin{macrocode} -%<> -%<> +%<> +%<> % \end{macrocode} % % \textbf{Do not use the following macros in \texttt{ldf} files. They @@ -10262,9 +10280,7 @@ wouldn’t exist. % TODO - error/warning if no script \directlua{ if Babel.script_blocks['\bbl@cl{sbcp}'] then - Babel.loc_to_scr[\the\localeid] = - Babel.script_blocks['\bbl@cl{sbcp}'] - Babel.locale_props[\the\localeid].lc = \the\localeid\space + Babel.loc_to_scr[\the\localeid] = Babel.script_blocks['\bbl@cl{sbcp}'] Babel.locale_props[\the\localeid].lg = \the\@nameuse{l@\languagename}\space end }% @@ -10458,6 +10474,7 @@ wouldn’t exist. \let\BabelBeforeIni\@gobbletwo \chardef\atcatcode=\catcode`\@ \catcode`\@=11\relax + \def\CurrentOption{#2}% \bbl@input@texini{\bbl@cs{rqtex@\languagename}}% \catcode`\@=\atcatcode \let\atcatcode\relax @@ -10907,6 +10924,11 @@ wouldn’t exist. \ifbbl@bcptoname \bbl@csarg\xdef{bcp@map@\bbl@cl{tbcp}}{\languagename}% \fi + \ifcase\bbl@engine\or + \directlua{% + Babel.locale_props[\the\bbl@cs{id@@\languagename}].script + = '\bbl@cl{sbcp}'}% + \fi % Conditional \ifnum#1>\z@ % 0 = only info, 1, 2 = basic, (re)new \bbl@exportkey{calpr}{date.calendar.preferred}{}% @@ -12291,11 +12313,12 @@ wouldn’t exist. % % \begin{macrocode} \bbl@trace{Encoding and fonts} -\newcommand\BabelNonASCII{LGR,X2,OT2,OT3,OT6,LHE,LWN,LMA,LMC,LMS,LMU} +\newcommand\BabelNonASCII{LGR,LGI,X2,OT2,OT3,OT6,LHE,LWN,LMA,LMC,LMS,LMU} \newcommand\BabelNonText{TS1,T3,TS3} \let\org@TeX\TeX \let\org@LaTeX\LaTeX \let\ensureascii\@firstofone +\let\asciiencoding\@empty \AtBeginDocument{% \def\@elt#1{,#1,}% \edef\bbl@tempa{\expandafter\@gobbletwo\@fontenc@load@list}% @@ -12305,10 +12328,10 @@ wouldn’t exist. \bbl@foreach\BabelNonASCII{% LGR loaded in a non-standard way \bbl@ifunset{T@#1}{}{\def\bbl@tempb{#1}}}% \bbl@foreach\bbl@tempa{% - \bbl@xin@{#1}{\BabelNonASCII}% + \bbl@xin@{,#1,}{,\BabelNonASCII,}% \ifin@ \def\bbl@tempb{#1}% Store last non-ascii - \else\bbl@xin@{#1}{\BabelNonText}% Pass + \else\bbl@xin@{,#1,}{,\BabelNonText,}% Pass \ifin@\else \def\bbl@tempc{#1}% Store last ascii \fi @@ -12318,8 +12341,9 @@ wouldn’t exist. \ifin@\else \edef\bbl@tempc{\cf@encoding}% The default if ascii wins \fi - \edef\ensureascii#1{% - {\noexpand\fontencoding{\bbl@tempc}\noexpand\selectfont#1}}% + \let\asciiencoding\bbl@tempc + \renewcommand\ensureascii[1]{% + {\fontencoding{\asciiencoding}\selectfont#1}}% \DeclareTextCommandDefault{\TeX}{\ensureascii{\org@TeX}}% \DeclareTextCommandDefault{\LaTeX}{\ensureascii{\org@LaTeX}}% \fi} @@ -14829,15 +14853,17 @@ end % \subsection{Automatic fonts and ids switching} % % After defining the blocks for a number of scripts (must be extended -% and very likely fine tuned), we define a short function which just -% traverse the node list to carry out the replacements. The table -% |loc_to_scr| gets the locale form a script range (note the locale is -% the key, and that there is an intermediate table built on the fly for -% optimization). This locale is then used to get the |\language| and -% the |\localeid| as stored in |locale_props|, as well as the font (as -% requested). In the latter table a key starting with |/| maps the font -% from the global one (the key) to the local one (the value). Maths are -% skipped and discretionaries are handled in a special way. +% and very likely fine tuned), we define a the function +% |Babel.locale_map|, which just traverse the node list to carry out +% the replacements. The table |loc_to_scr| stores the script range for +% each locale (whose id is the key), copied from this table (so that it +% can be modified on a locale basis); there is an intermediate table +% named |chr_to_loc| built on the fly for optimization, which maps a +% char to the locale. This locale is then used to get the |\language| +% as stored in |locale_props|, as well as the font (as requested). In +% the latter table a key starting with |/| maps the font from the +% global one (the key) to the local one (the value). Maths are skipped +% and discretionaries are handled in a special way. % % \begin{macrocode} % TODO - to a lua file @@ -14919,31 +14945,44 @@ function Babel.locale_map(head) end end end + % Treat composite chars in a different fashion, because they + % 'inherit' the previous locale. + if (item.char >= 0x0300 and item.char <= 0x036F) or + (item.char >= 0x1AB0 and item.char <= 0x1AFF) or + (item.char >= 0x1DC0 and item.char <= 0x1DFF) then + Babel.chr_to_loc[item.char] = -2000 + toloc = -2000 + end + if not toloc then + Babel.chr_to_loc[item.char] = -1000 + end end - % Now, take action, but treat composite chars in a different - % fashion, because they 'inherit' the previous locale. Not yet - % optimized. - if not toloc and - (item.char >= 0x0300 and item.char <= 0x036F) or - (item.char >= 0x1AB0 and item.char <= 0x1AFF) or - (item.char >= 0x1DC0 and item.char <= 0x1DFF) then + if toloc == -2000 then toloc = toloc_save + elseif toloc == -1000 then + toloc = nil end if toloc and Babel.locale_props[toloc] and Babel.locale_props[toloc].letters and tex.getcatcode(item.char) \string~= 11 then toloc = nil end - if toloc and toloc > -1 then + if toloc and Babel.locale_props[toloc].script + and Babel.locale_props[node.get_attribute(item, LOCALE)].script + and Babel.locale_props[toloc].script == + Babel.locale_props[node.get_attribute(item, LOCALE)].script then + toloc = nil + end + if toloc then if Babel.locale_props[toloc].lg then item.lang = Babel.locale_props[toloc].lg node.set_attribute(item, LOCALE, toloc) - end + end if Babel.locale_props[toloc]['/'..item.font] then item.font = Babel.locale_props[toloc]['/'..item.font] end - toloc_save = toloc end + toloc_save = toloc elseif not inmath and item.id == 7 then % Apply recursively item.replace = item.replace and Babel.locale_map(item.replace) item.pre = item.pre and Babel.locale_map(item.pre) @@ -23648,7 +23687,7 @@ Babel.cjk_breaks = { \@namedef{bbl@esname@nil}{Latin} \@namedef{bbl@sname@nil}{Latin} \@namedef{bbl@sbcp@nil}{Latn} -\@namedef{bbl@sotf@nil}{Latn} +\@namedef{bbl@sotf@nil}{latn} % \end{macrocode} % % The macro |\ldf@finish| takes care of looking for a diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins index bd09bf9cc1..b08918afa2 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/09/29} +\def\filedate{2023/10/25} \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 90f08f4a8d..4d1628d7d1 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 676fed11bb..e534dab18f 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/09/29 v3.95] +\ProvidesFile{bbcompat.dtx}[2023/10/25 v3.96] % % %% File 'bbcompat.dtx' -- cgit v1.2.3