summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-14 21:34:13 +0000
committerKarl Berry <karl@freefriends.org>2018-02-14 21:34:13 +0000
commit8b6cfd638559d98ab42f15ecae4afb6d754404d5 (patch)
tree65b9d0a06956be707fc0505ca551b4d2338fb9e1 /Master/texmf-dist
parent377d5868421b9bab3a6e0fddb02ccc99597b2855 (diff)
babel (14feb18)
git-svn-id: svn://tug.org/texlive/trunk@46640 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/babel/README.md12
-rw-r--r--Master/texmf-dist/doc/latex/babel/babel.pdfbin635190 -> 639170 bytes
-rw-r--r--Master/texmf-dist/source/latex/babel/babel.dtx345
-rw-r--r--Master/texmf-dist/source/latex/babel/babel.ins4
-rw-r--r--Master/texmf-dist/source/latex/babel/bbcompat.dtx2
-rw-r--r--Master/texmf-dist/source/latex/babel/locale.zipbin682821 -> 691173 bytes
-rw-r--r--Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua2
-rw-r--r--Master/texmf-dist/tex/generic/babel/babel-bidi.lua2
-rw-r--r--Master/texmf-dist/tex/generic/babel/babel.def72
-rw-r--r--Master/texmf-dist/tex/generic/babel/babel.sty21
-rw-r--r--Master/texmf-dist/tex/generic/babel/blplain.tex2
-rw-r--r--Master/texmf-dist/tex/generic/babel/bplain.tex2
-rw-r--r--Master/texmf-dist/tex/generic/babel/hyphen.cfg6
-rw-r--r--Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-DZ.ini153
-rw-r--r--Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-MA.ini153
-rw-r--r--Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-SY.ini151
-rw-r--r--Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar.ini6
-rw-r--r--Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-algeria.tex12
-rw-r--r--Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-dz.tex4
-rw-r--r--Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-ma.tex4
-rw-r--r--Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-morocco.tex12
-rw-r--r--Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-sy.tex4
-rw-r--r--Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-syria.tex12
-rw-r--r--Master/texmf-dist/tex/generic/babel/luababel.def29
-rw-r--r--Master/texmf-dist/tex/generic/babel/nil.ldf4
-rw-r--r--Master/texmf-dist/tex/generic/babel/plain.def19
-rw-r--r--Master/texmf-dist/tex/generic/babel/switch.def17
-rw-r--r--Master/texmf-dist/tex/generic/babel/txtbabel.def6
-rw-r--r--Master/texmf-dist/tex/generic/babel/xebabel.def3
29 files changed, 878 insertions, 181 deletions
diff --git a/Master/texmf-dist/doc/latex/babel/README.md b/Master/texmf-dist/doc/latex/babel/README.md
index add1ef51dab..68f077fe24e 100644
--- a/Master/texmf-dist/doc/latex/babel/README.md
+++ b/Master/texmf-dist/doc/latex/babel/README.md
@@ -1,4 +1,4 @@
-## Babel 3.17
+## Babel 3.18
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -64,6 +64,14 @@ respective authors.
### New
```
+3.18 - More bidi in luatex: captions (required only in multilingual
+ docs) and tabular (required for R tables). Also an experimental
+ support for captions in xetex and pdftex (tabular is not yet
+ supported).
+ - New ini files: ar-DZ, ar-MA, ar-SY
+ - Fix - \begin{hyphenrules} didn't work with polyglossia.
+ - Fix - switch.def was loaded twice.
+
3.17 - A tool for bidi footnotes.
- Fix - \ragged... didn't work for bidi.
@@ -110,5 +118,5 @@ respective authors.
```
Javier Bezos
-2018/01/24
+2018/02/14
diff --git a/Master/texmf-dist/doc/latex/babel/babel.pdf b/Master/texmf-dist/doc/latex/babel/babel.pdf
index b8da57f1c05..d72692a4d94 100644
--- a/Master/texmf-dist/doc/latex/babel/babel.pdf
+++ b/Master/texmf-dist/doc/latex/babel/babel.pdf
Binary files differ
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
index b472025d667..7fe56787485 100644
--- a/Master/texmf-dist/source/latex/babel/locale.zip
+++ b/Master/texmf-dist/source/latex/babel/locale.zip
Binary files differ
diff --git a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua
index 2970d9c016c..f394eaafec3 100644
--- a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua
+++ b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua
@@ -7,7 +7,7 @@
-- babel.dtx (with options: `basic-r')
--
--
--- 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.
diff --git a/Master/texmf-dist/tex/generic/babel/babel-bidi.lua b/Master/texmf-dist/tex/generic/babel/babel-bidi.lua
index f2fc552eda6..54b6ac3ed9f 100644
--- a/Master/texmf-dist/tex/generic/babel/babel-bidi.lua
+++ b/Master/texmf-dist/tex/generic/babel/babel-bidi.lua
@@ -7,7 +7,7 @@
-- babel.dtx (with options: `bidi')
--
--
--- 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.
diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def
index 1d6c7c725d5..62dfa7ed7c0 100644
--- a/Master/texmf-dist/tex/generic/babel/babel.def
+++ b/Master/texmf-dist/tex/generic/babel/babel.def
@@ -7,7 +7,7 @@
%% babel.dtx (with options: `core')
%%
%%
-%% 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.
@@ -40,18 +40,36 @@
\wlog{File: #1 #4 #3 <#2>}%
\let\ProvidesFile\@undefined}
\fi
-\ProvidesFile{babel.def}[2018/01/24 3.17 Babel common definitions]
+\ProvidesFile{babel.def}[2018/02/14 3.18 Babel common definitions]
\ifx\AtBeginDocument\@undefined
\input plain.def\relax
\fi
\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
+\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
@@ -78,6 +96,7 @@
\input luababel.def
\fi
\fi
+\bbl@trace{Basic macros}
\def\bbl@stripslash{\expandafter\@gobble\string}
\def\bbl@add#1#2{%
\bbl@ifunset{\bbl@stripslash#1}%
@@ -228,6 +247,7 @@
{\bbl@exp{\let\<org@\bbl@tempa>\<\bbl@tempa\space>}}%
\@namedef{\bbl@tempa\space}}
\@onlypreamble\bbl@redefinerobust
+\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}}%
@@ -249,6 +269,7 @@
adddialect=2,patterns=2,defaultcommands=0,encodedcommands=2,write=0,%
beforeextras=0,afterextras=0,stopcommands=0,stringprocess=0,%
hyphenation=2,initiateactive=3,afterreset=0,foreign=0,foreign*=0}
+\bbl@trace{Defining babelensure}
\newcommand\babelensure[2][]{% TODO - revise test files
\AddBabelHook{babel-ensure}{afterextras}{%
\ifcase\bbl@select@type
@@ -308,6 +329,7 @@
\contentsname\listfigurename\listtablename\indexname\figurename
\tablename\partname\enclname\ccname\headtoname\pagename\seename
\alsoname\proofname\glossaryname}
+\bbl@trace{Macros for setting language files up}
\def\bbl@ldfinit{%
\let\bbl@screset\@empty
\let\BabelStrings\bbl@opt@string
@@ -366,6 +388,7 @@
\else
\select@language{#1}%
\fi}
+\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}}%
@@ -683,6 +706,7 @@
\ifx\f@encoding\@undefined
\def\f@encoding{OT1}
\fi
+\bbl@trace{Language attributes}
\newcommand\languageattribute[2]{%
\def\bbl@tempc{#1}%
\bbl@fixname\bbl@tempc
@@ -749,6 +773,7 @@
\def\bbl@clear@ttrib#1-#2.{%
\expandafter\let\csname#1@attr@#2\endcsname\@undefined}
\AtBeginDocument{\bbl@clear@ttribs}
+\bbl@trace{Macros for saving definitions}
\def\babel@beginsave{\babel@savecnt\z@}
\newcount\babel@savecnt
\babel@beginsave
@@ -769,6 +794,7 @@
\let\bbl@nonfrenchspacing\nonfrenchspacing
\fi}
\let\bbl@nonfrenchspacing\nonfrenchspacing
+\bbl@trace{Short tags}
\def\babeltags#1{%
\edef\bbl@tempa{\zap@space#1 \@empty}%
\def\bbl@tempb##1=##2\@@{%
@@ -783,6 +809,7 @@
\bbl@tempc}%
\bbl@for\bbl@tempa\bbl@tempa{%
\expandafter\bbl@tempb\bbl@tempa\@@}}
+\bbl@trace{Hyphens}
\@onlypreamble\babelhyphenation
\AtEndOfPackage{%
\newcommand\babelhyphenation[2][\@empty]{%
@@ -846,6 +873,7 @@
\def\bbl@hy@empty{\hskip\z@skip}
\def\bbl@hy@@empty{\discretionary{}{}{}}
\def\bbl@disc#1#2{\nobreak\discretionary{#2-}{}{#1}\bbl@allowhyphens}
+\bbl@trace{Multiencoding strings}
\def\bbl@toglobal#1{\global\let#1#1}
\def\bbl@recatcode#1{%
\@tempcnta="7F
@@ -1070,6 +1098,7 @@
\bbl@xin@{,}{\bbl@language@opts}%
\chardef\bbl@opt@hyphenmap\ifin@4\else\@ne\fi
\fi}
+\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@}
@@ -1227,6 +1256,7 @@
\chardef\l@english\z@
\fi
\main@language{english}
+\bbl@trace{Bidi layout}
\providecommand\IfBabelLayout[3]{#3}%
\newcommand\BabelPatchSection[1]{%
\@ifundefined{#1}{}{%
@@ -1237,6 +1267,7 @@
\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}}}%
@@ -1244,10 +1275,11 @@
\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}%
@@ -1257,6 +1289,9 @@
\BabelPatchSection{subparagraph}%
\def\babel@toc#1{%
\select@language@x{\bbl@main@language}}}{}
+\IfBabelLayout{captions}%
+ {\BabelPatchSection{caption}}{}
+\bbl@trace{Input engine specific macros}
\ifcase\bbl@engine
\input txtbabel.def
\or
@@ -1264,15 +1299,7 @@
\or
\input xebabel.def
\fi
-{\def\format{lplain}
-\ifx\fmtname\format
-\else
- \def\format{LaTeX2e}
- \ifx\fmtname\format
- \else
- \aftergroup\endinput
- \fi
-\fi}
+\bbl@trace{Creating languages and reading ini files}
\newcommand\babelprovide[2][]{%
\let\bbl@savelangname\languagename
\def\languagename{#2}%
@@ -1563,6 +1590,16 @@
\bbl@read@ini{##1}%
\endgroup}% boxed, to avoid extra spaces:
{\setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}}}
+{\def\format{lplain}
+\ifx\fmtname\format
+\else
+ \def\format{LaTeX2e}
+ \ifx\fmtname\format
+ \else
+ \aftergroup\endinput
+ \fi
+\fi}
+\bbl@trace{Cross referencing macros}
\ifx\bbl@opt@safe\@empty\else
\def\@newl@bel#1#2#3{%
{\@safe@activestrue
@@ -1640,6 +1677,7 @@
\let\org@bibcite\bibcite
\let\org@@bibitem\@bibitem
\fi
+\bbl@trace{Marks}
\IfBabelLayout{sectioning}
{\ifx\bbl@opt@headfoot\@nnil
\g@addto@macro\@resetactivechars{%
@@ -1670,6 +1708,7 @@
{\@temptokena\expandafter{\bbl@tempb{#2}}}%
\bbl@exp{\\\org@markboth{\the\toks@}{\the\@temptokena}}}
\bbl@tempc} % end \IfBabelLayout
+\bbl@trace{Preventing clashes with other packages}
\bbl@xin@{R}\bbl@opt@safe
\ifin@
\AtBeginDocument{%
@@ -1741,6 +1780,7 @@
\closeout15
}
\@onlypreamble\substitutefontfamily
+\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
@@ -1798,6 +1838,7 @@
\else
\DeclareTextFontCommand{\textlatin}{\latintext}
\fi
+\bbl@trace{Basic (internal) bidi support}
\def\bbl@alscripts{,Arabic,Syriac,Thaana,}
\def\bbl@rscripts{%
,Imperial Aramaic,Avestan,Cypriot,Hatran,Hebrew,%
@@ -1915,6 +1956,7 @@
\bbl@severypar{\bbl@xeeverypar\the\everypar}}
\fi
\DeclareRobustCommand\babelsublr[1]{\leavevmode{\bbl@textdir\z@#1}}
+\bbl@trace{Local Language Configuration}
\ifx\loadlocalcfg\@undefined
\@ifpackagewith{babel}{noconfigs}%
{\let\loadlocalcfg\@gobble}%
diff --git a/Master/texmf-dist/tex/generic/babel/babel.sty b/Master/texmf-dist/tex/generic/babel/babel.sty
index b95260eb477..2c3d5df23c5 100644
--- a/Master/texmf-dist/tex/generic/babel/babel.sty
+++ b/Master/texmf-dist/tex/generic/babel/babel.sty
@@ -7,7 +7,7 @@
%% babel.dtx (with options: `package')
%%
%%
-%% 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.
@@ -32,16 +32,22 @@
%% extension |.ins|) which are part of the distribution.
%%
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\ProvidesPackage{babel}[2018/01/24 3.17 The Babel package]
+\ProvidesPackage{babel}[2018/02/14 3.18 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
\ifx\directlua\@undefined\else
\ifx\bbl@luapatterns\@undefined
\input luababel.def
\fi
\fi
+\bbl@trace{Basic macros}
\def\bbl@stripslash{\expandafter\@gobble\string}
\def\bbl@add#1#2{%
\bbl@ifunset{\bbl@stripslash#1}%
@@ -198,6 +204,7 @@
luatexbase.priority_in_callback('hpack_filter',
'luaotfload.node_processor') or nil)}}{}
\fi
+\bbl@trace{Defining option 'base'}
\@ifpackagewith{babel}{base}{%
\ifx\directlua\@undefined
\DeclareOption*{\bbl@patterns{\CurrentOption}}%
@@ -212,6 +219,7 @@
\global\let\@ifl@ter@@\@ifl@ter
\def\@ifl@ter#1#2#3#4#5{\global\let\@ifl@ter\@ifl@ter@@}%
\endinput}{}%
+\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}%
@@ -305,6 +313,7 @@
\bbl@add@list\bbl@language@opts{\CurrentOption}%
\fi}
\ProcessOptions*
+\bbl@trace{Conditional loading of shorthands}
\def\bbl@sh@string#1{%
\ifx#1\@empty\else
\ifx#1t\string~%
@@ -346,6 +355,7 @@
\ifx\bbl@language@opts\@empty\else\bbl@language@opts,\fi
\bbl@opt@main}
\fi
+\bbl@trace{Defining IfBabelLayout}
\ifx\bbl@opt@layout\@nnil
\newcommand\IfBabelLayout[3]{#3}%
\else
@@ -357,6 +367,7 @@
\expandafter\@secondoftwo
\fi}
\fi
+\bbl@trace{Language options}
\let\bbl@afterlang\relax
\let\BabelModifiers\relax
\let\bbl@loaded\@empty
diff --git a/Master/texmf-dist/tex/generic/babel/blplain.tex b/Master/texmf-dist/tex/generic/babel/blplain.tex
index c073dc47925..9c7a14215d3 100644
--- a/Master/texmf-dist/tex/generic/babel/blplain.tex
+++ b/Master/texmf-dist/tex/generic/babel/blplain.tex
@@ -7,7 +7,7 @@
%% babel.dtx (with options: `blplain')
%%
%%
-%% 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.
diff --git a/Master/texmf-dist/tex/generic/babel/bplain.tex b/Master/texmf-dist/tex/generic/babel/bplain.tex
index 70da67552f8..57c5be41992 100644
--- a/Master/texmf-dist/tex/generic/babel/bplain.tex
+++ b/Master/texmf-dist/tex/generic/babel/bplain.tex
@@ -7,7 +7,7 @@
%% babel.dtx (with options: `bplain')
%%
%%
-%% 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.
diff --git a/Master/texmf-dist/tex/generic/babel/hyphen.cfg b/Master/texmf-dist/tex/generic/babel/hyphen.cfg
index 98d4fa97d73..16d728edcd4 100644
--- a/Master/texmf-dist/tex/generic/babel/hyphen.cfg
+++ b/Master/texmf-dist/tex/generic/babel/hyphen.cfg
@@ -7,7 +7,7 @@
%% babel.dtx (with options: `patterns')
%%
%%
-%% 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.
@@ -36,7 +36,7 @@
\wlog{File: #1 #4 #3 <#2>}%
\let\ProvidesFile\@undefined}
\fi
-\ProvidesFile{hyphen.cfg}[2018/01/24 3.17 Babel hyphens]
+\ProvidesFile{hyphen.cfg}[2018/02/14 3.18 Babel hyphens]
\xdef\bbl@format{\jobname}
\ifx\AtBeginDocument\@undefined
\def\@empty{}
@@ -67,7 +67,7 @@
\countdef\last@language=19
\def\addlanguage{\alloc@9\language\chardef\@cclvi}
\fi
-\toks8{Babel <3.17> and hyphenation patterns for }%
+\toks8{Babel <3.18> and hyphenation patterns for }%
\def\process@line#1#2 #3 #4 {%
\ifx=#1%
\process@synonym{#2}%
diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-DZ.ini b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-DZ.ini
new file mode 100644
index 00000000000..2fee81351fe
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-DZ.ini
@@ -0,0 +1,153 @@
+; This file is part of babel. For further details see:
+; https://www.ctan.org/pkg/babel
+; Data has been collected mainly from the following sources:
+; * babel language styles (license LPPL):
+; https://www.ctan.org/pkg/babel-contrib
+; * polyglossia language styles (license LPPL)
+; https://www.ctan.org/pkg/polyglossia
+; * Common Locale Data Repository (license Unicode):
+; http://cldr.unicode.org/
+; http://unicode.org/copyright.html
+
+[identification]
+charset = utf8
+version = 1.0
+date = 2018-02-05
+name.local = العربية
+name.english = Arabic
+name.babel = arabic-dz
+name.babel.A = arabic-algeria
+tag.bcp47 = ar
+tag.opentype = ARA
+region.local = الجزائر
+region.english = Algeria
+region.tag.bcp47 = DZ
+script.name = Arabic
+script.tag.bcp47 = Arab
+script.tag.opentype = arab
+level = 1
+encodings =
+derivate = no
+
+[captions]
+preface = مدخل
+ref = المراجع
+abstract = ملخص
+bib = المصادر
+chapter = باب
+appendix = الملاحق
+contents = المحتويات
+listfigure = قائمة الأشكال
+listtable = قائمة الجداول
+index = الفهرس
+figure = شكل
+table = جدول
+part = القسم
+encl = المرفقات
+cc = نسخة ل‬
+headto = إلى
+page = صفحة
+see = راجع
+also = راجع أيضًا
+proof = برهان
+glossary = قاموس
+
+[date.gregorian]
+date.long = [d] [MMMM]، [y]
+date.short = [d]‏/[M]‏/[y]
+months.wide.1 = جانفي
+months.wide.2 = فيفري
+months.wide.3 = مارس
+months.wide.4 = أفريل
+months.wide.5 = ماي
+months.wide.6 = جوان
+months.wide.7 = جويلية
+months.wide.8 = أوت
+months.wide.9 = سبتمبر
+months.wide.10 = أكتوبر
+months.wide.11 = نوفمبر
+months.wide.12 = ديسمبر
+months.narrow.1 = ج
+months.narrow.2 = ف
+months.narrow.3 = م
+months.narrow.4 = أ
+months.narrow.5 = م
+months.narrow.6 = ج
+months.narrow.7 = ج
+months.narrow.8 = أ
+months.narrow.9 = س
+months.narrow.10 = أ
+months.narrow.11 = ن
+months.narrow.12 = د
+days.wide.mon = الاثنين
+days.wide.tue = الثلاثاء
+days.wide.wed = الأربعاء
+days.wide.thu = الخميس
+days.wide.fri = الجمعة
+days.wide.sat = السبت
+days.wide.sun = الأحد
+days.abbreviated.mon = الاثنين
+days.abbreviated.tue = الثلاثاء
+days.abbreviated.wed = الأربعاء
+days.abbreviated.thu = الخميس
+days.abbreviated.fri = الجمعة
+days.abbreviated.sat = السبت
+days.abbreviated.sun = الأحد
+days.narrow.mon = ن
+days.narrow.tue = ث
+days.narrow.wed = ر
+days.narrow.thu = خ
+days.narrow.fri = ج
+days.narrow.sat = س
+days.narrow.sun = ح
+dayPeriods.abbreviated.am = ص
+dayPeriods.abbreviated.pm = م
+dayPeriods.narrow.am = ص
+dayPeriods.narrow.pm = م
+dayPeriods.wide.am = ص
+dayPeriods.wide.pm = م
+
+[time.gregorian]
+time.medium = [h]:[mm]:[ss] [a]
+time.short = [h]:[mm] [a]
+
+[typography]
+frenchspacing =
+hyphenrules =
+lefthyphenmin =
+righthyphenmin =
+hyphenchar =
+prehyphenchar =
+posthyphenchar =
+exhyphenchar =
+preexhyphenchar =
+postexhyphenchar =
+hyphenationmin =
+
+[characters]
+delimiters.quotes = ”“’‘
+auxiliary = [\u200C\u200D\u200E\u200F پ چ ژ ڜ ڢ ڤ ڥ ٯ ڧ ڨ ک گ ی]
+exemplarCharacters = [\u064B \u064C \u064D \u064E \u064F \u0650 \u0651 \u0652 \u0670 ء أ ؤ إ ئ ا آ ب ة ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ ف ق ك ل م ن ه و ى ي]
+index = [ا ب ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ ف ق ك ل م ن ه و ي]
+punctuation = [\\- ‐ – — ، ؛ \\: ! ؟ . ' \" ( ) \\[ \\]]
+
+[numbers]
+defaultNumberingSystem = latn
+minimumGroupingDigits = 1
+decimal = ,
+exponential = E
+group = .
+infinity = ∞
+list = ;
+minusSign = ‎-
+nan = ليس رقمًا
+perMille = ‰
+percentSign = ‎%‎
+plusSign = ‎+
+superscriptingExponent = ×
+
+[counters]
+alph =
+Alph =
+ordinals =
+
diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-MA.ini b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-MA.ini
new file mode 100644
index 00000000000..00ffc97cfba
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-MA.ini
@@ -0,0 +1,153 @@
+; This file is part of babel. For further details see:
+; https://www.ctan.org/pkg/babel
+; Data has been collected mainly from the following sources:
+; * babel language styles (license LPPL):
+; https://www.ctan.org/pkg/babel-contrib
+; * polyglossia language styles (license LPPL)
+; https://www.ctan.org/pkg/polyglossia
+; * Common Locale Data Repository (license Unicode):
+; http://cldr.unicode.org/
+; http://unicode.org/copyright.html
+
+[identification]
+charset = utf8
+version = 1.0
+date = 2018-02-05
+name.local = العربية
+name.english = Arabic
+name.babel = arabic-ma
+name.babel.A = arabic-morocco
+tag.bcp47 = ar
+tag.opentype = ARA
+region.local = المغرب
+region.english = Morocco
+region.tag.bcp47 = MA
+script.name = Arabic
+script.tag.bcp47 = Arab
+script.tag.opentype = arab
+level = 1
+encodings =
+derivate = no
+
+[captions]
+preface = مدخل
+ref = المراجع
+abstract = ملخص
+bib = المصادر
+chapter = باب
+appendix = الملاحق
+contents = المحتويات
+listfigure = قائمة الأشكال
+listtable = قائمة الجداول
+index = الفهرس
+figure = شكل
+table = جدول
+part = القسم
+encl = المرفقات
+cc = نسخة ل‬
+headto = إلى
+page = صفحة
+see = راجع
+also = راجع أيضًا
+proof = برهان
+glossary = قاموس
+
+[date.gregorian]
+date.long = [d] [MMMM]، [y]
+date.short = [d]‏/[M]‏/[y]
+months.wide.1 = يناير
+months.wide.2 = فبراير
+months.wide.3 = مارس
+months.wide.4 = أبريل
+months.wide.5 = ماي
+months.wide.6 = يونيو
+months.wide.7 = يوليوز
+months.wide.8 = غشت
+months.wide.9 = شتنبر
+months.wide.10 = أكتوبر
+months.wide.11 = نونبر
+months.wide.12 = دجنبر
+months.narrow.1 = ي
+months.narrow.2 = ف
+months.narrow.3 = م
+months.narrow.4 = أ
+months.narrow.5 = م
+months.narrow.6 = ن
+months.narrow.7 = ل
+months.narrow.8 = غ
+months.narrow.9 = ش
+months.narrow.10 = ك
+months.narrow.11 = ب
+months.narrow.12 = د
+days.wide.mon = الاثنين
+days.wide.tue = الثلاثاء
+days.wide.wed = الأربعاء
+days.wide.thu = الخميس
+days.wide.fri = الجمعة
+days.wide.sat = السبت
+days.wide.sun = الأحد
+days.abbreviated.mon = الاثنين
+days.abbreviated.tue = الثلاثاء
+days.abbreviated.wed = الأربعاء
+days.abbreviated.thu = الخميس
+days.abbreviated.fri = الجمعة
+days.abbreviated.sat = السبت
+days.abbreviated.sun = الأحد
+days.narrow.mon = ن
+days.narrow.tue = ث
+days.narrow.wed = ر
+days.narrow.thu = خ
+days.narrow.fri = ج
+days.narrow.sat = س
+days.narrow.sun = ح
+dayPeriods.abbreviated.am = ص
+dayPeriods.abbreviated.pm = م
+dayPeriods.narrow.am = ص
+dayPeriods.narrow.pm = م
+dayPeriods.wide.am = ص
+dayPeriods.wide.pm = م
+
+[time.gregorian]
+time.medium = [HH]:[mm]:[ss]
+time.short = [HH]:[mm]
+
+[typography]
+frenchspacing =
+hyphenrules =
+lefthyphenmin =
+righthyphenmin =
+hyphenchar =
+prehyphenchar =
+posthyphenchar =
+exhyphenchar =
+preexhyphenchar =
+postexhyphenchar =
+hyphenationmin =
+
+[characters]
+delimiters.quotes = ”“’‘
+auxiliary = [\u200C\u200D\u200E\u200F پ چ ژ ڜ ڢ ڤ ڥ ٯ ڧ ڨ ک ڭ گ ݣ ی]
+exemplarCharacters = [\u064B \u064C \u064D \u064E \u064F \u0650 \u0651 \u0652 \u0670 ء أ ؤ إ ئ ا آ ب ة ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ ف ق ك ل م ن ه و ى ي]
+index = [ا ب ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ ف ق ك ل م ن ه و ي]
+punctuation = [\\- ‐ – — ، ؛ \\: ! ؟ . ' \" ( ) \\[ \\]]
+
+[numbers]
+defaultNumberingSystem = latn
+minimumGroupingDigits = 1
+decimal = ,
+exponential = E
+group = .
+infinity = ∞
+list = ;
+minusSign = ‎-
+nan = ليس رقمًا
+perMille = ‰
+percentSign = ‎%‎
+plusSign = ‎+
+superscriptingExponent = ×
+
+[counters]
+alph =
+Alph =
+ordinals =
+
diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-SY.ini b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-SY.ini
new file mode 100644
index 00000000000..46788019d47
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar-SY.ini
@@ -0,0 +1,151 @@
+; This file is part of babel. For further details see:
+; https://www.ctan.org/pkg/babel
+; Data has been collected mainly from the following sources:
+; * babel language styles (license LPPL):
+; https://www.ctan.org/pkg/babel-contrib
+; * polyglossia language styles (license LPPL)
+; https://www.ctan.org/pkg/polyglossia
+; * Common Locale Data Repository (license Unicode):
+; http://cldr.unicode.org/
+; http://unicode.org/copyright.html
+
+[identification]
+charset = utf8
+version = 1.0
+date = 2018-02-05
+name.local = العربية
+name.english = Arabic
+name.babel = arabic-sy
+name.babel.A = arabic-syria
+tag.bcp47 = ar
+tag.opentype = ARA
+region.local = سوريا
+region.english = Syria
+region.tag.bcp47 = SY
+script.name = Arabic
+script.tag.bcp47 = Arab
+script.tag.opentype = arab
+level = 1
+encodings =
+derivate = no
+
+[captions]
+preface = مدخل
+ref = المراجع
+abstract = ملخص
+bib = المصادر
+chapter = باب
+appendix = الملاحق
+contents = المحتويات
+listfigure = قائمة الأشكال
+listtable = قائمة الجداول
+index = الفهرس
+figure = شكل
+table = جدول
+part = القسم
+encl = المرفقات
+cc = نسخة ل‬
+headto = إلى
+page = صفحة
+see = راجع
+also = راجع أيضًا
+proof = برهان
+glossary = قاموس
+
+[date.gregorian]
+months.wide.1 = كانون الثاني
+months.wide.2 = شباط
+months.wide.3 = آذار
+months.wide.4 = نيسان
+months.wide.5 = أيار
+months.wide.6 = حزيران
+months.wide.7 = تموز
+months.wide.8 = آب
+months.wide.9 = أيلول
+months.wide.10 = تشرين الأول
+months.wide.11 = تشرين الثاني
+months.wide.12 = كانون الأول
+months.narrow.1 = ك
+months.narrow.2 = ش
+months.narrow.3 = آ
+months.narrow.4 = ن
+months.narrow.5 = أ
+months.narrow.6 = ح
+months.narrow.7 = ت
+months.narrow.8 = آ
+months.narrow.9 = أ
+months.narrow.10 = ت
+months.narrow.11 = ت
+months.narrow.12 = ك
+days.wide.mon = الاثنين
+days.wide.tue = الثلاثاء
+days.wide.wed = الأربعاء
+days.wide.thu = الخميس
+days.wide.fri = الجمعة
+days.wide.sat = السبت
+days.wide.sun = الأحد
+days.abbreviated.mon = الاثنين
+days.abbreviated.tue = الثلاثاء
+days.abbreviated.wed = الأربعاء
+days.abbreviated.thu = الخميس
+days.abbreviated.fri = الجمعة
+days.abbreviated.sat = السبت
+days.abbreviated.sun = الأحد
+days.narrow.mon = ن
+days.narrow.tue = ث
+days.narrow.wed = ر
+days.narrow.thu = خ
+days.narrow.fri = ج
+days.narrow.sat = س
+days.narrow.sun = ح
+dayPeriods.abbreviated.am = ص
+dayPeriods.abbreviated.pm = م
+dayPeriods.narrow.am = ص
+dayPeriods.narrow.pm = م
+dayPeriods.wide.am = ص
+dayPeriods.wide.pm = م
+
+[time.gregorian]
+time.medium = [h]:[mm]:[ss] [a]
+time.short = [h]:[mm] [a]
+
+[typography]
+frenchspacing =
+hyphenrules =
+lefthyphenmin =
+righthyphenmin =
+hyphenchar =
+prehyphenchar =
+posthyphenchar =
+exhyphenchar =
+preexhyphenchar =
+postexhyphenchar =
+hyphenationmin =
+
+[characters]
+delimiters.quotes = ”“’‘
+auxiliary = [\u200C\u200D\u200E\u200F پ چ ژ ڜ ڢ ڤ ڥ ٯ ڧ ڨ ک گ ی]
+exemplarCharacters = [\u064B \u064C \u064D \u064E \u064F \u0650 \u0651 \u0652 \u0670 ء أ ؤ إ ئ ا آ ب ة ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ ف ق ك ل م ن ه و ى ي]
+index = [ا ب ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ ف ق ك ل م ن ه و ي]
+punctuation = [\\- ‐ – — ، ؛ \\: ! ؟ . ' \" ( ) \\[ \\]]
+
+[numbers]
+defaultNumberingSystem = arab
+minimumGroupingDigits = 1
+decimal = .
+exponential = E
+group = ,
+infinity = ∞
+list = ;
+minusSign = ‎-
+nan = ليس رقمًا
+perMille = ‰
+percentSign = ‎%‎
+plusSign = ‎+
+superscriptingExponent = ×
+
+[counters]
+alph =
+Alph =
+ordinals =
+
diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar.ini b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar.ini
index e986941e941..3b7cb6f0ee8 100644
--- a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar.ini
+++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-ar.ini
@@ -11,8 +11,8 @@
[identification]
charset = utf8
-version = 1.0
-date = 2017-09-01
+version = 1.1
+date = 2018-02-05
name.local = العربية
name.english = Arabic
name.babel = arabic
@@ -32,7 +32,7 @@ abstract = ملخص
bib = المصادر
chapter = باب
appendix = الملاحق
-contents = الفهرس
+contents = المحتويات
listfigure = قائمة الأشكال
listtable = قائمة الجداول
index = الفهرس
diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-algeria.tex b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-algeria.tex
new file mode 100644
index 00000000000..93b4bcb2fc6
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-algeria.tex
@@ -0,0 +1,12 @@
+% This file is part of babel. For further details see:
+% https://www.ctan.org/pkg/babel
+\ifx\BabelBeforeIni\undefined
+ \PackageError{babel}%
+ {This file is a component of babel and cannot\MessageBreak
+ be loaded directly. I'll stop immediately}%
+ {Just use babel as documented.}%
+ \stop
+\fi
+\BabelBeforeIni{ar-DZ}{%
+}
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-dz.tex b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-dz.tex
new file mode 100644
index 00000000000..eb659bd580c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-dz.tex
@@ -0,0 +1,4 @@
+% This file is part of babel. For further details see:
+% https://www.ctan.org/pkg/babel
+\input{babel-arabic-algeria}
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-ma.tex b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-ma.tex
new file mode 100644
index 00000000000..4c9f811fcac
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-ma.tex
@@ -0,0 +1,4 @@
+% This file is part of babel. For further details see:
+% https://www.ctan.org/pkg/babel
+\input{babel-arabic-morocco}
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-morocco.tex b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-morocco.tex
new file mode 100644
index 00000000000..eb6b8efa262
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-morocco.tex
@@ -0,0 +1,12 @@
+% This file is part of babel. For further details see:
+% https://www.ctan.org/pkg/babel
+\ifx\BabelBeforeIni\undefined
+ \PackageError{babel}%
+ {This file is a component of babel and cannot\MessageBreak
+ be loaded directly. I'll stop immediately}%
+ {Just use babel as documented.}%
+ \stop
+\fi
+\BabelBeforeIni{ar-MA}{%
+}
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-sy.tex b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-sy.tex
new file mode 100644
index 00000000000..a073afaeed9
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-sy.tex
@@ -0,0 +1,4 @@
+% This file is part of babel. For further details see:
+% https://www.ctan.org/pkg/babel
+\input{babel-arabic-syria}
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-syria.tex b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-syria.tex
new file mode 100644
index 00000000000..dab1df681fb
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/babel/locale/ar/babel-arabic-syria.tex
@@ -0,0 +1,12 @@
+% This file is part of babel. For further details see:
+% https://www.ctan.org/pkg/babel
+\ifx\BabelBeforeIni\undefined
+ \PackageError{babel}%
+ {This file is a component of babel and cannot\MessageBreak
+ be loaded directly. I'll stop immediately}%
+ {Just use babel as documented.}%
+ \stop
+\fi
+\BabelBeforeIni{ar-SY}{%
+}
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def
index 7e09edcd9d8..447e2919076 100644
--- a/Master/texmf-dist/tex/generic/babel/luababel.def
+++ b/Master/texmf-dist/tex/generic/babel/luababel.def
@@ -7,7 +7,7 @@
%% babel.dtx (with options: `luatex')
%%
%%
-%% 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.
@@ -32,6 +32,7 @@
%% extension |.ins|) which are part of the distribution.
%%
\ifx\AddBabelHook\@undefined
+\bbl@trace{Read language.dat}
\begingroup
\toks@{}
\count@\z@ % 0=start, 1=0th, 2=normal
@@ -112,6 +113,7 @@
\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}
@@ -335,6 +337,7 @@
\ifx\DisableBabelHook\@undefined\endinput\fi
\AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont}
\DisableBabelHook{babel-fontspec}
+\bbl@trace{Font handling with fontspec}
\@onlypreamble\babelfont
\newcommand\babelfont[2][]{% 1=langs/scripts 2=fam
\edef\bbl@tempa{#1}%
@@ -448,8 +451,25 @@
\expandafter\addto\csname extras#1\endcsname{%
\babel@save\bbl@langfeatures
\edef\bbl@langfeatures{#2,}}}
+\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
@@ -458,6 +478,12 @@
\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
@@ -500,6 +526,7 @@
\def\@Roman#1{\babelsublr{\ensureascii{\bbl@asciiRoman#1}}}%
\def\labelenumii{)\theenumii(}%
\def\p@enumiii{\p@enumii)\theenumii(}}{}}{}
+\bbl@trace{Bidi footnotes}
\ifx\bbl@beforeforeign\leavevmode
\def\bbl@footnote#1#2#3{%
\@ifnextchar[%
diff --git a/Master/texmf-dist/tex/generic/babel/nil.ldf b/Master/texmf-dist/tex/generic/babel/nil.ldf
index f11e9b3820b..5f9fb22e75a 100644
--- a/Master/texmf-dist/tex/generic/babel/nil.ldf
+++ b/Master/texmf-dist/tex/generic/babel/nil.ldf
@@ -7,7 +7,7 @@
%% babel.dtx (with options: `nil')
%%
%%
-%% 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 @@
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension |.ins|) which are part of the distribution.
%%
-\ProvidesLanguage{nil}[2018/01/24 3.17 Nil language]
+\ProvidesLanguage{nil}[2018/02/14 3.18 Nil language]
\LdfInit{nil}{datenil}
\ifx\l@nohyphenation\@undefined
\@nopatterns{nil}
diff --git a/Master/texmf-dist/tex/generic/babel/plain.def b/Master/texmf-dist/tex/generic/babel/plain.def
index 3f4390d742f..1766c77135d 100644
--- a/Master/texmf-dist/tex/generic/babel/plain.def
+++ b/Master/texmf-dist/tex/generic/babel/plain.def
@@ -7,7 +7,7 @@
%% babel.dtx (with options: `plain')
%%
%%
-%% 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.
@@ -352,23 +352,6 @@
\ifx\scriptsize\@undefined
\let\scriptsize\sevenrm
\fi
-\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{}
\endinput
%%
%% End of file `plain.def'.
diff --git a/Master/texmf-dist/tex/generic/babel/switch.def b/Master/texmf-dist/tex/generic/babel/switch.def
index 501e9d932c4..79e2859dfe5 100644
--- a/Master/texmf-dist/tex/generic/babel/switch.def
+++ b/Master/texmf-dist/tex/generic/babel/switch.def
@@ -7,7 +7,7 @@
%% babel.dtx (with options: `kernel')
%%
%%
-%% 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.
@@ -36,7 +36,7 @@
\wlog{File: #1 #4 #3 <#2>}%
\let\ProvidesFile\@undefined}
\fi
-\ProvidesFile{switch.def}[2018/01/24 3.17 Babel switching mechanism]
+\ProvidesFile{switch.def}[2018/02/14 3.18 Babel switching mechanism]
\ifx\AtBeginDocument\@undefined
\input plain.def\relax
\fi
@@ -57,8 +57,8 @@
\countdef\last@language=19
\def\addlanguage{\alloc@9\language\chardef\@cclvi}
\fi
-\def\bbl@version{3.17}
-\def\bbl@date{2018/01/24}
+\def\bbl@version{3.18}
+\def\bbl@date{2018/02/14}
\def\adddialect#1#2{%
\global\chardef#1#2\relax
\bbl@usehooks{adddialect}{{#1}{#2}}%
@@ -283,9 +283,12 @@
\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
\def\providehyphenmins#1#2{%
\expandafter\ifx\csname #1hyphenmins\endcsname\relax
diff --git a/Master/texmf-dist/tex/generic/babel/txtbabel.def b/Master/texmf-dist/tex/generic/babel/txtbabel.def
index 9e547703fc0..525ac3ff5df 100644
--- a/Master/texmf-dist/tex/generic/babel/txtbabel.def
+++ b/Master/texmf-dist/tex/generic/babel/txtbabel.def
@@ -7,7 +7,7 @@
%% babel.dtx (with options: `texxet')
%%
%%
-%% 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,6 +31,9 @@
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension |.ins|) which are part of the distribution.
%%
+\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}
@@ -171,6 +174,7 @@
\endgroup
\fi}}%
{}
+\bbl@trace{Bidi footnotes}
\ifx\bbl@beforeforeign\leavevmode
\def\bbl@footnote#1#2#3{%
\@ifnextchar[%
diff --git a/Master/texmf-dist/tex/generic/babel/xebabel.def b/Master/texmf-dist/tex/generic/babel/xebabel.def
index 73c210e76d2..31085b2ce9b 100644
--- a/Master/texmf-dist/tex/generic/babel/xebabel.def
+++ b/Master/texmf-dist/tex/generic/babel/xebabel.def
@@ -7,7 +7,7 @@
%% babel.dtx (with options: `xetex')
%%
%%
-%% 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.
@@ -76,6 +76,7 @@
\ifx\DisableBabelHook\@undefined\endinput\fi
\AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont}
\DisableBabelHook{babel-fontspec}
+\bbl@trace{Font handling with fontspec}
\@onlypreamble\babelfont
\newcommand\babelfont[2][]{% 1=langs/scripts 2=fam
\edef\bbl@tempa{#1}%