diff options
author | Karl Berry <karl@freefriends.org> | 2019-04-01 21:10:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-04-01 21:10:44 +0000 |
commit | de9dc4bb86a87f4d72b59034b56593313b2e8c8a (patch) | |
tree | afcde74e28915439fef0d65c8a1eefeb9dc9df7a /Master/texmf-dist | |
parent | 98766f71d95e3aa7dcf598359ffb0f9902c73797 (diff) |
babel (1apr19)
git-svn-id: svn://tug.org/texlive/trunk@50699 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
22 files changed, 634 insertions, 223 deletions
diff --git a/Master/texmf-dist/doc/latex/babel/README.md b/Master/texmf-dist/doc/latex/babel/README.md index 0e99ab68450..97ff35a6918 100644 --- a/Master/texmf-dist/doc/latex/babel/README.md +++ b/Master/texmf-dist/doc/latex/babel/README.md @@ -1,4 +1,4 @@ -## Babel 3.27 +## Babel 3.28 This package manages culturally-determined typographical (and other) rules, and hyphenation patterns for a wide range of languages. Many @@ -51,6 +51,12 @@ respective authors. ### Latest changes ``` +3.28 - Fixes - wrong dir after math, in math inside tabular, in weak L + inside R inside L, and in boxes inside math. + - \babelfont now takes into account \defaultfontfeatures. This + is a potential source of backwards incompatibilities, but + very likely the risks are very low, and it is, I think, the + expected behavior. 3.27 - Preliminary support for bidi (by Vafa Khalighi) with xetex. - Fix for 3.23 - \ensureascii was redefined even when not necessary. @@ -119,5 +125,5 @@ respective authors. ``` Javier Bezos -2018/11/13 +2019/04/01 diff --git a/Master/texmf-dist/doc/latex/babel/babel.pdf b/Master/texmf-dist/doc/latex/babel/babel.pdf Binary files differindex bd66981e68d..c8a3099ce4b 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 73602cb01aa..ca43f71b84f 100644 --- a/Master/texmf-dist/source/latex/babel/babel.dtx +++ b/Master/texmf-dist/source/latex/babel/babel.dtx @@ -31,7 +31,7 @@ % % \iffalse %<*filedriver> -\ProvidesFile{babel.dtx}[2018/11/13 v3.27 The Babel package] +\ProvidesFile{babel.dtx}[2019/04/01 v3.28 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -362,6 +362,15 @@ You can also set the main language explicitly: \usepackage[_main=english_,dutch]{babel} \end{verbatim} +\begin{note} +Some classes load \babel{} with a hardcoded language option. Sometimes, +the main language could be overridden with something like that before +|\documentclass|: +\begin{verbatim} +\PassOptionsToPackage{main=english}{babel} +\end{verbatim} +\end{note} + \begin{warning} Languages may be set as global and as package option at the same time, but in such a case you should set explicitly the main language @@ -380,7 +389,7 @@ You can also set the main language explicitly: want to use some of the language selectors described below. \end{warning} -To switch the language there are two basic macros, decribed below in +To switch the language there are two basic macros, described below in detail: |\selectlanguage| is used for blocks of text, while |\foreignlanguage| is for chunks of text inside paragraphs. @@ -969,7 +978,7 @@ three options have been available in previous versions. \Describe{KeepShorthandsActive}{} Tells babel not to deactivate shorthands after loading a language -file, so that they are also availabe in the preamble. +file, so that they are also available in the preamble. \Describe{activeacute}{} For some languages \babel\ supports this options to set |'| as a shorthand in case it is not done by default. @@ -1855,7 +1864,7 @@ replace the red line above with, say: |\babelfont| can be used to implicitly define a new font family. Just write its name instead of |rm|, |sf| or |tt|. This is the preferred way -to select fonts in addition to the three basic ones. +to select fonts in addition to the three basic families. \begin{example} Here is how to do it: @@ -1877,13 +1886,17 @@ to select fonts in addition to the three basic ones. |dev2| (\luatex{} does not detect automatically the correct script\footnote{And even with the correct code some fonts could be rendered incorrectly by \textsf{fontspec}, so double check the - results. \xetex{} fares better, but some font are still problematic.}). + results. \xetex{} fares better, but some font are still + problematic.}). You may also pass some options to \textsf{fontspec}: + with |silent|, the warnings about unavailable scripts or languages + are not shown (they are only really useful when the document format + is being set up). \end{note} \begin{note} - Directionality is a property affecting margins, intentation, column + Directionality is a property affecting margins, indentation, column order, etc., not just text. Therefore, it is under the direct - control of the language, which appplies both the script and the + control of the language, which applies both the script and the direction to the text. As a consequence, there is no need to set \texttt{Script} when declaring a font (nor \texttt{Language}). In fact, it is even discouraged. @@ -1954,16 +1967,28 @@ unselected: |\noextras|\m{lang}. \end{itemize} \begin{note} - These macros (|\captions|\m{lang}, |\extras|\m{lang}) may be redefined, but - must not be used as such -- they just pass information to \babel{}, - which executes them in the proper context. + These macros (|\captions|\m{lang}, |\extras|\m{lang}) may be + redefined, but \textit{must not} be used as such -- they just pass + information to \babel{}, which executes them in the proper context. \end{note} +Another way to modify a language loaded as a package or class option +is by means of |\babelprovide|, described below in depth. So, +something like: +\begin{verbatim} +\usepackage[danish]{babel} +\babelprovide[captions=da,hyphenrules=nohyphenation]{danish} +\end{verbatim} +first loads |danish.ldf|, and then redefines the captions for +\texttt{danish} (as provided by the |ini| file) and prevents +hyphenation. The rest of the language definitions are not touched. + \subsection{Creating a language} -\New{3.10} And what if there is no style for your language or none -fits your needs? You may then define quickly a language with the -help of the following macro in the preamble. +\New{3.10} And what if there is no style for your language or none fits +your needs? You may then define quickly a language with the help of the +following macro in the preamble (which may be used to modify an +existing language, too, as explained in the previous subsection). \Describe{\babelprovide}{\oarg{options}\marg{language-name}} @@ -2054,7 +2079,7 @@ for example: \babelprovide[hyphenrules=+]{neo} \babelpatterns[neo]{a1 e1 i1 o1 u1} \end{verbatim} -In other engines it just supresses hyphenation (because the pattern +In other engines it just suppresses hyphenation (because the pattern list is empty). \Describe{main}{} This valueless option makes the language the main @@ -2080,14 +2105,15 @@ inconsistent, this makes setting a language up easier in most typical cases. \Describe{mapfont=}{\texttt{direction}} -Assigns the font for the writing direction of this language. More -precisely, what |mapfont=direction| means is, ‘when a character has the -same direction as the script for the “provided” language, then change -its font to that set for this language’. There are 3 directions, -following the bidi Unicode algorithm, namely, Arabic-like, Hebrew-like -and left to right.\footnote{In future realeases an new value -(\texttt{script}) will be added.} So, there should be at most 3 -directives of this kind. +Assigns the font for the writing direction of this +language.\footnote{There will be another value, \texttt{language}, not +yet implemented.} More precisely, what |mapfont=direction| means is, +‘when a character has the same direction as the script for the +“provided” language, then change its font to that set for this +language’. There are 3 directions, following the bidi Unicode +algorithm, namely, Arabic-like, Hebrew-like and left to +right.\footnote{In future releases an new value (\texttt{script}) will +be added.} So, there should be at most 3 directives of this kind. \Describe{intraspace=}{\meta{base} \meta{shrink} \meta{stretch}} Sets the interword space for the writing system of the language, in em @@ -2095,7 +2121,7 @@ units (so, |0 .1 0| is |0em plus .1em|). Like |\spaceskip|, the em unit applied is that of the current text (more precisely, the previous glyph). Currently used only in Southeast Asian scrips, like Thai. -\Describe{intrapenalty}{\meta{penalty}} +\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). @@ -2174,20 +2200,20 @@ respectively. \textit{explicit} or \textit{hard hyphens}, which in \TeX\ are entered as \verb|-|, and (2) \textit{optional} or \textit{soft hyphens}, which are entered as \verb|\-|. Strictly, a \textit{soft -hyphen} is not a hyphen, but just a breaking oportunity or, in +hyphen} is not a hyphen, but just a breaking opportunity or, in \TeX\ terms, a ``discretionary''; a \textit{hard hyphen} is a hyphen -with a breaking oportunity after it. A further type is a +with a breaking opportunity after it. A further type is a \textit{non-breaking hyphen}, a hyphen without a breaking -oportunity. +opportunity. -In \TeX, \verb|-| and \verb|\-| forbid further breaking oportunities +In \TeX, \verb|-| and \verb|\-| forbid further breaking opportunities in the word. This is the desired behavior very often, but not always, and therefore many languages provide shorthands for these cases. Unfortunately, this has not been done consistently: for example, \verb|"-| in Dutch, Portugese, Catalan or Danish is a hard hyphen, while in German, Spanish, Norwegian, Slovak or Russian is a soft hyphen. Furthermore, some of them even redefine |\-|, so that you -cannot insert a soft hyphen without breaking oportunities in the rest +cannot insert a soft hyphen without breaking opportunities in the rest of the word. Therefore, some macros are provide with a set of basic ``hyphens'' @@ -2290,7 +2316,7 @@ Some languages sharing the same script define macros to switch it (eg, |\textcyrillic|), but be aware they may also set the language to a certain default. Even the \babel{} core defined |\textlatin|, but is was somewhat buggy because in some cases it messed up encodings and -fonts (for example, if the main latin encoding was |LY1|), and +fonts (for example, if the main Latin encoding was |LY1|), and therefore it has been deprecated.\footnote{But still defined for backwards compatibility.} @@ -2315,7 +2341,7 @@ used for ``ordinary'' text (they are stored in |\BabelNonText|, used in some special cases when no Latin encoding is explicitly set). The foregoing rules (which are applied ``at begin document'') cover -most of cases. No asumption is made on characters above +most of cases. No assumption is made on characters above 127, which may not follow the LICR conventions -- the goal is just to ensure most of the ASCII letters and symbols are the right ones. @@ -2337,8 +2363,8 @@ differ in the way `weak' numeric characters are ordered (eg, Arabic A basic stable version for other engines must wait very likely until (Northern) Winter. This applies to text, but \textbf{graphical} elements, including the |picture| environment and PDF or PS based - graphics, are not yet correctly handled. Also, indexes and the like - are under study, as well as math. + graphics, are not yet correctly handled (far from trivial). Also, + indexes and the like are under study, as well as math. An effort is being made to avoid incompatibilities in the future (this one of the reason currently bidi must be explicitly requested @@ -2406,7 +2432,7 @@ _\babelprovide[import, main]{arabic}_ mixed without explicit markup (the latter will be only necessary in some special cases where the Unicode algorithm fails). It is used much like |bidi=basic-r|, but with R text inside L text you may want to map - the font so that the correct features are in force. This is accomplised + the font so that the correct features are in force. This is accomplished with an option in |\babelprovide|, as illustrated: \begingroup % If you are looking at the code to see how it has been written, you @@ -2469,7 +2495,7 @@ _\babelprovide[import, main]{arabic}_ \New{3.16} \textit{To be expanded}. Selects which layout elements are adapted in bidi documents, including some text elements. You may use -several options with a comma-separated list (eg, +several options with a dot-separated list (eg, |layout=counters.contents.sectioning|). This list will be expanded in future releases (tables, captions, etc.). Note not all options are required by all engines. @@ -2526,7 +2552,7 @@ required by all engines. future); ignored in \pdftex{} or \xetex{} (which will not support a similar option in the short term) \New{3.18}, -\item[extras] is used for miscelaneous readjustments which do not fit into +\item[extras] is used for miscellaneous readjustments which do not fit into the previous groups. Currently redefines in \luatex{} |\underline| and |\LaTeX2e| \New{3.19}. \end{description} @@ -2549,7 +2575,7 @@ RTL A ltr text \thechapter{} and still ltr RTL B \end{verbatim} There are \textit{three} R blocks and \textit{two} L blocks, and the order is \textit{RTL B and still ltr 1 ltr text RTL A}. This is by -design to provide the proper behaviour in the most usual cases — but if +design to provide the proper behavior in the most usual cases — but if you need to use |\ref| in an L text inside R, the L text must be marked up explictly; for example: \begin{verbatim} @@ -2625,7 +2651,7 @@ Very often, using a \textit{modifier} in a package option is better. Several language definition files use their own methods to set options. For example, \textsf{french} uses |\frenchsetup|, \textsf{magyar} (1.5) uses |\magyarOptions|; modifiers provided by -|spanish| have no attribute counterparts. Macros settting +|spanish| have no attribute counterparts. Macros setting options are also used (eg, |\ProsodicMarksOn| in \textsf{latin}). \subsection{Hooks} @@ -2882,16 +2908,16 @@ some languages (kerning and spacing). Ligatures can be disabled. \subsection{Current and future work} Current work is focused on the so-called complex scripts in \luatex{}. -In 8-bit engines, \babel{} provided a basic support for bidi text as part -of the style for Hebrew, but it is somewhat unsatisfactory and -internally replaces some hardwired commands by other hardwired -commands (generic changes would be much better). +In 8-bit engines, \babel{} provided a basic support for bidi text as +part of the style for Hebrew, but it is somewhat unsatisfactory and +internally replaces some hardwired commands by other hardwired commands +(generic changes would be much better). -It is possible now to typeset Arabic or Hebrew with numbers and L -text. Next on the roadmap are line breaking in Thai and the like, -as well as “non-European” digits. Also on the roadmap are R layouts -(lists, footnotes, tables, column order), page and section numbering, -and maybe kashida justification. +It is possible now to typeset Arabic or Hebrew with numbers and L text. +Next on the roadmap are line breaking in Thai and the like. Also on the +roadmap are better support for R layouts (lists, footnotes, tables, +column order), page and section numbering, and maybe kashida +justification. Useful additions would be, for example, time, currency, addresses and personal names.\footnote{See for example POSIX, ISO 14652 and the @@ -2975,7 +3001,7 @@ So, for example: \TeX{} and most engines based on it (pdf\TeX, \xetex, $\epsilon$-\TeX, the main exception being \luatex) require hyphenation patterns to be preloaded when a format is created (eg, \LaTeX, Xe\LaTeX, -pdf\LaTeX). \babel{} provides a tool which has become standand in many +pdf\LaTeX). \babel{} provides a tool which has become standard in many distributions and based on a ``configuration file'' named \file{language.dat}. The exact way this file is used depends on the distribution, so please, read the documentation for the latter (note @@ -3029,7 +3055,7 @@ didn't work correctly.} For example: german:T1 hyphenT1.ger german hyphen.ger \end{verbatim} -With the previous settings, if the enconding when the language is +With the previous settings, if the encoding when the language is selected is |T1| then the patterns in \file{hyphenT1.ger} are used, but otherwise use those in \file{hyphen.ger} (note the encoding could be set in |\extras|\m{lang}). @@ -3079,7 +3105,7 @@ The following assumptions are made: \item When a language definition file is loaded, it can define |\l@|\langvar\ to be a dialect of |\language0| when |\l@|\langvar\ is undefined. -\item Language names must be all lowercase. If an unknow language is +\item Language names must be all lowercase. If an unknown language is selected, \babel{} will attempt setting it after lowercasing its name. \item The semantics of modifiers is not defined (on purpose). In @@ -3197,7 +3223,7 @@ definition files to set |\lefthyphenmin| and |\righthyphenmin|. This macro will check whether these parameters were provided by the hyphenation file before it takes any action. If these values have been already set, this command is ignored -(currenty, default pattern files do \textit{not} set them). +(currently, default pattern files do \textit{not} set them). \DescribeMacro{\captions\langvar} The macro |\captions|\langvar\ defines the macros that @@ -3324,6 +3350,23 @@ explained in in sec. \ref{s:strings} (\babel{} 3.9 and later). \ldf@finish{<language>} \end{verbatim} +\begin{note} + If for some reason you want to load a package in your style, you + should be aware it cannot be done directly in the \texttt{ldf} file, + but it can be delayed with |\AtEndOfPackage|. Macros from external + packages can be used \textit{inside} definitions in the \textsf{ldf} + itself (for example, |\extras<language>|), but if executed directly, + the code must be placed inside |\AtEndOfPackage|. A trivial example + illustrating these points is: +\begin{verbatim} +\AtEndOfPackage{% + \RequirePackage{dingbat}% Delay package + \savebox{\myeye}{\eye}}% And direct usage +\newsavebox{\myeye} +\newcommand\myanchor{\anchor}% But OK inside command +\end{verbatim} +\end{note} + \subsection{Support for active characters} In quite a number of language definition files, active characters are @@ -3486,9 +3529,9 @@ the first one take precedence (ie, it works much like |\providecommand|). Encoding info is |charset=| followed by a charset, which if given sets -how the strings should be traslated to the internal representation +how the strings should be translated to the internal representation used by the engine, typically |utf8|, which is the only value -supported currently (default is no traslations). Note |charset| is +supported currently (default is no translations). Note |charset| is applied by \luatex{} and \xetex{} when reading the file, not when the macro or string is used in the document. @@ -3507,7 +3550,7 @@ into account except those). With |strings=encoded|, strings in those blocks are set as default (internally, |?|). With |strings=encoded| strings are protected, but they are correctly expanded in |\MakeUppercase| and the like. If there is no key |strings|, string -definitions are ignored, but |\SetCase|s are still honoured (in a +definitions are ignored, but |\SetCase|s are still honored (in a |encoded| way). The \m{category} is either |captions|, |date| or |extras|. You must @@ -3568,7 +3611,7 @@ A real example is: \end{verbatim} When used in |ldf| files, previous values of |\|\m{category}\m{language} -are overriden, which means the old way to define strings still works +are overridden, which means the old way to define strings still works and used by default (to be precise, is first set to undefined and then strings are added). However, when used in the preamble or in a package, new settings are added to the previous ones, if the language @@ -3582,7 +3625,7 @@ as package option, then the default for the engine is used. This is not done by default to prevent backward incompatibilities, but if you are creating a new language this version is better. It's up to the maintainers of the current languages to decide if using it is -appropiate.\footnote{This replaces in 3.9g a short-lived +appropriate.\footnote{This replaces in 3.9g a short-lived \texttt{\string\UseStrings} which has been removed because it did not work.} @@ -3621,7 +3664,7 @@ changes in lc/uc codes may not work). A \meta{map-list} is a series of macros using the internal format of |\@uclclist| (eg, |\bb\BB\cc\CC|). The mandatory arguments take precedence over the optional one. This command, unlike |\SetString|, is executed always -(even without |strings|), and it is intented for minor readjustments +(even without |strings|), and it is intended for minor readjustments only. For example, as |T1| is the default case mapping in \LaTeX, we could @@ -3874,8 +3917,8 @@ help from Bernd Raichle, for which I am grateful. % \section{Tools} % % \begin{macrocode} -%<<version=3.27>> -%<<date=2018/11/13>> +%<<version=3.28>> +%<<date=2019/04/01>> % \end{macrocode} % % \textbf{Do not use the following macros in \texttt{ldf} files. They @@ -7778,9 +7821,8 @@ help from Bernd Raichle, for which I am grateful. {\bbl@ifblank{#1}% {\bbl@error {If you want to modify `#2' you must tell how in\\% - the optional argument. Currently there are three\\% - options: captions=lang-tag, hyphenrules=lang-list\\% - import=lang-tag}% + the optional argument. See the manual for the\\% + available options.}% {Use this macro as documented}}% {\bbl@provide@renew{#2}}}% % Post tasks @@ -8080,9 +8122,9 @@ help from Bernd Raichle, for which I am grateful. \@nameuse{bbl@secpost@\bbl@section}% ends previous section \def\bbl@section{#1}% \@nameuse{bbl@secpre@\bbl@section}% starts current section - \bbl@ifunset{bbl@secline@#1}% + \bbl@ifunset{bbl@inikv@#1}% {\let\bbl@inireader\bbl@iniskip}% - {\bbl@exp{\let\\\bbl@inireader\<bbl@secline@#1>}}} + {\bbl@exp{\let\\\bbl@inireader\<bbl@inikv@#1>}}} % \end{macrocode} % % Reads a key=val line and stores the trimmed val in @@ -8114,7 +8156,7 @@ help from Bernd Raichle, for which I am grateful. % |identification| and |typography|. % % \begin{macrocode} -\let\bbl@secline@identification\bbl@inikv +\let\bbl@inikv@identification\bbl@inikv \def\bbl@secpost@identification{% \bbl@exportkey{lname}{identification.name.english}{}% \bbl@exportkey{lbcp}{identification.tag.bcp47}{}% @@ -8122,9 +8164,9 @@ help from Bernd Raichle, for which I am grateful. \bbl@exportkey{sname}{identification.script.name}{}% \bbl@exportkey{sbcp}{identification.script.tag.bcp47}{}% \bbl@exportkey{sotf}{identification.script.tag.opentype}{DFLT}} -\let\bbl@secline@typography\bbl@inikv -\let\bbl@secline@characters\bbl@inikv -\let\bbl@secline@numbers\bbl@inikv +\let\bbl@inikv@typography\bbl@inikv +\let\bbl@inikv@characters\bbl@inikv +\let\bbl@inikv@numbers\bbl@inikv \def\bbl@after@ini{% \bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}% \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}% @@ -8153,21 +8195,17 @@ help from Bernd Raichle, for which I am grateful. % \end{macrocode} % % Now |captions| and |captions.licr|, depending on the engine. And -% also for dates. They rely on a few auxilary macros. +% below also for dates. They rely on a few auxiliary macros. It is +% expected the ini file provides the complete set in Unicode and LICR, +% in that order. % % \begin{macrocode} \ifcase\bbl@engine - \bbl@csarg\def{secline@captions.licr}#1=#2\@@{% + \bbl@csarg\def{inikv@captions.licr}#1=#2\@@{% \bbl@ini@captions@aux{#1}{#2}} - \bbl@csarg\def{secline@date.gregorian}#1=#2\@@{% for defaults - \bbl@ini@dategreg#1...\relax{#2}} - \bbl@csarg\def{secline@date.gregorian.licr}#1=#2\@@{% override - \bbl@ini@dategreg#1...\relax{#2}} \else - \def\bbl@secline@captions#1=#2\@@{% + \def\bbl@inikv@captions#1=#2\@@{% \bbl@ini@captions@aux{#1}{#2}} - \bbl@csarg\def{secline@date.gregorian}#1=#2\@@{% - \bbl@ini@dategreg#1...\relax{#2}} \fi % \end{macrocode} % @@ -8186,22 +8224,41 @@ help from Bernd Raichle, for which I am grateful. % \end{macrocode} % % But dates are more complex. The full date format is stores in -% |date.gregorian|, so we must read it in non-Unicode engines, too. +% |date.gregorian|, so we must read it in non-Unicode engines, too +% (saved months are just discarded when the LICR section is reached). % -% \changes{3.16}{2018/01/02}{Fix - dates were severely broken.} +% TODO. Remove copypaste pattern. % -% \begin{macrocode} -\bbl@csarg\def{secpre@date.gregorian.licr}{% - \ifcase\bbl@engine\let\bbl@savedate\@empty\fi} -\def\bbl@ini@dategreg#1.#2.#3.#4\relax#5{% TODO - ignore with 'captions' +% \changes{3.16}{2018/01/02}{Fix - dates were severely broken.} +% \changes{3.28}{2019/04/01}{Start work on calendars.} +% +% \begin{macrocode} +\bbl@csarg\def{inikv@date.gregorian}#1=#2\@@{% for defaults + \bbl@inidate#1...\relax{#2}{}} +\bbl@csarg\def{inikv@date.islamic}#1=#2\@@{% + \bbl@inidate#1...\relax{#2}{islamic}} +\bbl@csarg\def{inikv@date.hebrew}#1=#2\@@{% + \bbl@inidate#1...\relax{#2}{hebrew}} +\bbl@csarg\def{inikv@date.persian}#1=#2\@@{% + \bbl@inidate#1...\relax{#2}{persian}} +\bbl@csarg\def{inikv@date.indian}#1=#2\@@{% + \bbl@inidate#1...\relax{#2}{indian}} +\ifcase\bbl@engine + \bbl@csarg\def{inikv@date.gregorian.licr}#1=#2\@@{% override + \bbl@inidate#1...\relax{#2}{}} + \bbl@csarg\def{secpre@date.gregorian.licr}{% discard uni + \ifcase\bbl@engine\let\bbl@savedate\@empty\fi} +\fi +% eg: 1=months, 2=wide, 3=1, 4=dummy +\def\bbl@inidate#1.#2.#3.#4\relax#5#6{% TODO - ignore with 'captions' \bbl@trim@def\bbl@tempa{#1.#2}% - \bbl@ifsamestring{\bbl@tempa}{months.wide}% + \bbl@ifsamestring{\bbl@tempa}{months.wide}% to savedate {\bbl@trim@def\bbl@tempa{#3}% \bbl@trim\toks@{#5}% \bbl@exp{% \\\bbl@add\\\bbl@savedate{% - \\\SetString\<month\romannumeral\bbl@tempa name>{\the\toks@}}}}% - {\bbl@ifsamestring{\bbl@tempa}{date.long}% + \\\SetString\<month\romannumeral\bbl@tempa#6name>{\the\toks@}}}}% + {\bbl@ifsamestring{\bbl@tempa}{date.long}% defined now {\bbl@trim@def\bbl@toreplace{#5}% \bbl@TG@@date \global\bbl@csarg\let{date@\languagename}\bbl@toreplace @@ -8220,9 +8277,10 @@ help from Bernd Raichle, for which I am grateful. % Dates will require some macros for the basic formatting. They may be % redefined by language, so ``semi-public'' names (camel case) are % used. Oddly enough, the CLDR places particles like “de” -% inconsistenly in either in the date or in the month name. +% inconsistently in either in the date or in the month name. % % \begin{macrocode} +\let\bbl@calendar\@empty \newcommand\BabelDateSpace{\nobreakspace} \newcommand\BabelDateDot{.\@} \newcommand\BabelDated[1]{{\number#1}} @@ -8230,7 +8288,7 @@ help from Bernd Raichle, for which I am grateful. \newcommand\BabelDateM[1]{{\number#1}} \newcommand\BabelDateMM[1]{{\ifnum#1<10 0\fi\number#1}} \newcommand\BabelDateMMMM[1]{{% - \csname month\romannumeral#1name\endcsname}}% + \csname month\romannumeral#1\bbl@calendar name\endcsname}}% \newcommand\BabelDatey[1]{{\number#1}}% \newcommand\BabelDateyy[1]{{% \ifnum#1<10 0\number#1 % @@ -9170,6 +9228,8 @@ help from Bernd Raichle, for which I am grateful. % \changes{3.15}{2017/10/30}{Use an attribute instead of tex language % (reserved for hyphenation).} % \changes{3.15}{2017/10/30}{Store direction in @wdir@<lang>.} +% \changes{3.28}{2019/04/01}{Dir in boxes within math and other +% contexts (passim).} % % \begin{macrocode} \bbl@trace{Basic (internal) bidi support} @@ -9205,6 +9265,7 @@ help from Bernd Raichle, for which I am grateful. \ifodd\bbl@engine % luatex=1 \AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir} \DisableBabelHook{babel-bidi} + \chardef\bbl@thetextdir\z@ \chardef\bbl@thepardir\z@ \def\bbl@getluadir#1{% \directlua{ @@ -9225,12 +9286,24 @@ help from Bernd Raichle, for which I am grateful. \fi} \def\bbl@textdir#1{% \bbl@setluadir{text}\textdir{#1}% TODO - ?\linedir + \chardef\bbl@thetextdir#1\relax \setattribute\bbl@attr@dir{\numexpr\bbl@thepardir*3+#1}} - \def\bbl@pardir#1{\bbl@setluadir{par}\pardir{#1}% + \def\bbl@pardir#1{% + \bbl@setluadir{par}\pardir{#1}% \chardef\bbl@thepardir#1\relax} \def\bbl@bodydir{\bbl@setluadir{body}\bodydir} \def\bbl@pagedir{\bbl@setluadir{page}\pagedir} \def\bbl@dirparastext{\pardir\the\textdir\relax}% %%%% + % Sadly, we have to deal with boxes in math with basic: + \def\bbl@mathboxdir{% + \ifcase\bbl@thetextdir\relax + \everyhbox{\bgroup\aftergroup\egroup\textdir TLT\relax}% + \else + \everyhbox{\bgroup\aftergroup\egroup\textdir TRT\relax}% + \fi} + % TODO - the same trick as bbl@severypar + \everymath{\bbl@mathboxdir} + \everydisplay{\bbl@mathboxdir} \else % pdftex=0, xetex=2 \AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir} \DisableBabelHook{babel-bidi} @@ -9316,12 +9389,19 @@ help from Bernd Raichle, for which I am grateful. \fi % \end{macrocode} % -% A tool for weak L (mainly digits). +% A tool for weak L (mainly digits). We also disable warnings with +% \textsf{hyperref}. % % \changes{3.16}{2018/01/02}{New macro \cs{babelsublr}} % % \begin{macrocode} - \DeclareRobustCommand\babelsublr[1]{\leavevmode{\bbl@textdir\z@#1}} +\DeclareRobustCommand\babelsublr[1]{\leavevmode{\bbl@textdir\z@#1}} +\AtBeginDocument{% + \ifx\pdfstringdefDisableCommands\@undefined\else + \ifx\pdfstringdefDisableCommands\relax\else + \pdfstringdefDisableCommands{\let\babelsublr\@firstofone}% + \fi + \fi} % \end{macrocode} % % \subsection{Local Language Configuration} @@ -9613,16 +9693,17 @@ help from Bernd Raichle, for which I am grateful. % % \begin{macro}{\bbl@set@language} % -% The macro |\bbl@set@language| takes care of switching the -% language environment \emph{and} of writing entries on the -% auxiliary files. For historial reasons, language names can be -% either |language| of |\language|. To catch either form a trick is -% used, but unfortunately as a side effect the catcodes of letters -% in |\languagename| are not well defined. The list of auxiliary -% files can be extended by redefining |\BabelContentsFiles|, but -% make sure they are loaded inside a group (as |aux|, |toc|, -% |lof|, and |lot| do) or the last language of the document will -% remain active afterwards. +% The macro |\bbl@set@language| takes care of switching the language +% environment \emph{and} of writing entries on the auxiliary files. +% For historial reasons, language names can be either |language| of +% |\language|. To catch either form a trick is used, but +% unfortunately as a side effect the catcodes of letters in +% |\languagename| are messed up. This is a bug, but preserved for +% backwards compatibility. The list of auxiliary files can be +% extended by redefining |\BabelContentsFiles|, but make sure they +% are loaded inside a group (as |aux|, |toc|, |lof|, and |lot| do) +% or the last language of the document will remain active +% afterwards. % % We also write a command to change the current language in the % auxiliary files. @@ -9640,19 +9721,22 @@ help from Bernd Raichle, for which I am grateful. % % \begin{macrocode} \def\BabelContentsFiles{toc,lof,lot} -\def\bbl@set@language#1{% +\def\bbl@set@language#1{% from selectlanguage, pop@ \edef\languagename{% \ifnum\escapechar=\expandafter`\string#1\@empty \else\string#1\@empty\fi}% \select@language{\languagename}% + % write to auxs \expandafter\ifx\csname date\languagename\endcsname\relax\else \if@filesw \protected@write\@auxout{}{\string\babel@aux{\languagename}{}}% \bbl@usehooks{write}{}% \fi \fi} -\def\select@language#1{% +\def\select@language#1{% from set@, babel@aux + % set hymap \ifnum\bbl@hymapsel=\@cclv\chardef\bbl@hymapsel4\relax\fi + % set name \edef\languagename{#1}% \bbl@fixname\languagename \bbl@iflanguage\languagename{% @@ -9665,6 +9749,7 @@ help from Bernd Raichle, for which I am grateful. some cases, you may need to remove the aux file}% {You may proceed, but expect wrong results}% \else + % set type \let\bbl@select@type\z@ \expandafter\bbl@switch\expandafter{\languagename}% \fi}} @@ -9744,7 +9829,8 @@ help from Bernd Raichle, for which I am grateful. % % \begin{macrocode} \newif\ifbbl@usedategroup -\def\bbl@switch#1{% +\def\bbl@switch#1{% from select@, foreign@ + % restore \originalTeX \expandafter\def\expandafter\originalTeX\expandafter{% \csname noextras#1\endcsname @@ -9752,6 +9838,7 @@ help from Bernd Raichle, for which I am grateful. \babel@beginsave}% \bbl@usehooks{afterreset}{}% \languageshorthands{none}% + % switch captions, date \ifcase\bbl@select@type \ifhmode \hskip\z@skip % trick to ignore spaces @@ -9762,19 +9849,27 @@ help from Bernd Raichle, for which I am grateful. \csname captions#1\endcsname\relax \csname date#1\endcsname\relax \fi - \else\ifbbl@usedategroup - \bbl@usedategroupfalse - \ifhmode - \hskip\z@skip % trick to ignore spaces - \csname date#1\endcsname\relax - \loop\ifdim\lastskip>\z@\unskip\repeat\unskip - \else - \csname date#1\endcsname\relax + \else + \ifbbl@usedategroup % if \foreign... within \<lang>date + \bbl@usedategroupfalse + \ifhmode + \hskip\z@skip % trick to ignore spaces + \csname date#1\endcsname\relax + \loop\ifdim\lastskip>\z@\unskip\repeat\unskip + \else + \csname date#1\endcsname\relax + \fi \fi - \fi\fi + \fi + % switch extras \bbl@usehooks{beforeextras}{}% \csname extras#1\endcsname\relax \bbl@usehooks{afterextras}{}% + % > babel-ensure + % > babel-sh-<short> + % > babel-bidi + % > babel-fontspec + % hyphenation - case mapping \ifcase\bbl@opt@hyphenmap\or \def\BabelLower##1##2{\lccode##1=##2\relax}% \ifnum\bbl@hymapsel>4\else @@ -9787,7 +9882,9 @@ help from Bernd Raichle, for which I am grateful. \fi \fi \global\let\bbl@hymapsel\@cclv + % hyphenation - patterns \bbl@patterns{#1}% + % hyphenation - mins \babel@savevariable\lefthyphenmin \babel@savevariable\righthyphenmin \expandafter\ifx\csname #1hyphenmins\endcsname\relax @@ -9939,18 +10036,21 @@ help from Bernd Raichle, for which I am grateful. % % \begin{macrocode} \def\foreign@language#1{% + % set name \edef\languagename{#1}% \bbl@fixname\languagename \bbl@iflanguage\languagename{% \expandafter\ifx\csname date\languagename\endcsname\relax - \bbl@warning + \bbl@warning % TODO - why a warning, not an error? {Unknown language `#1'. Either you have\\% misspelled its name, it has not been installed,\\% or you requested it in a previous run. Fix its name,\\% - install it or just rerun the file, respectively.\\% + install it or just rerun the file, respectively. In\\% + some cases, you may need to remove the aux file.\\% I'll proceed, but expect wrong results.\\% Reported}% \fi + % set type \let\bbl@select@type\@ne \expandafter\bbl@switch\expandafter{\languagename}}} % \end{macrocode} @@ -9994,6 +10094,7 @@ help from Bernd Raichle, for which I am grateful. \edef\bbl@tempa{#1:\f@encoding}% \fi \@expandtwoargs\bbl@usehooks{patterns}{{#1}{\bbl@tempa}}% + % > luatex \@ifundefined{bbl@hyphenation@}{}{% Can be \relax! \begingroup \bbl@xin@{,\number\language,}{,\bbl@hyphlist}% @@ -10467,10 +10568,12 @@ help from Bernd Raichle, for which I am grateful. \expandafter\language\csname l@#1\endcsname \edef\languagename{#1}% \bbl@hook@everylanguage{#1}% + % > luatex \bbl@get@enc#1::\@@@ \begingroup \lefthyphenmin\m@ne \bbl@hook@loadpatterns{#2}% + % > luatex \ifnum\lefthyphenmin=\m@ne \else \expandafter\xdef\csname #1hyphenmins\endcsname{% @@ -10480,6 +10583,7 @@ help from Bernd Raichle, for which I am grateful. \def\bbl@tempa{#3}% \ifx\bbl@tempa\@empty\else \bbl@hook@loadexceptions{#3}% + % > luatex \fi \let\bbl@elt\relax \edef\bbl@languages{% @@ -10831,20 +10935,27 @@ help from Bernd Raichle, for which I am grateful. % |\bbl@mapselect| because |\selectfont| is called internally when a % font is defined. % +% \changes{3.28}{2019/04/01}{\cs{babelfont} now based on +% \cs{newfontfamily}.} +% % \begin{macrocode} \def\bbl@font@set#1#2#3{% eg \bbl@rmdflt@lang \rmdefault \rmfamily \bbl@xin@{<>}{#1}% \ifin@ - \bbl@exp{\\\bbl@fontspec@set\\#1\expandafter\@gobbletwo#1}% + \bbl@exp{\\\bbl@fontspec@set\\#1\expandafter\@gobbletwo#1\\#3}% \fi \bbl@exp{% - \def\\#2{#1}% eg, \rmdefault{\bbl@rmdflt@lang} + \def\\#2{#1}% eg, \rmdefault{\bbl@rmdflt@lang} \\\bbl@ifsamestring{#2}{\f@family}{\\#3\let\\\bbl@tempa\relax}{}}} -\def\bbl@fontspec@set#1#2#3{% eg \bbl@rmdflt@lang fnt-opt fnt-nme +% TODO - next should be global?, but even local does its job. I'm +% still not sure -- must investigate: +\def\bbl@fontspec@set#1#2#3#4{% eg \bbl@rmdflt@lang fnt-opt fnt-nme \xxfamily \let\bbl@tempe\bbl@mapselect \let\bbl@mapselect\relax - \bbl@exp{% TODO - should be global, but even local does its job - % I'm still not sure -- must investigate + \let\bbl@temp@fam#4% eg, '\rmfamily', to be restored below + \let#4\relax % So that can be used with \newfontfamily + \bbl@exp{% + \let\\\bbl@temp@pfam\<\bbl@stripslash#4\space>% eg, '\rmfamily ' \<keys_if_exist:nnF>{fontspec-opentype}% {Script/\bbl@cs{sname@\languagename}}% {\\\newfontscript{\bbl@cs{sname@\languagename}}% @@ -10853,10 +10964,15 @@ help from Bernd Raichle, for which I am grateful. {Language/\bbl@cs{lname@\languagename}}% {\\\newfontlanguage{\bbl@cs{lname@\languagename}}% {\bbl@cs{lotf@\languagename}}}% - \<fontspec_set_family:Nnn>\\#1% - {\bbl@cs{lsys@\languagename},#2}}{#3}% ie \bbl@exp{..}{#3} - \let\bbl@mapselect\bbl@tempe - \bbl@toglobal#1}% + \\\newfontfamily\\#4% + [\bbl@cs{lsys@\languagename},#2]}{#3}% ie \bbl@exp{..}{#3} + \begingroup + #4% + \xdef#1{\f@family}% eg, \bbl@rmdflt@lang{FreeSerif(0)} + \endgroup + \let#4\bbl@temp@fam + \bbl@exp{\let\<\bbl@stripslash#4\space>}\bbl@temp@pfam + \let\bbl@mapselect\bbl@tempe}% % \end{macrocode} % % font@rst and famrst are only used when there is no global settings, @@ -11746,9 +11862,9 @@ help from Bernd Raichle, for which I am grateful. \fi \ifx\bbl@opt@layout\@nnil\endinput\fi % if no layout \ifx\bbl@beforeforeign\leavevmode % A poor test for bidi= - \def\bbl@nextfake#1{% - \mathdir\bodydir % non-local, use always inside a group! + \def\bbl@nextfake#1{% non-local changes - always inside a group! \bbl@exp{% + \mathdir\the\bodydir #1% Once entered in math, set boxes to restore values \everyvbox{% \the\everyvbox @@ -18046,6 +18162,7 @@ function Babel.bidi(head, ispar) local new_dir = false local first_dir = false + local inmath = false local last_lr @@ -18076,6 +18193,7 @@ function Babel.bidi(head, ispar) end end dir = dir or 'l' + if inmath then dir = ('TRT' == tex.mathdir) and 'r' or 'l' end % \end{macrocode} % % Next is based on the assumption babel sets the language AND @@ -18128,12 +18246,14 @@ function Babel.bidi(head, ispar) % \end{macrocode} % % Once finished the basic setup for glyphs, consider the two other -% cases: dir node and the rest. +% cases: dir node and the rest. % % \begin{macrocode} - elseif item.id == node.id'dir' then + elseif item.id == node.id'dir' and not inmath then new_dir = true dir = nil + elseif item.id == node.id'math' then + inmath = (item.subtype == 0) else dir = nil -- Not a char end @@ -18326,8 +18446,11 @@ local function insert_numeric(head, state) return head, new_state end --- \hbox with an explicit dir can lead to wrong results --- <R \hbox dir TLT{<R>}> and <L \hbox dir TRT{<L>}> +-- TODO - \hbox with an explicit dir can lead to wrong results +-- <R \hbox dir TLT{<R>}> and <L \hbox dir TRT{<L>}>. A small attempt +-- was s made to improve the situation, but the problem is the 3-dir +-- model in babel/Unicode and the 2-dir model in LuaTeX don't fit +-- well. function Babel.bidi(head, ispar, hdir) local d -- d is used mainly for computations in a loop @@ -18336,6 +18459,7 @@ function Babel.bidi(head, ispar, hdir) local nodes = {} local outer_first = nil + local inmath = false local glue_d = nil local glue_i = nil @@ -18354,9 +18478,14 @@ function Babel.bidi(head, ispar, hdir) (temp == 2 and 'al') elseif ispar then -- Or error? Shouldn't happen save_outer = ('TRT' == tex.pardir) and 'r' or 'l' - else + else -- Or error? Shouldn't happen save_outer = ('TRT' == hdir) and 'r' or 'l' end + -- when the callback is called, we are just _after_ the box, + -- and the textdir is that of the surrounding text + -- if not ispar and hdir ~= tex.textdir then + -- save_outer = ('TRT' == hdir) and 'r' or 'l' + -- end local outer = save_outer local last = outer -- 'al' is only taken into account in the first, current loop @@ -18395,6 +18524,7 @@ function Babel.bidi(head, ispar, hdir) end end d = d or 'l' + if inmath then d = ('TRT' == tex.mathdir) and 'r' or 'l' end d_font = d_font or d d_font = (d_font == 'l' and 0) or @@ -18442,6 +18572,9 @@ function Babel.bidi(head, ispar, hdir) glue_d = d glue_i = item d = nil + + elseif item.id == node.id'math' then + inmath = (item.subtype == 0) else d = nil @@ -18606,7 +18739,11 @@ function Babel.bidi(head, ispar, hdir) end else if d == 'an' or d == 'l' then - state.sim = state.sim or item + if nodes[q][3] then -- nil except after an explicit dir + state.sim = item -- so we move sim 'inside' the group + else + state.sim = state.sim or item + end state.eim = item elseif d == 'r' and state.sim then head, state = insert_implicit(head, state, outer) diff --git a/Master/texmf-dist/source/latex/babel/babel.ins b/Master/texmf-dist/source/latex/babel/babel.ins index 21726acdb0d..21bbb5de892 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{2018/11/13} +\def\filedate{2019/04/01} \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 4744d1b825a..0ee121329d8 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}[2018/11/13 v3.27] +\ProvidesFile{bbcompat.dtx}[2019/04/01 v3.28] %</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 2c6a66a2bb2..3e717ac7485 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-bidi-basic-r.lua b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua index 6961dd84221..008d27e0658 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua +++ b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua @@ -74,6 +74,7 @@ function Babel.bidi(head, ispar) local new_dir = false local first_dir = false + local inmath = false local last_lr @@ -104,6 +105,7 @@ function Babel.bidi(head, ispar) end end dir = dir or 'l' + if inmath then dir = ('TRT' == tex.mathdir) and 'r' or 'l' end if new_dir then attr_dir = 0 for at in node.traverse(item.attr) do @@ -131,9 +133,11 @@ function Babel.bidi(head, ispar) if dir == 'et' or dir == 'es' then dir = 'on' end -- W6 strong_lr = 'r' -- W3 end - elseif item.id == node.id'dir' then + elseif item.id == node.id'dir' and not inmath then new_dir = true dir = nil + elseif item.id == node.id'math' then + inmath = (item.subtype == 0) else dir = nil -- Not a char end diff --git a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua index 8fe47ecb80f..be342c12fe5 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua +++ b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua @@ -91,8 +91,11 @@ local function insert_numeric(head, state) return head, new_state end --- \hbox with an explicit dir can lead to wrong results --- <R \hbox dir TLT{<R>}> and <L \hbox dir TRT{<L>}> +-- TODO - \hbox with an explicit dir can lead to wrong results +-- <R \hbox dir TLT{<R>}> and <L \hbox dir TRT{<L>}>. A small attempt +-- was s made to improve the situation, but the problem is the 3-dir +-- model in babel/Unicode and the 2-dir model in LuaTeX don't fit +-- well. function Babel.bidi(head, ispar, hdir) local d -- d is used mainly for computations in a loop @@ -101,6 +104,7 @@ function Babel.bidi(head, ispar, hdir) local nodes = {} local outer_first = nil + local inmath = false local glue_d = nil local glue_i = nil @@ -119,9 +123,14 @@ function Babel.bidi(head, ispar, hdir) (temp == 2 and 'al') elseif ispar then -- Or error? Shouldn't happen save_outer = ('TRT' == tex.pardir) and 'r' or 'l' - else + else -- Or error? Shouldn't happen save_outer = ('TRT' == hdir) and 'r' or 'l' end + -- when the callback is called, we are just _after_ the box, + -- and the textdir is that of the surrounding text + -- if not ispar and hdir ~= tex.textdir then + -- save_outer = ('TRT' == hdir) and 'r' or 'l' + -- end local outer = save_outer local last = outer -- 'al' is only taken into account in the first, current loop @@ -160,6 +169,7 @@ function Babel.bidi(head, ispar, hdir) end end d = d or 'l' + if inmath then d = ('TRT' == tex.mathdir) and 'r' or 'l' end d_font = d_font or d d_font = (d_font == 'l' and 0) or @@ -208,6 +218,9 @@ function Babel.bidi(head, ispar, hdir) glue_i = item d = nil + elseif item.id == node.id'math' then + inmath = (item.subtype == 0) + else d = nil end @@ -371,7 +384,11 @@ function Babel.bidi(head, ispar, hdir) end else if d == 'an' or d == 'l' then - state.sim = state.sim or item + if nodes[q][3] then -- nil except after an explicit dir + state.sim = item -- so we move sim 'inside' the group + else + state.sim = state.sim or item + end state.eim = item elseif d == 'r' and state.sim then head, state = insert_implicit(head, state, outer) diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index 5d2db7261f2..accbb739ae7 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.def +++ b/Master/texmf-dist/tex/generic/babel/babel.def @@ -41,7 +41,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{babel.def}[2018/11/13 3.27 Babel common definitions] +\ProvidesFile{babel.def}[2019/04/01 3.28 Babel common definitions] \ifx\AtBeginDocument\@undefined \input plain.def\relax \fi @@ -1334,9 +1334,8 @@ {\bbl@ifblank{#1}% {\bbl@error {If you want to modify `#2' you must tell how in\\% - the optional argument. Currently there are three\\% - options: captions=lang-tag, hyphenrules=lang-list\\% - import=lang-tag}% + the optional argument. See the manual for the\\% + available options.}% {Use this macro as documented}}% {\bbl@provide@renew{#2}}}% % Post tasks @@ -1599,9 +1598,9 @@ \@nameuse{bbl@secpost@\bbl@section}% ends previous section \def\bbl@section{#1}% \@nameuse{bbl@secpre@\bbl@section}% starts current section - \bbl@ifunset{bbl@secline@#1}% + \bbl@ifunset{bbl@inikv@#1}% {\let\bbl@inireader\bbl@iniskip}% - {\bbl@exp{\let\\\bbl@inireader\<bbl@secline@#1>}}} + {\bbl@exp{\let\\\bbl@inireader\<bbl@inikv@#1>}}} \def\bbl@inikv#1=#2\@@{% key=value \bbl@trim@def\bbl@tempa{#1}% \bbl@trim\toks@{#2}% @@ -1614,7 +1613,7 @@ \else \bbl@exp{\global\let\<bbl@#1@\languagename>\<bbl@@kv@#2>}% \fi}} -\let\bbl@secline@identification\bbl@inikv +\let\bbl@inikv@identification\bbl@inikv \def\bbl@secpost@identification{% \bbl@exportkey{lname}{identification.name.english}{}% \bbl@exportkey{lbcp}{identification.tag.bcp47}{}% @@ -1622,9 +1621,9 @@ \bbl@exportkey{sname}{identification.script.name}{}% \bbl@exportkey{sbcp}{identification.script.tag.bcp47}{}% \bbl@exportkey{sotf}{identification.script.tag.opentype}{DFLT}} -\let\bbl@secline@typography\bbl@inikv -\let\bbl@secline@characters\bbl@inikv -\let\bbl@secline@numbers\bbl@inikv +\let\bbl@inikv@typography\bbl@inikv +\let\bbl@inikv@characters\bbl@inikv +\let\bbl@inikv@numbers\bbl@inikv \def\bbl@after@ini{% \bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}% \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}% @@ -1651,17 +1650,11 @@ \bbl@toglobal\bbl@savetoday \bbl@toglobal\bbl@savedate} \ifcase\bbl@engine - \bbl@csarg\def{secline@captions.licr}#1=#2\@@{% + \bbl@csarg\def{inikv@captions.licr}#1=#2\@@{% \bbl@ini@captions@aux{#1}{#2}} - \bbl@csarg\def{secline@date.gregorian}#1=#2\@@{% for defaults - \bbl@ini@dategreg#1...\relax{#2}} - \bbl@csarg\def{secline@date.gregorian.licr}#1=#2\@@{% override - \bbl@ini@dategreg#1...\relax{#2}} \else - \def\bbl@secline@captions#1=#2\@@{% + \def\bbl@inikv@captions#1=#2\@@{% \bbl@ini@captions@aux{#1}{#2}} - \bbl@csarg\def{secline@date.gregorian}#1=#2\@@{% - \bbl@ini@dategreg#1...\relax{#2}} \fi \def\bbl@ini@captions@aux#1#2{% \bbl@trim@def\bbl@tempa{#1}% @@ -1672,17 +1665,31 @@ \bbl@exp{% \\\bbl@add\\\bbl@savestrings{% \\\SetString\<\bbl@tempa name>{\the\toks@}}}} -\bbl@csarg\def{secpre@date.gregorian.licr}{% - \ifcase\bbl@engine\let\bbl@savedate\@empty\fi} -\def\bbl@ini@dategreg#1.#2.#3.#4\relax#5{% TODO - ignore with 'captions' +\bbl@csarg\def{inikv@date.gregorian}#1=#2\@@{% for defaults + \bbl@inidate#1...\relax{#2}{}} +\bbl@csarg\def{inikv@date.islamic}#1=#2\@@{% + \bbl@inidate#1...\relax{#2}{islamic}} +\bbl@csarg\def{inikv@date.hebrew}#1=#2\@@{% + \bbl@inidate#1...\relax{#2}{hebrew}} +\bbl@csarg\def{inikv@date.persian}#1=#2\@@{% + \bbl@inidate#1...\relax{#2}{persian}} +\bbl@csarg\def{inikv@date.indian}#1=#2\@@{% + \bbl@inidate#1...\relax{#2}{indian}} +\ifcase\bbl@engine + \bbl@csarg\def{inikv@date.gregorian.licr}#1=#2\@@{% override + \bbl@inidate#1...\relax{#2}{}} + \bbl@csarg\def{secpre@date.gregorian.licr}{% discard uni + \ifcase\bbl@engine\let\bbl@savedate\@empty\fi} +\fi +\def\bbl@inidate#1.#2.#3.#4\relax#5#6{% TODO - ignore with 'captions' \bbl@trim@def\bbl@tempa{#1.#2}% - \bbl@ifsamestring{\bbl@tempa}{months.wide}% + \bbl@ifsamestring{\bbl@tempa}{months.wide}% to savedate {\bbl@trim@def\bbl@tempa{#3}% \bbl@trim\toks@{#5}% \bbl@exp{% \\\bbl@add\\\bbl@savedate{% - \\\SetString\<month\romannumeral\bbl@tempa name>{\the\toks@}}}}% - {\bbl@ifsamestring{\bbl@tempa}{date.long}% + \\\SetString\<month\romannumeral\bbl@tempa#6name>{\the\toks@}}}}% + {\bbl@ifsamestring{\bbl@tempa}{date.long}% defined now {\bbl@trim@def\bbl@toreplace{#5}% \bbl@TG@@date \global\bbl@csarg\let{date@\languagename}\bbl@toreplace @@ -1696,6 +1703,7 @@ \\\SetString\\\today{% \<\languagename date>{\\\the\year}{\\\the\month}{\\\the\day}}}}}}% {}} +\let\bbl@calendar\@empty \newcommand\BabelDateSpace{\nobreakspace} \newcommand\BabelDateDot{.\@} \newcommand\BabelDated[1]{{\number#1}} @@ -1703,7 +1711,7 @@ \newcommand\BabelDateM[1]{{\number#1}} \newcommand\BabelDateMM[1]{{\ifnum#1<10 0\fi\number#1}} \newcommand\BabelDateMMMM[1]{{% - \csname month\romannumeral#1name\endcsname}}% + \csname month\romannumeral#1\bbl@calendar name\endcsname}}% \newcommand\BabelDatey[1]{{\number#1}}% \newcommand\BabelDateyy[1]{{% \ifnum#1<10 0\number#1 % @@ -2035,6 +2043,7 @@ \ifodd\bbl@engine % luatex=1 \AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir} \DisableBabelHook{babel-bidi} + \chardef\bbl@thetextdir\z@ \chardef\bbl@thepardir\z@ \def\bbl@getluadir#1{% \directlua{ @@ -2055,12 +2064,24 @@ \fi} \def\bbl@textdir#1{% \bbl@setluadir{text}\textdir{#1}% TODO - ?\linedir + \chardef\bbl@thetextdir#1\relax \setattribute\bbl@attr@dir{\numexpr\bbl@thepardir*3+#1}} - \def\bbl@pardir#1{\bbl@setluadir{par}\pardir{#1}% + \def\bbl@pardir#1{% + \bbl@setluadir{par}\pardir{#1}% \chardef\bbl@thepardir#1\relax} \def\bbl@bodydir{\bbl@setluadir{body}\bodydir} \def\bbl@pagedir{\bbl@setluadir{page}\pagedir} \def\bbl@dirparastext{\pardir\the\textdir\relax}% %%%% + % Sadly, we have to deal with boxes in math with basic: + \def\bbl@mathboxdir{% + \ifcase\bbl@thetextdir\relax + \everyhbox{\bgroup\aftergroup\egroup\textdir TLT\relax}% + \else + \everyhbox{\bgroup\aftergroup\egroup\textdir TRT\relax}% + \fi} + % TODO - the same trick as bbl@severypar + \everymath{\bbl@mathboxdir} + \everydisplay{\bbl@mathboxdir} \else % pdftex=0, xetex=2 \AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir} \DisableBabelHook{babel-bidi} @@ -2133,7 +2154,13 @@ \def\bbl@pardir#1{\ifcase#1\relax\setLR\else\setRL\fi}} {}% \fi - \DeclareRobustCommand\babelsublr[1]{\leavevmode{\bbl@textdir\z@#1}} +\DeclareRobustCommand\babelsublr[1]{\leavevmode{\bbl@textdir\z@#1}} +\AtBeginDocument{% + \ifx\pdfstringdefDisableCommands\@undefined\else + \ifx\pdfstringdefDisableCommands\relax\else + \pdfstringdefDisableCommands{\let\babelsublr\@firstofone}% + \fi + \fi} \bbl@trace{Local Language Configuration} \ifx\loadlocalcfg\@undefined \@ifpackagewith{babel}{noconfigs}% diff --git a/Master/texmf-dist/tex/generic/babel/babel.sty b/Master/texmf-dist/tex/generic/babel/babel.sty index c0b470c1ed2..3f616f84bef 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.sty +++ b/Master/texmf-dist/tex/generic/babel/babel.sty @@ -33,7 +33,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{babel}[2018/11/13 3.27 The Babel package] +\ProvidesPackage{babel}[2019/04/01 3.28 The Babel package] \@ifpackagewith{babel}{debug} {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}% \let\bbl@debug\@firstofone} diff --git a/Master/texmf-dist/tex/generic/babel/hyphen.cfg b/Master/texmf-dist/tex/generic/babel/hyphen.cfg index f537754e5de..91fa39860e6 100644 --- a/Master/texmf-dist/tex/generic/babel/hyphen.cfg +++ b/Master/texmf-dist/tex/generic/babel/hyphen.cfg @@ -37,7 +37,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{hyphen.cfg}[2018/11/13 3.27 Babel hyphens] +\ProvidesFile{hyphen.cfg}[2019/04/01 3.28 Babel hyphens] \xdef\bbl@format{\jobname} \ifx\AtBeginDocument\@undefined \def\@empty{} @@ -93,10 +93,12 @@ \expandafter\language\csname l@#1\endcsname \edef\languagename{#1}% \bbl@hook@everylanguage{#1}% + % > luatex \bbl@get@enc#1::\@@@ \begingroup \lefthyphenmin\m@ne \bbl@hook@loadpatterns{#2}% + % > luatex \ifnum\lefthyphenmin=\m@ne \else \expandafter\xdef\csname #1hyphenmins\endcsname{% @@ -106,6 +108,7 @@ \def\bbl@tempa{#3}% \ifx\bbl@tempa\@empty\else \bbl@hook@loadexceptions{#3}% + % > luatex \fi \let\bbl@elt\relax \edef\bbl@languages{% diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-DZ.ini b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-DZ.ini index 93a70ff73d7..60bad20aa01 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-DZ.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-DZ.ini @@ -11,8 +11,8 @@ [identification] charset = utf8 -version = 1.1 -date = 2018-02-05 +version = 1.2 +date = 2019-01-31 name.local = العربية name.english = Arabic name.babel = arabic-dz @@ -107,6 +107,32 @@ dayPeriods.narrow.pm = م dayPeriods.wide.am = ص dayPeriods.wide.pm = م +[date.islamic] +months.wide.1 = محرم +months.wide.2 = صفر +months.wide.3 = ربيع الأول +months.wide.4 = ربيع الآخر +months.wide.5 = جمادى الأولى +months.wide.6 = جمادى الآخرة +months.wide.7 = رجب +months.wide.8 = شعبان +months.wide.9 = رمضان +months.wide.10 = شوال +months.wide.11 = ذو القعدة +months.wide.12 = ذو الحجة +months.narrow.1 = ١ +months.narrow.2 = ٢ +months.narrow.3 = ٣ +months.narrow.4 = ٤ +months.narrow.5 = ٥ +months.narrow.6 = ٦ +months.narrow.7 = ٧ +months.narrow.8 = ٨ +months.narrow.9 = ٩ +months.narrow.10 = ١٠ +months.narrow.11 = ١١ +months.narrow.12 = ١٢ + [time.gregorian] time.medium = [h]:[mm]:[ss] [a] time.short = [h]:[mm] [a] diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-MA.ini b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-MA.ini index 86ca9cef1ee..0225a04e7a0 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-MA.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-MA.ini @@ -11,8 +11,8 @@ [identification] charset = utf8 -version = 1.1 -date = 2018-02-05 +version = 1.2 +date = 2019-01-31 name.local = العربية name.english = Arabic name.babel = arabic-ma @@ -107,6 +107,32 @@ dayPeriods.narrow.pm = م dayPeriods.wide.am = ص dayPeriods.wide.pm = م +[date.islamic] +months.wide.1 = محرم +months.wide.2 = صفر +months.wide.3 = ربيع الأول +months.wide.4 = ربيع الآخر +months.wide.5 = جمادى الأولى +months.wide.6 = جمادى الآخرة +months.wide.7 = رجب +months.wide.8 = شعبان +months.wide.9 = رمضان +months.wide.10 = شوال +months.wide.11 = ذو القعدة +months.wide.12 = ذو الحجة +months.narrow.1 = ١ +months.narrow.2 = ٢ +months.narrow.3 = ٣ +months.narrow.4 = ٤ +months.narrow.5 = ٥ +months.narrow.6 = ٦ +months.narrow.7 = ٧ +months.narrow.8 = ٨ +months.narrow.9 = ٩ +months.narrow.10 = ١٠ +months.narrow.11 = ١١ +months.narrow.12 = ١٢ + [time.gregorian] time.medium = [HH]:[mm]:[ss] time.short = [HH]:[mm] diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-SY.ini b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-SY.ini index 841435340f6..42cc757930b 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-SY.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-SY.ini @@ -11,8 +11,8 @@ [identification] charset = utf8 -version = 1.1 -date = 2018-02-05 +version = 1.2 +date = 2019-01-31 name.local = العربية name.english = Arabic name.babel = arabic-sy @@ -105,6 +105,32 @@ dayPeriods.narrow.pm = م dayPeriods.wide.am = ص dayPeriods.wide.pm = م +[date.islamic] +months.wide.1 = محرم +months.wide.2 = صفر +months.wide.3 = ربيع الأول +months.wide.4 = ربيع الآخر +months.wide.5 = جمادى الأولى +months.wide.6 = جمادى الآخرة +months.wide.7 = رجب +months.wide.8 = شعبان +months.wide.9 = رمضان +months.wide.10 = شوال +months.wide.11 = ذو القعدة +months.wide.12 = ذو الحجة +months.narrow.1 = ١ +months.narrow.2 = ٢ +months.narrow.3 = ٣ +months.narrow.4 = ٤ +months.narrow.5 = ٥ +months.narrow.6 = ٦ +months.narrow.7 = ٧ +months.narrow.8 = ٨ +months.narrow.9 = ٩ +months.narrow.10 = ١٠ +months.narrow.11 = ١١ +months.narrow.12 = ١٢ + [time.gregorian] time.medium = [h]:[mm]:[ss] [a] time.short = [h]:[mm] [a] diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar.ini b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar.ini index d22aed41034..9e9d18799cf 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar.ini @@ -11,8 +11,8 @@ [identification] charset = utf8 -version = 1.1 -date = 2018-02-05 +version = 1.2 +date = 2019-01-31 name.local = العربية name.english = Arabic name.babel = arabic @@ -103,6 +103,32 @@ dayPeriods.narrow.pm = م dayPeriods.wide.am = ص dayPeriods.wide.pm = م +[date.islamic] +months.wide.1 = محرم +months.wide.2 = صفر +months.wide.3 = ربيع الأول +months.wide.4 = ربيع الآخر +months.wide.5 = جمادى الأولى +months.wide.6 = جمادى الآخرة +months.wide.7 = رجب +months.wide.8 = شعبان +months.wide.9 = رمضان +months.wide.10 = شوال +months.wide.11 = ذو القعدة +months.wide.12 = ذو الحجة +months.narrow.1 = ١ +months.narrow.2 = ٢ +months.narrow.3 = ٣ +months.narrow.4 = ٤ +months.narrow.5 = ٥ +months.narrow.6 = ٦ +months.narrow.7 = ٧ +months.narrow.8 = ٨ +months.narrow.9 = ٩ +months.narrow.10 = ١٠ +months.narrow.11 = ١١ +months.narrow.12 = ١٢ + [time.gregorian] time.medium = [h]:[mm]:[ss] [a] time.short = [h]:[mm] [a] diff --git a/Master/texmf-dist/tex/generic/babel/locale/fa/babel-fa.ini b/Master/texmf-dist/tex/generic/babel/locale/fa/babel-fa.ini index 2a185b0904e..f20094592ed 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/fa/babel-fa.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/fa/babel-fa.ini @@ -11,8 +11,8 @@ [identification] charset = utf8 -version = 1.1 -date = 2018-04-11 +version = 1.2 +date = 2019-01-31 name.local = فارسی name.english = Persian name.babel = persian @@ -103,6 +103,32 @@ dayPeriods.narrow.pm = ب dayPeriods.wide.am = قبلازظهر dayPeriods.wide.pm = بعدازظهر +[date.persian] +months.wide.1 = فروردین +months.wide.2 = اردیبهشت +months.wide.3 = خرداد +months.wide.4 = تیر +months.wide.5 = مرداد +months.wide.6 = شهریور +months.wide.7 = مهر +months.wide.8 = آبان +months.wide.9 = آذر +months.wide.10 = دی +months.wide.11 = بهمن +months.wide.12 = اسفند +months.narrow.1 = ف +months.narrow.2 = ا +months.narrow.3 = خ +months.narrow.4 = ت +months.narrow.5 = م +months.narrow.6 = ش +months.narrow.7 = م +months.narrow.8 = آ +months.narrow.9 = آ +months.narrow.10 = د +months.narrow.11 = ب +months.narrow.12 = ا + [time.gregorian] time.medium = [H]:[mm]:[ss] time.short = [H]:[mm] diff --git a/Master/texmf-dist/tex/generic/babel/locale/he/babel-he.ini b/Master/texmf-dist/tex/generic/babel/locale/he/babel-he.ini index 0367a8fc258..2adc0802040 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/he/babel-he.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/he/babel-he.ini @@ -11,8 +11,8 @@ [identification] charset = utf8 -version = 1.0 -date = 2017-09-01 +version = 1.1 +date = 2019-01-31 name.local = עברית name.english = Hebrew name.babel = hebrew @@ -140,6 +140,34 @@ months.wide.10 = \hebalef\hebvav\hebqof\hebtet\hebvav\hebbet\hebresh months.wide.11 = \hebnun\hebvav\hebbet\hebmem\hebbet\hebresh months.wide.12 = \hebdalet\hebtsadi\hebmem\hebbet\hebresh +[date.hebrew] +months.wide.1 = תשרי +months.wide.2 = חשוון +months.wide.3 = כסלו +months.wide.4 = טבת +months.wide.5 = שבט +months.wide.6 = אדר א׳ +months.wide.7 = אדר +months.wide.8 = ניסן +months.wide.9 = אייר +months.wide.10 = סיוון +months.wide.11 = תמוז +months.wide.12 = אב +months.wide.13 = אלול +months.narrow.1 = תש׳ +months.narrow.2 = חש׳ +months.narrow.3 = כס׳ +months.narrow.4 = טב׳ +months.narrow.5 = שב׳ +months.narrow.6 = א״א +months.narrow.7 = אד׳ +months.narrow.8 = ני׳ +months.narrow.9 = אי׳ +months.narrow.10 = סי׳ +months.narrow.11 = תמ׳ +months.narrow.12 = אב +months.narrow.13 = אל׳ + [time.gregorian] time.medium = [H]:[mm]:[ss] time.short = [H]:[mm] diff --git a/Master/texmf-dist/tex/generic/babel/locale/hi/babel-hi.ini b/Master/texmf-dist/tex/generic/babel/locale/hi/babel-hi.ini index 5d31399348f..735e5392ba6 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/hi/babel-hi.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/hi/babel-hi.ini @@ -12,8 +12,8 @@ [identification] charset = utf8 -version = 0.91 -date = 2017-04-10 +version = 1.0 +date = 2019-01-31 name.local = हिन्दी name.english = Hindi name.babel = hindi @@ -127,6 +127,32 @@ dayPeriods.narrow.pm = अ dayPeriods.wide.am = पूर्वाह्न dayPeriods.wide.pm = अपराह्न +[date.indian] +months.wide.1 = चैत्र +months.wide.2 = वैशाख +months.wide.3 = ज्येष्ठ +months.wide.4 = आषाढ़ +months.wide.5 = श्रावण +months.wide.6 = भाद्रपद +months.wide.7 = अश्विन +months.wide.8 = कार्तिक +months.wide.9 = अग्रहायण +months.wide.10 = पौष +months.wide.11 = माघ +months.wide.12 = फाल्गुन +months.narrow.1 = 1 +months.narrow.2 = 2 +months.narrow.3 = 3 +months.narrow.4 = 4 +months.narrow.5 = 5 +months.narrow.6 = 6 +months.narrow.7 = 7 +months.narrow.8 = 8 +months.narrow.9 = 9 +months.narrow.10 = 10 +months.narrow.11 = 11 +months.narrow.12 = 12 + [time.gregorian] time.medium = [h]:[mm]:[ss] [a] time.short = [h]:[mm] [a] @@ -149,7 +175,7 @@ delimiters.quotes = “”‘’ auxiliary = [\u200C\u200D] exemplarCharacters = [\u093C ॐ \u0902 \u0901 ः अ आ इ ई उ ऊ ऋ ऌ ऍ ए ऐ ऑ ओ औ क ख ग घ ङ च छ ज झ ञ ट ठ ड ढ ण त थ द ध न प फ ब भ म य र ल ळ व श ष स ह ऽ ा ि ी \u0941 \u0942 \u0943 \u0944 \u0945 \u0947 \u0948 ॉ ो ौ \u094D] index = [अ आ इ ई उ ऊ ऋ ए ऐ ओ औ क ख ग घ ङ च छ ज झ ञ ट ठ ड ढ ण त थ द ध न प फ ब भ म य र ल व श ष स ह] -punctuation = [। ॥ \\- , ; \\: ! ? . ‘ ’ “ ” ( ) \\[ \\] \\{ \\} ॰] +punctuation = [\\- , ; \\: ! ? . ‘ ’ “ ” ( ) \\[ \\] \\{ \\} ॰] [numbers] defaultNumberingSystem = latn @@ -171,4 +197,3 @@ superscriptingExponent = × alph = Alph = ordinals = - diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def index 8d7467cf185..0f08afd5b2a 100644 --- a/Master/texmf-dist/tex/generic/babel/luababel.def +++ b/Master/texmf-dist/tex/generic/babel/luababel.def @@ -475,16 +475,18 @@ \def\bbl@font@set#1#2#3{% eg \bbl@rmdflt@lang \rmdefault \rmfamily \bbl@xin@{<>}{#1}% \ifin@ - \bbl@exp{\\\bbl@fontspec@set\\#1\expandafter\@gobbletwo#1}% + \bbl@exp{\\\bbl@fontspec@set\\#1\expandafter\@gobbletwo#1\\#3}% \fi \bbl@exp{% - \def\\#2{#1}% eg, \rmdefault{\bbl@rmdflt@lang} + \def\\#2{#1}% eg, \rmdefault{\bbl@rmdflt@lang} \\\bbl@ifsamestring{#2}{\f@family}{\\#3\let\\\bbl@tempa\relax}{}}} -\def\bbl@fontspec@set#1#2#3{% eg \bbl@rmdflt@lang fnt-opt fnt-nme +\def\bbl@fontspec@set#1#2#3#4{% eg \bbl@rmdflt@lang fnt-opt fnt-nme \xxfamily \let\bbl@tempe\bbl@mapselect \let\bbl@mapselect\relax - \bbl@exp{% TODO - should be global, but even local does its job - % I'm still not sure -- must investigate + \let\bbl@temp@fam#4% eg, '\rmfamily', to be restored below + \let#4\relax % So that can be used with \newfontfamily + \bbl@exp{% + \let\\\bbl@temp@pfam\<\bbl@stripslash#4\space>% eg, '\rmfamily ' \<keys_if_exist:nnF>{fontspec-opentype}% {Script/\bbl@cs{sname@\languagename}}% {\\\newfontscript{\bbl@cs{sname@\languagename}}% @@ -493,10 +495,15 @@ {Language/\bbl@cs{lname@\languagename}}% {\\\newfontlanguage{\bbl@cs{lname@\languagename}}% {\bbl@cs{lotf@\languagename}}}% - \<fontspec_set_family:Nnn>\\#1% - {\bbl@cs{lsys@\languagename},#2}}{#3}% ie \bbl@exp{..}{#3} - \let\bbl@mapselect\bbl@tempe - \bbl@toglobal#1}% + \\\newfontfamily\\#4% + [\bbl@cs{lsys@\languagename},#2]}{#3}% ie \bbl@exp{..}{#3} + \begingroup + #4% + \xdef#1{\f@family}% eg, \bbl@rmdflt@lang{FreeSerif(0)} + \endgroup + \let#4\bbl@temp@fam + \bbl@exp{\let\<\bbl@stripslash#4\space>}\bbl@temp@pfam + \let\bbl@mapselect\bbl@tempe}% \def\bbl@font@rst#1#2#3#4{% \bbl@csarg\def{famrst@#4}{\bbl@font@set{#1}#2#3}} \def\bbl@font@fams{rm,sf,tt} @@ -549,9 +556,9 @@ \fi \ifx\bbl@opt@layout\@nnil\endinput\fi % if no layout \ifx\bbl@beforeforeign\leavevmode % A poor test for bidi= - \def\bbl@nextfake#1{% - \mathdir\bodydir % non-local, use always inside a group! + \def\bbl@nextfake#1{% non-local changes - always inside a group! \bbl@exp{% + \mathdir\the\bodydir #1% Once entered in math, set boxes to restore values \everyvbox{% \the\everyvbox diff --git a/Master/texmf-dist/tex/generic/babel/nil.ldf b/Master/texmf-dist/tex/generic/babel/nil.ldf index 7ef76efb096..7a2b9fdc525 100644 --- a/Master/texmf-dist/tex/generic/babel/nil.ldf +++ b/Master/texmf-dist/tex/generic/babel/nil.ldf @@ -32,7 +32,7 @@ %% extension |.ins|) which are part of the distribution. %% -\ProvidesLanguage{nil}[2018/11/13 3.27 Nil language] +\ProvidesLanguage{nil}[2019/04/01 3.28 Nil language] \LdfInit{nil}{datenil} \ifx\l@nohyphenation\@undefined \@nopatterns{nil} diff --git a/Master/texmf-dist/tex/generic/babel/switch.def b/Master/texmf-dist/tex/generic/babel/switch.def index 486e4da6b14..6495fb6ab65 100644 --- a/Master/texmf-dist/tex/generic/babel/switch.def +++ b/Master/texmf-dist/tex/generic/babel/switch.def @@ -37,7 +37,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{switch.def}[2018/11/13 3.27 Babel switching mechanism] +\ProvidesFile{switch.def}[2019/04/01 3.28 Babel switching mechanism] \ifx\AtBeginDocument\@undefined \input plain.def\relax \fi @@ -58,8 +58,8 @@ \countdef\last@language=19 \def\addlanguage{\alloc@9\language\chardef\@cclvi} \fi -\def\bbl@version{3.27} -\def\bbl@date{2018/11/13} +\def\bbl@version{3.28} +\def\bbl@date{2019/04/01} \def\adddialect#1#2{% \global\chardef#1#2\relax \bbl@usehooks{adddialect}{{#1}{#2}}% @@ -115,19 +115,22 @@ \aftergroup\bbl@pop@language \bbl@set@language{#1}} \def\BabelContentsFiles{toc,lof,lot} -\def\bbl@set@language#1{% +\def\bbl@set@language#1{% from selectlanguage, pop@ \edef\languagename{% \ifnum\escapechar=\expandafter`\string#1\@empty \else\string#1\@empty\fi}% \select@language{\languagename}% + % write to auxs \expandafter\ifx\csname date\languagename\endcsname\relax\else \if@filesw \protected@write\@auxout{}{\string\babel@aux{\languagename}{}}% \bbl@usehooks{write}{}% \fi \fi} -\def\select@language#1{% +\def\select@language#1{% from set@, babel@aux + % set hymap \ifnum\bbl@hymapsel=\@cclv\chardef\bbl@hymapsel4\relax\fi + % set name \edef\languagename{#1}% \bbl@fixname\languagename \bbl@iflanguage\languagename{% @@ -140,6 +143,7 @@ some cases, you may need to remove the aux file}% {You may proceed, but expect wrong results}% \else + % set type \let\bbl@select@type\z@ \expandafter\bbl@switch\expandafter{\languagename}% \fi}} @@ -162,7 +166,8 @@ \select@language{#1}} \let\select@language@x\select@language \newif\ifbbl@usedategroup -\def\bbl@switch#1{% +\def\bbl@switch#1{% from select@, foreign@ + % restore \originalTeX \expandafter\def\expandafter\originalTeX\expandafter{% \csname noextras#1\endcsname @@ -170,6 +175,7 @@ \babel@beginsave}% \bbl@usehooks{afterreset}{}% \languageshorthands{none}% + % switch captions, date \ifcase\bbl@select@type \ifhmode \hskip\z@skip % trick to ignore spaces @@ -180,19 +186,27 @@ \csname captions#1\endcsname\relax \csname date#1\endcsname\relax \fi - \else\ifbbl@usedategroup - \bbl@usedategroupfalse - \ifhmode - \hskip\z@skip % trick to ignore spaces - \csname date#1\endcsname\relax - \loop\ifdim\lastskip>\z@\unskip\repeat\unskip - \else - \csname date#1\endcsname\relax + \else + \ifbbl@usedategroup % if \foreign... within \<lang>date + \bbl@usedategroupfalse + \ifhmode + \hskip\z@skip % trick to ignore spaces + \csname date#1\endcsname\relax + \loop\ifdim\lastskip>\z@\unskip\repeat\unskip + \else + \csname date#1\endcsname\relax + \fi \fi - \fi\fi + \fi + % switch extras \bbl@usehooks{beforeextras}{}% \csname extras#1\endcsname\relax \bbl@usehooks{afterextras}{}% + % > babel-ensure + % > babel-sh-<short> + % > babel-bidi + % > babel-fontspec + % hyphenation - case mapping \ifcase\bbl@opt@hyphenmap\or \def\BabelLower##1##2{\lccode##1=##2\relax}% \ifnum\bbl@hymapsel>4\else @@ -205,7 +219,9 @@ \fi \fi \global\let\bbl@hymapsel\@cclv + % hyphenation - patterns \bbl@patterns{#1}% + % hyphenation - mins \babel@savevariable\lefthyphenmin \babel@savevariable\righthyphenmin \expandafter\ifx\csname #1hyphenmins\endcsname\relax @@ -249,18 +265,21 @@ {\par}% \endgroup} \def\foreign@language#1{% + % set name \edef\languagename{#1}% \bbl@fixname\languagename \bbl@iflanguage\languagename{% \expandafter\ifx\csname date\languagename\endcsname\relax - \bbl@warning + \bbl@warning % TODO - why a warning, not an error? {Unknown language `#1'. Either you have\\% misspelled its name, it has not been installed,\\% or you requested it in a previous run. Fix its name,\\% - install it or just rerun the file, respectively.\\% + install it or just rerun the file, respectively. In\\% + some cases, you may need to remove the aux file.\\% I'll proceed, but expect wrong results.\\% Reported}% \fi + % set type \let\bbl@select@type\@ne \expandafter\bbl@switch\expandafter{\languagename}}} \let\bbl@hyphlist\@empty @@ -277,6 +296,7 @@ \edef\bbl@tempa{#1:\f@encoding}% \fi \@expandtwoargs\bbl@usehooks{patterns}{{#1}{\bbl@tempa}}% + % > luatex \@ifundefined{bbl@hyphenation@}{}{% Can be \relax! \begingroup \bbl@xin@{,\number\language,}{,\bbl@hyphlist}% diff --git a/Master/texmf-dist/tex/generic/babel/xebabel.def b/Master/texmf-dist/tex/generic/babel/xebabel.def index cd47364b3c6..1159998dde1 100644 --- a/Master/texmf-dist/tex/generic/babel/xebabel.def +++ b/Master/texmf-dist/tex/generic/babel/xebabel.def @@ -149,16 +149,18 @@ \def\bbl@font@set#1#2#3{% eg \bbl@rmdflt@lang \rmdefault \rmfamily \bbl@xin@{<>}{#1}% \ifin@ - \bbl@exp{\\\bbl@fontspec@set\\#1\expandafter\@gobbletwo#1}% + \bbl@exp{\\\bbl@fontspec@set\\#1\expandafter\@gobbletwo#1\\#3}% \fi \bbl@exp{% - \def\\#2{#1}% eg, \rmdefault{\bbl@rmdflt@lang} + \def\\#2{#1}% eg, \rmdefault{\bbl@rmdflt@lang} \\\bbl@ifsamestring{#2}{\f@family}{\\#3\let\\\bbl@tempa\relax}{}}} -\def\bbl@fontspec@set#1#2#3{% eg \bbl@rmdflt@lang fnt-opt fnt-nme +\def\bbl@fontspec@set#1#2#3#4{% eg \bbl@rmdflt@lang fnt-opt fnt-nme \xxfamily \let\bbl@tempe\bbl@mapselect \let\bbl@mapselect\relax - \bbl@exp{% TODO - should be global, but even local does its job - % I'm still not sure -- must investigate + \let\bbl@temp@fam#4% eg, '\rmfamily', to be restored below + \let#4\relax % So that can be used with \newfontfamily + \bbl@exp{% + \let\\\bbl@temp@pfam\<\bbl@stripslash#4\space>% eg, '\rmfamily ' \<keys_if_exist:nnF>{fontspec-opentype}% {Script/\bbl@cs{sname@\languagename}}% {\\\newfontscript{\bbl@cs{sname@\languagename}}% @@ -167,10 +169,15 @@ {Language/\bbl@cs{lname@\languagename}}% {\\\newfontlanguage{\bbl@cs{lname@\languagename}}% {\bbl@cs{lotf@\languagename}}}% - \<fontspec_set_family:Nnn>\\#1% - {\bbl@cs{lsys@\languagename},#2}}{#3}% ie \bbl@exp{..}{#3} - \let\bbl@mapselect\bbl@tempe - \bbl@toglobal#1}% + \\\newfontfamily\\#4% + [\bbl@cs{lsys@\languagename},#2]}{#3}% ie \bbl@exp{..}{#3} + \begingroup + #4% + \xdef#1{\f@family}% eg, \bbl@rmdflt@lang{FreeSerif(0)} + \endgroup + \let#4\bbl@temp@fam + \bbl@exp{\let\<\bbl@stripslash#4\space>}\bbl@temp@pfam + \let\bbl@mapselect\bbl@tempe}% \def\bbl@font@rst#1#2#3#4{% \bbl@csarg\def{famrst@#4}{\bbl@font@set{#1}#2#3}} \def\bbl@font@fams{rm,sf,tt} |