diff options
author | Karl Berry <karl@freefriends.org> | 2022-02-13 21:27:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-02-13 21:27:08 +0000 |
commit | 24041c1e41a3999c280f7b0139c5ab5117d71330 (patch) | |
tree | 10ee1b5e78446349c3232d09e96fdca64723c1b0 | |
parent | fd51a477ec609d23958713e57fbeffc026afdaaf (diff) |
babel (13feb22)
git-svn-id: svn://tug.org/texlive/trunk@62007 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/babel/README.md | 20 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/babel/babel.pdf | bin | 853492 -> 853443 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/babel.dtx | 389 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/babel.ins | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/bbcompat.dtx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/locale.zip | bin | 794551 -> 796174 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.def | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.sty | 54 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/hyphen.cfg | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa-Deva.ini | 102 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa.ini | 100 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/luababel.def | 207 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/nil.ldf | 2 |
13 files changed, 574 insertions, 316 deletions
diff --git a/Master/texmf-dist/doc/latex/babel/README.md b/Master/texmf-dist/doc/latex/babel/README.md index 7587c42b97f..41c7e9d0106 100644 --- a/Master/texmf-dist/doc/latex/babel/README.md +++ b/Master/texmf-dist/doc/latex/babel/README.md @@ -1,4 +1,6 @@ -## Babel 3.70 +## Babel 3.71 + +2022-02-13 This package manages culturally-determined typographical (and other) rules, and hyphenation patterns for a wide range of languages. Many @@ -8,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.70 are described in: +Changes in version 3.71 are described in: -https://latex3.github.io/babel/news/whats-new-in-babel-3.70.html +https://latex3.github.io/babel/news/whats-new-in-babel-3.71.html Apart from the manual, you can find information on some aspects of babel at: @@ -46,11 +48,13 @@ respective authors. ### Summary of Latest changes ``` -3.70 2022-01-26 - * Finnish: transform 'prehyphen.nobreak'. - * Better fixes for amsmath, as well as for the default - 'equation' and 'eqnarray' (but still not perfect). - * Fix an error with bidi=basic and some fonts for graphics. +3.71 2022-02-13 + * IAST transliteration for Sanskrit (by Maximilian Mehner). + * Fixes: + - Bad interraction between bidi option and mathtools (#166). + - 'provide+=' didn’t work with 'hebrew' as a secondary + language. + - Wrong equation direction in 'cases' and 'array' (#167). ``` ### Previous changes diff --git a/Master/texmf-dist/doc/latex/babel/babel.pdf b/Master/texmf-dist/doc/latex/babel/babel.pdf Binary files differindex 58449b95d40..f909b4d5c7d 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 a9b4ad69f9c..d5706cdaf13 100644 --- a/Master/texmf-dist/source/latex/babel/babel.dtx +++ b/Master/texmf-dist/source/latex/babel/babel.dtx @@ -32,7 +32,7 @@ % % \iffalse %<*filedriver> -\ProvidesFile{babel.dtx}[2022/01/26 v3.70 The Babel package] +\ProvidesFile{babel.dtx}[2022/02/13 v3.71 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -547,6 +547,7 @@ _\usepackage[vietnamese,danish]{babel}_ \end{note} \subsection{Mostly monolingual documents} +\label{mostlymono} \New{3.39} Very often, multilingual documents consist of a main language with small pieces of text in another languages (words, idioms, @@ -1291,6 +1292,11 @@ can take the following values: \New{3.16} Selects which layout elements are adapted in bidi documents. See sec.~\ref{bidi}. +\Describe{provide=}{\texttt{*}} +\New{3.49} An alternative to |\babelprovide| for languages passed as +options. See section~\ref{inifiles}, which describes also the variants +|provide+=| and |provide*=|. + \subsection{The \texttt{base} option} With this package option \babel{} just loads some basic macros (those @@ -1327,12 +1333,12 @@ be the same as the option name as set in |\usepackage|!). \end{verbatim} \end{example} -% \begin{note} -% With a recent version of \LaTeX, an alternative method to execute -% some code just after an |ldf| file is loaded is with |\AddToHook| and -% the hook |file/after/<language>.ldf|. \Babel{} does not predeclare -% it, and you have to do it yourself with |\NewHook| or |\ProvideHook|. -% \end{note} +\begin{note} + With a recent version of \LaTeX, an alternative method to execute + some code just after an |ldf| file is loaded is with |\AddToHook| and + the hook |file/<language>.ldf/after|. \Babel{} does not predeclare + it, and you have to do it yourself with |\ActivateGenericHook|. +\end{note} \begin{warning} Currently this option is not compatible with languages loaded on the @@ -1344,8 +1350,8 @@ be the same as the option name as set in |\usepackage|!). An alternative approach to define a language (or, more precisely, a \textit{locale}) is by means of an \texttt{ini} file. Currently -\babel{} provides about 200 of these files containing the basic data -required for a locale. +\babel{} provides about 250 of these files containing the basic data +required for a locale, plus basic templates for 500 about locales. |ini| files are not meant only for \babel, and they has been devised as a resource for other packages. To easy interoperability between \TeX{} @@ -1435,11 +1441,12 @@ Or also: \begin{description} \itemsep=-\parskip \item[Arabic] Monolingual documents mostly work in \luatex, but it must - be fine tuned, particularly graphical elements like |picture|. In \xetex{} - \babel{} resorts to the \textsf{bidi} package, which seems to work. + 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, but still problematic). + \luatex{} with Harfbuzz seems better). \item[Devanagari] In \luatex{} and the 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: @@ -1451,8 +1458,8 @@ need to set explicitly the script to either |deva| or |dev2|, eg: also work with \xetex{}, although unlike with \luatex{} fine tuning the font behavior is not always possible. \item[Southeast scripts] Thai works in both \luatex{} and \xetex{}, but - line breaking differs (rules can be modified in \luatex; they are - hard-coded in \xetex). Lao seems to work, too, but there are no + 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 @@ -1479,7 +1486,7 @@ need to set explicitly the script to either |deva| or |dev2|, eg: \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 seems related to kerning, + 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). @@ -2129,6 +2136,7 @@ zulu \textbf{Modifying and adding values to |ini| files} +\nobreak \New{3.39} There is a way to modify the values of |ini| files when they get loaded with |\babelprovide| and |import|. To set, say, |digits.native| in the |numbers| section, use something like @@ -2573,6 +2581,9 @@ Remerber there is an alternative syntax for the latter: \begin{verbatim} \usepackage[italian, polytonicgreek, provide=*]{babel} \end{verbatim} +Finally, also remember you might not need to load |italian| at all if +there are only a few word in this language (see~\ref{mostlymono}). + \end{example} \Describe{script=}{\meta{script-name}} @@ -2630,7 +2641,10 @@ CJK. \Describe{intrapenalty=}{\meta{penalty}} Sets the interword penalty for the writing system of this language. Currently used only in Southeast Asian scrips, like Thai. Ignored if 0 -(which is the default value). +(which is the default value). + +\Describe{transforms=}{\meta{transform-list}} +See section~\ref{transforms}. \Describe{justification=}{\texttt{kashida} $\string|$ \texttt{elongated} $\string|$ \texttt{unhyphenated}} @@ -2676,10 +2690,10 @@ well dates do not rely on |\arabic|.) For example: \begin{verbatim} -\babelprovide[import]{telugu} % Telugu better with XeTeX +\babelprovide[import]{telugu} % Or also, if you want: % \babelprovide[import, maparabic]{telugu} -\babelfont{rm}{Gautami} +\babelfont{rm}{Gautami} % With luatex, better with Harfbuzz \begin{document} _\telugudigits{1234}_ _\telugucounter{section}_ @@ -2827,7 +2841,7 @@ with the following command. {\marg{year}\m{month}\m{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 (currently |ar|, |ar-|*, |he|, |fa|, |hi|). 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 @@ -2853,7 +2867,7 @@ current language. If more than one language is used, it might be necessary to know which language is active at a specific time. This can be checked by a call -to |\iflanguage|, but note here ``language'' is used in the \TeX +to |\iflanguage|, but note here ``language'' is used in the \TeX{} sense, as a set of hyphenation patterns, and \textit{not} as its \textsf{babel} name. This macro takes three arguments. The first argument is the name of a language; the second and third arguments are @@ -2940,7 +2954,9 @@ identifier, which can be retrieved with |\localeid|. typically the LGC group, South East Asian, like Thai, and CJK, but support depends on the engine: \textsf{pdftex} only deals with the former, \xetex{} also with the second one (although in a limited way), -while \luatex{} provides basic rules for the latter, too. +while \luatex{} provides basic rules for the latter, too. With \luatex{} +there are also tools for non-standard hyphenation rules, explained in +the next section. \Describe{\babelhyphen}{% \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}\marg{type}} @@ -3087,6 +3103,7 @@ of the previous char in \luatex, and the font size set by the last |\selectfont| in \xetex). \subsection{Transforms} +\label{transforms} Transforms (only \luatex) provide a way to process the text on the typesetting level in several language-dependent ways, like non-standard @@ -3193,6 +3210,9 @@ Gujarati, Hindi, Kannada, Malayalam, Marathi, Oriya, Tamil, Telugu.} \trans{Latin}{letters.uv}{Replaces \textit{v}, \textit{U} with \textit{u}, \textit{V}.} +\trans{Sanskrit}{transliteration.iast}{The IAST system to +romanize Devanagari.\footnote{Thanks to Maximilian Mehner}} + \trans{Serbian}{transliteration.gajica}{(Note |serbian| with |ini| files refers to the Cyrillic script, which is here the target.) The standard system devised by Ljudevit Gaj.} @@ -3280,7 +3300,7 @@ This feature is activated with the first |\babelposthyphenation| or \babelprovide[hyphenrules=+]{russian-latin} % Create locale \babelprehyphenation{russian-latin}{([sz])h} % Create rule { - string = {1|sz|šž}, + string = _{1|sz|šž}_, remove } \end{verbatim} @@ -3449,15 +3469,16 @@ differ in the way `weak' numeric characters are ordered (eg, Arabic \begin{warning} The current code for \textbf{text} in \luatex{} should be considered - essentially stable, but, of course, it is not bug-free and there - can be improvements in the future, because setting bidi text has - many subtleties (see for example <https://www.w3.org/TR/html-bidi/>). - A basic stable version for other engines must wait. This applies to + essentially stable, but, of course, it is not bug-free and there can + be improvements in the future, because setting bidi text has many + subtleties (see for example <https://www.w3.org/TR/html-bidi/>). A + basic stable version for other engines must wait. This applies to text; there is a basic support for \textbf{graphical} elements, including the |picture| environment (with \textsf{pict2e}) and \textsf{pfg/tikz}. Also, indexes and the like are under study, as - well as math (there is progress in the latter, too, but for - example |cases| may fail). + well as math (there are progresses in the latter, including + \textsf{amsmath} and \textsf{mathtools} too, but for example + |gathered| may fail). An effort is being made to avoid incompatibilities in the future (this one of the reason currently bidi must be explicitly requested @@ -4156,7 +4177,7 @@ for a small example (|xe-bidi|). See the code section for |\foreignlanguage*| (a new starred version of |\foreignlanguage|). -For old an deprecated functions, see the wiki. +For old an deprecated functions, see the \babel{} site. \medskip \textbf{Options for locales loaded on the fly} @@ -4173,7 +4194,8 @@ extended numerals in Greek). \New{3.48} There is some work in progress for \babel{} to deal with labels, both with the relation to captions (chapters, part), and how counters are used to define them. It is still somewhat tentative -because it is far from trivial -- see the wiki for further details. +because it is far from trivial -- see the \babel{} site for further +details. \section{Loading languages with \file{language.dat}} @@ -4925,50 +4947,6 @@ is true with these two environment selectors. Its natural place of use is in hooks or in |\extras|\m{language}. -\section{Changes} - -\subsection{Changes in \babel\ version 3.9} - -Most of the changes in version 3.9 were related to bugs, either to fix -them (there were lots), or to provide some alternatives. Even new -features like |\babelhyphen| are intended to solve a certain problem -(in this case, the lacking of a uniform syntax and behavior for -shorthands across languages). These changes, as well as the subsequent -ones ($\ge$3.10), are described in this manual in the corresponding -place. A selective list of the changes in 3.9 follows: -\begin{itemize} -\item |\select@language| did not set |\languagename|. This meant the - language in force when auxiliary files were loaded was the one used - in, for example, shorthands -- if the language was |german|, a - |\select@language{spanish}| had no effect. - -\item |\foreignlanguage| and |otherlanguage*| messed up - |\extras<language>|. Scripts, encodings and many other things were - not switched correctly. - -\item The |:ENC| mechanism for hyphenation patterns used the encoding - of the \textit{previous} language, not that of the language being - selected. - -\item |'| (with |activeacute|) had the original value when writing to an - auxiliary file, and things like an infinite loop can happen. It - worked incorrectly with |^| (if activated) and also if deactivated. - -\item Active chars where not reset at the end of language options, and - that lead to incompatibilities between languages. - -\item |\textormath| raised an error with a conditional. - -\item |\aliasshorthand| didn't work (or only in a few and very specific - cases). - -\item |\l@english| was defined incorrectly (using |\let| instead of - |\chardef|). - -\item |ldf| files not bundled with babel were not recognized when - called as global options. -\end{itemize} - \DocInput{babel.dtx} \section{Acknowledgements} @@ -5122,8 +5100,8 @@ help from Bernd Raichle, for which I am grateful. % \section{Tools} % % \begin{macrocode} -%<<version=3.70>> -%<<date=2022/01/26>> +%<<version=3.71>> +%<<date=2022/02/13>> % \end{macrocode} % % \textbf{Do not use the following macros in \texttt{ldf} files. They @@ -12172,39 +12150,38 @@ help from Bernd Raichle, for which I am grateful. % the language exists. With class options, check if the option is a % language by checking if the correspondin file exists. % -% % \begin{macrocode} \bbl@foreach\bbl@language@opts{% \def\bbl@tempa{#1}% \ifx\bbl@tempa\bbl@opt@main\else - \bbl@ifunset{ds@#1}% - {\ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) - \DeclareOption{#1}{\bbl@load@language{#1}}% - \else % + * (other = ini) - \DeclareOption{#1}{% - \bbl@ldfinit - \babelprovide[import]{#1}% - \bbl@afterldf{}}% - \fi}% - {}% + \ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) + \bbl@ifunset{ds@#1}% + {\DeclareOption{#1}{\bbl@load@language{#1}}}% + {}% + \else % + * (other = ini) + \DeclareOption{#1}{% + \bbl@ldfinit + \babelprovide[import]{#1}% + \bbl@afterldf{}}% + \fi \fi} \bbl@foreach\@classoptionslist{% \def\bbl@tempa{#1}% \ifx\bbl@tempa\bbl@opt@main\else - \bbl@ifunset{ds@#1}% - {\ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) - \IfFileExists{#1.ldf}% - {\DeclareOption{#1}{\bbl@load@language{#1}}}% - {}% - \else % + * (other = ini) - \IfFileExists{babel-#1.tex}% - {\DeclareOption{#1}{% - \bbl@ldfinit - \babelprovide[import]{#1}% - \bbl@afterldf{}}}% - {}% - \fi}% - {}% + \ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) + \bbl@ifunset{ds@#1}% + {\IfFileExists{#1.ldf}% + {\DeclareOption{#1}{\bbl@load@language{#1}}}% + {}}% + {}% + \else % + * (other = ini) + \IfFileExists{babel-#1.tex}% + {\DeclareOption{#1}{% + \bbl@ldfinit + \babelprovide[import]{#1}% + \bbl@afterldf{}}}% + {}% + \fi \fi} % \end{macrocode} % @@ -13484,6 +13461,30 @@ help from Bernd Raichle, for which I am grateful. end lang.patterns(lg, pats) end + function Babel.hlist_has_bidi(head) + local has_bidi = false + for item in node.traverse(head) do + if item.id == node.id'glyph' then + local itemchar = item.char + local chardata = Babel.characters[itemchar] + local dir = chardata and chardata.d or nil + if not dir then + for nn, et in ipairs(Babel.ranges) do + if itemchar < et[1] then + break + elseif itemchar <= et[2] then + dir = et[3] + break + end + end + end + if dir and (dir == 'al' or dir == 'r') then + has_bidi = true + end + end + end + return has_bidi + end } \endgroup \ifx\newattribute\@undefined\else @@ -14462,9 +14463,11 @@ end #2 TRT\relax \fi \fi} +\def\bbl@thedir{0} \def\bbl@textdir#1{% \bbl@setluadir{text}\textdir{#1}% \chardef\bbl@thetextdir#1\relax + \edef\bbl@thedir{\the\numexpr\bbl@thepardir*3+#1}% \setattribute\bbl@attr@dir{\numexpr\bbl@thepardir*3+#1}} \def\bbl@pardir#1{% \bbl@setluadir{par}\pardir{#1}% @@ -14474,6 +14477,7 @@ end \def\bbl@dirparastext{\pardir\the\textdir\relax}% %%%% % \ifnum\bbl@bidimode>\z@ + \def\bbl@insidemath{0}% \def\bbl@mathboxdir{% \ifcase\bbl@thetextdir\relax \everyhbox{\bbl@mathboxdir@aux L}% @@ -14482,15 +14486,35 @@ end \fi} \def\bbl@mathboxdir@aux#1{% \@ifnextchar\egroup{}{\textdir T#1T\relax}} + \def\bbl@everymath{\def\bbl@insidemath{1}} + \def\bbl@everydisplay{% + \bbl@mathboxdir + \def\bbl@everymath{\bbl@mathboxdir}% + \def\bbl@insidemath{2}} \frozen@everymath\expandafter{% - \expandafter\bbl@mathboxdir\the\frozen@everymath} + \expandafter\bbl@everymath\the\frozen@everymath} \frozen@everydisplay\expandafter{% - \expandafter\bbl@mathboxdir\the\frozen@everydisplay} + \expandafter\bbl@everydisplay\the\frozen@everydisplay} + \AtBeginDocument{ + \directlua{ + function Babel.math_box_dir(head) + if not (token.get_macro('bbl@insidemath') == '0') then + if Babel.hlist_has_bidi(head) then + local d = node.new(node.id'dir') + d.dir = '+TRT' + node.insert_before(head, node.has_glyph(head), d) + for item in node.traverse(head) do + node.set_attribute(item, + Babel.attr_dir, token.get_macro('bbl@thedir')) + end + end + end + return head + end + luatexbase.add_to_callback("hpack_filter", Babel.math_box_dir, + "Babel.math_box_dir", 0) + }}% \fi -\def\bbl@truellap{%s - \ifcase\bbl@attr@dir\expandafter\llap\else\expandafter\rlap\fi} -\def\bbl@truerlap{% - \ifcase\bbl@attr@dir\expandafter\rlap\else\expandafter\llap\fi} % \end{macrocode} % % \subsection{Layout} @@ -14518,8 +14542,12 @@ end % % \begin{macrocode} \bbl@trace{Redefinitions for bidi layout} +\def\BabelNoAMSMath{\let\bbl@noamsmath\relax} \ifnum\bbl@bidimode>\z@ \let\bbl@eqnodir\relax +% \ifx\matheqdirmode\@undefined\else +% \matheqdirmode\@ne +% \fi \AtBeginDocument{% \ifx\maketag@@@\@undefined % Normal equation, eqnarray \AddToHook{env/eqnarray/begin}{% @@ -14538,71 +14566,81 @@ end \bbl@xin@{,leqno,}{,\@classoptionslist,}% \ifin@ \def\@eqnnum{% - \setbox\z@\hbox{\normalfont\normalcolor(\theequation)}% - \hbox to0.01pt{\hss\hbox to\displaywidth{\box\z@\hss}}}% + \setbox\z@\hbox{\normalfont\normalcolor(\theequation)}% + \hbox to0.01pt{\hss\hbox to\displaywidth{\box\z@\hss}}}% \fi \else % amstex - \bbl@sreplace\intertext@{\normalbaselines}% - {\normalbaselines - \ifx\bbl@eqnodir\relax\else\bbl@pardir\@ne\bbl@textdir\@ne\fi} - \def\bbl@ams@tagbox#1#2{#1{\bbl@eqnodir#2}}% #1=\hbox|ams@lap - \def\bbl@ams@eqtagbox#1{% - \setbox\z@\hbox{\bbl@eqnodir#1}% - \hbox to\wd\z@{% - \ifx\bbl@ams@lap\hbox - \hss\hbox to\displaywidth{\box\z@\hss}% - \else - \hbox to\displaywidth{\hss\box\z@}\hss - \fi}} - \def\bbl@ams@preset#1{% - \ifnum\bbl@thetextdir>\z@ - \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% - \chardef\bbl@thetextdir\z@ - \bbl@sreplace\textdef@{\hbox}{\bbl@ams@tagbox\hbox}% - \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@tagbox#1}% - \fi} - \@ifpackagewith{amsmath}{leqno}% - {\let\bbl@ams@lap\hbox}% = leqno - {\let\bbl@ams@lap\llap}% = default - % Not required?: split, alignat - \AddToHook{env/cases/begin}{\bbl@ams@preset\bbl@ams@lap}% - \AddToHook{env/multline/begin}{\bbl@ams@preset\hbox}% - \AddToHook{env/gather/begin}{\bbl@ams@preset\bbl@ams@lap}% - \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}% - % Hackish, for proper alignment-don’t ask me why it works! :-) - \bbl@exp{% - \\\AddToHook{env/align*/end}{\<iftag@>\<else>\\\tag*{}\<fi>}}% - \AddToHook{env/flalign/begin}{\bbl@ams@preset\hbox}% - \AddToHook{env/split/before}{% - \def\bbl@tempa{equation}% - \ifx\@currenvir\bbl@tempa - \def\bbl@ams@eqtagbox#1{% - \setbox\z@\hbox{\bbl@eqnodir#1}% - \hbox to\wd\z@{\box\z@}}% - \fi} - \AddToHook{env/equation/begin}{% - \bbl@add\ignorespacesafterend{\hrule\@height\z@}% - \ifnum\bbl@thetextdir>\z@ - \ifx\bbl@ams@lap\llap\hrule\@height\z@\fi - \def\bbl@eqnodir{\bbl@textdir\@ne}% - \bbl@textdir\z@ - \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% - \fi}% - \AddToHook{env/equation*/begin}{% - \bbl@add\ignorespacesafterend{\hrule\@height\z@}% - \ifnum\bbl@thetextdir>\z@ - \def\bbl@eqnodir{\bbl@textdir\@ne}% - \bbl@textdir\z@ - \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% - \fi}% + \ifx\bbl@noamsmath\@undefined + \edef\bbl@tempa{% + \catcode58=\the\catcode58\relax + \catcode95=\the\catcode95\relax}% + \catcode58=11 + \catcode95=11 + \bbl@sreplace\intertext@{\normalbaselines}% + {\normalbaselines + \ifx\bbl@eqnodir\relax\else\bbl@pardir\@ne\bbl@eqnodir\fi}% + \bbl@tempa + \def\bbl@ams@tagbox#1#2{#1{\bbl@eqnodir#2}}% #1=\hbox|ams@lap + \def\bbl@ams@eqtagbox#1{% + \setbox\z@\hbox{\bbl@eqnodir#1}% + \hbox to 0.01pt{% + \ifx\bbl@ams@lap\hbox + \hbox to\displaywidth{\hss\box\z@}\hss + \else + \hss\hbox to\displaywidth{\box\z@\hss}% + \fi}} + \def\bbl@ams@preset#1{% + \ifnum\bbl@thetextdir>\z@ + \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% + \chardef\bbl@thetextdir\z@ + \bbl@sreplace\textdef@{\hbox}{\bbl@ams@tagbox\hbox}% + \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@tagbox#1}% + \fi} + \@ifpackagewith{amsmath}{leqno}% + {\let\bbl@ams@lap\hbox}% = leqno + {\let\bbl@ams@lap\llap}% = default + % + \AddToHook{env/cases/begin}{\bbl@ams@preset\bbl@ams@lap}% + \AddToHook{env/multline/begin}{\bbl@ams@preset\hbox}% + \AddToHook{env/gather/begin}{\bbl@ams@preset\bbl@ams@lap}% + \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}% + % Hackish, for proper alignment-don’t ask me why it works! :-) + \bbl@exp{% + \\\AddToHook{env/align*/end}{\<iftag@>\<else>\\\tag*{}\<fi>}}% + \AddToHook{env/flalign/begin}{\bbl@ams@preset\hbox}% + \AddToHook{env/split/before}{% + \ifnum\bbl@thetextdir>\z@ + \def\bbl@tempa{equation}% + \ifx\@currenvir\bbl@tempa + \def\bbl@ams@eqtagbox#1{% + \ifx\bbl@ams@lap\hbox + \hbox to0.01pt{\hss\bbl@eqnodir#1}% leqno + \else + \hbox to0.01pt{\bbl@eqnodir#1\hss}% eqno + \fi} + \fi + \fi} + \AddToHook{env/equation/begin}{% + \ifnum\bbl@thetextdir>\z@ + \ifx\bbl@ams@lap\llap\hrule\@height\z@\fi + \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% + \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% + \fi}% + \AddToHook{env/equation*/begin}{% + \ifnum\bbl@thetextdir>\z@ + \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% + \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% + \fi}% + \fi \fi} \fi \ifx\bbl@opt@layout\@nnil\endinput\fi % if no layout \ifnum\bbl@bidimode>\z@ \def\bbl@nextfake#1{% non-local changes, use always inside a group! \bbl@exp{% + \def\\\bbl@insidemath{0}% \mathdir\the\bodydir #1% Once entered in math, set boxes to restore values \<ifmmode>% @@ -14665,28 +14703,11 @@ end \directlua{ Babel.get_picture_dir = true Babel.picture_has_bidi = 0 + % function Babel.picture_dir (head) if not Babel.get_picture_dir then return head end - for item in node.traverse(head) do - if item.id == node.id'glyph' then - local itemchar = item.char - % TODO. Copypaste pattern from Babel.bidi (-r) - local chardata = Babel.characters[itemchar] - local dir = chardata and chardata.d or nil - if not dir then - for nn, et in ipairs(Babel.ranges) do - if itemchar < et[1] then - break - elseif itemchar <= et[2] then - dir = et[3] - break - end - end - end - if dir and (dir == 'al' or dir == 'r') then - Babel.picture_has_bidi = 1 - end - end + if Babel.hlist_has_bidi(head) then + Babel.picture_has_bidi = 1 end return head end diff --git a/Master/texmf-dist/source/latex/babel/babel.ins b/Master/texmf-dist/source/latex/babel/babel.ins index cc5a9a01893..5bbdbce0f5b 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{2022/01/26} +\def\filedate{2022/02/13} \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 c96b67d1bc3..2da4345004e 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}[2022/01/26 v3.70] +\ProvidesFile{bbcompat.dtx}[2022/02/13 v3.71] %</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 9fda96f7c07..7b82345d1f9 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 a426500edd5..b60ad25a125 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.def +++ b/Master/texmf-dist/tex/generic/babel/babel.def @@ -40,7 +40,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{babel.def}[2022/01/26 3.70 Babel common definitions] +\ProvidesFile{babel.def}[2022/02/13 3.71 Babel common definitions] \ifx\AtBeginDocument\@undefined % TODO. change test. \def\@empty{} \def\loadlocalcfg#1{% @@ -406,8 +406,8 @@ \expandafter\newif\csname ifbbl@single\endcsname \chardef\bbl@bidimode\z@ \fi -\def\bbl@version{3.70} -\def\bbl@date{2022/01/26} +\def\bbl@version{3.71} +\def\bbl@date{2022/02/13} \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 26de1e5a34a..47e17405b35 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}[2005/12/01] -\ProvidesPackage{babel}[2022/01/26 3.70 The Babel package] +\ProvidesPackage{babel}[2022/02/13 3.71 The Babel package] \@ifpackagewith{babel}{debug} {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}% \let\bbl@debug\@firstofone @@ -453,8 +453,8 @@ \expandafter\@secondoftwo \fi} \fi -\def\bbl@version{3.70} -\def\bbl@date{2022/01/26} +\def\bbl@version{3.71} +\def\bbl@date{2022/02/13} \ifx\language\@undefined \csname newcount\endcsname\language \fi @@ -4219,34 +4219,34 @@ \bbl@foreach\bbl@language@opts{% \def\bbl@tempa{#1}% \ifx\bbl@tempa\bbl@opt@main\else - \bbl@ifunset{ds@#1}% - {\ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) - \DeclareOption{#1}{\bbl@load@language{#1}}% - \else % + * (other = ini) - \DeclareOption{#1}{% - \bbl@ldfinit - \babelprovide[import]{#1}% - \bbl@afterldf{}}% - \fi}% - {}% + \ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) + \bbl@ifunset{ds@#1}% + {\DeclareOption{#1}{\bbl@load@language{#1}}}% + {}% + \else % + * (other = ini) + \DeclareOption{#1}{% + \bbl@ldfinit + \babelprovide[import]{#1}% + \bbl@afterldf{}}% + \fi \fi} \bbl@foreach\@classoptionslist{% \def\bbl@tempa{#1}% \ifx\bbl@tempa\bbl@opt@main\else - \bbl@ifunset{ds@#1}% - {\ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) - \IfFileExists{#1.ldf}% - {\DeclareOption{#1}{\bbl@load@language{#1}}}% - {}% - \else % + * (other = ini) - \IfFileExists{babel-#1.tex}% - {\DeclareOption{#1}{% - \bbl@ldfinit - \babelprovide[import]{#1}% - \bbl@afterldf{}}}% - {}% - \fi}% - {}% + \ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) + \bbl@ifunset{ds@#1}% + {\IfFileExists{#1.ldf}% + {\DeclareOption{#1}{\bbl@load@language{#1}}}% + {}}% + {}% + \else % + * (other = ini) + \IfFileExists{babel-#1.tex}% + {\DeclareOption{#1}{% + \bbl@ldfinit + \babelprovide[import]{#1}% + \bbl@afterldf{}}}% + {}% + \fi \fi} \def\AfterBabelLanguage#1{% \bbl@ifsamestring\CurrentOption{#1}{\global\bbl@add\bbl@afterlang}{}} diff --git a/Master/texmf-dist/tex/generic/babel/hyphen.cfg b/Master/texmf-dist/tex/generic/babel/hyphen.cfg index 0bb128d4577..542b6546e5d 100644 --- a/Master/texmf-dist/tex/generic/babel/hyphen.cfg +++ b/Master/texmf-dist/tex/generic/babel/hyphen.cfg @@ -38,10 +38,10 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{hyphen.cfg}[2022/01/26 3.70 Babel hyphens] +\ProvidesFile{hyphen.cfg}[2022/02/13 3.71 Babel hyphens] \xdef\bbl@format{\jobname} -\def\bbl@version{3.70} -\def\bbl@date{2022/01/26} +\def\bbl@version{3.71} +\def\bbl@date{2022/02/13} \ifx\AtBeginDocument\@undefined \def\@empty{} \fi diff --git a/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa-Deva.ini b/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa-Deva.ini index 6305b963ead..af9b9fb2f6d 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa-Deva.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa-Deva.ini @@ -11,8 +11,8 @@ [identification] charset = utf8 -version = 0.11 -date = 2021-04-24 +version = 0.12 +date = 2022-02-06 name.local = संस्कृत name.english = Sanskrit name.babel = sanskrit @@ -159,4 +159,100 @@ transliteration.hk.10.2 = { string = ^^^^094d{1} } ; Inherent a transliteration.hk.11.0 = { [{0915}-{0939}]{0905} } transliteration.hk.11.1 = {} -transliteration.hk.11.2 = { remove }
\ No newline at end of file +transliteration.hk.11.2 = { remove } +; == IAST == +; Contributed by Maximilian Mehner +; uppercase to lowercase +transliteration.iast.1.0 = { ([AIUṚṜḶḸEOṂḤKGṄCJÑṬḌṆTDNPBMYRLVŚṢSH]) } +transliteration.iast.1.1 = { string = {1|AIUṚṜḶḸEOṂḤKGṄCJÑṬḌṆTDNPBMYRLVŚṢSH|aiuṛṝḷḹeoṃḥkgṅcjñṭḍṇtdnpbmyrlvśṣsh} } +; whitespace +transliteration.iast.2.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])|([aiuṛṝḷḹeokgṅcjñṭḍṇtdnpbmyrlvśṣsh]) } +transliteration.iast.2.1 = { string = {1} } +transliteration.iast.2.2 = { remove } +transliteration.iast.2.3 = { string = {2} } +; special strings +transliteration.iast.3.0 = { oṃ } +transliteration.iast.3.1 = { string = ॐ } +; aspirata with vowels +transliteration.iast.4.0 = { ([kgcjṭḍtdpb])[h][a]([iu]) } +transliteration.iast.4.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.4.2 = { remove } +transliteration.iast.4.3 = { remove } +transliteration.iast.4.4 = { string = {2|iu|ैौ} } +; +transliteration.iast.5.0 = { ([kgcjṭḍtdpb])[h][a] } +transliteration.iast.5.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.5.2 = { remove } +transliteration.iast.5.3 = { remove } +; +transliteration.iast.6.0 = { ([kgcjṭḍtdpb])[h]([āiīuūṛṝḷḹeo]) } +transliteration.iast.6.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.6.2 = { remove } +transliteration.iast.6.3 = { string = {2|āiīuūṛṝḷḹeo|ािीुूृॄॢॣेो} } +; aspirata without vowels +transliteration.iast.7.0 = { ([kgcjṭḍtdpb])[h] } +transliteration.iast.7.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ}् } +transliteration.iast.7.2 = { remove } +; tenues with vowels +transliteration.iast.8.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])[a]([iu]) } +transliteration.iast.8.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.8.2 = { remove } +transliteration.iast.8.3 = { string = {2|iu|ैौ} } +; +transliteration.iast.9.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])[a] } +transliteration.iast.9.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.9.2 = { remove } +; +transliteration.iast.10.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])([āiīuūṛṝḷḹeo]) } +transliteration.iast.10.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.10.2 = { string = {2|āiīuūṛṝḷḹeo|ािीुूृॄॢॣेो} } +; tenues without vowels +transliteration.iast.11.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh]) } +transliteration.iast.11.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह}् } +; vowels +; initial vowels +transliteration.iast.12.0 = { ai } +transliteration.iast.12.1 = { string = ऐ } +transliteration.iast.13.0 = { au } +transliteration.iast.13.1 = { string = औ } +transliteration.iast.14.0 = { a } +transliteration.iast.14.1 = { string = अ } +transliteration.iast.15.0 = { ā } +transliteration.iast.15.1 = { string = आ } +transliteration.iast.16.0 = { i } +transliteration.iast.16.1 = { string = इ } +transliteration.iast.17.0 = { ī } +transliteration.iast.17.1 = { string = ई } +transliteration.iast.18.0 = { u } +transliteration.iast.18.1 = { string = उ } +transliteration.iast.19.0 = { ū } +transliteration.iast.19.1 = { string = ऊ } +transliteration.iast.20.0 = { ṛ } +transliteration.iast.20.1 = { string = ऋ } +transliteration.iast.21.0 = { ṝ } +transliteration.iast.21.1 = { string = ॠ } +transliteration.iast.22.0 = { ḷ } +transliteration.iast.22.1 = { string = लृ } +transliteration.iast.23.0 = { ḹ } +transliteration.iast.23.1 = { string = लॄ } +transliteration.iast.24.0 = { e } +transliteration.iast.24.1 = { string = ए } +transliteration.iast.25.0 = { o } +transliteration.iast.25.1 = { string = ओ }} +; special characters +transliteration.iast.26.0 = { ' } +transliteration.iast.26.1 = { string = ऽ } +transliteration.iast.27.0 = { ṃ } +transliteration.iast.27.1 = { string = ं } +transliteration.iast.28.0 = { ḥ } +transliteration.iast.28.1 = { string = ः } +; numbers +transliteration.iast.29.0 = { ([0123456789]) } +transliteration.iast.29.1 = { string = {1|0123456789|०१२३४५६७८९} } +; punctuation +transliteration.iast.30.0 = { [./][./] } +transliteration.iast.30.1 = { string = ॥ } +transliteration.iast.31.0 = { [./] } +transliteration.iast.31.1 = { string = । } +transliteration.iast.32.0 = { [:] } +transliteration.iast.32.1 = { string = – }
\ No newline at end of file diff --git a/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa.ini b/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa.ini index 681cb49eb30..c3bb64df1b3 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa.ini @@ -11,8 +11,8 @@ [identification] charset = utf8 -version = 0.11 -date = 2021-04-2430 +version = 0.12 +date = 2022-02-05 name.english = Sanskrit name.babel = sanskrit name.polyglossia = sanskrit @@ -145,3 +145,99 @@ transliteration.hk.10.2 = { string = ^^^^094d{1} } transliteration.hk.11.0 = { [{0915}-{0939}]{0905} } transliteration.hk.11.1 = {} transliteration.hk.11.2 = { remove } +; == IAST == +; Contributed by Maximilian Mehner +; uppercase to lowercase +transliteration.iast.1.0 = { ([AIUṚṜḶḸEOṂḤKGṄCJÑṬḌṆTDNPBMYRLVŚṢSH]) } +transliteration.iast.1.1 = { string = {1|AIUṚṜḶḸEOṂḤKGṄCJÑṬḌṆTDNPBMYRLVŚṢSH|aiuṛṝḷḹeoṃḥkgṅcjñṭḍṇtdnpbmyrlvśṣsh} } +; whitespace +transliteration.iast.2.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])|([aiuṛṝḷḹeokgṅcjñṭḍṇtdnpbmyrlvśṣsh]) } +transliteration.iast.2.1 = { string = {1} } +transliteration.iast.2.2 = { remove } +transliteration.iast.2.3 = { string = {2} } +; special strings +transliteration.iast.3.0 = { oṃ } +transliteration.iast.3.1 = { string = ॐ } +; aspirata with vowels +transliteration.iast.4.0 = { ([kgcjṭḍtdpb])[h][a]([iu]) } +transliteration.iast.4.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.4.2 = { remove } +transliteration.iast.4.3 = { remove } +transliteration.iast.4.4 = { string = {2|iu|ैौ} } +; +transliteration.iast.5.0 = { ([kgcjṭḍtdpb])[h][a] } +transliteration.iast.5.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.5.2 = { remove } +transliteration.iast.5.3 = { remove } +; +transliteration.iast.6.0 = { ([kgcjṭḍtdpb])[h]([āiīuūṛṝḷḹeo]) } +transliteration.iast.6.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.6.2 = { remove } +transliteration.iast.6.3 = { string = {2|āiīuūṛṝḷḹeo|ािीुूृॄॢॣेो} } +; aspirata without vowels +transliteration.iast.7.0 = { ([kgcjṭḍtdpb])[h] } +transliteration.iast.7.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ}् } +transliteration.iast.7.2 = { remove } +; tenues with vowels +transliteration.iast.8.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])[a]([iu]) } +transliteration.iast.8.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.8.2 = { remove } +transliteration.iast.8.3 = { string = {2|iu|ैौ} } +; +transliteration.iast.9.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])[a] } +transliteration.iast.9.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.9.2 = { remove } +; +transliteration.iast.10.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])([āiīuūṛṝḷḹeo]) } +transliteration.iast.10.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.10.2 = { string = {2|āiīuūṛṝḷḹeo|ािीुूृॄॢॣेो} } +; tenues without vowels +transliteration.iast.11.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh]) } +transliteration.iast.11.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह}् } +; vowels +; initial vowels +transliteration.iast.12.0 = { ai } +transliteration.iast.12.1 = { string = ऐ } +transliteration.iast.13.0 = { au } +transliteration.iast.13.1 = { string = औ } +transliteration.iast.14.0 = { a } +transliteration.iast.14.1 = { string = अ } +transliteration.iast.15.0 = { ā } +transliteration.iast.15.1 = { string = आ } +transliteration.iast.16.0 = { i } +transliteration.iast.16.1 = { string = इ } +transliteration.iast.17.0 = { ī } +transliteration.iast.17.1 = { string = ई } +transliteration.iast.18.0 = { u } +transliteration.iast.18.1 = { string = उ } +transliteration.iast.19.0 = { ū } +transliteration.iast.19.1 = { string = ऊ } +transliteration.iast.20.0 = { ṛ } +transliteration.iast.20.1 = { string = ऋ } +transliteration.iast.21.0 = { ṝ } +transliteration.iast.21.1 = { string = ॠ } +transliteration.iast.22.0 = { ḷ } +transliteration.iast.22.1 = { string = लृ } +transliteration.iast.23.0 = { ḹ } +transliteration.iast.23.1 = { string = लॄ } +transliteration.iast.24.0 = { e } +transliteration.iast.24.1 = { string = ए } +transliteration.iast.25.0 = { o } +transliteration.iast.25.1 = { string = ओ }} +; special characters +transliteration.iast.26.0 = { ' } +transliteration.iast.26.1 = { string = ऽ } +transliteration.iast.27.0 = { ṃ } +transliteration.iast.27.1 = { string = ं } +transliteration.iast.28.0 = { ḥ } +transliteration.iast.28.1 = { string = ः } +; numbers +transliteration.iast.29.0 = { ([0123456789]) } +transliteration.iast.29.1 = { string = {1|0123456789|०१२३४५६७८९} } +; punctuation +transliteration.iast.30.0 = { [./][./] } +transliteration.iast.30.1 = { string = ॥ } +transliteration.iast.31.0 = { [./] } +transliteration.iast.31.1 = { string = । } +transliteration.iast.32.0 = { [:] } +transliteration.iast.32.1 = { string = – } diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def index 41137096197..1405e5710ba 100644 --- a/Master/texmf-dist/tex/generic/babel/luababel.def +++ b/Master/texmf-dist/tex/generic/babel/luababel.def @@ -248,6 +248,30 @@ end lang.patterns(lg, pats) end + function Babel.hlist_has_bidi(head) + local has_bidi = false + for item in node.traverse(head) do + if item.id == node.id'glyph' then + local itemchar = item.char + local chardata = Babel.characters[itemchar] + local dir = chardata and chardata.d or nil + if not dir then + for nn, et in ipairs(Babel.ranges) do + if itemchar < et[1] then + break + elseif itemchar <= et[2] then + dir = et[3] + break + end + end + end + if dir and (dir == 'al' or dir == 'r') then + has_bidi = true + end + end + end + return has_bidi + end } \endgroup \ifx\newattribute\@undefined\else @@ -1310,9 +1334,11 @@ end #2 TRT\relax \fi \fi} +\def\bbl@thedir{0} \def\bbl@textdir#1{% \bbl@setluadir{text}\textdir{#1}% \chardef\bbl@thetextdir#1\relax + \edef\bbl@thedir{\the\numexpr\bbl@thepardir*3+#1}% \setattribute\bbl@attr@dir{\numexpr\bbl@thepardir*3+#1}} \def\bbl@pardir#1{% \bbl@setluadir{par}\pardir{#1}% @@ -1321,6 +1347,7 @@ end \def\bbl@pagedir{\bbl@setluadir{page}\pagedir} \def\bbl@dirparastext{\pardir\the\textdir\relax}% %%%% \ifnum\bbl@bidimode>\z@ + \def\bbl@insidemath{0}% \def\bbl@mathboxdir{% \ifcase\bbl@thetextdir\relax \everyhbox{\bbl@mathboxdir@aux L}% @@ -1329,16 +1356,37 @@ end \fi} \def\bbl@mathboxdir@aux#1{% \@ifnextchar\egroup{}{\textdir T#1T\relax}} + \def\bbl@everymath{\def\bbl@insidemath{1}} + \def\bbl@everydisplay{% + \bbl@mathboxdir + \def\bbl@everymath{\bbl@mathboxdir}% + \def\bbl@insidemath{2}} \frozen@everymath\expandafter{% - \expandafter\bbl@mathboxdir\the\frozen@everymath} + \expandafter\bbl@everymath\the\frozen@everymath} \frozen@everydisplay\expandafter{% - \expandafter\bbl@mathboxdir\the\frozen@everydisplay} + \expandafter\bbl@everydisplay\the\frozen@everydisplay} + \AtBeginDocument{ + \directlua{ + function Babel.math_box_dir(head) + if not (token.get_macro('bbl@insidemath') == '0') then + if Babel.hlist_has_bidi(head) then + local d = node.new(node.id'dir') + d.dir = '+TRT' + node.insert_before(head, node.has_glyph(head), d) + for item in node.traverse(head) do + node.set_attribute(item, + Babel.attr_dir, token.get_macro('bbl@thedir')) + end + end + end + return head + end + luatexbase.add_to_callback("hpack_filter", Babel.math_box_dir, + "Babel.math_box_dir", 0) + }}% \fi -\def\bbl@truellap{%s - \ifcase\bbl@attr@dir\expandafter\llap\else\expandafter\rlap\fi} -\def\bbl@truerlap{% - \ifcase\bbl@attr@dir\expandafter\rlap\else\expandafter\llap\fi} \bbl@trace{Redefinitions for bidi layout} +\def\BabelNoAMSMath{\let\bbl@noamsmath\relax} \ifnum\bbl@bidimode>\z@ \let\bbl@eqnodir\relax \AtBeginDocument{% @@ -1359,71 +1407,81 @@ end \bbl@xin@{,leqno,}{,\@classoptionslist,}% \ifin@ \def\@eqnnum{% - \setbox\z@\hbox{\normalfont\normalcolor(\theequation)}% - \hbox to0.01pt{\hss\hbox to\displaywidth{\box\z@\hss}}}% + \setbox\z@\hbox{\normalfont\normalcolor(\theequation)}% + \hbox to0.01pt{\hss\hbox to\displaywidth{\box\z@\hss}}}% \fi \else % amstex - \bbl@sreplace\intertext@{\normalbaselines}% - {\normalbaselines - \ifx\bbl@eqnodir\relax\else\bbl@pardir\@ne\bbl@textdir\@ne\fi} - \def\bbl@ams@tagbox#1#2{#1{\bbl@eqnodir#2}}% #1=\hbox|ams@lap - \def\bbl@ams@eqtagbox#1{% - \setbox\z@\hbox{\bbl@eqnodir#1}% - \hbox to\wd\z@{% - \ifx\bbl@ams@lap\hbox - \hss\hbox to\displaywidth{\box\z@\hss}% - \else - \hbox to\displaywidth{\hss\box\z@}\hss - \fi}} - \def\bbl@ams@preset#1{% - \ifnum\bbl@thetextdir>\z@ - \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% - \chardef\bbl@thetextdir\z@ - \bbl@sreplace\textdef@{\hbox}{\bbl@ams@tagbox\hbox}% - \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@tagbox#1}% - \fi} - \@ifpackagewith{amsmath}{leqno}% - {\let\bbl@ams@lap\hbox}% = leqno - {\let\bbl@ams@lap\llap}% = default - % Not required?: split, alignat - \AddToHook{env/cases/begin}{\bbl@ams@preset\bbl@ams@lap}% - \AddToHook{env/multline/begin}{\bbl@ams@preset\hbox}% - \AddToHook{env/gather/begin}{\bbl@ams@preset\bbl@ams@lap}% - \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}% - % Hackish, for proper alignment-don’t ask me why it works! :-) - \bbl@exp{% - \\\AddToHook{env/align*/end}{\<iftag@>\<else>\\\tag*{}\<fi>}}% - \AddToHook{env/flalign/begin}{\bbl@ams@preset\hbox}% - \AddToHook{env/split/before}{% - \def\bbl@tempa{equation}% - \ifx\@currenvir\bbl@tempa - \def\bbl@ams@eqtagbox#1{% - \setbox\z@\hbox{\bbl@eqnodir#1}% - \hbox to\wd\z@{\box\z@}}% - \fi} - \AddToHook{env/equation/begin}{% - \bbl@add\ignorespacesafterend{\hrule\@height\z@}% - \ifnum\bbl@thetextdir>\z@ - \ifx\bbl@ams@lap\llap\hrule\@height\z@\fi - \def\bbl@eqnodir{\bbl@textdir\@ne}% - \bbl@textdir\z@ - \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% - \fi}% - \AddToHook{env/equation*/begin}{% - \bbl@add\ignorespacesafterend{\hrule\@height\z@}% - \ifnum\bbl@thetextdir>\z@ - \def\bbl@eqnodir{\bbl@textdir\@ne}% - \bbl@textdir\z@ - \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% - \fi}% + \ifx\bbl@noamsmath\@undefined + \edef\bbl@tempa{% + \catcode58=\the\catcode58\relax + \catcode95=\the\catcode95\relax}% + \catcode58=11 + \catcode95=11 + \bbl@sreplace\intertext@{\normalbaselines}% + {\normalbaselines + \ifx\bbl@eqnodir\relax\else\bbl@pardir\@ne\bbl@eqnodir\fi}% + \bbl@tempa + \def\bbl@ams@tagbox#1#2{#1{\bbl@eqnodir#2}}% #1=\hbox|ams@lap + \def\bbl@ams@eqtagbox#1{% + \setbox\z@\hbox{\bbl@eqnodir#1}% + \hbox to 0.01pt{% + \ifx\bbl@ams@lap\hbox + \hbox to\displaywidth{\hss\box\z@}\hss + \else + \hss\hbox to\displaywidth{\box\z@\hss}% + \fi}} + \def\bbl@ams@preset#1{% + \ifnum\bbl@thetextdir>\z@ + \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% + \chardef\bbl@thetextdir\z@ + \bbl@sreplace\textdef@{\hbox}{\bbl@ams@tagbox\hbox}% + \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@tagbox#1}% + \fi} + \@ifpackagewith{amsmath}{leqno}% + {\let\bbl@ams@lap\hbox}% = leqno + {\let\bbl@ams@lap\llap}% = default + % + \AddToHook{env/cases/begin}{\bbl@ams@preset\bbl@ams@lap}% + \AddToHook{env/multline/begin}{\bbl@ams@preset\hbox}% + \AddToHook{env/gather/begin}{\bbl@ams@preset\bbl@ams@lap}% + \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}% + % Hackish, for proper alignment-don’t ask me why it works! :-) + \bbl@exp{% + \\\AddToHook{env/align*/end}{\<iftag@>\<else>\\\tag*{}\<fi>}}% + \AddToHook{env/flalign/begin}{\bbl@ams@preset\hbox}% + \AddToHook{env/split/before}{% + \ifnum\bbl@thetextdir>\z@ + \def\bbl@tempa{equation}% + \ifx\@currenvir\bbl@tempa + \def\bbl@ams@eqtagbox#1{% + \ifx\bbl@ams@lap\hbox + \hbox to0.01pt{\hss\bbl@eqnodir#1}% leqno + \else + \hbox to0.01pt{\bbl@eqnodir#1\hss}% eqno + \fi} + \fi + \fi} + \AddToHook{env/equation/begin}{% + \ifnum\bbl@thetextdir>\z@ + \ifx\bbl@ams@lap\llap\hrule\@height\z@\fi + \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% + \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% + \fi}% + \AddToHook{env/equation*/begin}{% + \ifnum\bbl@thetextdir>\z@ + \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% + \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% + \fi}% + \fi \fi} \fi \ifx\bbl@opt@layout\@nnil\endinput\fi % if no layout \ifnum\bbl@bidimode>\z@ \def\bbl@nextfake#1{% non-local changes, use always inside a group! \bbl@exp{% + \def\\\bbl@insidemath{0}% \mathdir\the\bodydir #1% Once entered in math, set boxes to restore values \<ifmmode>% @@ -1486,28 +1544,11 @@ end \directlua{ Babel.get_picture_dir = true Babel.picture_has_bidi = 0 + % function Babel.picture_dir (head) if not Babel.get_picture_dir then return head end - for item in node.traverse(head) do - if item.id == node.id'glyph' then - local itemchar = item.char - % TODO. Copypaste pattern from Babel.bidi (-r) - local chardata = Babel.characters[itemchar] - local dir = chardata and chardata.d or nil - if not dir then - for nn, et in ipairs(Babel.ranges) do - if itemchar < et[1] then - break - elseif itemchar <= et[2] then - dir = et[3] - break - end - end - end - if dir and (dir == 'al' or dir == 'r') then - Babel.picture_has_bidi = 1 - end - end + if Babel.hlist_has_bidi(head) then + Babel.picture_has_bidi = 1 end return head end diff --git a/Master/texmf-dist/tex/generic/babel/nil.ldf b/Master/texmf-dist/tex/generic/babel/nil.ldf index 78e6c9d5f46..937d1f50a8b 100644 --- a/Master/texmf-dist/tex/generic/babel/nil.ldf +++ b/Master/texmf-dist/tex/generic/babel/nil.ldf @@ -33,7 +33,7 @@ %% extension |.ins|) which are part of the distribution. %% -\ProvidesLanguage{nil}[2022/01/26 3.70 Nil language] +\ProvidesLanguage{nil}[2022/02/13 3.71 Nil language] \LdfInit{nil}{datenil} \ifx\l@nil\@undefined \newlanguage\l@nil |