diff options
Diffstat (limited to 'Master/texmf-dist')
16 files changed, 271 insertions, 142 deletions
diff --git a/Master/texmf-dist/doc/latex/babel/README.md b/Master/texmf-dist/doc/latex/babel/README.md index afbc13b9630..b724c564c78 100644 --- a/Master/texmf-dist/doc/latex/babel/README.md +++ b/Master/texmf-dist/doc/latex/babel/README.md @@ -1,20 +1,31 @@ -## Babel 24.13 +## Babel 24.14 -2024-11-08 +2024-11-30 -`babel` is the multilingual framework to localize documents in -LaTeX, LuaLaTeX, XeLaTeX. It manages culturally-determined -typographical (and other) rules for about 170 to 300 languages, -depending on the engine, with several levels of coverage. A few +`Babel` is the multilingual framework to localize documents. It fully +supports LaTeX and the Unicode engines LuaLaTeX and XeLaTeX. A few languages even work with Plain formats. +Its aim is to provide a localization framework for different languages, +scripts, and cultures based on the latest advances in Unicode +(including the CLDR, Common Language Repository Data), the W3C (where +applicable) and other technologies, as well as on international +standards. + +Babel supports approximately from 170 to 300 languages, depending on +the engine (with various levels of coverage), across about 45 scripts, +including complex and RTL ones. Its high-level interface with +`fontscpec` allows for seamless integration with OpenType technologies +in LuaLaTeX and XeLaTeX, enabling the use of advanced typographic +features. + The latest stable version is available on <https://ctan.org/pkg/babel>. -Changes in version 24.13 are described in: +Changes in version 24.14 are described in: -https://latex3.github.io/babel/news/whats-new-in-babel-24.13.html +https://latex3.github.io/babel/news/whats-new-in-babel-24.14.html -Apart from the manual, you can find information on some aspects of babel at: +Apart from the manual, you can find information and examples in: https://latex3.github.io/babel/ @@ -43,18 +54,19 @@ You may also report them to the current maintainer more informally on: https://latex3.github.io/babel/contact.html -Bugs related to specific languages are best reported to theirs +Bugs related to specific languages are best reported to their respective authors. ### Summary of latest changes ``` -24.13 2024-11-08 - * French: Added ‘transform values’ for punctuation.space. - * Pashto: Persian and Islamic calendar (which fixes an error, - too). - * Fixes: - - Uyghur hyphenation mechanism stopped working. - - The Hebrew calendar converter raised an error. +24.14 2024-11-30 + * Now Harfbuzz is the default renderer with \babelfont in many + (but not all) scripts (lua). + * Now lazy locale loading sets 'import'. + * Improvements in French (thanks to Daniel Flipo) and Japanese + ini locale files (lua). + * Fix issue with axis (tikz) in RTL (lua, #318). Thanks to Salim + Bou. ``` ### Previous changes diff --git a/Master/texmf-dist/doc/latex/babel/babel-code.pdf b/Master/texmf-dist/doc/latex/babel/babel-code.pdf Binary files differindex d5e651bde5a..04be6856241 100644 --- a/Master/texmf-dist/doc/latex/babel/babel-code.pdf +++ b/Master/texmf-dist/doc/latex/babel/babel-code.pdf diff --git a/Master/texmf-dist/doc/latex/babel/babel.pdf b/Master/texmf-dist/doc/latex/babel/babel.pdf Binary files differindex 3d13d2f2a2a..2ae78422398 100644 --- a/Master/texmf-dist/doc/latex/babel/babel.pdf +++ b/Master/texmf-dist/doc/latex/babel/babel.pdf diff --git a/Master/texmf-dist/source/latex/babel/babel.dtx b/Master/texmf-dist/source/latex/babel/babel.dtx index 08e61332a73..b64326162b9 100644 --- a/Master/texmf-dist/source/latex/babel/babel.dtx +++ b/Master/texmf-dist/source/latex/babel/babel.dtx @@ -37,7 +37,7 @@ lang = en-001, } \ProvidesFile{babel.dtx}% - [2024/11/08 v24.13 + [2024/11/30 v24.14 The multilingual framework for pdfLaTeX, LuaLaTeX and XeLaTeX] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} @@ -323,8 +323,8 @@ Xe\largetex \begin{description} \item[\sffamily\color{messages}What is this document about?] This user guide focuses on internationalization and localization with \LaTeX{} -and \pdftex, \luatex{} and \xetex{} with the \babel{} package. There -are also some notes on its use with e-Plain and pdf-Plain \TeX. +and \pdftex, \luatex{} and \xetex{}. There are also some notes on its +use with e-Plain and pdf-Plain \TeX. \item[\sffamily\color{messages}I only need learn the most basic features.] The first subsections (1.1-1.6) describe the ways @@ -388,12 +388,17 @@ Basically, what you need is typically: \begin{itemize} \bfseries \item Tell \babel{} which language or languages are required. -\item With non-Latin scripts and Unicode engines (\luatex is the +\item With non-Latin scripts and Unicode engines (\luatex{} is the preferred one), select a suitable font (sec.~\ref{fonts}) \item In multilingual documents, switch the language in the text body (sec.~\ref{selectors}). \end{itemize} +You can find basic info and minimal \luatex{} example files for about +300 locales in the +\href{https://latex3.github.io/babel/guides/index-locale.html}{GitHub +repository}. + \subsection{Monolingual documents: the ‘classical’ way} In most cases, a single language is required, and then all you need in @@ -591,7 +596,8 @@ option |provide=*| (in monolingual documents). Although Georgian has its own \texttt{ldf} file, here is how to declare this language in Unicode engines. Here, as in a previous example, we resort to |\babelfont| to set the font for this language - (with the |Harfbuzz| renderer). + (with the |Harfbuzz| renderer, just to show how to set it, because + here the |Node| renderer should be fine). \setengine{luatex/xetex} \begin{verbatim} \documentclass{book} @@ -797,8 +803,9 @@ Vietnamese: \prefacename, \alsoname, \today. If lazy loading is not enough for your purposes, you can still tell which languages should be loaded as either class or package options. -However, there are three options to set which method you want, which -cover the most typical cases: +You can combine the ‘classical’ and the ‘modern’ ways with three +options to set which method you want, which cover the most typical +cases: \begin{itemize} \item |provide=*| is the option explained above for monolingual documents. If there are more languages, it applies only to the main @@ -806,8 +813,10 @@ cover the most typical cases: \item |provide+=*| loads the main language in the ‘classical’ way, and the rest in the ‘modern’ one. \item |provide*=*| is the same for all languages, ie, main and - secondary ones are loaded in the ‘modern’ way. + secondary ones are all loaded in the ‘modern’ way. \end{itemize} +More complex combinations can be handled with |\babelprovide|, +explained below. \begin{example} Your document is written in Thai with large chunks in Dutch and German, @@ -816,14 +825,26 @@ need their shorthands. The font is Norasi, which covers the three languages: \setengine{luatex/xetex} \begin{verbatim} -\usepackage[dutch,ngerman,thai,provide=*]{babel} +\usepackage[dutch,ngerman,thai,_provide=*_]{babel} \babelfont{rm}{Norasi} \end{verbatim} +This will load |dutch| and |ngerman| in the classical |ldf| mode, but +|thai| in the modern |ini| mode. Other options are: +\begin{verbatim} + \usepackage[dutch,ngerman,thai]{babel} +\end{verbatim} +which will use the classical mode for in languages (as decribed in the +previous section, but note |thai.ldf| is not supported in Unicode +engines), and: +\begin{verbatim} + \usepackage[dutch,german,thai,_provide*=*_]{babel} +\end{verbatim} +which will use the modern mode in all languages (note the correct name +here is |german|. (The option +|\usepackage||[dutch,ngerman,thai,provide+=*]||{babel}| doesn’t make +much sense in this case.) \end{example} -More complex combinations can be handled with |\babelprovide|, -explained below. - \subsection{Languages supported by \babel{} in the ‘classical’ mode} (To be updated.) In the following table most of the languages supported @@ -1019,6 +1040,10 @@ files, with |\babelprovide| (or |provide=|). With these languages, |\babelprovide| with a valueless |import|, which will load the |ini| file with the tag given in parenthesis. +Following the current common practice (for example, the Unicode CLDR), +all locales are organized in a flat structure. This eases their +identification and customization. + Many locale are quite usable, provided captions and dates are not required (which is a very frequent case, particularly in ancient languages). So, they are included in the default \babel{} distribution. @@ -1599,16 +1624,6 @@ There is no need to load \textsf{fontspec} explicitly – \babel{} does it for you with the first |\babelfont|. (See also the package \textsf{combofont} for a complementary approach.) -\begin{note} - There is a list of fonts in - \href{https://latex3.github.io/babel/guides/which-method-for-which-language.html}{Which - method for which language}. If you know the codepoint of a character - in the script you need, you can find fonts containing it with the - commands line, with \textsf{albatross} (requires Java) or with - something like \texttt{fc-list :charset=1033C family} (in this case, - a Gothic character, the script required by the |gothic| language). -\end{note} - \Describe\babelfont{\oarg{language-list}\marg{font-family}% \oarg{font-options}\marg{font-name}} @@ -1646,6 +1661,43 @@ but you may add further key/value pairs if necessary. write its name instead of |rm|, |sf| or |tt|. This is the preferred way to select fonts in addition to the three basic families. +\New{24.14} With \luatex, \Babel\ selects the renderer in the following +way: +\begin{itemize} +\item The default renderer in alphabetic scripts, so that the tools + provided by \textsf{luaotfload} for ligatures, kerning and the like, + which are essential typographical features in these scripts, are + directly available: Armenian, Coptic, Cyrillic, Georgian, Glagolitic, + Gothic, Greek, Latin, Old Church Slavonic Cyrillic. +\item Harfbuzz in the rest of scripts, particularly complex scripts with + heavy contextual analysis (like Arabic and Devanagari). +\end{itemize} +You can still select a different renderer with the \textsf{fontspec} +key |Renderer|. Note also the same font can be loaded with different +renderers. See +\href{https://github.com/latex3/luaotfload/wiki/Comparing-the-modes}{Comparing +the modes} for further info. + +\begin{note} + There is a list of fonts in + \href{https://latex3.github.io/babel/guides/which-method-for-which-language.html}{Which + method for which language}. If you know the codepoint of a character + in the script you need, you can find fonts containing it with + \textsf{albatross} (requires Java) or with something like + \texttt{fc-list :charset=1033C family} in the commands line (in this + case, a Gothic character, the script required by the |gothic| + language). +\end{note} + +\begin{note} + As \babel{} sets the font language system, the following setup is + redundant, so avoid it and use only the first line: +\begin{verbatim} +\babelfont{rm}{DejaVu Serif} +\babelfont[armenian]{rm}[Script=Armenian, Language=Armenian]{DejaVu Serif} +\end{verbatim} +\end{note} + \begin{example} Usage in most cases is very simple. Let us assume you are setting up a document in Swedish, with some words in Hebrew, with a font suited @@ -1695,9 +1747,9 @@ at once with the following single line: \begin{verbatim} \babelfont[_*cyrillic, *greek_]{rm}{NewComputerModern10} \end{verbatim} -With some scripts, the \textsf{Harfbuzz} renderer is preferred: +And if you need, say, Arabic and Devanagari: \begin{verbatim} - \babelfont[_*arabic, *devanagari_]{rm}[_Renderer=Harfbuzz_]{FreeSerif} + \babelfont[_*arabic, *devanagari_]{rm}{FreeSerif} \end{verbatim} \Babel{} does the rest for you, including setting the font script \textit{and} language. @@ -1730,11 +1782,11 @@ With some scripts, the \textsf{Harfbuzz} renderer is preferred: \setengine{luatex/xetex} \begin{verbatim} \usepackage{fontspec} -\newfontscript{Devanagari}{deva} +\newfontscript{Devanagari}{dev2} \babelfont[hindi]{rm}{Shobhika} \end{verbatim} This makes sure the OpenType script for Devanagari is |deva| and not - |dev2|, in case it is not detected correctly. + |dev2|, in case you need it. \end{note} \begin{note} @@ -1975,7 +2027,7 @@ of locales and fonts is lazy, which greatly simplifies the preamble. _\usepackage[english]{babel}_ -_\babelfont[*devanagari]{rm}[Renderer=Harfbuzz]{FreeSans}_ +_\babelfont[*devanagari]{rm}{FreeSans}_ \newenvironment{excerpt}[1] {\begin{quote}_\begin{otherlanguage*}{#1}_} @@ -2178,7 +2230,7 @@ The available fields are: \item[|name.english|] as provided by the Unicode CLDR. \item[|tag.ini|] is the tag of the |ini| file (the way this file is identified in its name). -\item[|tag.bcp47|] is the full BCP 47 tag (see the warning below). This +\item[|tag.bcp47|] is the full BCP 47 tag. This is the value to be used for the ‘real' provided tag (\babel{} may fill other fields if they are considered necessary). \item[|language.tag.bcp47|] is the BCP 47 language tag. @@ -2454,47 +2506,16 @@ lack of suitability of some features. corresponding behavior is not always implemented. Also, there are some limitations in the engines. A few remarks follow (which could no longer be valid when you read this manual, if the packages involved - have been updated). The Harfbuzz renderer still has some issues, so - as a rule of thumb: -\begin{itemize} -\item prefer the default renderer in alphabetic scripts (like Latin, - Greek and Cyrillic); -\item resort to Harfbuzz in complex scripts with heavy contextual - analysis (like Arabic and Devanagari). -\end{itemize} - See - \href{https://github.com/latex3/luaotfload/wiki/Comparing-the-modes}{Comparing - the modes} for further info. Fortunately, fonts can be loaded twice - with different renderers; for example: -\begin{verbatim} -\babelfont[spanish]{rm}{FreeSerif} -\babelfont[hindi]{rm}[Renderer=Harfbuzz]{FreeSerif} -\end{verbatim} + have been updated). \begin{description} \itemsep=-\parskip -\item[Arabic] Monolingual documents mostly work in \luatex, but it must - be fine tuned, particularly math and graphical elements like - |picture|. In \xetex{} \babel{} resorts to the \textsf{bidi} package, - which seems to work. -\item[Hebrew] Niqqud marks seem to work in both engines, but depending - on the font cantillation marks might be misplaced (\xetex{} or - \luatex{} with Harfbuzz seems better). -\item[Devanagari] In \luatex{} and the default renderer many fonts -work, but some others do not, the main issue being the ‘ra’. You may -need to set explicitly the script to either |deva| or |dev2|, eg: -\begin{verbatim} -\newfontscript{Devanagari}{deva} -\end{verbatim} - Other Indic scripts are still under development in the default - \luatex{} renderer, but should work with |Renderer=Harfbuzz|. They - also work with \xetex{}, although unlike with \luatex{} fine tuning - the font behavior is not always possible. +\item[Arabic] Math and graphical elements like |picture| are complex + and requires some additional fine tuning. In \xetex{} \babel{} + resorts to the \textsf{bidi} package, which seems to work. \item[Southeast scripts] Thai works in both \luatex{} and \xetex{}, but line breaking differs (rules are hard-coded in \xetex, but they can be modified in \luatex). Lao seems to work, too, but there are no - patterns for the latter in \luatex{}. Khemer clusters are rendered - wrongly with the default renderer. The comment about Indic scripts - and \textsf{lualatex} also applies here. Some quick patterns can + patterns for the latter in \luatex{}. Some quick patterns can help, with something similar to: \begin{verbatim} \babelprovide[import, hyphenrules=+]{lao} @@ -2513,12 +2534,12 @@ need to set explicitly the script to either |deva| or |dev2|, eg: \usepackage{babel} \end{verbatim} \item[Latin, Greek, Cyrillic] Combining chars with the default - \luatex{} font renderer might be wrong; on then other hand, with the - Harfbuzz renderer diacritics are stacked correctly, but many - hyphenations points are discarded (this bug is related to kerning, - so it depends on the font). With \xetex{} both combining characters - and hyphenation work as expected (not quite, but in most cases it - works; the problem here are font clusters). + \luatex{} font renderer might be wrong in some cases; on the other + hand, with the Harfbuzz renderer diacritics are stacked correctly, + but many hyphenations points are discarded (this bug is related to + kerning, so it depends on the font). With \xetex{} both combining + characters and hyphenation work as expected (not quite, but in most + cases it works; the problem here are font clusters). \end{description} \end{note} @@ -2571,8 +2592,7 @@ Here is a minimal example: \usepackage[danish]{babel} _\babeladjust{_ -_ autoload.bcp47 = on,_ -_ autoload.bcp47.options = import_ +_ autoload.bcp47 = on_ _}_ \begin{document} @@ -2598,9 +2618,9 @@ The behavior is adjusted with |\babeladjust| with the following parameters: \begin{description} \item \texttt{autoload.bcp47} with values |on| and |off|. \item \texttt{autoload.bcp47.options}, which are passed to - |\babelprovide|; empty by default, but you may add \texttt{import} - (features defined in the corresponding |babel-...tex| file might not - be available). + |\babelprovide|; \New{24.14} |import| by default (features defined in + the corresponding |babel-...tex| file might not be available), but + you can set it to another value (even empty). \item \texttt{autoload.bcp47.prefix}. Although the public name used in selectors is the tag, the internal name will be different and generated by prepending a prefix, which by default is @@ -2646,11 +2666,28 @@ stylistic choice, is: \begin{verbatim} \setlocalecaption{english}{contents}{Table of Contents} \end{verbatim} -This works not only with existing caption names, because it also serves to -define new ones by setting the \textit{caption-name} to the name of +This works not only with existing caption names, because it also serves +to define new ones by setting the \textit{caption-name} to the name of your choice (|name| will be postpended). Captions so defined or redefined behave with the ‘new way’ described in the following note. +Note the string should not contain a language selector or changes in +the text direction, which is done by \babel{} when necessary. With +|arabic|, all you need is: +\begingroup +% If you are looking at the code to see how it has been written, you +% will be disappointed :-). The following example is built ad hoc to +% emulate the final result to avoid dependencies, and therefore it's +% not "real" code. +\setmonofont[Scale=.86, FakeStretch=.97,Script=Arabic]{DejaVu Sans Mono} +\catcode`@=13 +\def@#1{\ifcase#1\relax \egroup \or \bgroup\textdir TLT \else +\bgroup\textdir TRT \pardir TRT \fi} +\begin{verbatim} +\setlocalecaption{arabic}{part}{@2القسم@0} +\end{verbatim} +\endgroup + \begin{note} There are a few alternative methods: \begin{itemize} @@ -2680,7 +2717,7 @@ many languages but discouraged in general, is the following: \begin{verbatim} \renewcommand\spanishchaptername{Foo} \end{verbatim} -This redefinition is immediate. +This redefinition is immediate. \end{itemize} \end{note} @@ -2849,6 +2886,7 @@ You can define new counters freely, and assign them to |\alph|: \babelprovide[ counters/acute = á é í ó ú, % Define a counter named `acute` alph = acute % Assign it to \alph + alph = acute % Assign it to \alph ]{english} \end{verbatim} You can choose the name, and instead of `alphabetic` it can be another one. @@ -3069,7 +3107,7 @@ set to 2 and 3. In either case, caption, date and language system are not defined. If no |ini| file is imported with |import|, \m{language-name} is still -relevant because in such a case the hyphenation and like breaking rules +relevant because in such a case the hyphenation and breaking rules (including those for South East Asian and CJK) are based on it as provided in the |ini| file corresponding to that name; the same applies to OpenType language and script. @@ -3905,7 +3943,7 @@ For example: \usepackage[telugu, provide=*]{babel} % Or also, if you want, with: % provide={ maparabic } -\babelfont{rm}{Gautami} % With luatex, better with Harfbuzz +\babelfont{rm}{Gautami} \begin{document} _\telugudigits{1234}_ _\telugucounter{section}_ @@ -5156,10 +5194,10 @@ For old and deprecated functions, see the \babel{} site. \textbf{Options for locales loaded on the fly} \New{3.51} |\babeladjust{ autoload.options = ... }| sets the options -when a language is loaded on the fly (by default, no options). A -typical value would be |import|, which defines captions, date, -numerals, etc., but ignores the code in the |tex| file (for example, -extended numerals in Greek). +when a language is loaded on the fly. \New{24.14} By default, it is +|import|, which defines captions, date, numerals, etc., but ignores the +code in the |tex| file (for example, extended numerals in Greek). It +can be set to empty. \medskip \textbf{Labels} @@ -5971,8 +6009,8 @@ wouldn’t exist. % \section{Tools} % % \begin{macrocode} -%<<version=24.13>> -%<<date=2024/11/08>> +%<<version=24.14>> +%<<date=2024/11/30>> % \end{macrocode} % % \textbf{Do not use the following macros in \texttt{ldf} files. They @@ -6567,12 +6605,9 @@ wouldn’t exist. \DeclareOption{silent}{} \DeclareOption{shorthands=off}{\bbl@tempa shorthands=\bbl@tempa} \chardef\bbl@iniflag\z@ -\DeclareOption{provide=*}{\chardef\bbl@iniflag\@ne} % main -> +1 +\DeclareOption{provide=*}{\chardef\bbl@iniflag\@ne} % main = 1 \DeclareOption{provide+=*}{\chardef\bbl@iniflag\tw@} % second = 2 \DeclareOption{provide*=*}{\chardef\bbl@iniflag\thr@@} % second + main -% A separate option -\let\bbl@autoload@options\@empty -\DeclareOption{provide@=*}{\def\bbl@autoload@options{import}} % Don't use. Experimental. TODO. \newif\ifbbl@single \DeclareOption{selectors=off}{\bbl@singletrue} @@ -11676,6 +11711,7 @@ wouldn’t exist. % \begin{macrocode} \newif\ifbbl@bcpallowed \bbl@bcpallowedfalse +\def\bbl@autoload@options{import} \def\bbl@provide@locale{% \ifx\babelprovide\@undefined \bbl@error{base-on-the-fly}{}{}{}% @@ -11815,7 +11851,7 @@ wouldn’t exist. \def\bbl@bcp@prefix{bcp47-} \@namedef{bbl@ADJ@autoload.options}#1{% \def\bbl@autoload@options{#1}} -\let\bbl@autoload@bcpoptions\@empty +\def\bbl@autoload@bcpoptions{import} \@namedef{bbl@ADJ@autoload.bcp47.options}#1{% \def\bbl@autoload@bcpoptions{#1}} \newif\ifbbl@bcptoname @@ -13821,8 +13857,12 @@ wouldn’t exist. \\\bbl@ifsamestring{\f@series}{\bfdefault}{\\\bfseries}{}% \let\\\bbl@tempa\relax}% {}}} -% TODO - next should be global?, but even local does its job. I'm -% still not sure -- must investigate: +% \end{macrocode} +% +% Loaded locally, which does its job, but very must be global. The +% problem is how. +% +% \begin{macrocode} \def\bbl@fontspec@set#1#2#3#4{% eg \bbl@rmdflt@lang fnt-opt fnt-nme \xxfamily \let\bbl@tempe\bbl@mapselect \edef\bbl@tempb{\bbl@stripslash#4/}% Catcodes hack (better pass it). @@ -13830,6 +13870,7 @@ wouldn’t exist. \let\bbl@mapselect\relax \let\bbl@temp@fam#4% eg, '\rmfamily', to be restored below \let#4\@empty % Make sure \renewfontfamily is valid + \bbl@set@renderer \bbl@exp{% \let\\\bbl@temp@pfam\<\bbl@stripslash#4\space>% eg, '\rmfamily ' \<keys_if_exist:nnF>{fontspec-opentype}{Script/\bbl@cl{sname}}% @@ -13840,6 +13881,7 @@ wouldn’t exist. [\bbl@cl{lsys},% xetex removes unknown features :-( \ifcase\bbl@engine\or RawFeature={family=\bbl@tempb},\fi #2]}{#3}% ie \bbl@exp{..}{#3} + \bbl@unset@renderer \begingroup #4% \xdef#1{\f@family}% eg, \bbl@rmdflt@lang{FreeSerif(0)} @@ -13859,9 +13901,9 @@ wouldn’t exist. \let\bbl@mapselect\bbl@tempe}% % \end{macrocode} % -% font@rst and famrst are only used when there is no global settings, -% to save and restore de previous families. Not really necessary, but -% done for optimization. +% |font@rst| and |famrst| are only used when there are no global +% settings, to save and restore de previous families. Not really +% necessary, but done for optimization. % % \begin{macrocode} \def\bbl@font@rst#1#2#3#4{% @@ -14003,6 +14045,8 @@ wouldn’t exist. \fi}% \fi} \ifx\DisableBabelHook\@undefined\endinput\fi %%%% TODO: why +\let\bbl@set@renderer\relax +\let\bbl@unset@renderer\relax <@Font selection@> \def\bbl@provide@extra#1{} % \end{macrocode} @@ -15270,7 +15314,33 @@ end % % \subsection{Common stuff} % -% \begin{macrocode} +% First, a couple of auxiliary macros to set the renderer according +% to the script. This is done by patching temporarily the low-level +% \textsf{fontspec} macro containing the current features set with +% |\defaultfontfeatures|. Admittedly this is somewhat dangerous, but +% that way the latter command still works as expected, because the +% renderer is set just before other settings. In \xetex\ they are set +% to |\relax|. +% +% \begin{macrocode} +\def\bbl@scr@node@list{% + ,Armenian,Coptic,Cyrillic,Georgian,,Glagolitic,Gothic,% + ,Greek,Latin,Old Church Slavonic Cyrillic,} +\ifnum\bbl@bidimode=102 % bidi-r + \bbl@add\bbl@scr@node@list{Arabic,Hebrew,Syriac} +\fi +\def\bbl@set@renderer{% + \bbl@xin@{\bbl@cl{sname}}{\bbl@scr@node@list}% + \ifin@ + \let\bbl@unset@renderer\relax + \else + \bbl@exp{% + \def\\\bbl@unset@renderer{% + \def\<g__fontspec_default_fontopts_clist>{% + \[g__fontspec_default_fontopts_clist]}}% + \def\<g__fontspec_default_fontopts_clist>{% + Renderer=Harfbuzz,\[g__fontspec_default_fontopts_clist]}}% + \fi} <@Font selection@> % \end{macrocode} % @@ -15533,6 +15603,16 @@ end 'spacefactor = {' .. '%2, %3, %4' .. '}') rep = rep:gsub('(kashida)%s*=%s*([^%s,]*)', Babel.capture_kashida) &% Transform values + rep, n = rep:gsub( '{([%a%-%.]+)|([%a%_%.]+)}', + function(v,d) + return string.format ( + '{\the\csname bbl@id@@#3\endcsname,"%s",%s}', + v, + load( 'return Babel.locale_props'.. + '[\the\csname bbl@id@@#3\endcsname].' .. d)() ) + end ) + texio.write( '+++++' ) + texio.write( _VERSION ) rep, n = rep:gsub( '{([%a%-%.]+)|([%-%d%.]+)}', '{\the\csname bbl@id@@#3\endcsname,"%1",%2}') end @@ -16412,6 +16492,7 @@ end \AddToHook{env/tikzpicture/begin}{\bbl@pictsetdir\tw@}% \bbl@add\tikz@atbegin@node{\bbl@pictresetdir}% \bbl@sreplace\tikz{\begingroup}{\begingroup\bbl@pictsetdir\tw@}% + \bbl@sreplace\tikzpicture{\begingroup}{\begingroup\bbl@pictsetdir\tw@}% \fi \ifx\tcolorbox\@undefined\else \def\tcb@drawing@env@begin{% diff --git a/Master/texmf-dist/source/latex/babel/babel.ins b/Master/texmf-dist/source/latex/babel/babel.ins index a268eb31949..2b1653a5ba1 100644 --- a/Master/texmf-dist/source/latex/babel/babel.ins +++ b/Master/texmf-dist/source/latex/babel/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{2024/11/08} +\def\filedate{2024/11/30} \def\batchfile{babel.ins} \input docstrip.tex diff --git a/Master/texmf-dist/source/latex/babel/bbcompat.dtx b/Master/texmf-dist/source/latex/babel/bbcompat.dtx index 3fe6559437d..5ef97f1162b 100644 --- a/Master/texmf-dist/source/latex/babel/bbcompat.dtx +++ b/Master/texmf-dist/source/latex/babel/bbcompat.dtx @@ -30,7 +30,7 @@ % % \iffalse %<*dtx> -\ProvidesFile{bbcompat.dtx}[2024/11/08 v24.] +\ProvidesFile{bbcompat.dtx}[2024/11/30 v24.] %</dtx> % %% File 'bbcompat.dtx' diff --git a/Master/texmf-dist/source/latex/babel/locale.zip b/Master/texmf-dist/source/latex/babel/locale.zip Binary files differindex ab84ebdd6e9..6766019b1c1 100644 --- a/Master/texmf-dist/source/latex/babel/locale.zip +++ b/Master/texmf-dist/source/latex/babel/locale.zip diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index bef836d3966..04d0bc4372d 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.def +++ b/Master/texmf-dist/tex/generic/babel/babel.def @@ -39,7 +39,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{babel.def}[2024/11/08 v24.13 Babel common definitions] +\ProvidesFile{babel.def}[2024/11/30 v24.14 Babel common definitions] \ifx\AtBeginDocument\@undefined \def\@empty{} \def\loadlocalcfg#1{% @@ -595,8 +595,8 @@ \toks@\expandafter{\bbl@tempc#3}% \expandafter\edef\csname extras\languagename\endcsname{\the\toks@}% \fi} -\def\bbl@version{24.13} -\def\bbl@date{2024/11/08} +\def\bbl@version{24.14} +\def\bbl@date{2024/11/30} \ifx\language\@undefined \csname newcount\endcsname\language \fi diff --git a/Master/texmf-dist/tex/generic/babel/babel.sty b/Master/texmf-dist/tex/generic/babel/babel.sty index c30933da249..8cb741d94ff 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.sty +++ b/Master/texmf-dist/tex/generic/babel/babel.sty @@ -34,7 +34,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{babel}% - [2024/11/08 v24.13 + [2024/11/30 v24.14 The multilingual framework for pdfLaTeX, LuaLaTeX and XeLaTeX] \@ifpackagewith{babel}{debug} {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}% @@ -346,11 +346,9 @@ \DeclareOption{silent}{} \DeclareOption{shorthands=off}{\bbl@tempa shorthands=\bbl@tempa} \chardef\bbl@iniflag\z@ -\DeclareOption{provide=*}{\chardef\bbl@iniflag\@ne} % main -> +1 +\DeclareOption{provide=*}{\chardef\bbl@iniflag\@ne} % main = 1 \DeclareOption{provide+=*}{\chardef\bbl@iniflag\tw@} % second = 2 \DeclareOption{provide*=*}{\chardef\bbl@iniflag\thr@@} % second + main -\let\bbl@autoload@options\@empty -\DeclareOption{provide@=*}{\def\bbl@autoload@options{import}} \newif\ifbbl@single \DeclareOption{selectors=off}{\bbl@singletrue} \DeclareOption{math=active}{} @@ -468,8 +466,8 @@ \expandafter\@secondoftwo \fi} \fi -\def\bbl@version{24.13} -\def\bbl@date{2024/11/08} +\def\bbl@version{24.14} +\def\bbl@date{2024/11/30} \ifx\language\@undefined \csname newcount\endcsname\language \fi @@ -3373,6 +3371,7 @@ \typeout{*******}} \newif\ifbbl@bcpallowed \bbl@bcpallowedfalse +\def\bbl@autoload@options{import} \def\bbl@provide@locale{% \ifx\babelprovide\@undefined \bbl@error{base-on-the-fly}{}{}{}% @@ -3487,7 +3486,7 @@ \def\bbl@bcp@prefix{bcp47-} \@namedef{bbl@ADJ@autoload.options}#1{% \def\bbl@autoload@options{#1}} -\let\bbl@autoload@bcpoptions\@empty +\def\bbl@autoload@bcpoptions{import} \@namedef{bbl@ADJ@autoload.bcp47.options}#1{% \def\bbl@autoload@bcpoptions{#1}} \newif\ifbbl@bcptoname diff --git a/Master/texmf-dist/tex/generic/babel/hyphen.cfg b/Master/texmf-dist/tex/generic/babel/hyphen.cfg index 116176dd1ca..edf6cd1f5c6 100644 --- a/Master/texmf-dist/tex/generic/babel/hyphen.cfg +++ b/Master/texmf-dist/tex/generic/babel/hyphen.cfg @@ -37,10 +37,10 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{hyphen.cfg}[2024/11/08 v24.13 Babel hyphens] +\ProvidesFile{hyphen.cfg}[2024/11/30 v24.14 Babel hyphens] \xdef\bbl@format{\jobname} -\def\bbl@version{24.13} -\def\bbl@date{2024/11/08} +\def\bbl@version{24.14} +\def\bbl@date{2024/11/30} \ifx\AtBeginDocument\@undefined \def\@empty{} \fi diff --git a/Master/texmf-dist/tex/generic/babel/locale/fr/babel-fr-BE.ini b/Master/texmf-dist/tex/generic/babel/locale/fr/babel-fr-BE.ini index 0ccd73e6dc1..94254e5452c 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/fr/babel-fr-BE.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/fr/babel-fr-BE.ini @@ -9,8 +9,8 @@ [identification] charset = utf8 -version = 1.1 -date = 2024-11-05 +version = 1.2 +date = 2024-11-29 name.local = français name.english = French name.babel = french-belgium french-be @@ -188,11 +188,11 @@ superscriptingExponent = × date.day = 1\textsuperscript{er} 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 [transforms.prehyphenation] -punctuation.space.1.0 = { [^|{(}{[}{007B}] () [;!{?}] () } +punctuation.space.1.0 = { [^|{(}{[}{007B}!{?}] () [;!{?}] () } punctuation.space.1.1 = { insert, penalty = 10000 } punctuation.space.1.2 = { insert, spacefactor= {high.natural|.5} {high.plus|0} {high.minus|0}, data = 1 } punctuation.space.1.3 = {} -punctuation.space.2.0 = { [^{(}{[}{007B}] () | [;!{?}] () } +punctuation.space.2.0 = { [^{(}{[}{007B}!{?}] () | [;!{?}] () } punctuation.space.2.1 = { insert, penalty = 10000 } punctuation.space.2.2 = { spacefactor= {high.natural|.5} {high.plus|0} {high.minus|0}, data = 2 } punctuation.space.2.3 = {} diff --git a/Master/texmf-dist/tex/generic/babel/locale/fr/babel-fr.ini b/Master/texmf-dist/tex/generic/babel/locale/fr/babel-fr.ini index b0aee1a8848..b3611e80e0f 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/fr/babel-fr.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/fr/babel-fr.ini @@ -9,8 +9,8 @@ [identification] charset = utf8 -version = 1.1 -date = 2024-11-05 +version = 1.2 +date = 2024-11-29 name.local = français name.english = French name.babel = french @@ -187,11 +187,11 @@ superscriptingExponent = × date.day = 1\textsuperscript{er} 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 [transforms.prehyphenation] -punctuation.space.1.0 = { [^|{(}{[}{007B}] () [;!{?}] () } +punctuation.space.1.0 = { [^|{(}{[}{007B}!{?}] () [;!{?}] () } punctuation.space.1.1 = { insert, penalty = 10000 } punctuation.space.1.2 = { insert, spacefactor= {high.natural|.5} {high.plus|0} {high.minus|0}, data = 1 } punctuation.space.1.3 = {} -punctuation.space.2.0 = { [^{(}{[}{007B}] () | [;!{?}] () } +punctuation.space.2.0 = { [^{(}{[}{007B}!{?}] () | [;!{?}] () } punctuation.space.2.1 = { insert, penalty = 10000 } punctuation.space.2.2 = { spacefactor= {high.natural|.5} {high.plus|0} {high.minus|0}, data = 2 } punctuation.space.2.3 = {} diff --git a/Master/texmf-dist/tex/generic/babel/locale/ja/babel-ja.ini b/Master/texmf-dist/tex/generic/babel/locale/ja/babel-ja.ini index eab65831399..812f7673f3b 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/ja/babel-ja.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/ja/babel-ja.ini @@ -10,8 +10,8 @@ [identification] charset = utf8 -version = 1.12 -date = 2024-08-27 +version = 1.13 +date = 2024-11-29 name.local = 日本語 name.english = Japanese name.babel = japanese @@ -200,8 +200,10 @@ fullwidth.upper.alpha = A B C D E F G H I J K L M N [transforms.prehyphenation] linebreak.strict.1.0 = { [々ぁぃぅぇぉっゃゅょゎ゛-ゞァィゥェォッャュョヮヵヶゕゖㇰ-ㇿ・-ヾ・-ゥェ-ー゙] } -linebreak.strict.1.1 = { insert, penalty = 10000, step = 1 } -linebreak.strict.1.2 = {} +linebreak.strict.1.1 = { insert, penalty = {small.penalty|10000}, step = 1 } +; Don’t rely on internal names. Definitive names to be decided. +linebreak.strict.1.2 = { insert, space = {small.natural|intraspace.b} {small.plus|intraspace.p} {small.minus|intraspace.m} } +linebreak.strict.1.3 = {} ; spacing.basic.1.0 = { [、。,.・:;!?)]}〉》」』】〕〗〙〛”〞] ()[([{〈《「『【〔〖〘〚“〝]() } spacing.basic.1.1 = { insert, kern = -.5 } diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def index c6eae45ca37..fb71f621a9c 100644 --- a/Master/texmf-dist/tex/generic/babel/luababel.def +++ b/Master/texmf-dist/tex/generic/babel/luababel.def @@ -850,6 +850,24 @@ end } \endgroup \fi\fi % ends Arabic just block: \ifnum\bbl@bidimode>100... +\def\bbl@scr@node@list{% + ,Armenian,Coptic,Cyrillic,Georgian,,Glagolitic,Gothic,% + ,Greek,Latin,Old Church Slavonic Cyrillic,} +\ifnum\bbl@bidimode=102 % bidi-r + \bbl@add\bbl@scr@node@list{Arabic,Hebrew,Syriac} +\fi +\def\bbl@set@renderer{% + \bbl@xin@{\bbl@cl{sname}}{\bbl@scr@node@list}% + \ifin@ + \let\bbl@unset@renderer\relax + \else + \bbl@exp{% + \def\\\bbl@unset@renderer{% + \def\<g__fontspec_default_fontopts_clist>{% + \[g__fontspec_default_fontopts_clist]}}% + \def\<g__fontspec_default_fontopts_clist>{% + Renderer=Harfbuzz,\[g__fontspec_default_fontopts_clist]}}% + \fi} \bbl@trace{Font handling with fontspec} \AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont} \AddBabelHook{babel-fontspec}{beforestart}{\bbl@ckeckstdfonts} @@ -985,6 +1003,7 @@ end \let\bbl@mapselect\relax \let\bbl@temp@fam#4% eg, '\rmfamily', to be restored below \let#4\@empty % Make sure \renewfontfamily is valid + \bbl@set@renderer \bbl@exp{% \let\\\bbl@temp@pfam\<\bbl@stripslash#4\space>% eg, '\rmfamily ' \<keys_if_exist:nnF>{fontspec-opentype}{Script/\bbl@cl{sname}}% @@ -995,6 +1014,7 @@ end [\bbl@cl{lsys},% xetex removes unknown features :-( \ifcase\bbl@engine\or RawFeature={family=\bbl@tempb},\fi #2]}{#3}% ie \bbl@exp{..}{#3} + \bbl@unset@renderer \begingroup #4% \xdef#1{\f@family}% eg, \bbl@rmdflt@lang{FreeSerif(0)} @@ -1227,6 +1247,16 @@ end 'spacefactor = {' .. '%2, %3, %4' .. '}') rep = rep:gsub('(kashida)%s*=%s*([^%s,]*)', Babel.capture_kashida) &% Transform values + rep, n = rep:gsub( '{([%a%-%.]+)|([%a%_%.]+)}', + function(v,d) + return string.format ( + '{\the\csname bbl@id@@#3\endcsname,"%s",%s}', + v, + load( 'return Babel.locale_props'.. + '[\the\csname bbl@id@@#3\endcsname].' .. d)() ) + end ) + texio.write( '+++++' ) + texio.write( _VERSION ) rep, n = rep:gsub( '{([%a%-%.]+)|([%-%d%.]+)}', '{\the\csname bbl@id@@#3\endcsname,"%1",%2}') end @@ -1995,6 +2025,7 @@ end \AddToHook{env/tikzpicture/begin}{\bbl@pictsetdir\tw@}% \bbl@add\tikz@atbegin@node{\bbl@pictresetdir}% \bbl@sreplace\tikz{\begingroup}{\begingroup\bbl@pictsetdir\tw@}% + \bbl@sreplace\tikzpicture{\begingroup}{\begingroup\bbl@pictsetdir\tw@}% \fi \ifx\tcolorbox\@undefined\else \def\tcb@drawing@env@begin{% diff --git a/Master/texmf-dist/tex/generic/babel/nil.ldf b/Master/texmf-dist/tex/generic/babel/nil.ldf index e6fe3d88ca6..629684d14b3 100644 --- a/Master/texmf-dist/tex/generic/babel/nil.ldf +++ b/Master/texmf-dist/tex/generic/babel/nil.ldf @@ -32,7 +32,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension |.ins|) which are part of the distribution. %% -\ProvidesLanguage{nil}[2024/11/08 v24.13 Nil language] +\ProvidesLanguage{nil}[2024/11/30 v24.14 Nil language] \LdfInit{nil}{datenil} \ifx\l@nil\@undefined \newlanguage\l@nil diff --git a/Master/texmf-dist/tex/generic/babel/xebabel.def b/Master/texmf-dist/tex/generic/babel/xebabel.def index ccb2f14b9fd..293a3744fe2 100644 --- a/Master/texmf-dist/tex/generic/babel/xebabel.def +++ b/Master/texmf-dist/tex/generic/babel/xebabel.def @@ -93,6 +93,8 @@ \fi}% \fi} \ifx\DisableBabelHook\@undefined\endinput\fi %%%% TODO: why +\let\bbl@set@renderer\relax +\let\bbl@unset@renderer\relax \bbl@trace{Font handling with fontspec} \AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont} \AddBabelHook{babel-fontspec}{beforestart}{\bbl@ckeckstdfonts} @@ -228,6 +230,7 @@ \let\bbl@mapselect\relax \let\bbl@temp@fam#4% eg, '\rmfamily', to be restored below \let#4\@empty % Make sure \renewfontfamily is valid + \bbl@set@renderer \bbl@exp{% \let\\\bbl@temp@pfam\<\bbl@stripslash#4\space>% eg, '\rmfamily ' \<keys_if_exist:nnF>{fontspec-opentype}{Script/\bbl@cl{sname}}% @@ -238,6 +241,7 @@ [\bbl@cl{lsys},% xetex removes unknown features :-( \ifcase\bbl@engine\or RawFeature={family=\bbl@tempb},\fi #2]}{#3}% ie \bbl@exp{..}{#3} + \bbl@unset@renderer \begingroup #4% \xdef#1{\f@family}% eg, \bbl@rmdflt@lang{FreeSerif(0)} |