diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/babel')
-rw-r--r-- | Master/texmf-dist/source/latex/babel/babel.dtx | 541 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/babel.ins | 7 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/bbcompat.dtx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/locale.zip | bin | 695472 -> 703750 bytes |
4 files changed, 322 insertions, 228 deletions
diff --git a/Master/texmf-dist/source/latex/babel/babel.dtx b/Master/texmf-dist/source/latex/babel/babel.dtx index dd085dd4cfd..8706a4c546f 100644 --- a/Master/texmf-dist/source/latex/babel/babel.dtx +++ b/Master/texmf-dist/source/latex/babel/babel.dtx @@ -5,10 +5,10 @@ %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. -%% +%% %% This file is part of the Babel system. %% -------------------------------------- -%% +%% %% It may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 %% of this license or (at your option) any later version. @@ -16,11 +16,11 @@ %% http://www.latex-project.org/lppl.txt %% and version 1.3 or later is part of all distributions of LaTeX %% version 2003/12/01 or later. -%% +%% %% This work has the LPPL maintenance status "maintained". -%% +%% %% The Current Maintainer of this work is Javier Bezos. -%% +%% %% The list of derived (unpacked) files belonging to the distribution %% and covered by LPPL is defined by the unpacking scripts (with %% extension |.ins|) which are part of the distribution. @@ -31,7 +31,7 @@ % % \iffalse %<*filedriver> -\ProvidesFile{babel.dtx}[2018/05/10 v3.21 The Babel package] +\ProvidesFile{babel.dtx}[2018/06/05 v3.22 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -58,7 +58,7 @@ \newcommand*\Lenv[1]{\texttt{#1}} \newcommand*\menv[1]{\char`\{#1\char`\}} \newcommand*\Eenv[1]{% - \quad\ldots\quad + \quad\ldots\quad \texttt{\color{thered}\string\end\menv{#1}}} \newcommand*\file[1]{\texttt{#1}} \newcommand*\cls[1]{\texttt{#1}} @@ -245,6 +245,11 @@ Javier Bezos (which provides some sample files, too). \item See section \ref{contribute} for contributing a language. + +\item The first sections describe the traditional way of loading a + language (with |ldf| files). The alternative way based on |ini| + files, which complements the previous one (it will \textit{not} + replace it), is described below. \end{itemize} \section{The user interface}\label{U-I} @@ -335,7 +340,7 @@ Package babel Warning: No hyphenation patterns were preloaded for \subsection{Multilingual documents} In multilingual documents, just use several options. The last one is -considered the main language, activated by default. Sometimes, the +considered the main language, activated by default. Sometimes, the main language changes the document layout (eg, |spanish| and |french|). \begin{example} @@ -533,7 +538,7 @@ necessary. The environments |otherlanguage|, |otherlanguage*| and |hyphenrules| are auxiliary, and described in the next section. The main language is selected automatically when the |document| -environment begins. +environment begins. \Describe{\selectlanguage}{\marg{language}} When a user wants to switch from one language to another he can @@ -582,7 +587,7 @@ patterns and a warning is shown). The environment \Lenv{otherlanguage} does basically the same as |\selectlanguage|, except the language change is (mostly) local to -the environment. +the environment. Actually, there might be some non-local changes, as this environment is roughly equivalent to: @@ -629,7 +634,7 @@ say, |'| done by some languages (eg, \textsf{italian}, \textsf{french}, \subsection{More on selection} \Describe{\babeltags}{\char`\{\m{tag1} \texttt{=} \m{language1}, \m{tag2} -\texttt{=} \m{language2}, \dots\char`\}} +\texttt{=} \m{language2}, \dots\char`\}} \New{3.9i} In multilingual documents with many language switches the commands above can be cumbersome. With this tool shorter names can be @@ -739,7 +744,7 @@ use only shorthands provided by languages. by a closing brace |}| and the spaces following are gobbled. With one-char shorthands (eg,~|:|), they are preserved. \item If on a certain level (system, language, user) there is a - one-char shorthand, two-char ones starting with that + one-char shorthand, two-char ones starting with that char and on the same level are ignored. \item Since they are active, a shorthand cannot contain the same character in its definition (except if it is deactivated with, eg, @@ -754,7 +759,7 @@ has an extra \textbraceright} ! Argument of \language@active@arg" has an extra }. \end{verbatim} It means there is a closing brace just after a shorthand, which is not -allowed (eg,~|"}|). Just add |{}| after (eg,~|"{}}|). +allowed (eg,~|"}|). Just add |{}| after (eg,~|"{}}|). \Describe{\shorthandon}{\marg{shorthands-list}} \DescribeOther{\shorthandoff}{% @@ -852,7 +857,7 @@ The command |\aliasshorthand| can be used to let another character perform the same functions as the default shorthand character. If one prefers for example to use the character |/| over |"| in typing Polish texts, this can be achieved by entering -|\aliasshorthand{"}{/}|. +|\aliasshorthand{"}{/}|. \begin{note} The substitute character must \textit{not} have been declared before @@ -965,7 +970,7 @@ The only language shorthands activated are those given, like, eg: \begin{verbatim} \usepackage[esperanto,french,shorthands=:;!?]{babel} -\end{verbatim} +\end{verbatim} If \verb|'| is included, \texttt{activeacute} is set; if \verb|`| is included, \texttt{activegrave} is set. Active characters (like \verb|~|) should be preceded by \verb|\string| (otherwise they will be @@ -988,7 +993,7 @@ and |\pageref| are redefined (as well as a few macros from redefined. This option is strongly recommended, because a good deal of incompatibilities and errors are related to these redefinitions -- of course, in such a case you cannot use shorthands in these macros, but -this is not a real problem (just use ``allowed'' characters). +this is not a real problem (just use ``allowed'' characters). \Describe{math=}{\texttt{active} $\string|$ \texttt{normal}} Shorthands are mainly intended for text, not for math. By setting this @@ -1017,7 +1022,7 @@ this file is loaded. \Describe{showlanguages}{} Prints to the log the list of languages loaded when the format was created: number (remember dialects can -share it), name, hyphenation file and exceptions file. +share it), name, hyphenation file and exceptions file. \Describe{nocase}{} \New{3.9l} Language settings for uppercase and lowercase mapping (as set by |\SetCase|) are ignored. Use only if there @@ -1103,7 +1108,7 @@ is finished (at |\ldf@finish|). The setting is global. So does ... at the end of |french.ldf|. It can be used in |ldf| files, too, but in such a case the code is executed only if \meta{option-name} is the same as |\CurrentOption| (which could not -be the same as the option name as set in |\usepackage|!). +be the same as the option name as set in |\usepackage|!). \begin{example} Consider two languages \textsf{foo} and \textsf{bar} defining the @@ -1126,14 +1131,15 @@ files containing the basic data required for a language. Most of them set the date, and many also the captions (Unicode and LICR). They will be evolving with the time to add more features -(something to keep in mind if backward compatibility is -important). The following section shows how to make use of them -currently (by means of |\babelprovide|), but a higher interface, based -on package options, in under development. +(something to keep in mind if backward compatibility is important). The +following section shows how to make use of them currently (by means of +|\babelprovide|), but a higher interface, based on package options, in +under development (in other words, |\babelprovide| is mainly intended +for auxiliary tasks). -\begin{example} +\begin{example} Although Georgian has its own \texttt{ldf} file, here is how to - declare this language with an |ini| file in Unicode engines. + declare this language with an |ini| file in Unicode engines. \begingroup \setmonofont[Scale=.87,Script=Georgian]{DejaVu Sans Mono} \begin{verbatim} @@ -1346,6 +1352,13 @@ captions): \tag{ru} Russian\hascapu\hascapl \tag{rw} Kinyarwanda \tag{rwk} Rwa +\tag{sa-Beng} Sanskrit +\tag{sa-Deva} Sanskrit +\tag{sa-Gujr} Sanskrit +\tag{sa-Knda} Sanskrit +\tag{sa-Mlym} Sanskrit +\tag{sa-Telu} Sanskrit +\tag{sa} Sanskrit \tag{sah} Sakha \tag{saq} Samburu \tag{sbp} Sangu @@ -1660,6 +1673,19 @@ samburu\\ samin\\ sango\\ sangu\\ +sanskrit-beng\\ +sanskrit-bengali\\ +sanskrit-deva\\ +sanskrit-devanagari\\ +sanskrit-gujarati\\ +sanskrit-gujr\\ +sanskrit-kannada\\ +sanskrit-knda\\ +sanskrit-malayalam\\ +sanskrit-mlym\\ +sanskrit-telu\\ +sanskrit-telugu\\ +sanskrit\\ scottishgaelic\\ sena\\ serbian-cyrillic-bosniaherzegovina\\ @@ -1833,7 +1859,10 @@ to select fonts in addition to the three basic ones. \babelfont[hindi]{rm}{Shobhika} \end{verbatim} This makes sure the OpenType script for Devanagari is |deva| and not - |dev2|. + |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.}). \end{note} \begin{note} @@ -1935,7 +1964,7 @@ Package babel Warning: \mylangchaptername not set. Please, define (babel) Reported on input line 18. \end{verbatim} -In most cases, you will only need to define a few macros. +In most cases, you will only need to define a few macros. \begin{example} If you need a language named |arhinish|: @@ -2047,11 +2076,16 @@ For example: \end{document} \end{verbatim} +Languages providing native digits in all or some variants are +\textit{ar, as, bn, bo, brx, ckb, dz, fa, gu, hi, km, kn, kok, ks, lo, +lrc, ml, mr, my, mzn, ne, or, pa, ps, ta, te, th, ug, ur, uz, vai, yue, +zh.} + \subsection{Getting the current language name} \Describe{\languagename}{} The control sequence |\languagename| contains the name of the -current language. +current language. \begin{warning} Due to some internal inconsistencies in catcodes, it should @@ -2125,7 +2159,7 @@ original |\-|), |\babelhyphen*{hard}|, etc. Note |hard| is also good for isolated prefixes (eg, \textit{anti-}) and |nobreak| for isolated suffixes (eg, \textit{-ism}), but in both -cases |\babelhyphen*{nobreak}| is usually better. +cases |\babelhyphen*{nobreak}| is usually better. There are also some differences with \LaTeX: (1) the character used is that set for the current font, while in \LaTeX{} it is hardwired to @@ -2180,7 +2214,7 @@ font encodings are the same, like in Unicode based engines. \subsection{Selecting scripts} -Currently \babel{} provides no standard interface to select +Currently \babel{} provides no standard interface to select scripts, because they are best selected with either |\fontencoding| (low level) or a language name (high level). Even the Latin script may require different encodings (ie, sets of glyphs) depending on the @@ -2237,12 +2271,15 @@ differ in the way `weak' numeric characters are ordered (eg, Arabic Setting bidi text has many subtleties (see for example <https://www.w3.org/TR/html-bidi/>). \textit{This means the \babel{} bidi code may take some time before it is truly stable.}\footnote{A - basic stable version for \luatex{} is planned before Summer - 2018. Other engines must wait very likely until Winter.} An effort - is being made to avoid incompatibilities in the future (this one of - the reason currently bidi must be explicitly requested as a package - option, with a certain bidi model, and also the |layout| options - described below). + basic stable version for \luatex{} is planned before (Northern) + Summer 2018. Other engines must wait very likely until (Northern) + Winter.} \textit{This is particularly true for graphical elements, + including the |picture| environment and PDF or PS based graphics.} + + An effort is being made to avoid incompatibilities in the future + (this one of the reason currently bidi must be explicitly requested + as a package option, with a certain bidi model, and also the |layout| + options described below). \end{warning} There are some package options controlling bidi writing. @@ -2341,10 +2378,10 @@ required by all engines. necessary.\footnote{Next on the roadmap are counters and numeral systems in general. Expect some minor readjustments.} -\item[lists] required in \xetex{} and \pdftex{}, but only in +\item[lists] required in \xetex{} and \pdftex{}, but only in multilingual documents in \luatex{}. -\item[contents] required in \xetex{} and \pdftex{}; in \luatex{} +\item[contents] required in \xetex{} and \pdftex{}; in \luatex{} toc entries are R by default if the main language is R. \item[columns] required in \xetex{} and \pdftex{} to reverse the @@ -2367,8 +2404,8 @@ 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 - the previous groups. Currently redefines in \luatex{} |\underline| and +\item[extras] is used for miscelaneous readjustments which do not fit into + the previous groups. Currently redefines in \luatex{} |\underline| and |LaTeX2e| \New{3.19}. \end{description} @@ -2523,7 +2560,7 @@ three \TeX{} parameters (|#1|, |#2|, |#3|), with the meaning given: Four events are used in \file{hyphen.cfg}, which are handled in a quite different way for efficiency reasons -- unlike the precedent -ones, they only have a single hook and replace a default definition. +ones, they only have a single hook and replace a default definition. \begin{description} \renewcommand\makelabel[1]{% \hspace\labelsep\normalfont\ttfamily\color{thered}#1} @@ -2539,7 +2576,7 @@ ones, they only have a single hook and replace a default definition. \end{description} \Describe\BabelContentsFiles{} -\New{3.9a} This macro contains a list of ``toc'' types +\New{3.9a} This macro contains a list of ``toc'' types requiring a command to switch the language. Its default value is |toc,lof,lot|, but you may redefine it with |\renewcommand| (it's up to you to make sure no toc type is duplicated). @@ -2586,7 +2623,7 @@ the current options may be different. It does not include |ini| files. \item[Norwegian] norsk, nynorsk \item[Polish] polish \item[Portuguese] portuges, portuguese, brazilian, brazil -\item[Romanian] romanian +\item[Romanian] romanian \item[Russian] russian \item[Scottish Gaelic] scottish \item[Spanish] spanish @@ -2674,7 +2711,7 @@ Then you preprocess it with |devnag| \m{file}, which creates (non-)French spacing is not always properly (un)set by languages. However, problems are unlikely to happen and therefore this part remains untouched in version 3.9 (but it is in the `to - do' list). + do' list). \item Using a character mathematically active (ie, with math code |"8000|) as a shorthand can make \TeX{} enter in an infinite loop in some rare cases. (Another issue in the `to do' list, although there @@ -2841,7 +2878,7 @@ body; here |\texthe| must be defined to select the main language): In a future a more complete method, reading recursively boxed text, may be added. -There are samples on GitHub, under \texttt{/required/babel/samples}: +There are samples on GitHub, under \texttt{/required/babel/samples}: |lua-bidibasic.tex| and |lua-secenum.tex|. \medskip @@ -2849,7 +2886,7 @@ There are samples on GitHub, under \texttt{/required/babel/samples}: A couple of tentative macros were provided by \babel{} ($\ge$3.9g) with a partial solution for ``Unicode'' fonts. These macros are now -deprecated --- use |\babelfont|. A short description follows, for +deprecated --- use |\babelfont|. A short description follows, for reference: \begin{itemize} \item |\babelFSstore|\marg{babel-language} sets the current three @@ -2857,7 +2894,7 @@ reference: given. \item |\babelFSdefault|\marg{babel-language}\marg{fontspec-features} patches |\fontspec| so that the given features are always passed as - the optional argument or added to it (not an ideal solution). + the optional argument or added to it (not an ideal solution). \end{itemize} So, for example: \begin{verbatim} @@ -2952,7 +2989,7 @@ Please, configure your TeX system to add them and rebuild the format. Now I will use the patterns preloaded for english instead}} \end{verbatim} -It simply means you must reconfigure \file{language.dat}, either by +It simply means you must reconfigure \file{language.dat}, either by hand or with the tools provided by your distribution. \section{The interface between the core of \babel{} and the language @@ -3047,7 +3084,7 @@ but if you want to do it, here are a few guidelines. \item Do not hesitate stating on the file heads you are the author and the maintainer, if you actually are. There is no need to state the babel maintainer(s) as authors if they have not contributed significantly - to your language files. + to your language files. \item Fonts are not strictly part of a language, so they are best placed in the corresponding TeX tree. This includes not only \texttt{tfm}, \texttt{vf}, \texttt{ps1}, \texttt{otf}, \texttt{mf} files and the @@ -3187,7 +3224,7 @@ first family in the given encoding seems to be needed. Here is the basic structure of an |ldf| file, with a language, a dialect and an attribute. Strings are best defined using the method -explained in in sec. \ref{s:strings} (\babel{} 3.9 and later). +explained in in sec. \ref{s:strings} (\babel{} 3.9 and later). \begin{verbatim} \ProvidesLanguage{<language>} @@ -3699,7 +3736,7 @@ help from Bernd Raichle, for which I am grateful. \bibitem{treebus} K.F. Treebus. \emph{Tekstwijzer, een gids voor het grafisch verwerken van tekst.} - SDU Uitgeverij ('s-Gravenhage, 1988). + SDU Uitgeverij ('s-Gravenhage, 1988). \bibitem{HP} Hubert Partl, \emph{German \TeX}, \emph{TUGboat} 9 (1988) \#1, p.~70--72. \bibitem{LLth} Leslie Lamport, @@ -3713,7 +3750,7 @@ help from Bernd Raichle, for which I am grateful. \emph{International \LaTeX\ is ready to use}, \emph{TUGboat} 11 (1990) \#1, p.~87--90. \bibitem{STS} Apostolos Syropoulos, Antonis Tsolomitis and Nick - Sofroniu, + Sofroniu, \emph{Digital typography using \LaTeX}, Springer, 2002, p.~301--373. \end{thebibliography} @@ -3723,7 +3760,7 @@ help from Bernd Raichle, for which I am grateful. % \fi % % \changes{babel~3.8e}{2005/03/24}{Many enhancements to the text by -% Andrew Young} +% Andrew Young} % \changes{babel~3.9c}{2013/04/04}{Added the ``modifiers'' mechanism} % \changes{babel~3.9g}{2013/06/01}{bbplain merged} % \changes{babel~3.9k}{2014/03/23}{Code and doc reorganized, and some @@ -3749,7 +3786,7 @@ help from Bernd Raichle, for which I am grateful. % features are considered complete. In other words, use \babel{} only % as documented (except, of course, if you want to explore and test % them -- you can post suggestions about multilingual issues to -% |kadingira@tug.org| on |http://tug.org/mailman/listinfo/kadingira|). +% |kadingira@tug.org| on |http://tug.org/mailman/listinfo/kadingira|). % % \section{Identification and loading of required files} % @@ -3770,20 +3807,62 @@ help from Bernd Raichle, for which I am grateful. % \file{switch.def}. % \end{description} % -% The \babel{} installer extends \textsf{docstrip} with a few -% ``pseudo-guards'' to set ``variables'' used at installation time. -% They are used with |<||@name@>| at the appropiated places in the -% source code and shown below with -% $\langle\langle$\textit{name}$\rangle\rangle$. That brings a -% little bit of literate programming. +% The \babel{} installer extends \textsf{docstrip} with a few +% ``pseudo-guards'' to set ``variables'' used at installation time. +% They are used with |<||@name@>| at the appropiated places in the +% source code and shown below with +% $\langle\langle$\textit{name}$\rangle\rangle$. That brings a little +% bit of literate programming. +% +% \section{\texttt{locale} directory} +% +% A required component of \babel{} is a set of |ini| files +% with basic definitions for about 200 languages. They are distributed +% as a separate |zip| file, not packed as |dtx|. With them, babel +% will fully support Unicode engines. + +% Most of them are essentially finished (except bugs and mistakes, of +% course). Some of them are still incomplete (but they will be usable), +% and there are some omissions (eg, Latin and polytonic Greek, and +% there are no geographic areas in Spanish). Hindi, French, Occitan and +% Breton will show a warning related to dates. Not all include LICR +% variants. +% +% This is a preliminary documentation. +% +% |ini| files contain the actual data; |tex| files are currently just +% proxies to the corresponding ini files. +% +% Most keys are self-explanatory. +% \begin{description} +% \item[charset] the encoding used in the ini file. +% \item[version] of the ini file +% \item[level] ``version'' of the ini specification . which keys are +% available (they may grow in a compatible way) and how they should be +% read. +% \item[encodings] a descriptive list of font encondings. +% \item[{[captions]}] section of captions in the file charset +% \item[{[captions.licr]}] same, but in pure ASCII using the LICR +% \item[date.long] fields are as in the CLDR, but the syntax is +% different. Anything inside brackets is a date field (eg, |MMMM| for +% the month name) and anything outside is text. In addition, |[ ]| is a +% non breakable space and |[.]| is an abbreviation dot. +% \end{description} +% +% Keys may be further qualified in a particular language with a suffix +% starting with a uppercase letter. It can be just a letter (eg, +% babel.name.A, babel.name.B) or a name (eg, date.long.Nominative, +% date.long.Formal, but no language is currently using the latter). +% Multi-letter qualifiers are forward compatible in the sense they +% won’t conflict with new ``global'' keys (all lowercase). +% +% \section{Tools} % % \begin{macrocode} -%<<version=3.21>> -%<<date=2018/05/10>> +%<<version=3.22>> +%<<date=2018/06/05>> % \end{macrocode} % -% \section{Tools} -% % \textbf{Do not use the following macros in \texttt{ldf} files. They % may change in the future}. This applies mainly to those recently % added for replacing, trimming and looping. The older ones, like @@ -3893,7 +3972,7 @@ help from Bernd Raichle, for which I am grateful. \long\def\bbl@trim@def#1{\bbl@trim{\def#1}} % \end{macrocode} % \end{macro} -% +% % % \begin{macro}{\bbl@ifunset} % To check if a macro is defined, we create a new macro, which does @@ -3922,7 +4001,7 @@ help from Bernd Raichle, for which I am grateful. \fi}} % \end{macrocode} % \end{macro} -% +% % \begin{macro}{\bbl@ifblank} % A tool from \textsf{url}, by Donald Arseneau, which tests if a % string is empty or space. @@ -3983,7 +4062,7 @@ help from Bernd Raichle, for which I am grateful. \bbl@afterfi \bbl@replace@aux##2#2% \fi}% - \expandafter\bbl@replace@aux#1#2\bbl@nil#2% + \expandafter\bbl@replace@aux#1#2\bbl@nil#2% \edef#1{\the\toks@}} % \end{macrocode} % \end{macro} @@ -4006,7 +4085,7 @@ help from Bernd Raichle, for which I am grateful. \bbl@exp@aux} % \end{macrocode} % \end{macro} -% +% % Two further tools. |\bbl@samestring| first expand its arguments and % then compare their expansion (sanitized, so that the catcodes do not % matter). |\bbl@engine| takes the following values: 0 is pdf\TeX, 1 @@ -4483,7 +4562,7 @@ help from Bernd Raichle, for which I am grateful. % \begin{macrocode} \ifx\bbl@opt@headfoot\@nnil\else \g@addto@macro\@resetactivechars{% - \set@typeset@protect + \set@typeset@protect \expandafter\select@language@x\expandafter{\bbl@opt@headfoot}% \let\protect\noexpand} \fi @@ -4529,7 +4608,7 @@ help from Bernd Raichle, for which I am grateful. % % \changes{babel~3.9a}{2012/06/15}{Rewritten the loading mechanism, so % that languages not declared are also correctly recognized, even -% if given as global options} +% if given as global options} % \changes{babel~3.9a}{2012/08/12}{Revised the loading mechanism} % \changes{babel~3.9i}{2014/03/01}{Removed German options, because % they are now loaded directly} @@ -4562,7 +4641,7 @@ help from Bernd Raichle, for which I am grateful. % \end{macrocode} % % Now, we set language options whose names are different from |ldf| files. -% +% % \changes{babel~3.9t}{2017/04/23}{Removed options for English, Indonesian and % Malay, now handled with proxy files} % \changes{babel~3.13}{2017/08/24}{Removed options for French, @@ -4794,7 +4873,7 @@ help from Bernd Raichle, for which I am grateful. \ProvidesFile{babel.def}[<@date@> <@version@> Babel common definitions] <@Load macros for plain if not LaTeX@> % \end{macrocode} -% +% % The file |babel.def| expects some definitions made in the \LaTeXe{} % style file. So, In \LaTeX2.09 and Plain{} we must provide at least % some predefined values as well some tools to set them (even if not @@ -5013,7 +5092,7 @@ help from Bernd Raichle, for which I am grateful. % implicitly. So, if a further argument is added in the future, % there is no need to change the existing code. Note events % intended for \textsf{hyphen.cfg} are also loaded (just in -% case you need them for some reason). +% case you need them for some reason). % % \begin{macrocode} \def\bbl@evargs{,% don't delete the comma @@ -5108,12 +5187,12 @@ help from Bernd Raichle, for which I am grateful. \fi \expandafter\bbl@tempa \fi}% - \bbl@tempa#1\@empty} + \bbl@tempa#1\@empty} \def\bbl@captionslist{% \prefacename\refname\abstractname\bibname\chaptername\appendixname \contentsname\listfigurename\listtablename\indexname\figurename \tablename\partname\enclname\ccname\headtoname\pagename\seename - \alsoname\proofname\glossaryname} + \alsoname\proofname\glossaryname} % \end{macrocode} % % \end{macro} @@ -5261,7 +5340,7 @@ help from Bernd Raichle, for which I am grateful. % % We also have to make sure that some code gets executed at the % beginning of the document. Languages does not set |\pagedir|, so -% we set here for the whole document to the main |\bodydir|. +% we set here for the whole document to the main |\bodydir|. % % \begin{macrocode} \AtBeginDocument{% @@ -5271,9 +5350,9 @@ help from Bernd Raichle, for which I am grateful. % % \end{macro} % \end{macro} -% +% % A bit of optimization. Select in heads/foots the language only if -% necessary. +% necessary. % % \begin{macrocode} \def\select@language@x#1{% @@ -5390,7 +5469,7 @@ help from Bernd Raichle, for which I am grateful. % % When there is also no current-level shorthand with an argument we % will check whether there is a next-level defined shorthand for -% this active character. +% this active character. % % \begin{macrocode} \long\@namedef{#3@arg#1}##1{% @@ -5429,7 +5508,7 @@ help from Bernd Raichle, for which I am grateful. % The very first thing to do is saving the original catcode and the % original definition, even if not active, which is possible % (undefined characters require a special treatement to avoid -% making them |\relax|). +% making them |\relax|). % % \begin{macrocode} \def\@initiate@active@char#1#2#3{% @@ -5527,7 +5606,7 @@ help from Bernd Raichle, for which I am grateful. % % \changes{babel~3.9a}{2012/12/27}{Shorthands are not defined % directly, but with a couple of intermediate macros} -% +% % We now define the default values which the shorthand is set to % when activated or deactivated. It is set to the deactivated form % (globally), so that the character expands to @@ -5599,8 +5678,8 @@ help from Bernd Raichle, for which I am grateful. % \changes{babel~3.9a}{2012/12/27}{Removed the redeclaration of % \cs{normal@char'} because it is handled in a generic way above} % \changes{babel~3.9a}{2012/12/29}{Removed the intermediate step of -% \cs{bbl@act@caret} and moved above} -% \changes{babel~3.9i}{2012/12/29}{Added the event \cs{initiateactive}} +% \cs{bbl@act@caret} and moved above} +% \changes{babel~3.9i}{2012/12/29}{Added the event \cs{initiateactive}} % % \begin{macrocode} \if\string'#2% @@ -5817,7 +5896,7 @@ help from Bernd Raichle, for which I am grateful. % achieve this the helper macro |\textormath| is provided. % % \changes{babel~3.9a}{2012/12/29}{Failed if an argument had a -% condicional. Use the more robust mechanism of \cs{XXXoftwo}} +% condicional. Use the more robust mechanism of \cs{XXXoftwo}} % % \begin{macrocode} \def\textormath{% @@ -5888,7 +5967,7 @@ help from Bernd Raichle, for which I am grateful. % \begin{macro}{\defineshorthand} % % \changes{babel~3.9a}{2012/08/05}{Added optional argument, to provide -% a way to (re)define language shorthands} +% a way to (re)define language shorthands} % \changes{babel~3.9a}{2012/08/25}{Extended for language-dependent % user macros, with two new auxiliary macros} % @@ -5980,7 +6059,7 @@ help from Bernd Raichle, for which I am grateful. % \begin{macro}{\@notshorthand} % % \changes{v3.8d}{2004/11/20}{Error message added} -% +% % \begin{macrocode} \def\@notshorthand#1{% \bbl@error{% @@ -6023,7 +6102,7 @@ help from Bernd Raichle, for which I am grateful. % Switching off and on is easy -- we just set the category % code to `other' (12) and |\active|. With the starred version, the % original catcode and the original definition, saved -% in |@initiate@active@char|, are restored. +% in |@initiate@active@char|, are restored. % % \begin{macrocode} \def\bbl@switch@sh#1#2{% @@ -6110,7 +6189,7 @@ help from Bernd Raichle, for which I am grateful. \fi\fi} \begingroup \catcode`\^=7 \catcode`\*=\active \lccode`\*=`\^ - \catcode`\'=12 \catcode`\"=\active \lccode`\"=`\' + \catcode`\'=12 \catcode`\"=\active \lccode`\"=`\' \lowercase{% \gdef\bbl@pr@m@s{% \bbl@if@primes"'% @@ -6746,7 +6825,7 @@ help from Bernd Raichle, for which I am grateful. % \begin{macrocode} \@onlypreamble\StartBabelCommands \def\StartBabelCommands{% - \begingroup + \begingroup \bbl@recatcode{11}% <@Macros local to BabelCommands@> \def\bbl@provstring##1##2{% @@ -6799,7 +6878,7 @@ help from Bernd Raichle, for which I am grateful. % does with encoded strings what the manual says.} % \changes{babel~3.9h}{2013/11/08}{Tidied up code related to % \cs{bbl@scswitch}} -% +% % \begin{macrocode} \newcommand\bbl@startcmds@ii[1][\@empty]{% \let\SetString\@gobbletwo @@ -6873,7 +6952,7 @@ help from Bernd Raichle, for which I am grateful. % There are also two version of |\bbl@forlang|. The first one skips % the current iteration if the language is not in |\BabelLanguages| % (used in |ldf|s), and the second one skips undefined languages -% (after \babel{} has been loaded) . +% (after \babel{} has been loaded) . % % \begin{macrocode} \def\bbl@forlang#1#2{% @@ -6902,9 +6981,9 @@ help from Bernd Raichle, for which I am grateful. \endgroup \bbl@scafter} % \end{macrocode} -% +% % Now we define commands to be used inside |\StartBabelCommands|. -% +% % \paragraph{Strings} The following macro is the actual definition % of |\SetString| when it is ``active'' % @@ -6917,7 +6996,7 @@ help from Bernd Raichle, for which I am grateful. % % \changes{babel~3.9g}{2013/07/29}{Added \cs{bbl@forlang} to ignore in % the preamble unknown languages, as described in the doc.} -% +% % \begin{macrocode} \def\bbl@setstring#1#2{% \bbl@forlang\bbl@tempa{% @@ -6938,7 +7017,7 @@ help from Bernd Raichle, for which I am grateful. % expanded in case transformations. It is |\relax| by default, but % in |\MakeUppercase| and |\MakeLowercase| its value is a modified % expandable |\@changed@cmd|. -% +% % \changes{babel~3.9i}{2014/03/13}{Added code to expand captions in % case transformations.} % @@ -6946,7 +7025,7 @@ help from Bernd Raichle, for which I am grateful. \ifx\bbl@opt@strings\relax \def\bbl@scset#1#2{\def#1{\bbl@encoded#2}} \bbl@patchuclc - \let\bbl@encoded\relax + \let\bbl@encoded\relax \def\bbl@encoded@uclc#1{% \@inmathwarn#1% \expandafter\ifx\csname\cf@encoding\string#1\endcsname\relax @@ -6972,7 +7051,7 @@ help from Bernd Raichle, for which I am grateful. % % \changes{babel~3.9h}{2013/10/16}{Tidied up and bug fixed - first % element expanded prematurely.} -% +% % \begin{macrocode} %<<*Macros local to BabelCommands>> \def\SetStringLoop##1##2{% @@ -7013,7 +7092,7 @@ help from Bernd Raichle, for which I am grateful. \expandafter\bbl@encstring \csname\bbl@tempa @bbl@uclc\endcsname{\bbl@tempa##1}% \expandafter\bbl@encstring - \csname\bbl@tempa @bbl@uc\endcsname{##2}% + \csname\bbl@tempa @bbl@uc\endcsname{##2}% \expandafter\bbl@encstring \csname\bbl@tempa @bbl@lc\endcsname{##3}}}% %<</Macros local to BabelCommands>> @@ -7022,7 +7101,7 @@ help from Bernd Raichle, for which I am grateful. % Macros to deal with case mapping for hyphenation. To decide if the % document is monolingual or multilingual, we make a rough guess -- % just see if there is a comma in the languages list, built in the -% first pass of the package options. +% first pass of the package options. % % \begin{macrocode} %<<*Macros local to BabelCommands>> @@ -7070,13 +7149,13 @@ help from Bernd Raichle, for which I am grateful. % \cs{bbl@opt@hyphenmap} for consistency} % % \begin{macrocode} -%<<*More package options>> +%<<*More package options>> \DeclareOption{hyphenmap=off}{\chardef\bbl@opt@hyphenmap\z@} \DeclareOption{hyphenmap=first}{\chardef\bbl@opt@hyphenmap\@ne} -\DeclareOption{hyphenmap=select}{\chardef\bbl@opt@hyphenmap\tw@} +\DeclareOption{hyphenmap=select}{\chardef\bbl@opt@hyphenmap\tw@} \DeclareOption{hyphenmap=other}{\chardef\bbl@opt@hyphenmap\thr@@} \DeclareOption{hyphenmap=other*}{\chardef\bbl@opt@hyphenmap4\relax} -%<</More package options>> +%<</More package options>> % \end{macrocode} % % Initial setup to provide a default behavior if |hypenmap| @@ -7111,7 +7190,7 @@ help from Bernd Raichle, for which I am grateful. % % \begin{macrocode} \def\save@sf@q#1{\leavevmode - \begingroup + \begingroup \edef\@SF{\spacefactor\the\spacefactor}#1\@SF \endgroup} % \end{macrocode} @@ -7524,7 +7603,7 @@ help from Bernd Raichle, for which I am grateful. % ones that are provided when the package \pkg{fontenc} with % option \Lopt{OT1} is used. Therefore these declarations are % postponed until the beginning of the document. Note these -% definitions only apply to some languages, but +% definitions only apply to some languages, but % babel sets them for \textit{all} languages -- you may want to % redefine |\bbl@umlauta| and/or |\bbl@umlaute| for a language % in the corresponding |ldf| (using the babel switching mechanism, @@ -7641,7 +7720,7 @@ help from Bernd Raichle, for which I am grateful. % % \begin{macrocode} \bbl@trace{Creating languages and reading ini files} -\newcommand\babelprovide[2][]{% +\newcommand\babelprovide[2][]{% \let\bbl@savelangname\languagename \def\languagename{#2}% \let\bbl@KVP@captions\@nil @@ -7748,6 +7827,8 @@ help from Bernd Raichle, for which I am grateful. % % Depending on whether or not the language exists, we define two macros. % +% \changes{3.22}{2018/06/05}{Fix - Error with \cs{chapter} if empty in ini.}- +% % \begin{macrocode} \def\bbl@provide@new#1{% \@namedef{date#1}{}% marks lang exists - required by \StartBabelCommands @@ -7759,9 +7840,9 @@ help from Bernd Raichle, for which I am grateful. \ifx##1\@empty\else \bbl@exp{% \\\SetString\\##1{% - \\\bbl@nocaption{\bbl@stripslash##1}{\<#1\bbl@stripslash##1>}}}% + \\\bbl@nocaption{\bbl@stripslash##1}{#1\bbl@stripslash##1}}}% \expandafter\bbl@tempb - \fi}% + \fi}% \expandafter\bbl@tempb\bbl@captionslist\@empty \else \bbl@read@ini{\bbl@KVP@captions}% Here all letters cat = 11 @@ -7771,7 +7852,7 @@ help from Bernd Raichle, for which I am grateful. \StartBabelCommands*{#1}{date}% \ifx\bbl@KVP@import\@nil \bbl@exp{% - \\\SetString\\\today{\\\bbl@nocaption{today}{\<#1today>}}}% + \\\SetString\\\today{\\\bbl@nocaption{today}{#1today}}}% \else \bbl@savetoday \bbl@savedate @@ -7874,8 +7955,8 @@ help from Bernd Raichle, for which I am grateful. % The special cases for comment lines and sections are handled by the % two following commands. In sections, we provide the posibility to % take extra actions at the end or at the start (TODO - but note the last -% section is not ended). By default, key=val pairs are ignored. -% +% section is not ended). By default, key=val pairs are ignored. +% % \begin{macrocode} \def\bbl@iniskip#1\@@{}% if starts with ; \def\bbl@inisec[#1]#2\@@{% if starts with opening bracket @@ -7886,7 +7967,7 @@ help from Bernd Raichle, for which I am grateful. {\let\bbl@inireader\bbl@iniskip}% {\bbl@exp{\let\\\bbl@inireader\<bbl@secline@#1>}}} % \end{macrocode} -% +% % Reads a key=val line and stores the trimmed val in % |\bbl@@kv@<section>.<key>|. % @@ -7896,7 +7977,7 @@ help from Bernd Raichle, for which I am grateful. \bbl@trim\toks@{#2}% \bbl@csarg\edef{@kv@\bbl@section.\bbl@tempa}{\the\toks@}} % \end{macrocode} -% +% % The previous assignments are local, so we need to export them. If % the value is empty, we can provide a default value. % @@ -7931,6 +8012,13 @@ help from Bernd Raichle, for which I am grateful. \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}% \bbl@exportkey{hyphr}{typography.hyphenrules}{}% \bbl@exportkey{dgnat}{numbers.digits.native}{}% + \bbl@xin@{0.5}{\@nameuse{bbl@@kv@identification.version}}% + \ifin@ + \bbl@warning{% + There are neither captions nor date in `\languagename'.\\% + It may not be suitable for proper typesetting, and it\\% + could change. Reported}% + \fi \bbl@xin@{0.9}{\@nameuse{bbl@@kv@identification.version}}% \ifin@ \bbl@warning{% @@ -7941,7 +8029,7 @@ help from Bernd Raichle, for which I am grateful. \bbl@toglobal\bbl@savetoday \bbl@toglobal\bbl@savedate} % \end{macrocode} -% +% % Now |captions| and |captions.licr|, depending on the engine. And % also for dates. They rely on a few auxilary macros. % @@ -7960,7 +8048,7 @@ help from Bernd Raichle, for which I am grateful. \bbl@ini@dategreg#1...\relax{#2}} \fi % \end{macrocode} -% +% % The auxiliary macro for captions define |\<caption>name|. % % \begin{macrocode} @@ -7968,7 +8056,7 @@ help from Bernd Raichle, for which I am grateful. \bbl@trim@def\bbl@tempa{#1}% \bbl@ifblank{#2}% {\bbl@exp{% - \toks@{\\\bbl@nocaption{\bbl@tempa}\<\languagename\bbl@tempa name>}}}% + \toks@{\\\bbl@nocaption{\bbl@tempa}{\languagename\bbl@tempa name}}}}% {\bbl@trim\toks@{#2}}% \bbl@exp{% \\\bbl@add\\\bbl@savestrings{% @@ -7979,7 +8067,7 @@ help from Bernd Raichle, for which I am grateful. % |date.gregorian|, so we must read it in non-Unicode engines, too. % % \changes{3.16}{2018/01/02}{Fix - dates were severely broken.} -% +% % \begin{macrocode} \bbl@csarg\def{secpre@date.gregorian.licr}{% \ifcase\bbl@engine\let\bbl@savedate\@empty\fi} @@ -7991,7 +8079,7 @@ help from Bernd Raichle, for which I am grateful. \bbl@exp{% \\\bbl@add\\\bbl@savedate{% \\\SetString\<month\romannumeral\bbl@tempa name>{\the\toks@}}}}% - {\bbl@ifsamestring{\bbl@tempa}{date.long}% + {\bbl@ifsamestring{\bbl@tempa}{date.long}% {\bbl@trim@def\bbl@toreplace{#5}% \bbl@TG@@date \global\bbl@csarg\let{date@\languagename}\bbl@toreplace @@ -8069,11 +8157,11 @@ help from Bernd Raichle, for which I am grateful. \bbl@csarg\bbl@toglobal{lsys@#1}}% % \bbl@exp{% TODO - should be global % \<keys_if_exist:nnF>{fontspec-opentype/Script}{\bbl@cs{sname@#1}}% - % {\\\newfontscript{\bbl@cs{sname@#1}}{\bbl@cs{sotf@#1}}}% + % {\\\newfontscript{\bbl@cs{sname@#1}}{\bbl@cs{sotf@#1}}}% % \<keys_if_exist:nnF>{fontspec-opentype/Language}{\bbl@cs{lname@#1}}% % {\\\newfontlanguage{\bbl@cs{lname@#1}}{\bbl@cs{lotf@#1}}}}} % \end{macrocode} -% +% % The following |ini| reader ignores everything but the % |identification| section. It is called when a font is defined (ie, % when the language is first selected) to know which script/language @@ -8089,7 +8177,7 @@ help from Bernd Raichle, for which I am grateful. \def\BabelBeforeIni##1##2{% \begingroup \bbl@add\bbl@secpost@identification{\closein1 }% - \catcode`\[=12 \catcode`\]=12 \catcode`\==12 + \catcode`\[=12 \catcode`\]=12 \catcode`\==12 % \bbl@read@ini{##1}% \endgroup}% boxed, to avoid extra spaces: {\setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}}} @@ -8463,9 +8551,9 @@ help from Bernd Raichle, for which I am grateful. % argument} % \changes{babel~3.8f}{2005/05/15}{Make the definition independent of % the original definition; expand \cs{languagename} before passing -% it into the token registers} +% it into the token registers} % \changes{babel~3.9t}{2017/04/23}{Refactored \cs{markright} and -% \cs{markboth}} +% \cs{markboth}} % % We check whether the argument is empty; if it is, we just make % sure the scratch token register is empty. Next, we store the @@ -8481,7 +8569,7 @@ help from Bernd Raichle, for which I am grateful. \IfBabelLayout{sectioning} {\ifx\bbl@opt@headfoot\@nnil \g@addto@macro\@resetactivechars{% - \set@typeset@protect + \set@typeset@protect \expandafter\select@language@x\expandafter{\bbl@main@language}% \let\protect\noexpand}% \fi} @@ -8508,12 +8596,12 @@ help from Bernd Raichle, for which I am grateful. % % \changes{babel~3.8c}{2004/05/26}{No need to add \emph{anything} to % an empty mark, prevented this by checking the contents of the -% arguments} +% arguments} % \changes{babel~3.8f}{2005/05/15}{Make the definition independent of % the original definition; expand \cs{languagename} before passing -% it into the token registers} +% it into the token registers} % \changes{babel~3.8j}{2008/03/21}{Added setting of \cs{@mkboth} (PR -% 3826)} +% 3826)} % % \begin{macrocode} \ifx\@mkboth\markboth @@ -8734,7 +8822,7 @@ help from Bernd Raichle, for which I am grateful. % but it broke bookmarks. This was quickly fixed in \pkg{hyperref}, % which essentially made it no-op. However, it will not removed for % the moment because \pkg{hyperref} is expecting it. -% +% % \begin{macrocode} \AtBeginDocument{% \ifx\pdfstringdefDisableCommands\@undefined\else @@ -8834,7 +8922,7 @@ help from Bernd Raichle, for which I am grateful. \def\bbl@tempb#1\@@{\uppercase{\bbl@tempc#1}ENC.DEF\@empty\@@}% \def\bbl@tempc#1ENC.DEF#2\@@{% \ifx\@empty#2\else - \bbl@ifunset{T@#1}% + \bbl@ifunset{T@#1}% {}% {\bbl@xin@{,#1,}{,\BabelNonASCII,}% \ifin@ @@ -8930,7 +9018,7 @@ help from Bernd Raichle, for which I am grateful. % \end{macrocode} % % \end{macro} -% +% % \subsection{Basic bidi support} % % \textbf{Work in progress.} This code is currently placed here for @@ -9055,7 +9143,7 @@ help from Bernd Raichle, for which I am grateful. {I'll insert a new group, but expect wrong results.}% \bgroup\aftergroup#2\aftergroup\egroup \else - \ifcase\currentgrouptype\or % 0 bottom + \ifcase\currentgrouptype\or % 0 bottom \aftergroup#2% 1 simple {} \or \bgroup\aftergroup#2\aftergroup\egroup % 2 hbox @@ -9080,7 +9168,7 @@ help from Bernd Raichle, for which I am grateful. \let\bbl@pagedir\@gobble \def\bbl@dirparastext{\chardef\bbl@thepardir\bbl@thetextdir} % \end{macrocode} -% +% % The following command is executed only if there is a right-to-left % script (once). It activates the |\everypar| hack for \xetex, to % properly handle the par direction. Note text and par dirs are @@ -9091,13 +9179,13 @@ help from Bernd Raichle, for which I am grateful. % % \begin{macrocode} \def\bbl@xebidipar{% - \let\bbl@xebidipar\relax + \let\bbl@xebidipar\relax \TeXXeTstate\@ne \def\bbl@xeeverypar{% \ifcase\bbl@thepardir \ifcase\bbl@thetextdir\else\beginR\fi \else - {\setbox\z@\lastbox\beginR\box\z@}% + {\setbox\z@\lastbox\beginR\box\z@}% \fi}% \let\bbl@severypar\everypar \newtoks\everypar @@ -9105,8 +9193,8 @@ help from Bernd Raichle, for which I am grateful. \bbl@severypar{\bbl@xeeverypar\the\everypar}} \fi % \end{macrocode} -% -% A tool for weak L (mainly digits). +% +% A tool for weak L (mainly digits). % % \changes{3.16}{2018/01/02}{New macro \cs{babelsublr}} % @@ -9193,7 +9281,7 @@ help from Bernd Raichle, for which I am grateful. % \end{macro} % % \changes{babel~3.9a}{2012/09/07}{Added macro} -% \changes{babel~3.9a}{2013/01/23}{New macro to normalize +% \changes{babel~3.9a}{2013/01/23}{New macro to normalize % a macro (eg, \cs{languagename}) to lowercase if necessary} % % |\bbl@iflanguage| executes code only if the language |l@| @@ -9402,7 +9490,7 @@ help from Bernd Raichle, for which I am grateful. % \end{macro} % % \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 @@ -9425,6 +9513,8 @@ help from Bernd Raichle, for which I am grateful. % \changes{babel~3.9h}{2013/11/20}{Error with a more helpful text } % \changes{babel~3.16}{2018/01/02}{New mechanism to pass the language % to aux, toc, etc.} +% \changes{babel~3.22}{2018/06/05}{Unknown languages in aux files do +% not raise an error any more (only a warning).} % % \begin{macrocode} \def\BabelContentsFiles{toc,lof,lot} @@ -9457,13 +9547,24 @@ help from Bernd Raichle, for which I am grateful. \expandafter\bbl@switch\expandafter{\languagename}% \fi}} \def\babel@aux#1#2{% - \select@language{#1}% - \bbl@foreach\BabelContentsFiles{% - \@writefile{##1}{\babel@toc{#1}{#2}}}} %% TODO - ok in plain? + \expandafter\ifx\csname date#1\endcsname\relax + \expandafter\ifx\csname bbl@auxwarn@#1\endcsname\relax + \@namedef{bbl@auxwarn@#1}{}% + \bbl@warning + {Unknown language `#1'. Very likely you\\% + requested it in a previous run. Expect some\\% + wrong results in this run, which should vanish\\% + in the next one. Reported}% + \fi + \else + \select@language{#1}% + \bbl@foreach\BabelContentsFiles{% + \@writefile{##1}{\babel@toc{#1}{#2}}}% %% TODO - ok in plain? + \fi} \def\babel@toc#1#2{% \select@language{#1}} % \end{macrocode} -% +% % A bit of optimization. Select in heads/foots the language only if % necessary. The real thing is in \texttt{babel.def}. % @@ -9508,7 +9609,7 @@ help from Bernd Raichle, for which I am grateful. % % \changes{babel~3.9a}{2012/08/01}{Adddd \cs{bbl@iflanguagename} and % \cs{select@language@x}, which is no-op if the language is the same} -% \changes{babel~3.9a}{2013/01/23}{\cs{select@language} sets +% \changes{babel~3.9a}{2013/01/23}{\cs{select@language} sets % \textsc{languagename} so that it has the correct value in the aux % file (eg, shorthand expansion was wrong)} % \changes{babel~3.9a}{2012/08/14}{Make sure the save counter is reset @@ -9620,7 +9721,7 @@ help from Bernd Raichle, for which I am grateful. % definitions. The grouping mechanism of the environment will take % care of resetting the correct hyphenation rules and ``extras''. % -% \begin{macrocode} +% \begin{macrocode} \expandafter\let\csname endotherlanguage*\endcsname\relax % \end{macrocode} % @@ -9797,7 +9898,7 @@ help from Bernd Raichle, for which I am grateful. % cases you should use |otherlanguage*|. % % \changes{babel~3.8j}{2008/03/16}{Also set the hyphenmin parameters to -% the correct value (PR3997)} +% the correct value (PR3997)} % \changes{babel~3.8l}{2008/07/06}{Use \cs{bbl@patterns}} % \changes{3.15}{2017/10/30}{Don't set language name. Use temp macro.} % \changes{3.15}{2018/02/14}{Fix - didn't work with polyglossia} @@ -9964,7 +10065,7 @@ help from Bernd Raichle, for which I am grateful. % \changes{babel~3.9a}{2012/07/30}{\cs{newcommand}s replaced by % \cs{def}'s, so that the file can be loaded twice} % \changes{babel~3.9a}{2013/01/26}{Define generic variants instead of -% duplicating each predefined message} +% duplicating each predefined message} % % \begin{macrocode} \edef\bbl@nulllanguage{\string\language=0} @@ -10008,13 +10109,14 @@ help from Bernd Raichle, for which I am grateful. {\let\bbl@info\@gobble \let\bbl@warning\@gobble} {} -\def\bbl@nocaption#1#2{% 1: text to be printed 2: caption macro \langXname - \gdef#2{\textbf{?#1?}}% - #2% +\def\bbl@nocaption{\protect\bbl@nocaption@i} +\def\bbl@nocaption@i#1#2{% 1: text to be printed 2: caption macro \langXname + \global\@namedef{#2}{\textbf{?#1?}}% + \@nameuse{#2}% \bbl@warning{% - \string#2 not set. Please, define\\% + \@backslashchar#2 not set. Please, define\\% it in the preamble with something like:\\% - \string\renewcommand\string#2{..}\\% + \string\renewcommand\@backslashchar#2{..}\\% Reported}} \def\@nolanerr#1{% \bbl@error @@ -10044,13 +10146,11 @@ help from Bernd Raichle, for which I am grateful. % this code in the file \file{hyphen.cfg}. Code is written with lower % level macros. % -% |toks8| stores info to be shown when the program is run. -% % \changes{babel~3.9g}{2013/05/30}{Code moved from plain.def} % % We want to add a message to the message \LaTeX$\:$2.09 puts in % the |\everyjob| register. This could be done by the following -% code: +% code: %\begin{verbatim} % \let\orgeveryjob\everyjob % \def\everyjob#1{% @@ -10091,7 +10191,7 @@ help from Bernd Raichle, for which I am grateful. % % Then everything is restored to the old situation and the format % is dumped. -% +% % \begin{macrocode} <@Make sure ProvidesFile is defined@> \ProvidesFile{hyphen.cfg}[<@date@> <@version@> Babel hyphens] @@ -10109,7 +10209,6 @@ help from Bernd Raichle, for which I am grateful. \let\dump\orig@dump\let\orig@dump\@undefined\dump} \fi <@Define core switching macros@> -\toks8{Babel <<@version@>> and hyphenation patterns for }% % \end{macrocode} % % @@ -10124,7 +10223,7 @@ help from Bernd Raichle, for which I am grateful. % \changes{babel~3.9a}{2012/12/12}{Use spaces as delimiters, to avoid % extra spaces. Once parsed, pass them in the traditional way} % -% \begin{macrocode} +% \begin{macrocode} \def\process@line#1#2 #3 #4 {% \ifx=#1% \process@synonym{#2}% @@ -10140,7 +10239,7 @@ help from Bernd Raichle, for which I am grateful. % % This macro takes care of the lines which start with an % \texttt{=}. It needs an empty token register to begin with. -% |\bbl@languages| is also set to empty. +% |\bbl@languages| is also set to empty. % % \begin{macrocode} \toks@{} @@ -10183,11 +10282,9 @@ help from Bernd Raichle, for which I am grateful. % patterns. The optional third argument is the name of a file % containing hyphenation exceptions. % -% The first thing to do is call |\addlanguage| to allocate a -% pattern register and to make that register `active'. -% Then the `name' of the language that will be loaded now is -% added to the token register |\toks8|. and finally -% the pattern file is read. +% The first thing to do is call |\addlanguage| to allocate a pattern +% register and to make that register `active'. Then the pattern file +% is read. % % \changes{babel~3.9a}{2012/12/10}{Removed \cs{selectfont} (I presume % it was intended to catch wrong encoding codes, but I don't think @@ -10373,7 +10470,7 @@ help from Bernd Raichle, for which I am grateful. % % \changes{babel~3.9a}{2012/12/14}{Test simplified and moved} % \changes{babel~3.9a}{2012/12/12}{Use only spaces as delimiters and -% not /, as previouly done} +% not /, as previouly done} % % If the file has reached its end, exit from the loop here. If not, % empty lines are skipped. Add 3 space characters to the end of @@ -10394,7 +10491,7 @@ help from Bernd Raichle, for which I am grateful. % |\ifeof| without |\else|. Then reactivate the default patterns. % % \changes{babel~3.8m}{2008/07/08}{Also restore the name of the -% language in \cs{languagename} (PR 4039)} +% language in \cs{languagename} (PR 4039)} % % \begin{macrocode} \begingroup @@ -10418,13 +10515,13 @@ help from Bernd Raichle, for which I am grateful. % register. % % \changes{babel~3.9a}{2012/09/25}{The list of languages is not -% printed every job any more (it is saved in \cs{bbl@languages}).} +% printed every job any more (it is saved in \cs{bbl@languages}).} % \changes{babel~3.9g}{2013/07/28}{In non-LaTeX formats the number of % languages were not printed. Moved from \cs{dump} and cleaned up: -% now \cs{toks}8 is expanded here.} +% now \cs{toks}8 is expanded here.} % \changes{babel~3.9o}{2016/01/25}{The number of languages loaded was -% off by 1.} -% \changes{babel~3.21}{2018/05/09}{The message is not printed any more.} +% off by 1.} +% \changes{babel~3.21}{2018/05/09}{The message is not printed any more.} % % \begin{macrocode} \if/\the\toks@/\else @@ -10504,7 +10601,7 @@ help from Bernd Raichle, for which I am grateful. \fi}} %<</More package options>> % \end{macrocode} -% +% % With explicit languages, we could define the font at once, but we % don't. Just wait and see if the language is actually activated. % @@ -10530,11 +10627,11 @@ help from Bernd Raichle, for which I am grateful. \\\bbl@font@set\<bbl@\bbl@tempb dflt@\languagename>% \<\bbl@tempb default>\<\bbl@tempb family>}}% {\bbl@foreach\bbl@tempa{% ie bbl@rmdflt@lang / *scrt - \bbl@csarg\def{\bbl@tempb dflt@##1}{<>{#1}{#2}}}}}% + \bbl@csarg\def{\bbl@tempb dflt@##1}{<>{#1}{#2}}}}}% % \end{macrocode} % % If the family in the previous command does not exist, it must be -% defined. Here is how: +% defined. Here is how: % % \begin{macrocode} \def\bbl@providefam#1{% @@ -10546,7 +10643,7 @@ help from Bernd Raichle, for which I am grateful. \\\fontfamily\<#1default>\\\selectfont}% \\\DeclareTextFontCommand{\<text#1>}{\<#1family>}}} % \end{macrocode} -% +% % The following macro is activated when the hook |babel-fontspec| is % enabled. % @@ -10564,7 +10661,7 @@ help from Bernd Raichle, for which I am grateful. \global\let\<bbl@##1dflt@\languagename>% \<bbl@##1dflt@>}}}% {\bbl@exp{% 2=T - from script - \global\let\<bbl@##1dflt@\languagename>% + \global\let\<bbl@##1dflt@\languagename>% \<bbl@##1dflt@*\bbl@tempa>}}}% {}}% 1=T - language, already defined \def\bbl@tempa{% @@ -10610,7 +10707,7 @@ help from Bernd Raichle, for which I am grateful. \let\bbl@mapselect\bbl@tempe \bbl@toglobal#1}% % \end{macrocode} -% +% % font@rst and famrst are only used when there is no global settings, % to save and restore de previous families. Not really necessary, but % done for optimization. @@ -10622,7 +10719,7 @@ help from Bernd Raichle, for which I am grateful. % % The default font families. They are eurocentric, but the list can be % expanded easily with |\babelfont|. -% +% % \begin{macrocode} \def\bbl@font@fams{rm,sf,tt} % \end{macrocode} @@ -10674,7 +10771,7 @@ help from Bernd Raichle, for which I am grateful. \edef\bbl@langfeatures{#2,}}} %<</Font selection>> % \end{macrocode} -% +% % % \section{Hooks for XeTeX and LuaTeX} % @@ -10689,7 +10786,7 @@ help from Bernd Raichle, for which I am grateful. % they must be reset to the proper value. Most of the work is done in % \textsf{xe(la)tex.ini}, so here we just ``undo'' some of the % changes done by \LaTeX. Anyway, for consistency Lua\TeX{} also -% resets the catcodes. +% resets the catcodes. % % \changes{bbunicode~1.0c}{2014/03/10}{Reset ``codes'' set by \cs{LaTeX} % to what xetex expects. Used also in luatex.} @@ -10834,7 +10931,7 @@ help from Bernd Raichle, for which I am grateful. % |\advance\bbl@startskip\adim|, |\bbl@startskip\adim|. % % Consider |txtbabel| as a shorthand for \textit{tex--xet babel}, -% which is the bidi model in both \pdftex{} and \xetex{}. +% which is the bidi model in both \pdftex{} and \xetex{}. % % \begin{macrocode} %<*texxet> @@ -11388,7 +11485,7 @@ help from Bernd Raichle, for which I am grateful. % almost any macro where text direction is relevant. % % |\@hangfrom| is useful in many contexts and it is redefined always -% with the |layout| option. +% with the |layout| option. % % There are, however, a number of issues when the text direction is % not the same as the box direction (as set by |\bodydir|), and when @@ -11437,7 +11534,7 @@ help from Bernd Raichle, for which I am grateful. \noindent\box\@tempboxa} \fi \IfBabelLayout{tabular} - {\def\@tabular{% + {\def\@tabular{% \leavevmode\hbox\bgroup\bbl@nextfake$% %$ \let\@acol\@tabacol \let\@classz\@tabclassz \let\@classiv\@tabclassiv \let\\\@tabularcr\@tabarray}} @@ -11529,12 +11626,12 @@ help from Bernd Raichle, for which I am grateful. % file. %\iffalse % \begin{macrocode} -%<*bidi> +%<*bidi> -- Data from Unicode and ConTeXt Babel = Babel or {} -Babel.ranges={ +Babel.ranges={ {0x0590, 0x05FF, 'r'}, {0x0600, 0x07BF, 'al'}, {0x07C0, 0x085F, 'r'}, @@ -17628,7 +17725,7 @@ Babel.characters={ % implementations, and fail to consider other possible % implementations! % \end{quote} -% +% % Well, it took me some time to guess what the batch rules in UAX\#9 % actually mean (in other word, \textit{what} they do and\textit{why}, % and not only \textit{how}), but I think (or I hope) I've managed to @@ -17644,7 +17741,7 @@ Babel.characters={ % From UAX\#9: “Where available, markup should be used instead of the % explicit formatting characters”. So, this simple version just % ignores formatting characters. Actually, most of that annex is -% devoted to how to handle them. +% devoted to how to handle them. % % BD14-BD16 are not implemented. Unicode (and the W3C) are making a % great effort to deal with some special problematic cases in @@ -17656,7 +17753,7 @@ Babel.characters={ % % TODO: math mode (as weak L?) % -% \changes{babel~3.20}{2018/05/01}{Adapted to exhyphens in luatex >= +% \changes{babel~3.20}{2018/05/01}{Adapted to exhyphens in luatex >= % 1.07. Fix - now attr@dir is mod 3.} % % \begin{macrocode} @@ -17706,8 +17803,8 @@ function Babel.bidi(head, ispar) % way): % % \begin{macrocode} - local strong = ('TRT' == tex.pardir) and 'r' or 'l' - local strong_lr = (strong == 'l') and 'l' or 'r' + local strong = ('TRT' == tex.pardir) and 'r' or 'l' + local strong_lr = (strong == 'l') and 'l' or 'r' local outer = strong local new_dir = false @@ -17765,7 +17862,7 @@ function Babel.bidi(head, ispar) else strong = 'l' end - strong_lr = (strong == 'l') and 'l' or 'r' + strong_lr = (strong == 'l') and 'l' or 'r' outer = strong_lr new_dir = false end @@ -17798,7 +17895,7 @@ function Babel.bidi(head, ispar) % % \begin{macrocode} elseif item.id == node.id'dir' then - new_dir = true + new_dir = true dir = nil else dir = nil -- Not a char @@ -17827,9 +17924,9 @@ function Babel.bidi(head, ispar) elseif dir == 'cs' then -- it's right - do nothing elseif first_n then -- & if dir = any but en, et, an, es, cs, inc nil if strong_lr == 'r' and type_n ~= '' then - dir_mark(head, first_n, last_n, 'r') + dir_mark(head, first_n, last_n, 'r') elseif strong_lr == 'l' and first_d and type_n == 'an' then - dir_mark(head, first_n, last_n, 'r') + dir_mark(head, first_n, last_n, 'r') dir_mark(head, first_d, last_d, outer) first_d, last_d = nil, nil elseif strong_lr == 'l' and type_n ~= '' then @@ -17856,7 +17953,7 @@ function Babel.bidi(head, ispar) dir_mark(head, first_d, last_d, outer) first_d, last_d = nil, nil end - end + end % \end{macrocode} % % \textbf{Mirroring.} Each chunk of text in a certain language is @@ -17898,7 +17995,7 @@ function Babel.bidi(head, ispar) elseif new_dir then last_lr = nil end - end + end % \end{macrocode} % % Mirror the last chars if they are no directed. And make sure any @@ -17910,10 +18007,10 @@ function Babel.bidi(head, ispar) ch.char = characters[ch.char].m or ch.char end end - if first_n then + if first_n then dir_mark(head, first_n, last_n, outer) end - if first_d then + if first_d then dir_mark(head, first_d, last_d, outer) end % \end{macrocode} @@ -17928,7 +18025,7 @@ end % \end{macrocode} % % And here the Lua code for |bidi=basic|: -% \changes{babel~3.20}{2018/05/01}{Adapted to exhyphens in luatex >= +% \changes{babel~3.20}{2018/05/01}{Adapted to exhyphens in luatex >= % 1.07. Fix - nsm in mapfont (eg, Arabic vowels)} % % \begin{macrocode} @@ -18015,7 +18112,7 @@ function Babel.bidi(head, ispar, hdir) save_outer = (temp == 0 and 'l') or (temp == 1 and 'r') or (temp == 2 and 'al') - elseif ispar then -- Or error? Shouldn't happen + elseif ispar then -- Or error? Shouldn't happen save_outer = ('TRT' == tex.pardir) and 'r' or 'l' else save_outer = ('TRT' == hdir) and 'r' or 'l' @@ -18029,11 +18126,11 @@ function Babel.bidi(head, ispar, hdir) for item in node.traverse(head) do - -- In what follows, #node is the last (previous) node, because the + -- In what follows, #node is the last (previous) node, because the -- current one is not added until we start processing the neutrals. - -- three cases: glyph, dir, otherwise - if item.id == GLYPH + -- three cases: glyph, dir, otherwise + if item.id == GLYPH or (item.id == 7 and item.subtype == 2) then local d_font = nil @@ -18050,7 +18147,7 @@ function Babel.bidi(head, ispar, hdir) if item_r.char < et[1] then break elseif item_r.char <= et[2] then - if not d then d = et[3] + if not d then d = et[3] elseif d == 'nsm' then d_font = et[3] end break @@ -18097,12 +18194,12 @@ function Babel.bidi(head, ispar, hdir) d = nil end - -- AL <= EN/ET/ES -- W2 + W3 + W6 + -- AL <= EN/ET/ES -- W2 + W3 + W6 if last == 'al' and d == 'en' then d = 'an' -- W3 elseif last == 'al' and (d == 'et' or d == 'es') then d = 'on' -- W6 - end + end -- EN + CS/ES + EN -- W4 if d == 'en' and #nodes >= 2 then @@ -18123,7 +18220,7 @@ function Babel.bidi(head, ispar, hdir) -- ET/EN -- W5 + W7->l / W6->on if d == 'et' then first_et = first_et or (#nodes + 1) - elseif d == 'en' then + elseif d == 'en' then has_en = true first_et = first_et or (#nodes + 1) elseif first_et then -- d may be nil here ! @@ -18149,15 +18246,15 @@ function Babel.bidi(head, ispar, hdir) last = 'al' elseif d == 'l' or d == 'r' then last = d - end + end prev_d = d table.insert(nodes, {item, d, outer_first}) - else - -- Not sure about the following. Looks too 'ad hoc', but it's - -- required for numbers, so that 89 19 becomes 19 89. It also + else + -- Not sure about the following. Looks too 'ad hoc', but it's + -- required for numbers, so that 89 19 becomes 19 89. It also -- affects n+cs/es+n. if prev_d == 'an' or prev_d == 'en' then - table.insert(nodes, {item, 'on', nil}) + table.insert(nodes, {item, 'on', nil}) end end @@ -18165,10 +18262,10 @@ function Babel.bidi(head, ispar, hdir) end - -- TODO -- repeated here in case EN/ET is the last node. Find a + -- TODO -- repeated here in case EN/ET is the last node. Find a -- better way of doing things: if first_et then -- dir may be nil here ! - if has_en then + if has_en then if last == 'l' then temp = 'l' -- W7 else @@ -18306,7 +18403,7 @@ end % % When this file is read as an option, i.e. by the |\usepackage| % command, \texttt{nil} could be an `unknown' language in which -% case we have to make it known. +% case we have to make it known. % % \begin{macrocode} \ifx\l@nohyphenation\@undefined @@ -18336,7 +18433,7 @@ end % % \end{macro} % \end{macro} -% +% % The macro |\ldf@finish| takes care of looking for a % configuration file, setting the main language to be switched on % at |\begin{document}| and resetting the category code of @@ -18354,7 +18451,7 @@ end % only be used to designate \emph{his} version of the american % English hyphenation patterns, a new solution has to be found in % order to be able to load hyphenation patterns for other languages -% in a plain-based \TeX-format. +% in a plain-based \TeX-format. % When asked he responded: % \begin{quote} % That file name is ``sacred'', and if anybody changes it they will @@ -18362,7 +18459,7 @@ end % % People can have a file localhyphen.tex or whatever they like, % but they mustn't diddle with hyphen.tex (or plain.tex except to -% preload additional fonts). +% preload additional fonts). % \end{quote} % % The files \file{bplain.tex} and \file{blplain.tex} can be used as @@ -18386,7 +18483,7 @@ end % % Now let's see if a file called \file{hyphen.cfg} can be found % somewhere on \TeX's input path by trying to open it for -% reading... +% reading... % % \begin{macrocode} \openin 0 hyphen.cfg @@ -18458,7 +18555,7 @@ end % are needed for \babel. % % \changes{bbplain-1.0s}{2012/12/21}{\cs{loadlocalcfg} not loaded in -% the format} +% the format} % % \begin{macrocode} %<*plain> @@ -18551,7 +18648,7 @@ end \@preamblecmds \global\let\do\noexpand} % \end{macrocode} -% +% % \begin{macrocode} \ifx\@begindocumenthook\@undefined \def\@begindocumenthook{} @@ -18626,7 +18723,7 @@ end \def\reserved@a{\new@command\reserved@a}}% \reserved@a}% % \end{macrocode} -% +% % \begin{macrocode} \def\DeclareRobustCommand{\@star@or@long\declare@robustcommand} \def\declare@robustcommand#1{% @@ -18683,7 +18780,7 @@ end % \Lopt{activeacute}). For plain \TeX\ we assume that the user % wants them to be active by default. Therefore the only thing we % do is execute the third argument (the code for the true case). -% +% % \begin{macrocode} \def\@ifpackagewith#1#2#3#4{#3} % \end{macrocode} @@ -18755,7 +18852,7 @@ end % \subsection{Encoding related macros} % % Code from \file{ltoutenc.dtx}, adapted for use in the plain \TeX\ -% environment. +% environment. % % \begin{macrocode} \def\DeclareTextCommand{% @@ -18936,8 +19033,8 @@ end % \endinput % -% Local Variables: +% Local Variables: % mode: doctex % coding: utf-8 % TeX-engine: luatex -% End: +% End: diff --git a/Master/texmf-dist/source/latex/babel/babel.ins b/Master/texmf-dist/source/latex/babel/babel.ins index d03e0aca03a..db54d176ad6 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/05/10} +\def\filedate{2018/06/05} \def\batchfile{babel.ins} \input docstrip.tex @@ -74,7 +74,7 @@ \else \activefiles \fi} - + \newif\ifcollect \newif\ifsaving @@ -122,11 +122,8 @@ \usepreamble\mainpreamble -% \csname UseRawInputEncoding\endcsname - % Dummy, it just read "modules" to be used when generating % the actual file. There must be a better way. -\tracingmacros2 \savingtrue \generate{\usepreamble\empty \usepostamble\empty diff --git a/Master/texmf-dist/source/latex/babel/bbcompat.dtx b/Master/texmf-dist/source/latex/babel/bbcompat.dtx index 7ec73194638..7e78bc232b3 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/05/10 v3.21] +\ProvidesFile{bbcompat.dtx}[2018/06/05 v3.22] %</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 a93199cf850..c3cb868ca43 100644 --- a/Master/texmf-dist/source/latex/babel/locale.zip +++ b/Master/texmf-dist/source/latex/babel/locale.zip |