diff options
author | Karl Berry <karl@freefriends.org> | 2018-02-14 21:34:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-02-14 21:34:13 +0000 |
commit | 8b6cfd638559d98ab42f15ecae4afb6d754404d5 (patch) | |
tree | 65b9d0a06956be707fc0505ca551b4d2338fb9e1 /Master/texmf-dist/source/latex/babel | |
parent | 377d5868421b9bab3a6e0fddb02ccc99597b2855 (diff) |
babel (14feb18)
git-svn-id: svn://tug.org/texlive/trunk@46640 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/babel')
-rw-r--r-- | Master/texmf-dist/source/latex/babel/babel.dtx | 345 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/babel.ins | 4 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/bbcompat.dtx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/locale.zip | bin | 682821 -> 691173 bytes |
4 files changed, 232 insertions, 119 deletions
diff --git a/Master/texmf-dist/source/latex/babel/babel.dtx b/Master/texmf-dist/source/latex/babel/babel.dtx index b846f29fc4e..b11d3d5c99d 100644 --- a/Master/texmf-dist/source/latex/babel/babel.dtx +++ b/Master/texmf-dist/source/latex/babel/babel.dtx @@ -1,7 +1,7 @@ % \iffalse % This document requires lualatex %% -%% Copyright (C) 2012-2017 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2018 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. @@ -31,7 +31,7 @@ % % \iffalse %<*filedriver> -\ProvidesFile{babel.dtx}[2018/01/24 v3.17 The Babel package] +\ProvidesFile{babel.dtx}[2018/02/14 v3.18 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -101,6 +101,9 @@ \DescribeMacro{#1}\args} \def\DescribeOther{\vskip-4ex\Describe} \makeatletter +\def\trouble#1{\addcontentsline{tsh}{trouble}{#1}} +\def\listoftroubles{\section*{Troubleshoooting}\@starttoc{tsh}} +\let\l@trouble\l@figure \let\saved@check@percent\check@percent \let\check@percent\relax \def\args#1{% @@ -220,6 +223,7 @@ Javier Bezos \end{titlepage} \tableofcontents +\listoftroubles \clearpage \part{User guide} @@ -370,7 +374,7 @@ _\foreignlanguage{french}{français}_. \subsection{Modifiers} -\New{3.9c} The basic behaviour of some languages can be modified when +\New{3.9c} The basic behavior of some languages can be modified when loading \babel{} by means of \textit{modifiers}. They are set after the language name, and are prefixed with a dot (only when the language is set as package option -- neither global options nor the |main| key @@ -450,6 +454,7 @@ _\usepackage[russian]{babel}_ |\usepackage|\marg{language}) is deprecated and you will get the error:\footnote{In old versions the error read ``You have used an old interface to call babel'', not very helpful.} +\trouble{You are loading directly a language style} \begin{verbatim} ! Package babel Error: You are loading directly a language style. (babel) This syntax is deprecated and you must use @@ -459,6 +464,7 @@ _\usepackage[russian]{babel}_ \item Another typical error when using \babel{} is the following:\footnote{In old versions the error read ``You haven't loaded the language LANG yet''.} +\trouble{Unknown language `LANG'} \begin{verbatim} ! Package babel Error: Unknown language `LANG'. Either you have misspelled (babel) its name, it has not been installed, or you requested @@ -473,6 +479,8 @@ _\usepackage[russian]{babel}_ \item The following warning is about hyphenation patterns, which are not under the direct control of \babel: +\trouble{No hyphenation patterns were preloaded for (babel) the + language `LANG' into the format} \begin{verbatim} Package babel Warning: No hyphenation patterns were preloaded for (babel) the language `LANG' into the format. @@ -586,7 +594,7 @@ environment are \textit{not} ignored. This environment was originally intended for intermixing left-to-right typesetting with right-to-left typesetting in engines not supporting a change in the writing direction inside a line. However, by default it never -complied with the documented behaviour and it is just a version as +complied with the documented behavior and it is just a version as environment of |\foreignlanguage|. \Describe{\begin\menv{hyphenrules}}{\marg{language}\Eenv{hyphenrules}} @@ -728,6 +736,8 @@ use only shorthands provided by languages. \end{note} A typical error when using shorthands is the following: +\trouble{Argument of \textbackslash language@active@arg" +has an extra \textbraceright} \begin{verbatim} ! Argument of \language@active@arg" has an extra }. \end{verbatim} @@ -807,7 +817,7 @@ system shorthands. Language-dependent user shorthands (new in \defineshorthand{"*}{\babelhyphen{soft}} \defineshorthand{"-}{\babelhyphen{hard}} \end{verbatim} - However, behaviour of hyphens is language dependent. For example, in + However, behavior of hyphens is language dependent. For example, in languages like Polish and Portuguese, a hard hyphen inside compound words are repeated at the beginning of the next line. You could then set: @@ -1021,7 +1031,7 @@ it only as a last resort). $\string|$ \texttt{select} $\string|$ \texttt{other} $\string|$ \texttt{other*}} -\New{3.9g} Sets the behaviour of case mapping for hyphenation, +\New{3.9g} Sets the behavior of case mapping for hyphenation, provided the language defines it.\footnote{Turned off in plain.} It can take the following values: \begin{description} @@ -1044,7 +1054,7 @@ can take the following values: optimized version of \texttt{other*} for monolingual documents.\footnote{Providing |foreign| is pointless, because the case mapping applied is that at the end of paragraph, but if either - \xetex{} or \luatex{} change this behaviour it might be added. On + \xetex{} or \luatex{} change this behavior it might be added. On the other hand, |other| is provided even if I [JBL] think it isn't really useful, but who knows.} \end{description} @@ -1833,7 +1843,7 @@ to select fonts in addition to the three basic ones. \textit{language} (and therefore the writing direction). In other words, the |ini| file or |\babelprovide| provides default values for |\babelfont| if omitted, but the opposite is not true. See the note - above for the reasons of this behaviour. + above for the reasons of this behavior. \end{note} \begin{warning} @@ -1852,7 +1862,7 @@ to select fonts in addition to the three basic ones. \subsection{Modifying a language} -Modifying the behaviour of a language (say, the chapter “caption”), is +Modifying the behavior of a language (say, the chapter “caption”), is sometimes necessary, but not always trivial. \begin{itemize} \item The old way, still valid for many languages, to redefine a @@ -1959,7 +1969,7 @@ language the first valid hyphenation rules in the list. For example: \begin{verbatim} \babelprovide[hyphenrules=chavacano spanish italian]{chavacano} \end{verbatim} -If none of the listed hyphenrules exist, the default behaviour +If none of the listed hyphenrules exist, the default behavior applies. Note in this example we set |chavacano| as first option -- without it, it would select |spanish| even if |chavacano| exists. @@ -2041,7 +2051,7 @@ with a breaking oportunity after it. A further type is a oportunity. In \TeX, \verb|-| and \verb|\-| forbid further breaking oportunities -in the word. This is the desired behaviour very often, but not always, +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 @@ -2211,7 +2221,8 @@ text, which handles numbers and unmarked L text within an R context. this writing some Arabic fonts are not rendered correctly by the default \luatex{} font loader, with misplaced kerns inside some words, so double check the resulting text. It seems a fix is on the - way.} + way, but in the meanwhile you could have a look at the workaround + available on GitHub, under \texttt{/required/babel/samples}} \begingroup % If you are looking at the code to see how it has been written, you % will be disappointed :-). The following example is built ad hoc to @@ -2246,6 +2257,7 @@ _\babelprovide[import=ar, main]{arabic}_ \texttt{lists} $\string|$ \texttt{contents} $\string|$ \texttt{footnotes} $\string|$ + \texttt{captions} $\string|$ \texttt{columns}} \New{3.16} \textit{To be expanded}. Selects which layout elements are @@ -2278,6 +2290,14 @@ etc.). Note not all options are required by all engines. useful in multilingual documents in all engines; you may use alternatively |\BabelFootnote| described below (what this options does exactly is also explained there). +\item[captions] is similar to |sectioning|, but for |\caption|; not + required in monolingual documents with \luatex{}, but may be + required in \xetex{} and \pdftex{} in some styles (support for the + latter two engines is still experimental); \New{3.18} +\item[tabular] required in \luatex{} for R |tabular| (it has been + tested only with simple tables, so expect some readjustments in the + future); ignored in \pdftex{} or \xetex{} (which will not support a + similar option in the short term). \New{3.18} \end{description} \Describe{\babelsublr}{\marg{lr-text}} @@ -2921,7 +2941,7 @@ set of hyphenation patterns. The macro |\adddialect| can be used when two languages can (or must) use the same hyphenation patterns. This can also be useful for languages for which no patterns are preloaded in the -format. In such cases the default behaviour of the \babel{} +format. In such cases the default behavior of the \babel{} system is to define this language as a `dialect' of the language for which the patterns were loaded as |\language0|. Here ``language'' is used in the \TeX{} sense of set of hyphenation @@ -3085,7 +3105,7 @@ that way until the end of the document. Its definition may vary. \DescribeMacro{\bbl@activate} \DescribeMacro{\bbl@deactivate} The command |\bbl@activate| is used to change the way an active -character expands. |\bbl@activate| `switches on' the active behaviour +character expands. |\bbl@activate| `switches on' the active behavior of the character. |\bbl@deactivate| lets the active character expand to its former (mostly) non-active self. @@ -3144,7 +3164,7 @@ instance, be used in adding instructions to a macro like Be careful when using this macro, because depending on the case the assignment could be either global (usually) or local (sometimes). That -does not seem very consistent, but this behaviour is preserved for +does not seem very consistent, but this behavior is preserved for backward compatibility. If you are using \pkg{etoolbox}, by Philipp Lehman, consider using the tools provided by this package instead of |\addto|. @@ -3166,7 +3186,7 @@ this encoding but constructed with |\accent| in |OT1|. Note the previous command (|\bbl@allowhyphens|) has different applications (hyphens and discretionaries) than this one (composite chars). Note also prior to version 3.7, |\allowhyphens| had the -behaviour of |\bbl@allowhyphens|. +behavior of |\bbl@allowhyphens|. \DescribeMacro{\set@low@box} For some languages, quotes need to be lowered to the baseline. For @@ -3437,7 +3457,7 @@ assignment is wrong, fix it directly. Most of changes in version 3.9 are related to bugs, either to fix them (there were lots), or to provide some alternatives. Even new features like |\babelhyphen| are intended to solve a certain problem (in this -case, the lacking of a uniform syntax and behaviour for shorthands +case, the lacking of a uniform syntax and behavior for shorthands across languages). These changes are described in this manual in the corresponding place. A selective list follows: \begin{itemize} @@ -3615,8 +3635,8 @@ help from Bernd Raichle, for which I am grateful. % little bit of literate programming. % % \begin{macrocode} -%<<version=3.17>> -%<<date=2018/01/24>> +%<<version=3.18>> +%<<date=2018/02/14>> % \end{macrocode} % % \section{Tools} @@ -3632,7 +3652,7 @@ help from Bernd Raichle, for which I am grateful. % % We define some basic macros which just make the code cleaner. % |\bbl@add| is now used internally instead of |\addto| because of -% the unpredictable behaviour of the latter. Used in +% the unpredictable behavior of the latter. Used in % \file{babel.def} and in \file{babel.sty}, which means in \LaTeX{} % is executed twice, but we need them when defining options and % \file{babel.def} cannot be load until options have been defined. @@ -3645,6 +3665,7 @@ help from Bernd Raichle, for which I am grateful. % % \begin{macrocode} %<<*Basic macros>> +\bbl@trace{Basic macros} \def\bbl@stripslash{\expandafter\@gobble\string} \def\bbl@add#1#2{% \bbl@ifunset{\bbl@stripslash#1}% @@ -4012,7 +4033,7 @@ help from Bernd Raichle, for which I am grateful. % % % Apart from all the language options below we also have a few options -% that influence the behaviour of language definition files. +% that influence the behavior of language definition files. % % Many of the following options don't do anything themselves, they % are just defined in order to make it possible for babel and @@ -4033,15 +4054,22 @@ help from Bernd Raichle, for which I am grateful. % base} % \changes{babel~3.9q}{2016/02/11}{Load patterns with option base. % To be improved. Moved showlanguages before base} +% \changes{babel~3.18}{2018/02/14}{Fix - prevent doble input of +% switch.def} % % \begin{macrocode} %<*package> \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{babel}[<@date@> <@version@> The Babel package] \@ifpackagewith{babel}{debug} - {\let\bbl@debug\@firstofone} - {\let\bbl@debug\@gobble} -\input switch.def\relax + {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}% + \let\bbl@debug\@firstofone} + {\providecommand\bbl@trace[1]{}% + \let\bbl@debug\@gobble} +\ifx\bbl@switchflag\@undefined % Prevent double input + \let\bbl@switchflag\relax + \input switch.def\relax +\fi <@Load patterns in luatex@> <@Basic macros@> \def\AfterBabelLanguage#1{% @@ -4097,6 +4125,7 @@ help from Bernd Raichle, for which I am grateful. % rest of babel. Useful for old versions of \textsf{polyglossia}, too. % % \begin{macrocode} +\bbl@trace{Defining option 'base'} \@ifpackagewith{babel}{base}{% \ifx\directlua\@undefined \DeclareOption*{\bbl@patterns{\CurrentOption}}% @@ -4126,6 +4155,7 @@ help from Bernd Raichle, for which I am grateful. % key=value pairs} % % \begin{macrocode} +\bbl@trace{key=value and another general options} \bbl@csarg\let{tempa\expandafter}\csname opt@babel.sty\endcsname \def\bbl@tempb#1.#2{% #1\ifx\@empty#2\else,\bbl@afterfi\bbl@tempb#2\fi}% @@ -4241,6 +4271,7 @@ help from Bernd Raichle, for which I am grateful. % \changes{babel~3.9c}{2013/04/07}{Added t and c for tilde and comma} % % \begin{macrocode} +\bbl@trace{Conditional loading of shorthands} \def\bbl@sh@string#1{% \ifx#1\@empty\else \ifx#1t\string~% @@ -4326,6 +4357,7 @@ help from Bernd Raichle, for which I am grateful. % macro \cs{IfBabelLayout}} % % \begin{macrocode} +\bbl@trace{Defining IfBabelLayout} \ifx\bbl@opt@layout\@nnil \newcommand\IfBabelLayout[3]{#3}% \else @@ -4355,6 +4387,7 @@ help from Bernd Raichle, for which I am grateful. % checks (|\input| works, too, but possible errors are not catched). % % \begin{macrocode} +\bbl@trace{Language options} \let\bbl@afterlang\relax \let\BabelModifiers\relax \let\bbl@loaded\@empty @@ -4564,7 +4597,7 @@ help from Bernd Raichle, for which I am grateful. % able to switch hyphenation patterns (by default, it also inputs % \file{switch.def}, for ``historical reasons'', but it is not % necessary). When \file{babel.def} is loaded it checks if the current -% version of \file{switch.def} is in the format; if not it is +% version of \file{switch.def} is in the format; if not, it is % loaded. A further file, \file{babel.sty}, contains \LaTeX-specific % stuff. % @@ -4606,14 +4639,49 @@ help from Bernd Raichle, for which I am grateful. <@Make sure ProvidesFile is defined@> \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 +% all options are available). There in no package options, and +% therefore and alternative mechanism is provided. For the moment, +% only |\babeloptionstrings| and |\babeloptionmath| are provided, +% which can be defined before loading \babel. |\BabelModifiers| can be +% set too (but not sure it works). +% +% \begin{macrocode} \ifx\bbl@ifshorthand\@undefined + \let\bbl@opt@shorthands\@nnil \def\bbl@ifshorthand#1#2#3{#2}% - \def\bbl@opt@safe{BR} + \let\bbl@language@opts\@empty + \ifx\babeloptionstrings\@undefined + \let\bbl@opt@strings\@nnil + \else + \let\bbl@opt@strings\babeloptionstrings + \fi + \def\BabelStringsDefault{generic} + \def\bbl@tempa{normal} + \ifx\babeloptionmath\bbl@tempa + \def\bbl@mathnormal{\noexpand\textormath} + \fi \def\AfterBabelLanguage#1#2{} + \ifx\BabelModifiers\@undefined\let\BabelModifiers\relax\fi \let\bbl@afterlang\relax - \let\bbl@language@opts\@empty + \def\bbl@opt@safe{BR} + \ifx\@uclclist\@undefined\let\@uclclist\@empty\fi + \ifx\bbl@trace\@undefined\def\bbl@trace#1{}\fi \fi -\input switch.def\relax +% \end{macrocode} +% +% And continue. +% +% \begin{macrocode} +\ifx\bbl@switchflag\@undefined % Prevent double input + \let\bbl@switchflag\relax + \input switch.def\relax +\fi +\bbl@trace{Compatibility with language.def} \ifx\bbl@languages\@undefined \ifx\directlua\@undefined \openin1 = language.def @@ -4768,6 +4836,7 @@ help from Bernd Raichle, for which I am grateful. % undefined in Plain} % % \begin{macrocode} +\bbl@trace{Hooks} \def\AddBabelHook#1#2{% \bbl@ifunset{bbl@hk@#1}{\EnableBabelHook{#1}}{}% \def\bbl@tempa##1,#2=##2,##3\@empty{\def\bbl@tempb{##2}}% @@ -4831,6 +4900,7 @@ help from Bernd Raichle, for which I am grateful. % \cs{today} must be given explicitly in \cs{babelensure}} % % \begin{macrocode} +\bbl@trace{Defining babelensure} \newcommand\babelensure[2][]{% TODO - revise test files \AddBabelHook{babel-ensure}{afterextras}{% \ifcase\bbl@select@type @@ -4937,6 +5007,7 @@ help from Bernd Raichle, for which I am grateful. % Finally we check |\originalTeX|. % % \begin{macrocode} +\bbl@trace{Macros for setting language files up} \def\bbl@ldfinit{% \let\bbl@screset\@empty \let\BabelStrings\bbl@opt@string @@ -5077,6 +5148,7 @@ help from Bernd Raichle, for which I am grateful. % \changes{3.10}{2017/05/14}{Refactored. Add to \cs{nfss@catcodes} too.} % % \begin{macrocode} +\bbl@trace{Shorhands} \def\bbl@add@special#1{% 1:a macro like \", \?, etc. \bbl@add\dospecials{\do#1}% test @sanitize = \relax, for back. compat. \bbl@ifunset{@sanitize}{}{\bbl@add\@sanitize{\@makeother#1}}% @@ -5384,7 +5456,7 @@ help from Bernd Raichle, for which I am grateful. \bbl@usehooks{initiateactive}{{#1}{#2}{#3}}} % \end{macrocode} % -% The following package options control the behaviour of shorthands +% The following package options control the behavior of shorthands % in math mode. % % \begin{macrocode} @@ -5956,6 +6028,7 @@ help from Bernd Raichle, for which I am grateful. % attribute in the list. % % \begin{macrocode} +\bbl@trace{Language attributes} \newcommand\languageattribute[2]{% \def\bbl@tempc{#1}% \bbl@fixname\bbl@tempc @@ -6173,6 +6246,7 @@ help from Bernd Raichle, for which I am grateful. % zero. % % \begin{macrocode} +\bbl@trace{Macros for saving definitions} \def\babel@beginsave{\babel@savecnt\z@} % \end{macrocode} % @@ -6252,6 +6326,7 @@ help from Bernd Raichle, for which I am grateful. % \changes{babel~3.9i}{2014/02/21}{Macro \cs{babeltags} added} % % \begin{macrocode} +\bbl@trace{Short tags} \def\babeltags#1{% \edef\bbl@tempa{\zap@space#1 \@empty}% \def\bbl@tempb##1=##2\@@{% @@ -6283,6 +6358,7 @@ help from Bernd Raichle, for which I am grateful. % \changes{babel~3.9a}{2012/08/28}{Macro added} % % \begin{macrocode} +\bbl@trace{Hyphens} \@onlypreamble\babelhyphenation \AtEndOfPackage{% \newcommand\babelhyphenation[2][\@empty]{% @@ -6356,7 +6432,7 @@ help from Bernd Raichle, for which I am grateful. % \end{macrocode} % % The following two commands are used to wrap the ``hyphen'' and -% set the behaviour of the rest of the word -- the version with a +% set the behavior of the rest of the word -- the version with a % single |@| is used when further hyphenation is allowed, while % that with |@@| if no more hyphen are allowed. In both cases, if % the hyphen is preceded by a positive space, breaking after the @@ -6438,6 +6514,7 @@ help from Bernd Raichle, for which I am grateful. % variable. This is not the best solution, but it works. % % \begin{macrocode} +\bbl@trace{Multiencoding strings} \def\bbl@toglobal#1{\global\let#1#1} \def\bbl@recatcode#1{% \@tempcnta="7F @@ -6491,7 +6568,7 @@ help from Bernd Raichle, for which I am grateful. %<</More package options>> % \end{macrocode} % -% The following package options control the behaviour of |\SetString|. +% The following package options control the behavior of |\SetString|. % % \begin{macrocode} %<<*More package options>> @@ -6549,7 +6626,7 @@ help from Bernd Raichle, for which I am grateful. % % Parse the encoding info to get the label, input, and font parts. % -% Select the behaviour of |\SetString|. Thre are two main cases, +% Select the behavior of |\SetString|. Thre are two main cases, % depending of if there is an optional argument: without it and % |strings=encoded|, strings are defined % always; otherwise, they are set only if they are still undefined @@ -6767,7 +6844,7 @@ help from Bernd Raichle, for which I am grateful. % % \paragraph{Case mapping} % -% The command |\SetCase| provides a way to change the behaviour of +% The command |\SetCase| provides a way to change the behavior of % |\MakeUppercase| and |\MakeLowercase|. |\bbl@tempa| is set by the % patched |\@uclclist| to the parsing command. % @@ -6832,7 +6909,7 @@ help from Bernd Raichle, for which I am grateful. \bbl@tempa} % \end{macrocode} % -% The following package options control the behaviour of +% The following package options control the behavior of % hyphenation mapping. % % \changes{babel~3.9t}{2017/04/28}{Renamed \cs{bbl@hymapopt} to @@ -6848,7 +6925,7 @@ help from Bernd Raichle, for which I am grateful. %<</More package options>> % \end{macrocode} % -% Initial setup to provide a default behaviour if |hypenmap| +% Initial setup to provide a default behavior if |hypenmap| % is not set. % % \begin{macrocode} @@ -6866,6 +6943,7 @@ help from Bernd Raichle, for which I am grateful. % the comma. It prepares its argument in box register~0. % % \begin{macrocode} +\bbl@trace{Macros related to glyphs} \def\set@low@box#1{\setbox\tw@\hbox{,}\setbox\z@\hbox{#1}% \dimen\z@\ht\z@ \advance\dimen\z@ -\ht\tw@% \setbox\z@\hbox{\lower\dimen\z@ \box\z@}\ht\z@\ht\tw@ \dp\z@\dp\tw@} @@ -7334,6 +7412,7 @@ help from Bernd Raichle, for which I am grateful. % least a tool useful in general. % % \begin{macrocode} +\bbl@trace{Bidi layout} \providecommand\IfBabelLayout[3]{#3}% \newcommand\BabelPatchSection[1]{% \@ifundefined{#1}{}{% @@ -7344,6 +7423,7 @@ help from Bernd Raichle, for which I am grateful. \def\bbl@presec@x#1[#2]#3{% \bbl@exp{% \\\select@language@x{\bbl@main@language}% + \\\@nameuse{bbl@sspre@#1}% \\\@nameuse{bbl@ss@#1}% [\\\foreignlanguage{\languagename}{\unexpanded{#2}}]% {\\\foreignlanguage{\languagename}{\unexpanded{#3}}}% @@ -7351,10 +7431,11 @@ help from Bernd Raichle, for which I am grateful. \def\bbl@presec@s#1#2{% \bbl@exp{% \\\select@language@x{\bbl@main@language}% + \\\@nameuse{bbl@sspre@#1}% \\\@nameuse{bbl@ss@#1}*% {\\\foreignlanguage{\languagename}{\unexpanded{#2}}}% \\\select@language@x{\languagename}}} -\IfBabelLayout{sectioning}% at begin document ??? +\IfBabelLayout{sectioning}% {\BabelPatchSection{part}% \BabelPatchSection{chapter}% \BabelPatchSection{section}% @@ -7364,11 +7445,14 @@ help from Bernd Raichle, for which I am grateful. \BabelPatchSection{subparagraph}% \def\babel@toc#1{% \select@language@x{\bbl@main@language}}}{} +\IfBabelLayout{captions}% + {\BabelPatchSection{caption}}{} % \end{macrocode} % % Now we load definition files for engines. % % \begin{macrocode} +\bbl@trace{Input engine specific macros} \ifcase\bbl@engine \input txtbabel.def \or @@ -7378,31 +7462,8 @@ help from Bernd Raichle, for which I am grateful. \fi % \end{macrocode} % -% \section{The kernel of Babel (\texttt{babel.def}, only \LaTeX)} -% -% \subsection{The redefinition of the style commands} -% -% The rest of the code in this file can only be processed by -% \LaTeX, so we check the current format. If it is plain \TeX, -% processing should stop here. But, because of the need to limit -% the scope of the definition of |\format|, a macro that is used -% locally in the following |\if|~statement, this comparison is done -% inside a group. To prevent \TeX\ from complaining about an -% unclosed group, the processing of the command |\endinput| is -% deferred until after the group is closed. This is accomplished by -% the command |\aftergroup|. -% -% \begin{macrocode} -{\def\format{lplain} -\ifx\fmtname\format -\else - \def\format{LaTeX2e} - \ifx\fmtname\format - \else - \aftergroup\endinput - \fi -\fi} -% \end{macrocode} +% \changes{babel~3.18}{2018/02/14}{Moved \cs{babelprovide}, also for +% plain} % % \subsection{Creating languages} % @@ -7422,6 +7483,7 @@ help from Bernd Raichle, for which I am grateful. % % % \begin{macrocode} +\bbl@trace{Creating languages and reading ini files} \newcommand\babelprovide[2][]{% \let\bbl@savelangname\languagename \def\languagename{#2}% @@ -7809,6 +7871,32 @@ help from Bernd Raichle, for which I am grateful. {\setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}}} % \end{macrocode} % +% \section{The kernel of Babel (\texttt{babel.def}, only \LaTeX)} +% +% \subsection{The redefinition of the style commands} +% +% The rest of the code in this file can only be processed by +% \LaTeX, so we check the current format. If it is plain \TeX, +% processing should stop here. But, because of the need to limit +% the scope of the definition of |\format|, a macro that is used +% locally in the following |\if|~statement, this comparison is done +% inside a group. To prevent \TeX\ from complaining about an +% unclosed group, the processing of the command |\endinput| is +% deferred until after the group is closed. This is accomplished by +% the command |\aftergroup|. +% +% \begin{macrocode} +{\def\format{lplain} +\ifx\fmtname\format +\else + \def\format{LaTeX2e} + \ifx\fmtname\format + \else + \aftergroup\endinput + \fi +\fi} +% \end{macrocode} +% % \subsection{Cross referencing macros} % % The \LaTeX\ book states: @@ -7866,6 +7954,7 @@ help from Bernd Raichle, for which I am grateful. % arguments immediately expands to its non-active self. % % \begin{macrocode} +\bbl@trace{Cross referencing macros} \ifx\bbl@opt@safe\@empty\else \def\@newl@bel#1#2#3{% {\@safe@activestrue @@ -8164,6 +8253,7 @@ help from Bernd Raichle, for which I am grateful. % \cs{@safe@activestrue} is in effect. % % \begin{macrocode} +\bbl@trace{Marks} \IfBabelLayout{sectioning} {\ifx\bbl@opt@headfoot\@nnil \g@addto@macro\@resetactivechars{% @@ -8260,6 +8350,7 @@ help from Bernd Raichle, for which I am grateful. % time. % % \begin{macrocode} +\bbl@trace{Preventing clashes with other packages} \bbl@xin@{R}\bbl@opt@safe \ifin@ \AtBeginDocument{% @@ -8500,6 +8591,7 @@ help from Bernd Raichle, for which I am grateful. % executed only with LaTeX} % % \begin{macrocode} +\bbl@trace{Encoding and fonts} \newcommand\BabelNonASCII{LGR,X2,OT2,OT3,OT6,LHE,LWN,LMA,LMC,LMS,LMU,} \let\org@TeX\TeX \let\org@LaTeX\LaTeX @@ -8616,9 +8708,22 @@ help from Bernd Raichle, for which I am grateful. % % \subsection{Basic bidi support} % -% \textbf{Work in progress.} This code is currently placed here for -% practical reasons. It is loosely based on |rlbabel.def|, but most -% of it has been developed from scratch. +% \textbf{Work in progress.} This code is currently placed here for +% practical reasons. +% +% It is loosely based on |rlbabel.def|, but most of it has been +% developed from scratch. This \babel{} module (by Johannes Braams and +% Boris Lavva) has served the purpose of typesetting R documents for +% two decades, and despite its flaws I think it is still a good starting +% point (some parts have been copied here almost verbatim), partly +% thanks to its simplicity. I've also looked at \textsc{arabi} (by +% Youssef Jabri), which is compatible with \babel{}. +% +% There are two ways of modifying macros to make them “bidi”, namely, +% by patching the internal low level macros (which is what I have done +% with lists, columns, counters, tocs, much like |rlbabel| did), and +% by introducing a “middle layer” just below the user interface +% (sectioning, footnotes). % % \begin{itemize} % \item pdftex provides a minimal support for bidi text, and it @@ -8644,6 +8749,7 @@ help from Bernd Raichle, for which I am grateful. % \changes{3.15}{2017/10/30}{Store direction in @wdir@<lang>.} % % \begin{macrocode} +\bbl@trace{Basic (internal) bidi support} \def\bbl@alscripts{,Arabic,Syriac,Thaana,} \def\bbl@rscripts{% ,Imperial Aramaic,Avestan,Cypriot,Hatran,Hebrew,% @@ -8795,6 +8901,7 @@ help from Bernd Raichle, for which I am grateful. % of |\loadlocalcfg| from \file{plain.def}. % % \begin{macrocode} +\bbl@trace{Local Language Configuration} \ifx\loadlocalcfg\@undefined \@ifpackagewith{babel}{noconfigs}% {\let\loadlocalcfg\@gobble}% @@ -9165,7 +9272,6 @@ help from Bernd Raichle, for which I am grateful. % temporarily |\set@hyphenmins| and hyphenation. It can be done in % hooks if necessary.} % -% % The switching of the values of |\lefthyphenmin| and % |\righthyphenmin| is somewhat different. First we save their % current values, then we check if |\|\langvar|hyphenmins| is @@ -9324,7 +9430,7 @@ help from Bernd Raichle, for which I am grateful. % (3.11) Also experimental are the hook |foreign| and % |foreign*|. With them you can redefine |\BabelText| which by % default does nothing. Its -% behaviour is not well defined yet. So, use it in +% behavior is not well defined yet. So, use it in % horizontal mode only if you do not want surprises. % % In other words, at the beginning of a paragraph |\foreignlanguage| @@ -9466,6 +9572,7 @@ help from Bernd Raichle, for which I am grateful. % 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} % % \begin{macrocode} \def\hyphenrules#1{% @@ -9474,9 +9581,12 @@ help from Bernd Raichle, for which I am grateful. \bbl@iflanguage\bbl@tempf{% \expandafter\bbl@patterns\expandafter{\bbl@tempf}% \languageshorthands{none}% - \bbl@ifunset{\bbl@tempf hyphenmins}% - {\set@hyphenmins\tw@\thr@@\relax}% - {\bbl@exp{\\\set@hyphenmins\@nameuse{\bbl@tempf hyphenmins}}}}} + \expandafter\ifx\csname\bbl@tempf hyphenmins\endcsname\relax + \set@hyphenmins\tw@\thr@@\relax + \else + \expandafter\expandafter\expandafter\set@hyphenmins + \csname\bbl@tempf hyphenmins\endcsname\relax + \fi}} \let\endhyphenrules\@empty % \end{macrocode} % @@ -9861,7 +9971,7 @@ help from Bernd Raichle, for which I am grateful. % the name of the language. The macro |\bbl@get@enc| extracts the % font encoding from the language name and stores it in % |\bbl@hyph@enc|. The latter can be used in hyphenation files if -% you need to set a behaviour depending on the given encoding (it +% you need to set a behavior depending on the given encoding (it % is set to empty if no encoding is given). % % Pattern files may contain assignments to |\lefthyphenmin| and @@ -10178,7 +10288,8 @@ help from Bernd Raichle, for which I am grateful. % don't. Just wait and see if the language is actually activated. % % \begin{macrocode} -%<<*Font selection>> +%<<*Font selection>> +\bbl@trace{Font handling with fontspec} \@onlypreamble\babelfont \newcommand\babelfont[2][]{% 1=langs/scripts 2=fam \edef\bbl@tempa{#1}% @@ -10397,6 +10508,7 @@ help from Bernd Raichle, for which I am grateful. % % \begin{macrocode} %<<*Footnote changes>> +\bbl@trace{Bidi footnotes} \ifx\bbl@beforeforeign\leavevmode \def\bbl@footnote#1#2#3{% \@ifnextchar[% @@ -10476,17 +10588,18 @@ help from Bernd Raichle, for which I am grateful. % \changes{babel~3.16}{2018/01/02}{Option layout - first available options: % sectioning, counters, lists, columns, contents} % -% In progress. +% \textit{In progress.} % -% Unfortunately, for proper support for \xetex{} lots of macros and -% packages must be patched somehow. At least at this stage, \babel{} -% will not do it and therefore a package similar to \textsf{bidi} will -% be required. Any help in making \babel{} and \textsf{bidi} -% collaborate will be welcome, although the underlying concepts in -% both packages seem very different. Note as well, elements like -% headlines and margins can be modified easily with packages like -% \textsf{fancyhdr}, \textsf{typearea} or \textsf{titleps}, and -% \textsf{geometry}. +% Unfortunately, proper support for \xetex{} requires patching somehow +% lots of macros and packages (and some issues related to |\special|s +% remain, like color and hyperlinks). At least at this stage, \babel{} +% will not do it and therefore a package like \textsf{bidi} (by Vafa +% Khalighi) would be necessary to overcome the limitations of +% \xetex. Any help in making \babel{} and \textsf{bidi} collaborate +% will be welcome, although the underlying concepts in both packages +% seem very different. Note also elements like headlines and margins +% can be modified easily with packages like \textsf{fancyhdr}, +% \textsf{typearea} or \textsf{titleps}, and \textsf{geometry}. % % |\bbl@startskip| and |\bbl@endskip| are available to package % authors. Thanks to the \TeX{} expansion mechanism the following @@ -10494,10 +10607,13 @@ 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 the bidi model in both \pdftex{} and \xetex{}. +% which is the bidi model in both \pdftex{} and \xetex{}. % % \begin{macrocode} %<*texxet> +\bbl@trace{Redefinitions for bidi layout} +\def\bbl@sspre@caption{% + \bbl@exp{\everyhbox{\\\bbl@textdir\bbl@cs{wdir@\bbl@main@language}}}} \ifx\bbl@opt@layout\@nnil\endinput\fi % No layout \def\bbl@startskip{\ifcase\bbl@thepardir\leftskip\else\rightskip\fi} \def\bbl@endskip{\ifcase\bbl@thepardir\rightskip\else\leftskip\fi} @@ -10736,6 +10852,7 @@ help from Bernd Raichle, for which I am grateful. % \begin{macrocode} %<*luatex> \ifx\AddBabelHook\@undefined +\bbl@trace{Read language.dat} \begingroup \toks@{} \count@\z@ % 0=start, 1=0th, 2=normal @@ -10816,6 +10933,7 @@ help from Bernd Raichle, for which I am grateful. \repeat \fi \endgroup +\bbl@trace{Macros for reading patterns files} \def\bbl@get@enc#1:#2:#3\@@@{\def\bbl@hyph@enc{#2}} \ifx\babelcatcodetablenum\@undefined \def\babelcatcodetablenum{5211} @@ -11050,9 +11168,29 @@ help from Bernd Raichle, for which I am grateful. % |\parbox| and |\hangindent| are involved. Fortunately, latest % releases of \luatex{} simplify a lot the solution with |\shapemode|. % +% \changes{3.18}{2018/02/14}{\cs{bbl@nextfake}, similar to the old +% \cs{nextfakemath} in Omega} +% % \begin{macrocode} +\bbl@trace{Redefinitions for bidi layout} \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! + \bbl@exp{% + #1% Once entered in math, set boxes to restore values + \everyvbox{% + \the\everyvbox + \bodydir\the\bodydir + \mathdir\the\mathdir + \everyhbox{\the\everyhbox}% + \everyvbox{\the\everyvbox}}% + \everyhbox{% + \the\everyhbox + \bodydir\the\bodydir + \mathdir\the\mathdir + \everyhbox{\the\everyhbox}% + \everyvbox{\the\everyvbox}}}}% \def\@hangfrom#1{% \setbox\@tempboxa\hbox{{#1}}% \hangindent\wd\@tempboxa @@ -11061,6 +11199,12 @@ help from Bernd Raichle, for which I am grateful. \fi \noindent\box\@tempboxa} \fi +\IfBabelLayout{tabular} + {\def\@tabular{% + \leavevmode\hbox\bgroup\bbl@nextfake$% + \let\@acol\@tabacol \let\@classz\@tabclassz + \let\@classiv\@tabclassiv \let\\\@tabularcr\@tabarray}} + {} \IfBabelLayout{lists} {\def\list#1#2{% \ifnum \@listdepth >5\relax @@ -17254,6 +17398,8 @@ Babel.characters={ % excels, because everything related to bidi writing is under our % control. % +% TODO: math mode (as weak L?) +% % \begin{macrocode} %<*basic-r> Babel = Babel or {} @@ -17387,7 +17533,7 @@ function Babel.pre_otfload(head) % nil, ie, a non-char), the textdir is set. This means you cannot % insert, say, a whatsit, but this is what I would expect (with % \textsf{luacolor} you may colorize some digits). Anyway, this -% behaviour could be changed with a switch in the future. Note in the +% behavior could be changed with a switch in the future. Note in the % first branch only <an> is relevant if <al>. % % \begin{macrocode} @@ -18147,39 +18293,6 @@ end \ifx\scriptsize\@undefined \let\scriptsize\sevenrm \fi -% \end{macrocode} -% -% \subsection{\Babel{} options} -% -% \changes{babel~3.9k}{2014/03/22}{Moved code from babel.def, and add -% some new tools (not yet documented)} -% -% The file |babel.def| expects some definitions made in the \LaTeX{} -% style file. So we must provide them at least some predefined values as -% well some tools to set them (even if not all options are -% available). There in no package options, and therefore and alternative -% mechanism is provided. For the moment, only |\babeloptionstrings| and -% |\babeloptionmath| are provided, which can be defined before loading -% \babel. |\BabelModifiers| can be set too (but not sure it works). -% -% \begin{macrocode} -\let\bbl@opt@shorthands\@nnil -\def\bbl@ifshorthand#1#2#3{#2}% -\ifx\babeloptionstrings\@undefined - \let\bbl@opt@strings\@nnil -\else - \let\bbl@opt@strings\babeloptionstrings -\fi -\def\bbl@tempa{normal} -\ifx\babeloptionmath\bbl@tempa - \def\bbl@mathnormal{\noexpand\textormath} -\fi -\def\BabelStringsDefault{generic} -\ifx\BabelModifiers\@undefined\let\BabelModifiers\relax\fi -\let\bbl@afterlang\relax -\let\bbl@language@opts\@empty -\ifx\@uclclist\@undefined\let\@uclclist\@empty\fi -\def\AfterBabelLanguage#1#2{} %</plain> % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/babel/babel.ins b/Master/texmf-dist/source/latex/babel/babel.ins index 69c35095142..f33ccf206b8 100644 --- a/Master/texmf-dist/source/latex/babel/babel.ins +++ b/Master/texmf-dist/source/latex/babel/babel.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 2012-2017 Javier Bezos and Johannes L. Braams. +%% Copyright 2012-2018 Javier Bezos and Johannes L. Braams. %% Copyright 1989-2008 Johannes L. Braams and any individual authors %% listed elsewhere in this file. All rights reserved. %% @@ -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/01/24} +\def\filedate{2018/02/14} \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 66af9a52eb1..d99a4de0211 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/01/24 v3.17] +\ProvidesFile{bbcompat.dtx}[2018/02/14 v3.18] %</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 b472025d667..7fe56787485 100644 --- a/Master/texmf-dist/source/latex/babel/locale.zip +++ b/Master/texmf-dist/source/latex/babel/locale.zip |