texlive[44427] Master/texmf-dist: babel (19may17)

commits+karl at tug.org commits+karl at tug.org
Fri May 19 23:04:34 CEST 2017


Revision: 44427
          http://tug.org/svn/texlive?view=revision&revision=44427
Author:   karl
Date:     2017-05-19 23:04:34 +0200 (Fri, 19 May 2017)
Log Message:
-----------
babel (19may17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/babel/README
    trunk/Master/texmf-dist/doc/latex/babel/babel.pdf
    trunk/Master/texmf-dist/doc/latex/babel/locale.zip
    trunk/Master/texmf-dist/source/latex/babel/babel.dtx
    trunk/Master/texmf-dist/source/latex/babel/babel.ins
    trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx
    trunk/Master/texmf-dist/source/latex/babel/bbunicode.dtx
    trunk/Master/texmf-dist/tex/generic/babel/UKenglish.sty
    trunk/Master/texmf-dist/tex/generic/babel/USenglish.sty
    trunk/Master/texmf-dist/tex/generic/babel/afrikaans.sty
    trunk/Master/texmf-dist/tex/generic/babel/albanian.sty
    trunk/Master/texmf-dist/tex/generic/babel/american.sty
    trunk/Master/texmf-dist/tex/generic/babel/austrian.sty
    trunk/Master/texmf-dist/tex/generic/babel/babel.def
    trunk/Master/texmf-dist/tex/generic/babel/babel.sty
    trunk/Master/texmf-dist/tex/generic/babel/bahasa.sty
    trunk/Master/texmf-dist/tex/generic/babel/bahasam.sty
    trunk/Master/texmf-dist/tex/generic/babel/basque.sty
    trunk/Master/texmf-dist/tex/generic/babel/blplain.tex
    trunk/Master/texmf-dist/tex/generic/babel/bplain.tex
    trunk/Master/texmf-dist/tex/generic/babel/breton.sty
    trunk/Master/texmf-dist/tex/generic/babel/british.sty
    trunk/Master/texmf-dist/tex/generic/babel/bulgarian.sty
    trunk/Master/texmf-dist/tex/generic/babel/catalan.sty
    trunk/Master/texmf-dist/tex/generic/babel/croatian.sty
    trunk/Master/texmf-dist/tex/generic/babel/czech.sty
    trunk/Master/texmf-dist/tex/generic/babel/danish.sty
    trunk/Master/texmf-dist/tex/generic/babel/dutch.sty
    trunk/Master/texmf-dist/tex/generic/babel/english.sty
    trunk/Master/texmf-dist/tex/generic/babel/esperanto.sty
    trunk/Master/texmf-dist/tex/generic/babel/estonian.sty
    trunk/Master/texmf-dist/tex/generic/babel/finnish.sty
    trunk/Master/texmf-dist/tex/generic/babel/francais.sty
    trunk/Master/texmf-dist/tex/generic/babel/galician.sty
    trunk/Master/texmf-dist/tex/generic/babel/germanb.sty
    trunk/Master/texmf-dist/tex/generic/babel/greek.sty
    trunk/Master/texmf-dist/tex/generic/babel/hebrew.sty
    trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg
    trunk/Master/texmf-dist/tex/generic/babel/icelandic.sty
    trunk/Master/texmf-dist/tex/generic/babel/interlingua.sty
    trunk/Master/texmf-dist/tex/generic/babel/irish.sty
    trunk/Master/texmf-dist/tex/generic/babel/italian.sty
    trunk/Master/texmf-dist/tex/generic/babel/latin.sty
    trunk/Master/texmf-dist/tex/generic/babel/lsorbian.sty
    trunk/Master/texmf-dist/tex/generic/babel/magyar.sty
    trunk/Master/texmf-dist/tex/generic/babel/naustrian.sty
    trunk/Master/texmf-dist/tex/generic/babel/ngermanb.sty
    trunk/Master/texmf-dist/tex/generic/babel/nil.ldf
    trunk/Master/texmf-dist/tex/generic/babel/norsk.sty
    trunk/Master/texmf-dist/tex/generic/babel/plain.def
    trunk/Master/texmf-dist/tex/generic/babel/polish.sty
    trunk/Master/texmf-dist/tex/generic/babel/portuges.sty
    trunk/Master/texmf-dist/tex/generic/babel/romanian.sty
    trunk/Master/texmf-dist/tex/generic/babel/russianb.sty
    trunk/Master/texmf-dist/tex/generic/babel/samin.sty
    trunk/Master/texmf-dist/tex/generic/babel/scottish.sty
    trunk/Master/texmf-dist/tex/generic/babel/serbian.sty
    trunk/Master/texmf-dist/tex/generic/babel/slovak.sty
    trunk/Master/texmf-dist/tex/generic/babel/slovene.sty
    trunk/Master/texmf-dist/tex/generic/babel/spanish.sty
    trunk/Master/texmf-dist/tex/generic/babel/swedish.sty
    trunk/Master/texmf-dist/tex/generic/babel/switch.def
    trunk/Master/texmf-dist/tex/generic/babel/turkish.sty
    trunk/Master/texmf-dist/tex/generic/babel/ukraineb.sty
    trunk/Master/texmf-dist/tex/generic/babel/usorbian.sty
    trunk/Master/texmf-dist/tex/generic/babel/welsh.sty

Modified: trunk/Master/texmf-dist/doc/latex/babel/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/babel/README	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/doc/latex/babel/README	2017-05-19 21:04:34 UTC (rev 44427)
@@ -1,30 +1,41 @@
-Babel 3.9t
+Babel 3.10
 ----------
 
-This is Babel 3.9t.
+This package manages culturally-determined typographical (and other)
+rules, and hyphenation patterns for a wide range of languages.  Many
+language styles work with pdflatex, as well as with xelatex and
+lualatex out of the box.  A few even work with plain formats.
 
-*** Babel 3.9o and 3.9p are deprecated ***
-*** For incompatibilities with polyglossia read the manual ***
-*** You must recreate the formats if coming from version <3.9q ***
-
 Version 3.9a fixed lots of bugs and added some new features, intended
 mainly to make it compatible somehow with Unicode engines. Some bugs
 have not been fixed to avoid backward incompatibilities, but they have
-been documented. Most of the new features (like package options) are
+been documented. Most of the new features (like package options) were
 intended to overcome issues in previous releases without changing
 significantly the behaviour of Babel.
 
+Current development is focused on Unicode engines (XeTeX and LuaTeX).
+New features related to font selection, bidi writing and the like will
+be added incrementally. Versions numbers drop the letter and now 3.10,
+3.11, etc., will be used instead. So, 3.9t is the last in the former
+series.
+
+Included is a pre-release of the new ini files (for about 200
+languages) to be used in forthcoming versions. They are currenly not
+used, but this way they can be fine-tuned before the final release
+(they are based mainly on the CLDR, and some settings are not well
+suited for fine typesetting).
+
 Languages are not part of the Babel core any more; in particular, it
 shall be no longer necessary to synchronize Babel core releases with
 releases of Babel language files. See CONTRIB for further details
-about contributing a language.
+about contributing a language. You may also create an ini file or
+improve the existing ones -- it's a trivial task (no programming
+skills required at all), but don't hesitate to ask for help.
 
-To install it, just tex babel.ins and move the generated files to the
-corresponding place in your TeX distribution. Unlike former releases,
-formats must not be recreated, but it is recommended, at least the
-first time Babel is updated from 3.8 (or previous versions).
+The best way to install and/or update it is with the help of package
+managers.
 
-Changes are described in babel.pdf with the label "New 3.9". The
+Changes are described in babel.pdf with the label "New <version>". The
 manual has been expanded to include some tips and tricks, but it will
 be improved in next releases.
 
@@ -39,95 +50,32 @@
 Bugs related to specific languages are best reported to their
 respective authors.
 
-Versions >=3.9i presumes the german style has been updated to 2.7.
+Recent changes
+--------------
 
-New
----
-* babel.dtx
-3.9b  - Fixed an idiot slip in hyphen.cfg: a \def instead of \let
-3.9c  - Added the "modifiers" mechanism
-      - Option shorthands accepts t for ~ and c for ,
-      - \foreinglanguage inserted a par (because of an empty line
-        in the doc part)
-3.9d  - Fixed undefined \@expandtwoargs in Plain
-      - Code reorganized (just an "internal" change)
-3.9e  - Fixed a bug introduced in 3.9c which mangled key=value
-        options.
-3.9f  - Default hyphenmins were not set to 2 3. Now they are again.
-3.9g  - bbplain.dtx and babel.dtx merged.
-      - The number of languages was not printed in some formats.
-      - A new mechanism to force \StartBabelCommands even without the
-        'strings' key (\UseStrings didn't work at all).
-      - With \AfterBabelCommands macros can be defined in the global scope.
-      - A tool for readjusting lccodes for hyphenation (\SetHyphenMap and a
-        package option).
-      - Tentative macros for \fontspec.
-3.9h  - Fixed bugs in \SetStringLoop (first token expanded prematurely)
-        and \SetCase (sometimes ignored).
-      - bplain didn't work (again). Fixed.
-      - Other minor internal changes.
-3.9i  - With LuaTeX, spaces are not ignored after shorthands and closing
-        braces can follow them.
-      - \textlatin and friends are deprecated. For the logos (see
-	below) a new macro is used if necessary (\ensureascii), so
-	\textlatin is not used in the core any more.
-      - \babelensure can be used to wrap caption texts with \foreignlanguage,
-        as well as to enforce an encoding.
-      - \babeltags is just for syntactical sugar, and defines macros
-	with short names to switch the language (eg, \textdeu and \deu).
-      - Partial compatibility with languages named as \lang@ instead
-	of \l@ (plain etex/xetex/luatex).
-      - Bug fix. The logos \TeX and \LaTeX were typeset in a wrong font
-	in some cases. Now if a non-ASCII font is not loaded they are not
-	redefined at all.
-      - Bug fix. \bbl at allowhyphens is now ignored in vertical mode.
-      - Bug fix. Loops with \@for failed in Plain.
-      - Bug fix. A few codes in xetex where wrong when loading patterns.
-      - Bug fix. With strings=encoded captions were left unchanged in
-	\MakeUppercase/\MakeLowercase.
-3.9j  - Bug fix. Plain formats didn't work (Undefined \@filelist).
-3.9k  - Code and doc reorganized with some `literate' concepts (with a
-        slightly patched docstrip).
-      - Removed the luatex stuff for shorthands. It was just a first step,
-        but ended up in the final release of 3.9i (it shouldn't).
-      - Improvements for Plain and other non-LaTeX formats.
-3.9l  - Formerly, fontspec set \latinencoding to EUx if babel was loaded.
-        Now, babel sets it if fontspec is loaded.
-      - New package options 'nocase' (\SetCase is ignored) and 'silent'
-      - Improved compatibility (hopefully) with babelbib.
-3.9m  - Fixed melayu name (from meyalu).
-      - A few lines for \babelpatterns (only luatex, see below).
-3.9n  - Just fixes a couple of minor bugs (related to 2.09 and ifthen).
-3.9o  - Adapted to the forthcoming Unicode encoding.
-3.9p  - A little change for bbunicode 1.1b.
-3.9q  - base now reads patterns in lua
-      - Some minor changes for luatex
-3.9r  - The three main dtx files now share version numbers.
-      - bbunicode - Fixed a line break at \cs{foreignlanguage} with
-        unloaded patterns. Also added \babelcatcodetablenum, just in
-	case.
-3.9s  - Bug fix - extra speces with \babelensure
-3.9t  - Part of the code for 3.10 has been "back-ported" to this
+3.10  - New versioning
+      - New macro - \babelprovide
+
+3.9t  - Part of the code for 3.10 ss has been "back-ported" to this
         release, but they are only internal changes.
       - Fix - with \babelhyphen{soft} the hyphen could vanish.
       - English, Indonesian and Malay "dialects" now rely on the proxy
         files provided by these languages (eg, american.ldf, melayu.ldf).
-	If you upgrade babel, you must upgrade those languages, too.
+	If you upgrade babel, you MUST upgrade those languages, too.
+	
+3.9s  - Bug fix - extra spaces with \babelensure
 
-* bbunicode.dtx
-1.0b  - Improvements by Elie Roux for LuaTeX.
-1.0c  - Bug fix. A few codes in xetex where wrong when loading patterns.
-1.0e  - \babelpatterns, which adds patterns to a language.
-      - Use [[]] instead of \luaescapestring (the latter is not always
-        available).
-1.0f  - Code for luatex assigned mistakenly to xetex.
-1.1a  - Revamped hyphenation loader for luatex.
-1.1b  - Now patterns are loaded with lua(e)tex (and a bug fixed).
-1.1c  - Patterns loader thorougly revised
-3.9r and later - The three main dtx files now share version numbers. See
-        changes above    
+3.9r  - The three main dtx files now share version numbers.
+      - bbunicode - Fixed a line break at \cs{foreignlanguage} with
+        unloaded patterns. Also added \babelcatcodetablenum, just in
+	case.
+	
+3.9q  - base now reads patterns in lua
+      - Some minor changes for luatex
 
+*** Babel 3.9o and 3.9p are deprecated ***
+
 ------------
 Javier Bezos
-2017-04-28
+2017-05-19
 

Modified: trunk/Master/texmf-dist/doc/latex/babel/babel.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/babel/locale.zip
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/babel/babel.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/babel.dtx	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/source/latex/babel/babel.dtx	2017-05-19 21:04:34 UTC (rev 44427)
@@ -36,7 +36,7 @@
 %\iffalse
 %% File 'babel.dtx'
 %\fi
-%%\ProvidesFile{babel.dtx}[2017/04/28 v3.9t The Babel package]
+%%\ProvidesFile{babel.dtx}[2017/05/19 v3.10 The Babel package]
 %\iffalse
 %
 % Babel DOCUMENT-STYLE option for LaTeX version 2.09 or plain TeX;
@@ -52,6 +52,8 @@
 %
 %<*filedriver>
 \documentclass{ltxdoc}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
 \usepackage{bera}
 \raggedright
 \addtolength{\textwidth}{25pt}
@@ -88,8 +90,19 @@
 \definecolor{theshade}{rgb}{1,1,0.97}
 \definecolor{theframe}{gray}{0.6}
 \definecolor{lightgray}{gray}{0.95}
+\definecolor{messages}{rgb}{.66,.13,.27}
+\makeatletter
+\def\@begintheorem#1#2{%
+  \list{}{}%
+  \global\advance\@listdepth\m at ne
+  \item[{\sffamily\bfseries\color{messages}\MakeUppercase{#1}}]}%
+\makeatother
+\newtheorem{warning}{Warning}
+\newtheorem{note}{Note}
+\newtheorem{example}{Example}
 \IfFileExists{listings.sty}{
   \usepackage{listings}
+  \usepackage{listingsutf8}
   \lstdefinestyle{verbatim}{
     % gobble=1,
     columns=flexible,
@@ -114,6 +127,7 @@
     backgroundcolor=\color{theshade},
     rulecolor=\color{theframe},
     framerule=\fboxrule,
+    inputencoding=utf8
   }
   \let\verbatim\relax
   \lstnewenvironment{verbatim}[1][]{\lstset{style=verbatim,##1}}{}
@@ -194,8 +208,8 @@
 \vspace{2cm}\hspace{1.5cm}
 \begin{minipage}{5cm}
 \Large
-Version 3.9t\newline
-2017/04/28
+Version 3.10\newline
+2017/05/19
 
 \vspace{1cm}
 \textit{Original author}\newline
@@ -247,8 +261,29 @@
 
 In most cases, a single language is required, and then all you need in
 \LaTeX{} is to load the package using its standand mechanism for this
-purpose, namely, passing that language as an optional argument.
+purpose, namely, passing that language as an optional argument. In
+addition, you may want to set the font and input encodings. Here is a
+simple full example:
+\begin{verbatim}[escapechar=\&]
+\documentclass{article}
 
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+
+\usepackage[frenchb]{babel}
+
+\begin{document}
+
+Plus &\c c&a change, plus c'est la m&\^e&me chose!
+
+\end{document}
+\end{verbatim}
+
+\begin{warning} 
+A common source of trouble is a wrong setting of the input
+encoding. Make sure you set the encoding actually used by your editor.
+\end{warning}
+
 In multilingual documents, just use several option. So, in \LaTeX2e\
 the preamble of the document:
 \begin{verbatim}
@@ -299,16 +334,19 @@
 set an attribute by including it in the list of modifiers. However,
 modifiers is a more general mechanism.
 
-Because of the way \babel{} has evolved, ``language'' can refer to (1)
-a set of hyphenation patterns as preloaded into the format, (2) a
-package option, (3) an |ldf| file, and (4) a name used in the document
-to select a language or dialect. So, a package option refers to a
-language in a generic way -- sometimes it is the actual language name
-used to select it, sometimes it is a file name loading a language with
-a different name, sometimes it is a file name loading several
-languages. Please, read the documentation for specific languages for
-further info.
+\begin{note}
+  Because of the way \babel{} has evolved, ``language'' can refer to
+  (1) a set of hyphenation patterns as preloaded into the format, (2)
+  a package option, (3) an |ldf| file, and (4) a name used in the
+  document to select a language or dialect. So, a package option
+  refers to a language in a generic way -- sometimes it is the actual
+  language name used to select it, sometimes it is a file name loading
+  a language with a different name, sometimes it is a file name
+  loading several languages. Please, read the documentation for
+  specific languages for further info.
+\end{note}
 
+
 Loading directly |sty| files in \LaTeX{} (ie,
 |\usepackage|\marg{language}) is deprecated and you will get the
 error:\footnote{In former versions the error read ``You have used an
@@ -952,6 +990,86 @@
 \usepackage[foo,bar]{babel}
 \end{verbatim}
 
+\subsection{Creating a language}
+
+\New{3.10} And what if there is no style for your language or none
+fits your needs? You may then define quickly a language with the
+help of the following macro in the preamble.
+
+\Describe\babelprovide{\oarg{options}\marg{language-name}}
+
+Defines the internal structure of the language with some defaults: the
+hyphen rules, if not available, are set to the current ones, left and
+right hyphen mins are set to 2 and 3, but captions and date are not
+defined. Conveniently, \babel{} warns you about what to do. Very
+likely you will find warnings like that in the |log| file:
+\begin{verbatim}
+Package babel Warning: \mylangchaptername not set. Please, define
+(babel)                it in the preamble with something like:
+(babel)                \renewcommand\maylangchaptername{..}
+(babel)                Reported on input line 18.
+\end{verbatim}
+
+In most cases, you will only need to define a few macros. 
+
+For example, if you need a language named |arhinish|:
+\begin{verbatim}
+\usepackage[danish]{babel}
+\babelprovide{arhinish}
+\renewcommand\arhinishchaptername{Chapitula}
+\renewcommand\arhinishrefname{Refirenke}
+\renewcommand\arhinishhyphenmins{22}
+\end{verbatim}
+
+The main language is not changed (\texttt{danish} in this example).
+So, you must add |\selectlanguage{arhinish}| or other selectors when
+necessary.
+
+\Describe{captions=}{\meta{language-tag}}
+Currently, the \oarg{options} may be used to load captions from an
+|ini| file, but note these files are still tentative and might change.
+For example:
+\begin{verbatim}
+\babelprovide[captions=hu]{hungarian}
+\end{verbatim}
+It just loads the strings, no more. Encoding, font,
+\textsf{fontspec} language and script, writing direction, etc., are
+not touched at all. Unicode engines load the UTF-8 variants, while
+8-bit engines load the LICR (ie, with macros like |\'| or |\ss|) ones.
+
+\Describe{hyphenrules=}{\meta{language-list}} With this option, with a
+space-separated list of hyphenation rules, \babel{} assigns to the
+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
+applies. Note in this example we set |chavacano| as first option --
+without it, it would select |spanish| even if |chavacano| exists.
+
+A special value is |+|, which allocates a new language (in the \TeX{}
+sense). It only makes sense as the last value (or the only one; the
+subsequent ones are silently ignored). It is mostly useful with
+\luatex, because you can add some patterns with |\babelpatterns|, as
+for example:
+\begin{verbatim}
+\babelprovide[hyphenrules=+]{neo}
+\babelpatterns[neo]{a1 e2 i1 o1 u1}
+\end{verbatim}
+In other engines it just supresses hyphenation (because the pattern
+list is empty).
+
+\Describe{main}{} This valueless option makes the language the main
+one. Only in newly defined languages.
+
+\begin{note}
+  (1) Setting \verb|\today| is not so easy, and requires more work
+  (some tools are on the way). (2) If you need shorthands, you can use
+  |\useshorthands| and |\defineshorthand| as described above. (3)
+  Captions and |\today| are ``ensured'' with |\babelensure| (because
+  this will be the default in |ini|-based languages).
+\end{note}
+
 \subsection{Hooks}
 
 \New{3.9a} A hook is a piece of code to be executed at certain
@@ -2321,7 +2439,9 @@
 \end{document}
 %</filedriver>
 %\fi
+%
 % \changes{babel~3.9a}{2012/05/16}{Now using \cs{ldf at quit} for the test} 
+%
 %    \begin{macrocode}
 %<*core>
 \ifx\ldf at quit\@undefined
@@ -2330,6 +2450,7 @@
 \fi
 %</core>
 %    \end{macrocode}
+%
 %<*dtx>
 \ProvidesFile{babel.dtx}
 %</dtx>
@@ -2343,6 +2464,7 @@
 % \changes{babel~3.9g}{2013/06/01}{bbplain merged}
 % \changes{babel~3.9k}{2014/03/23}{Code and doc reorganized, and some
 %    minor enhancements}
+%
 %\begingroup
 %  \catcode`<=\active%
 %  \catcode`>=\active
@@ -2384,15 +2506,21 @@
 %    little bit of literate programming.
 %
 %    \begin{macrocode}
-%<<version=3.9t>>
-%<<date=2017/04/28>>
+%<<version=3.10>>
+%<<date=2017/05/19>>
 %    \end{macrocode}
 %
 % \section{Tools}
 %
+% \textbf{Do not use the following macros in ldf files. They may
+% change in the future}. This applies mainly to those recently added
+% for replacing, trimming and looping. The older ones, like
+% |\bbl at afterfi|, will not change.
+%
 % \changes{babel~3.9t}{2017/04/22}{Added new helper macros. Not all are
 %   currently used, but will be in 3.10 -- \cs{bbl at trim},
 %   \cs{bbl at ifunset}, \cs{bbl at exp}, \cs{bbl at stripslash}}
+%
 %    We define some basic macros which just make the code cleaner.
 %    |\bbl at add| is now used internally instead of |\addto| because of
 %    the unpredictable behaviour of the latter. Used in
@@ -2400,8 +2528,10 @@
 %    is executed twice, but we need them when defining options and
 %    \file{babel.def} cannot be load until options have been defined.
 %    This does not hurt, but should be fixed somehow.
+%
 % \changes{babel~3.9i}{2014/02/16}{\cs{@for} didn't work with
 %    Plain. Added \cs{bbl at loop}}
+%
 %    \begin{macrocode}
 %<<*Basic macros>>
 \def\bbl at stripslash{\expandafter\@gobble\string}
@@ -2418,6 +2548,7 @@
   \fi}
 \def\bbl at for#1#2#3{\bbl at loopx#1{#2}{\ifx#1\@empty\else#3\fi}}
 %    \end{macrocode}
+%
 % \changes{babel~3.9t}{2017/04/22}{Use \cs{bbl at ifunset} instead of
 %    \cs{@ifundefined}.}
 %
@@ -2426,8 +2557,10 @@
 %    separated list in its first argument. When the list is not
 %    defined yet (or empty), it will be initiated. It presumes
 %    expandable character strings.
+%
 % \changes{babel~3.9t}{2017/04/22}{Redefined to avoid infinite loops
 %    if the macro is \cs{relax}.}
+%
 %    \begin{macrocode}
 \def\bbl at add@list#1#2{%
   \edef#1{%
@@ -2436,6 +2569,7 @@
       {\ifx#1\@empty\else#1,\fi}%
     #2}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at afterelse}
@@ -2448,10 +2582,12 @@
 %    by Sonja Maus.}. These macros will break if another |\if...\fi|
 %    statement appears in one of the arguments and it is not enclosed
 %    in braces.
+%
 %    \begin{macrocode}
 \long\def\bbl at afterelse#1\else#2\fi{\fi#1}
 \long\def\bbl at afterfi#1\fi{\fi#1}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -2513,6 +2649,58 @@
 \long\def\bbl at ifblank@i#1#2\@nil#3#4#5\@nil{#4}
 %    \end{macrocode}
 %
+% For each element in the comma separated <key>|=|<value> list,
+% execute <code> with |#1| and |#2| as the key and the value of
+% current item (trimmed). In addition, the item is passed verbatim as
+% |#3|. With the <key> alone, it passes |\@empty| (ie, the macro thus
+% named, not an empty argument, which is what you get with <key>|=|
+% and no value).
+%
+%    \begin{macrocode}
+\def\bbl at forkv#1#2{%
+  \def\bbl at kvcmd##1##2##3{#2}%
+  \bbl at kvnext#1,\@nil,}
+\def\bbl at kvnext#1,{%
+  \ifx\@nil#1\relax\else
+    \bbl at ifblank{#1}{}{\bbl at forkv@eq#1=\@empty=\@nil{#1}}%
+    \expandafter\bbl at kvnext
+  \fi}
+\def\bbl at forkv@eq#1=#2=#3\@nil#4{%
+  \bbl at trim@def\bbl at forkv@a{#1}%
+  \bbl at trim{\expandafter\bbl at kvcmd\expandafter{\bbl at forkv@a}}{#2}{#4}}
+%    \end{macrocode}
+%
+% A \textit{for} loop. Each item (trimmed), is |#1|.  It cannot be
+% nested (it's doable, but we don't need it).
+%
+%    \begin{macrocode}
+\def\bbl at vforeach#1#2{%
+  \def\bbl at forcmd##1{#2}%
+  \bbl at fornext#1,\@nil,}
+\def\bbl at fornext#1,{%
+  \ifx\@nil#1\relax\else
+    \bbl at ifblank{#1}{}{\bbl at trim\bbl at forcmd{#1}}%
+    \expandafter\bbl at fornext
+  \fi}
+\def\bbl at foreach#1{\expandafter\bbl at vforeach\expandafter{#1}}
+%    \end{macrocode}
+%
+%
+%    \begin{macrocode}
+\def\bbl at replace#1#2#3{% in #1 -> repl #2 by #3
+  \toks@{}%
+  \def\bbl at replace@aux##1#2##2#2{%
+    \ifx\bbl at nil##2%
+      \toks@\expandafter{\the\toks@##1}%
+    \else
+      \toks@\expandafter{\the\toks@##1#3}%
+      \bbl at afterfi
+      \bbl at replace@aux##2#2%
+    \fi}%
+  \expandafter\bbl at replace@aux#1#2\bbl at nil#2% 
+  \edef#1{\the\toks@}}
+%    \end{macrocode}
+%
 % Now, just syntactical sugar, but it makes partial expansion of some
 % code a lot more simple and readable. Here |\\| stands for
 % |\noexpand| and |\<..>| for |\noexpand| applied to a built macro
@@ -2621,6 +2809,7 @@
 %    counter. The following block is used in \file{switch.def} and
 %    \file{hyphen.cfg}; the latter may seem redundant, but remember
 %    \babel{} doesn't requires loading \file{switch.def} in the format.
+%
 %    \begin{macrocode}
 %<<*Define core switching macros>>
 \ifx\language\@undefined
@@ -2628,6 +2817,7 @@
 \fi
 %<</Define core switching macros>>
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\last at language}
@@ -2650,6 +2840,7 @@
 %    For formats based on plain version~3.0 the definition of
 %    |\newlanguage| can be simply copied, removing |\outer|.
 %    Plain \TeX\ version 3.0 uses |\count 19| for this purpose.
+%
 %    \begin{macrocode}
 %<<*Define core switching macros>>
 \ifx\newlanguage\@undefined
@@ -2668,10 +2859,12 @@
 \fi
 %<</Define core switching macros>>
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
 %    Identify each file that is produced from this source file.
+%
 %    \begin{macrocode}
 %<*driver&!user>
 \ProvidesFile{babel.drv}[<@date@> <@version@>]
@@ -2697,6 +2890,7 @@
 %    previously loaded (mainly, \file{hyphen.cfg}). If not, load it
 %    now. We cannot load |babel.def| here because we first need to
 %    declare and process the package options.
+%
 % \changes{babel~3.9a}{2012/08/11}{Now switch.def is loaded always, so
 %    that there is no need to rebuild formats just to update babel}
 % \changes{babel~3.9a}{2012/12/13}{But switch.def is loaded only if
@@ -2737,21 +2931,26 @@
 %   base}
 % \changes{babel~3.9q}{2016/02/11}{Load patterns with option base.
 %    To be improved. Moved showlanguages before base}
+%
 %    \begin{macrocode}
 %<*package>
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
 \ProvidesPackage{babel}[<@date@> <@version@> The Babel package]
 \@ifpackagewith{babel}{debug}
- {\input switch.def\relax}
- {<@Load switch if newer@>}
+ {\let\bbl at debug\@firstofone
+  \input switch.def\relax}
+ {\let\bbl at debug\@gobble
+  <@Load switch if newer@>}
 <@Load patterns in luatex@>
 <@Basic macros@>
 \def\AfterBabelLanguage#1{%
   \global\expandafter\bbl at add\csname#1.ldf-h@@k\endcsname}%
 %    \end{macrocode}
+%
 %    If the format created a list of loaded languages (in
 %    |\bbl at languages|), get the name of the 0-th to show the actual
 %    language used.
+%
 %    \begin{macrocode}
 \ifx\bbl at languages\@undefined\else
   \begingroup
@@ -2772,9 +2971,11 @@
   \bbl at languages
 \fi
 %    \end{macrocode}
+%
 % Now the \texttt{base} option. With it we can define (and load, with
 % \luatex) hyphenation patterns, even if we are not interesed in the
 % rest of babel. Useful for old versions of \textsf{polyglossia}, too.
+%
 %    \begin{macrocode}
 \@ifpackagewith{babel}{base}{%
   \ifx\directlua\@undefined
@@ -2800,6 +3001,7 @@
 %    no modifiers have been given, the former is |\relax|. How
 %    modifiers are handled are left to language styles; they can use
 %    |\in@|, loop them with |\@for| or load |keyval|, for example).
+%
 % \changes{babel~3.9e}{2013/04/15}{Bug fixed - a dot was added in
 %    key=value pairs}
 %
@@ -2819,15 +3021,16 @@
     \fi
   \fi}
 \let\bbl at tempc\@empty
-\bbl at for\bbl at tempa\bbl at tempa{%
-  \expandafter\bbl at tempd\bbl at tempa.\@empty\@nnil}
+\bbl at foreach\bbl at tempa{\bbl at tempd#1.\@empty\@nnil}
 \expandafter\let\csname opt at babel.sty\endcsname\bbl at tempc
 %    \end{macrocode}
+%
 %    The next option tells \babel\ to leave shorthand characters
 %    active at the end of processing the package. This is \emph{not}
 %    the default as it can cause problems with other packages, but for
 %    those who want to use the shorthand characters in the preamble of
 %    their documents this can help.
+%
 % \changes{babel~3.9a}{2012/08/14}{Implemented the \texttt{noconfigs}
 %    option}
 % \changes{babel~3.9a}{2012/09/26}{Implemented the
@@ -2834,6 +3037,7 @@
 %    \texttt{showlanguages} option}
 % \changes{babel~3.9g}{2013/08/07}{Options for hyphenmap}
 % \changes{babel~3.9l}{2014/07/29}{Option \texttt{silent}}
+%
 %    \begin{macrocode}
 \DeclareOption{KeepShorthandsActive}{}
 \DeclareOption{activeacute}{}
@@ -2853,8 +3057,10 @@
 %    loads the requested languages, except the main one if set with
 %    the key |main|, and the third one loads the latter. First, we
 %    ``flag'' valid keys with a nil value.
+%
 % \changes{babel~3.9a}{2012/08/10}{Added the `safe' key, including code
 %    below for selecting the redefined macros}
+%
 %    \begin{macrocode}
 \let\bbl at opt@shorthands\@nnil
 \let\bbl at opt@config\@nnil
@@ -2861,8 +3067,10 @@
 \let\bbl at opt@main\@nnil
 \let\bbl at opt@headfoot\@nnil
 %    \end{macrocode}
+%
 %    The following tool is defined temporarily to store the values of
 %    options.
+%
 %    \begin{macrocode}
 \def\bbl at tempa#1=#2\bbl at tempa{%
   \bbl at csarg\ifx{opt@#1}\@nnil
@@ -2875,11 +3083,13 @@
       `headfoot', `safe', `math'}
   \fi}
 %    \end{macrocode}
+%
 %    Now the option list is processed, taking into account only
 %    currently declared options (including those declared with a |=|),
 %    and |<key>=<value>| options (the former take precedence). 
 %    Unrecognized options are saved in |\bbl at language@opts|, because
 %    they are language options. 
+%
 %    \begin{macrocode}
 \let\bbl at language@opts\@empty
 \DeclareOption*{%
@@ -2890,7 +3100,9 @@
     \bbl at add@list\bbl at language@opts{\CurrentOption}%
   \fi}
 %    \end{macrocode}
+%
 %    Now we finish the first pass (and start over).
+%
 %    \begin{macrocode}
 \ProcessOptions*
 %    \end{macrocode}
@@ -2904,8 +3116,10 @@
 %    A bit of optimization: if there is no |shorthands=|, then
 %    |\bbl at ifshorthands| is always true, and it is always false if
 %    |shorthands| is empty. Also, some code makes sense only with
-%    |shorthands=...|.  
+%    |shorthands=...|.
+%
 % \changes{babel~3.9c}{2013/04/07}{Added t and c for tilde and comma}
+%
 %    \begin{macrocode}
 \def\bbl at sh@string#1{%
   \ifx#1\@empty\else
@@ -2921,8 +3135,10 @@
   \def\bbl at ifshorthand#1#2#3{#3}%
 \else
 %    \end{macrocode}
+%
 %    The following macro tests if a shortand is one of the allowed
 %    ones.
+%
 %    \begin{macrocode}
   \def\bbl at ifshorthand#1{%
     \@expandtwoargs\in@{\string#1}{\bbl at opt@shorthands}%
@@ -2932,8 +3148,10 @@
       \expandafter\@secondoftwo
     \fi}
 %    \end{macrocode}
+%
 %    We make sure all chars in the string are `other', with the help
 %    of an auxiliary macro defined above (which also zaps spaces).
+%
 %    \begin{macrocode}
   \edef\bbl at opt@shorthands{%
     \expandafter\bbl at sh@string\bbl at opt@shorthands\@empty}%
@@ -2949,11 +3167,14 @@
     {\PassOptionsToPackage{activegrave}{babel}}{}
 \fi\fi
 %    \end{macrocode}
+%
 % \changes{babel~3.9a}{2012/07/30}{Code setting language in
 %    head/foots.  Related to babel/3796}
+%
 %    With |headfoot=lang| we can set the language used in heads/foots.         
 %    For example, in babel/3796 just adds |headfoot=english|.  It
 %    misuses \cs{@resetactivechars} but seems to work.
+%
 %    \begin{macrocode}
 \ifx\bbl at opt@headfoot\@nnil\else
   \g at addto@macro\@resetactivechars{%
@@ -2962,9 +3183,11 @@
     \let\protect\noexpand}
 \fi
 %    \end{macrocode}
+%
 %    For the option safe we use a different approach --
 %    |\bbl at opt@safe| says which macros are redefined (B for bibs and R
 %    for refs). By default, both are set. 
+%
 %    \begin{macrocode}
 \ifx\bbl at opt@safe\@undefined
   \def\bbl at opt@safe{BR}
@@ -2982,18 +3205,8 @@
 %    that languages not declared are also correctly recognized, even
 %    if given as global options} 
 % \changes{babel~3.9a}{2012/08/12}{Revised the loading mechanism}
-% \changes{babel~3.8c}{2004/06/12}{Added option \Lopt{australian}}
-% \changes{babel~3.8h}{2005/11/23}{Added option \Lopt{albanian}}
-% \changes{babel~3.8h}{2005/11/23}{added synonyms \Lopt{indonesian},
-%    \Lopt{indon} and \Lopt{bahasai} for the original bahasa
-%    (indonesia) support}
-% \changes{babel~3.8h}{2005/11/23}{added \Lopt{malay}, \Lopt{meyalu}
-%    and \Lopt{bahasam} for the Bahasa Malaysia support}
-% \changes{babel~3.8c}{2004/06/12}{Added the \Lopt{newzealand} option}
 % \changes{babel~3.9i}{2014/03/01}{Removed German options, because
 %    they are now loaded directly}
-% \changes{babel~3.9m}{2015/07/28}{Added melayu (meyalu preserved for
-%    compatibility)} 
 %
 %    Languages are loaded when processing the corresponding option
 %    \textit{except} if a |main| language has been set. In such a
@@ -3000,6 +3213,7 @@
 %    case, it is not loaded until all options has been processed.
 %    The following macro inputs the ldf file and does some additional
 %    checks (|\input| works, too, but possible errors are not catched).
+%
 %    \begin{macrocode}
 \let\bbl at afterlang\relax
 \let\BabelModifiers\relax
@@ -3019,6 +3233,7 @@
        activeacute, activegrave, noconfigs, safe=, main=, math=\\%
        headfoot=, strings=, config=, hyphenmap=, or a language name.}}}
 %    \end{macrocode}
+%
 %    Now, we set language options whose names are different from |ldf| files.
 % 
 % \changes{babel~3.9t}{2017/04/23}{Removed options for English, Indonesian and
@@ -3053,11 +3268,13 @@
 %    want an alternative name for a language, just create a new |.ldf|
 %    file loading the actual one. You can also set the name
 %    of the file with the package option |config=<name>|, which will
-%    load |<name>.cfg| instead. 
+%    load |<name>.cfg| instead.
+%
 % \changes{babel~3.9a}{2012/06/28}{Added the \cs{AfterBabelLanguage}
 %    mechanism, to be used mainly with the local cfg file.}
 % \changes{babel~3.9a}{2012/06/31}{Now you can set the name of the
 %    local cfg file.}
+%
 %    \begin{macrocode}
 \ifx\bbl at opt@config\@nnil
   \@ifpackagewith{babel}{noconfigs}{}%
@@ -3084,6 +3301,7 @@
 %    languages (note this list also contains the language given with
 %    |main|). If not declared above, the name of the option and the
 %    file are the same.
+%
 %    \begin{macrocode}
 \bbl at for\bbl at tempa\bbl at language@opts{%
   \bbl at ifunset{ds@\bbl at tempa}%
@@ -3094,24 +3312,24 @@
      \bbl at tempb}%
      \@empty}
 %    \end{macrocode}
+%
 %    Now, we make sure an option is explicitly declared for any
 %    language set as global option, by checking if an |ldf|
 %    exists. The previous step was, in fact, somewhat redundant, but
 %    that way we minimize accesing the file system just to see if the
 %    option could be a language.
+%
 %    \begin{macrocode}
-\bbl at for\bbl at tempa\@classoptionslist{%
-  \bbl at ifunset{ds@\bbl at tempa}%
-    {\IfFileExists{\bbl at tempa.ldf}%
-      {\edef\bbl at tempb{%
-         \noexpand\DeclareOption
-           {\bbl at tempa}%
-           {\noexpand\bbl at load@language{\bbl at tempa}}}%
-       \bbl at tempb}%
-      \@empty}%
-    \@empty}
+\bbl at foreach\@classoptionslist{%
+  \bbl at ifunset{ds@#1}%
+    {\IfFileExists{#1.ldf}%
+      {\DeclareOption{#1}{\bbl at load@language{#1}}}%
+      {}}%
+    {}}
 %    \end{macrocode}
+%
 %    If a main language has been set, store it for the third pass.
+%
 %    \begin{macrocode}
 \ifx\bbl at opt@main\@nnil\else
   \expandafter
@@ -3119,13 +3337,17 @@
   \DeclareOption{\bbl at opt@main}{}
 \fi
 %    \end{macrocode}
+%
 %    And we are done, because all options for this pass has been
-%    declared. Those already processed in the first pass are just ignored.
+%    declared. Those already processed in the first pass are just
+%    ignored.
+%
 % \changes{babel~3.9a}{2012/12/22}{Default option does nothing}
 %
 %    The options have to be processed in the order in which the user
 %    specified them (except, of course, global options, which \LaTeX{}
 %    processes before):
+%
 %    \begin{macrocode}
 \def\AfterBabelLanguage#1{%
   \bbl at ifsamestring\CurrentOption{#1}{\global\bbl at add\bbl at afterlang}{}}
@@ -3132,6 +3354,7 @@
 \DeclareOption*{}
 \ProcessOptions*
 %    \end{macrocode}
+%
 %    This finished the second pass. Now the third one begins, which
 %    loads the main language set with the key |main|. A warning is
 %    raised if the main language is not the same as the last named
@@ -3139,6 +3362,7 @@
 %    execute directly the option (because it could be used only in
 %    |main|). After loading all languages, we deactivate
 %    |\AfterBabelLanguage|.
+%
 %    \begin{macrocode}
 \ifx\bbl at opt@main\@nnil
   \edef\bbl at tempa{\@classoptionslist,\bbl at language@opts}
@@ -3172,8 +3396,10 @@
 %    language we check whether |\bbl at main@language|, has become
 %    defined. If not, no language has been loaded and an error
 %    message is displayed.
+%
 % \changes{babel~3.9a}{2012/06/24}{Now babel is not loaded to prevent
 %    the document from raising errors after fixing it}
+%
 %    \begin{macrocode}
 \ifx\bbl at main@language\@undefined
   \bbl at error{%
@@ -3299,14 +3525,18 @@
     \fi
   \fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 % \changes{babel~3.9a}{2012/08/10}{Removed the \cs{peek at token} and
 %    \textsc{test at token} stuff}
+%
 %    The macro |\initiate at active@char| takes all the necessary actions
 %    to make its argument a shorthand character. The real work is
 %    performed once for each character.
+%
 % \changes{babel~3.9a}{1999/04/30}{Added \cs{bbl at withactive}}
+%
 %    \begin{macrocode}
 \def\bbl at withactive#1#2{%
   \begingroup
@@ -3325,6 +3555,7 @@
 %    Because we need to redefine a number of commands we define the
 %    command |\bbl at redefine| which takes care of this. It creates a
 %    new control sequence, |\org at ...|
+%
 %    \begin{macrocode}
 \def\bbl at redefine#1{%
   \edef\bbl at tempa{\bbl at stripslash#1}%
@@ -3333,14 +3564,17 @@
 %    \end{macrocode}
 %
 %    This command should only be used in the preamble of the document.
+%
 %    \begin{macrocode}
 \@onlypreamble\bbl at redefine
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at redefine@long}
 %    This version of |\babel at redefine| can be used to redefine |\long|
 %    commands such as |\ifthenelse|.
+%
 %    \begin{macrocode}
 \def\bbl at redefine@long#1{%
   \edef\bbl at tempa{\bbl at stripslash#1}%
@@ -3348,6 +3582,7 @@
   \expandafter\long\expandafter\def\csname\bbl at tempa\endcsname}
 \@onlypreamble\bbl at redefine@long
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at redefinerobust}
@@ -3357,6 +3592,7 @@
 %    it is necessary to check whether \verb*|\foo | exists. The result
 %    is that the command that is being redefined is always robust
 %    afterwards.  Therefore all we need to do now is define \verb*|\foo |.
+%
 %    \begin{macrocode}
 \def\bbl at redefinerobust#1{%
   \edef\bbl at tempa{\bbl at stripslash#1}%
@@ -3368,9 +3604,11 @@
 %    \end{macrocode}
 %
 %    This command should only be used in the preamble of the document.
+%
 %    \begin{macrocode}
 \@onlypreamble\bbl at redefinerobust
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \subsection{Hooks}
@@ -3380,7 +3618,8 @@
 %  below). Admittedly, the current implementation is a somewhat
 %  simplistic and does vety little to catch errors, but it is intended
 %  for developpers, after all. |\bbl at usehooks| is the commands used by
-%  babel to execute hooks defined for an event.  
+%  babel to execute hooks defined for an event.
+%
 % \changes{babel~3.9k}{2014/03/23}{Removed a \cs{newcommand},
 %    undefined in Plain}
 %
@@ -3402,11 +3641,13 @@
     \@nameuse{bbl at hk@##1}{\@nameuse{bbl at ev@##1@#1}#2}}%
   \@nameuse{bbl at ev@#1}}
 %    \end{macrocode}
+%
 %    To ensure forward compatibility, arguments in hooks are set
 %    implicitly. So, if a further argument is added in the future,
 %    there is no need to change the existing code. Note events
 %    intended for \textsf{hyphen.cfg} are also loaded (just in
 %    case you need them for some reason). 
+%
 %    \begin{macrocode}
 \def\bbl at evargs{,% don't delete the comma
   everylanguage=1,loadkernel=1,loadpatterns=1,loadexceptions=1,%
@@ -3418,32 +3659,35 @@
 % \begin{macro}{\babelensure}
 %
 % The user command just parses the optional argument and creates a
-% new macro named |\bbl at ens@|\m{language}. We register a hook at the
+% new macro named |\bbl at e@|\m{language}. We register a hook at the
 % |afterextras| event which just executes this macro in a
 % ``complete'' selection (which, if undefined, is |\relax| and does
 % nothing). This part is somewhat involved because we have to make
 % sure things are expanded the correct number of times.
 %
-% The macro |\bbl at ens@|\m{language} contains
-% |\bbl at ensure|\marg{include}\marg{exclude}\marg{fontenc}, which
-% in turn loops over the macros names in |\bbl at ensured|, excluding
+% The macro |\bbl at e@|\m{language} contains
+% |\bbl at ensure|\marg{include}\marg{exclude}\marg{fontenc}, which in in
+% turn loops over the macros names in |\bbl at captionslist|, excluding
 % (with the help of |\in@|) those in the |exclude| list. If the
-% |fontenc| is given (and not |\relax|), the |\fontencoding| is
-% also added. Then we loop over the |include| list, but if the
-% macro already contains |\foreignlanguage|, nothing is done.
-% Note this macro (1) is not restricted to the preamble, and (2)
-% changes are local.
+% |fontenc| is given (and not |\relax|), the |\fontencoding| is also
+% added. Then we loop over the |include| list, but if the macro
+% already contains |\foreignlanguage|, nothing is done.  Note this
+% macro (1) is not restricted to the preamble, and (2) changes are
+% local.
 %
-% |\bbl at ensured| is the list of macros supposed to be ``ensured''.
 % \changes{babel~3.9i}{2014/02/14}{Macro \cs{babelensure} added}
 % \changes{babel~3.9k}{2014/03/23}{Encapsulate \cs{foreignlanguage} in
 %   \cs{bbl at ensure@}language, to "protect" strings}
 % \changes{babel~3.9s}{2017/04/10}{Bug fix - extra spaces because a
 %   missing percent}
-% \changes{babel~3.9s}{2017/04/10}{\cs{bbl at ensure@lang} defined only once}
+% \changes{babel~3.9s}{2017/04/10}{\cs{bbl at ensure@lang} defined only
+%   once}
+% \changes{babel~3.10}{2017/05/06}{\cs{bbl at ensured} renamed to
+%   \cs{bbl at captionslist} (for \cs{babelprovide}), which means
+%   \cs{today} must be given explicitly in \cs{babelensure}}
 %
 %    \begin{macrocode}
-\newcommand\babelensure[2][]{%
+\newcommand\babelensure[2][]{%  TODO - revise test files
   \AddBabelHook{babel-ensure}{afterextras}{%
     \ifcase\bbl at select@type
       \@nameuse{bbl at e@\languagename}%
@@ -3456,7 +3700,7 @@
       \ifx\@empty##1\else\noexpand##1\expandafter\bbl at tempb\fi}%
     \edef\bbl at tempa{\bbl at tempb#1\@empty}%
     \def\bbl at tempb##1=##2\@@{\@namedef{bbl at ens@##1}{##2}}%
-    \bbl at for\bbl at tempa\bbl at tempa{\expandafter\bbl at tempb\bbl at tempa\@@}%
+    \bbl at foreach\bbl at tempa{\bbl at tempb##1\@@}%
     \def\bbl at tempc{\bbl at ensure}%
     \expandafter\bbl at add\expandafter\bbl at tempc\expandafter{%
       \expandafter{\bbl at ens@include}}%
@@ -3466,8 +3710,8 @@
     \bbl at exp{%
   \endgroup
   \def\<bbl at e@#2>{\the\toks@{\bbl at ens@fontenc}}}}
-\def\bbl at ensure#1#2#3{%
-  \def\bbl at tempb##1{% elt for \bbl at ensured list
+\def\bbl at ensure#1#2#3{% 1: include 2: exclude 3: fontenc
+  \def\bbl at tempb##1{% elt for (excluding) \bbl at captionslist list
     \ifx##1\@empty\else
       \in@{##1}{#2}%
       \ifin@\else
@@ -3487,7 +3731,7 @@
       \fi
       \expandafter\bbl at tempb
     \fi}%
-  \expandafter\bbl at tempb\bbl at ensured\@empty
+  \expandafter\bbl at tempb\bbl at captionslist\today\@empty
   \def\bbl at tempa##1{% elt for include list
     \ifx##1\@empty\else
       \bbl at csarg\in@{ensure@\languagename\expandafter}\expandafter{##1}%
@@ -3497,12 +3741,13 @@
       \expandafter\bbl at tempa
     \fi}%
   \bbl at tempa#1\@empty} 
-\def\bbl at ensured{%
+\def\bbl at captionslist{%
   \prefacename\refname\abstractname\bibname\chaptername\appendixname
   \contentsname\listfigurename\listtablename\indexname\figurename
   \tablename\partname\enclname\ccname\headtoname\pagename\seename
-  \alsoname\proofname\glossaryname\today}   
+  \alsoname\proofname\glossaryname}   
 %    \end{macrocode}
+%
 %    \end{macro}
 %
 %  \subsection{Setting up language files}
@@ -3537,7 +3782,8 @@
 %   more after \cs{fi} , since \cs{endinput} is not executed
 %   immediately}
 % \changes{babel~3.9g}{2012/08/11}{Preset the ``family'' of macros
-%   \cs{Babel}...} 
+%   \cs{Babel}...}
+%
 %   If so, we call |\ldf at quit| to set the main language, restore the
 %   category code of the @-sign and call |\endinput|
 %
@@ -3545,7 +3791,18 @@
 %    compare it with |\relax|.
 %
 %    Finally we check |\originalTeX|.
+%
 %    \begin{macrocode}
+\def\bbl at ldfinit{%
+  \let\bbl at screset\@empty
+  \let\BabelStrings\bbl at opt@string
+  \let\BabelOptions\@empty
+  \let\BabelLanguages\relax
+  \ifx\originalTeX\@undefined
+    \let\originalTeX\@empty
+  \else
+    \originalTeX
+  \fi}
 \def\LdfInit#1#2{%
   \chardef\atcatcode=\catcode`\@
   \catcode`\@=11\relax
@@ -3561,20 +3818,14 @@
       \ldf at quit{#1}%
     \fi
   \fi
-  \let\bbl at screset\@empty
-  \let\BabelStrings\bbl at opt@strings
-  \let\BabelOptions\@empty
-  \let\BabelLanguages\relax
-  \ifx\originalTeX\@undefined
-    \let\originalTeX\@empty
-  \else
-    \originalTeX
-  \fi}
+  \bbl at ldfinit}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\ldf at quit}
 %    This macro interrupts the processing of a language definition file.
+%
 %    \begin{macrocode}
 \def\ldf at quit#1{%
   \expandafter\main at language\expandafter{#1}%
@@ -3582,6 +3833,7 @@
   \catcode`\==\eqcatcode \let\eqcatcode\relax
   \endinput}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\ldf at finish}
@@ -3592,24 +3844,30 @@
 %    the main language (taking into account that the argument might be
 %    a control sequence that needs to be expanded) and reset the
 %    category code of the @-sign.
+%
 % \changes{babel~3.9a}{2012/10/01}{Added \cs{bbl at afterlang} which
 %    executes the code delayed with \cs{AfterBabelLanguage}}
+%
 %    \begin{macrocode}
-\def\ldf at finish#1{%
-  \loadlocalcfg{#1}%
+\def\bbl at afterldf#1{%
   \bbl at afterlang
   \let\bbl at afterlang\relax
   \let\BabelModifiers\relax
-  \let\bbl at screset\relax
+  \let\bbl at screset\relax}%
+\def\ldf at finish#1{%
+  \loadlocalcfg{#1}%
+  \bbl at afterldf{#1}%
   \expandafter\main at language\expandafter{#1}%
   \catcode`\@=\atcatcode \let\atcatcode\relax
   \catcode`\==\eqcatcode \let\eqcatcode\relax}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %    After the preamble of the document the commands |\LdfInit|,
 %    |\ldf at quit| and |\ldf at finish| are no longer needed. Therefore
 %    they are turned into warning messages in \LaTeX.
+%
 %    \begin{macrocode}
 \@onlypreamble\LdfInit
 \@onlypreamble\ldf at quit
@@ -3622,7 +3880,9 @@
 %    files. It stores its argument in |\bbl at main@language|; to be used
 %    to switch to the correct language at the beginning of the
 %    document.
+%
 % \changes{babel~3.8l}{2008/07/06}{Use \cs{bbl at patterns}}
+%
 %    \begin{macrocode}
 \def\main at language#1{%
   \def\bbl at main@language{#1}%
@@ -3632,10 +3892,12 @@
 %
 %    We also have to make sure that some code gets executed at the
 %    beginning of the document.
+%
 %    \begin{macrocode}
 \AtBeginDocument{%
   \expandafter\selectlanguage\expandafter{\bbl at main@language}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %   
@@ -3656,37 +3918,34 @@
 %  \begin{macro}{\bbl at add@special}
 %    The macro |\bbl at add@special| is used to add a new character (or
 %    single character control sequence) to the macro |\dospecials|
-%    (and |\@sanitize| if \LaTeX\ is used).
+%    (and |\@sanitize| if \LaTeX\ is used). It is used only at one
+%    place, namely when |\initiate at active@char| is called (which is
+%    ignored if the char has been made active before).  Because
+%    |\@sanitize| can be undefined, we put the definition inside a
+%    conditional.
 %
-%    To keep all changes local, we begin a new group.  Then we
-%    redefine the macros |\do| and |\@makeother| to add themselves and
-%    the given character without expansion.
+%    Items are added to the lists without checking its existence or
+%    the original catcode. It does not hurt, but should be fixed. It's
+%    already done with |\nfss at catcodes|, added in 3.10.
 %
-%    To add the character to the macros, we expand the original macros
-%    with the additional character inside the redefinition of the
-%    macros.  Because |\@sanitize| can be undefined, we put the
-%    definition inside a conditional.
+% \changes{3.10}{2017/05/14}{Refactored. Add to \cs{nfss at catcodes} too.}
+%
 %    \begin{macrocode}
-\def\bbl at add@special#1{%
-  \begingroup
-    \def\do{\noexpand\do\noexpand}%
-    \def\@makeother{\noexpand\@makeother\noexpand}%
-  \edef\x{\endgroup
-    \def\noexpand\dospecials{\dospecials\do#1}%
-    \expandafter\ifx\csname @sanitize\endcsname\relax \else
-      \def\noexpand\@sanitize{\@sanitize\@makeother#1}%
-    \fi}%
-  \x}
+\def\bbl at add@special#1{% 1:a macro like \", \?, etc.
+  \bbl at add\dospecials{\do#1}% test @sanitize = \relax, for back. compat.
+  \bbl at ifunset{@sanitize}{}{\bbl at add\@sanitize{\@makeother#1}}%
+  \ifx\nfss at catcodes\@undefined\else % TODO - same for above
+    \begingroup
+      \catcode`#1\active
+      \nfss at catcodes
+      \ifnum\catcode`#1=\active
+        \endgroup
+        \bbl at add\nfss at catcodes{\@makeother#1}%
+      \else
+        \endgroup
+      \fi
+  \fi}
 %    \end{macrocode}
-%    The macro |\x| contains at this moment the following:\\
-%    |\endgroup\def\dospecials{|\textit{old contents}%
-%    |\do|\meta{char}|}|.\\
-%    If |\@sanitize| is defined, it contains an additional definition
-%    of this macro.  The last thing we have to do, is the expansion of
-%    |\x|.  Then |\endgroup| is executed, which restores the old
-%    meaning of |\x|, |\do| and |\@makeother|.  After the group is
-%    closed, the new definition of |\dospecials| (and |\@sanitize|) is
-%    assigned.
 %
 %  \end{macro}
 %
@@ -3696,16 +3955,6 @@
 %    removes a character from the set macros |\dospecials| and
 %    |\@sanitize|, but it is not used at all in the \babel{} core.
 %
-%    To keep all changes local, we begin a new group.  Then we define
-%    a help macro |\x|, which expands to empty if the characters
-%    match, otherwise it expands to its nonexpandable input.  Because
-%    \TeX\ inserts a |\relax|, if the corresponding |\else| or |\fi|
-%    is scanned before the comparison is evaluated, we provide a `stop
-%    sign' which should expand to nothing.
-%
-%    With the help of this macro we define |\do| and |\make at other|.
-%
-%    The rest of the work is similar to |\bbl at add@special|.
 %    \begin{macrocode}
 \def\bbl at remove@special#1{%
   \begingroup
@@ -3720,9 +3969,9 @@
     \fi}%
   \x}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
-%
 %  \begin{macro}{\initiate at active@char}
 %    A language definition file can call this macro to make a
 %    character active. This macro takes one argument, the character
@@ -3752,9 +4001,11 @@
 %    The following macro is used to define shorthands in the three
 %    levels. It takes 4 arguments: the (string'ed) character,
 %    |\<level>@group|, |<level>@active| and |<next-level>@active|
-%    (except in |system|). 
+%    (except in |system|).
+%
 % \changes{babel~3.9a}{2012/08/18}{New macro, with code from
 %    \cs{@initiate at active@char}}
+%
 %    \begin{macrocode}
 \def\bbl at active@def#1#2#3#4{%
   \@namedef{#3#1}{%
@@ -3764,9 +4015,11 @@
       \bbl at afterfi\csname#2 at sh@#1@\endcsname
     \fi}%
 %    \end{macrocode}
+%
 %    When there is also no current-level shorthand with an argument we
 %    will check whether there is a next-level  defined shorthand for
 %    this active character. 
+%
 %    \begin{macrocode}
   \long\@namedef{#3 at arg#1}##1{%
     \expandafter\ifx\csname#2 at sh@#1@\string##1@\endcsname\relax
@@ -3775,12 +4028,15 @@
       \bbl at afterfi\csname#2 at sh@#1@\string##1@\endcsname
     \fi}}%
 %    \end{macrocode}
+%
 % \changes{babel~3.9a}{2012/08/18}{Removed an extra hash. Now calls
 %    \cs{@initiate at active@char} with 3 arguments.}
+%
 %    |\initiate at active@char| calls |\@initiate at active@char| with 3
 %    arguments. All of them are the same character with different
 %    catcodes: active, other (|\string|'ed) and the original one.
 %    This trick simplifies the code a lot.
+%
 %    \begin{macrocode}
 \def\initiate at active@char#1{%
   \bbl at ifunset{active at char\string#1}%
@@ -3788,6 +4044,7 @@
       {\expandafter\@initiate at active@char\expandafter}#1\string#1#1}%
     {}}
 %    \end{macrocode}
+%
 % \changes{babel~3.9e}{2012/08/18}{Introduced the 3-argument
 %   \cs{@initiate at active@char}, with different catcodes: active,
 %   string'ed, and original. Reorganized}
@@ -3796,10 +4053,12 @@
 % too}
 % \changes{babel~3.9a}{2012/12/27}{Take into account mathematically
 %   active chars, to avoid infinite loops}
+%
 %   The very first thing to do is saving the original catcode and the
 %   original definition, even if not active, which is possible
 %   (undefined characters require a special treatement to avoid
 %   making them |\relax|).  
+%
 %    \begin{macrocode}
 \def\@initiate at active@char#1#2#3{%
   \bbl at csarg\edef{oricat@#2}{\catcode`#2=\the\catcode`#2\relax}%
@@ -3812,6 +4071,7 @@
       \expandafter\noexpand\csname bbl at oridef@@#2\endcsname}%
   \fi
 %    \end{macrocode}
+%
 %    If the character is already active we provide the default
 %    expansion under this shorthand mechanism. Otherwise we write a
 %    message in the transcript file, and define |\normal at char|\m{char}
@@ -3820,6 +4080,7 @@
 %    |'|) the normal expansion is somewhat different to avoid an
 %    infinite loop (but it does not prevent the loop if the mathcode
 %    is set to |"8000| \textit{a posteriori}).
+%
 %    \begin{macrocode}
   \ifx#1#3\relax
     \expandafter\let\csname normal at char#2\endcsname#3%
@@ -3832,6 +4093,7 @@
       \@namedef{normal at char#2}{#3}%
     \fi
 %    \end{macrocode}
+%
 %    To prevent problems with the loading of other packages after
 %    \babel\ we reset the catcode of the character to the original one
 %    at the end of the package and of each language file (except with
@@ -3842,6 +4104,7 @@
 %    the printout when a shorthand was used in the optional argument
 %    of |\bibitem| for example. Then we make it active (not strictly
 %    necessary, but done for backward compatibility).
+%
 %    \begin{macrocode}
     \bbl at restoreactive{#2}%
     \AtBeginDocument{%
@@ -3853,6 +4116,7 @@
     \catcode`#2\active
   \fi
 %    \end{macrocode}
+%
 %    Now we have set |\normal at char|\m{char}, we must define
 %    |\active at char|\m{char}, to be executed when the character is
 %    activated.  We define the first level expansion of
@@ -3861,9 +4125,11 @@
 %    this character, otherwise we call |\user at active|\m{char} to start
 %    the search of a definition in the user, language and system
 %    levels (or eventually |normal at char|\m{char}).
+%
 % \changes{babel~3.9a}{2012/12/27}{Added code for option math=normal}
 % \changes{babel~3.9i}{2014/02/03}{Don't call directly
-%   \cs{user at active}, but with an intermediate step}
+%    \cs{user at active}, but with an intermediate step}
+%
 %    \begin{macrocode}
   \let\bbl at tempa\@firstoftwo
   \if\string^#2%
@@ -3907,18 +4173,22 @@
     \expandafter\noexpand\csname normal at char#2\endcsname}%
   \expandafter\let\expandafter#1\csname bbl at normal@#2\endcsname
 %    \end{macrocode}
+%
 %    The next level of the code checks whether a user has defined a
 %    shorthand for himself with this character. First we check for a
 %    single character shorthand. If that doesn't exist we check for a
 %    shorthand with an argument.
+%
 % \changes{babel~3.8b}{2004/04/19}{Now use \cs{bbl at sh@select}}
 % \changes{babel~3.9a}{2012/08/18}{Instead of the ``copy-paste pattern''
-%    a new macro is used}
+% a new macro is used}
+%
 %    \begin{macrocode}
   \bbl at active@def#2\user at group{user at active}{language at active}%
   \bbl at active@def#2\language at group{language at active}{system at active}%
   \bbl at active@def#2\system at group{system at active}{normal at char}%
 %    \end{macrocode}
+%
 %    In order to do the right thing when a shorthand with an argument
 %    is used by itself at the end of the line we provide a definition
 %    for the case of an empty argument. For that case we let the
@@ -3926,8 +4196,10 @@
 %    shorthand combination such as |''| ends up in a heading \TeX\
 %    would see |\protect'\protect'|. To prevent this from happening a
 %    couple of shorthand needs to be defined at user level.
+%
 % \changes{babel~3.9a}{2012/8/18}{Use \cs{user at group}, as above,
 %    instead of the hardwired \texttt{user}}
+%
 %    \begin{macrocode}
   \expandafter\edef\csname\user at group @sh@#2@@\endcsname
     {\expandafter\noexpand\csname normal at char#2\endcsname}%
@@ -3934,6 +4206,7 @@
   \expandafter\edef\csname\user at group @sh@#2@\string\protect@\endcsname
     {\expandafter\noexpand\csname user at active#2\endcsname}%
 %    \end{macrocode}
+%
 %    Finally, a couple of special cases are taken care of.  (1) If we
 %    are making the right quote (|'|) active we need to change |\pr at m@s| as
 %    well.  Also, make sure that a single |'| in math mode `does the
@@ -3956,6 +4229,7 @@
 % \changes{babel~3.9a}{2012/12/29}{Removed the intermediate step of
 %   \cs{bbl at act@caret} and moved above} 
 % \changes{babel~3.9i}{2012/12/29}{Added the event \cs{initiateactive}} 
+%
 %    \begin{macrocode}
   \if\string'#2%
     \let\prim at s\bbl at prim@s
@@ -3966,6 +4240,7 @@
 %
 %    The following package options control the behaviour of shorthands
 %    in math mode.
+%
 %    \begin{macrocode}
 %<<*More package options>>
 \DeclareOption{math=active}{}
@@ -3972,6 +4247,7 @@
 \DeclareOption{math=normal}{\def\bbl at mathnormal{\noexpand\textormath}}
 %<</More package options>>
 %    \end{macrocode}
+%
 %    Initiating a shorthand makes active the char. That is not
 %    strictly necessary but it is still done for backward
 %    compatibility. So we need to restore the original catcode at the
@@ -3987,13 +4263,14 @@
 \@ifpackagewith{babel}{KeepShorthandsActive}%
   {\let\bbl at restoreactive\@gobble}%
   {\def\bbl at restoreactive#1{%
-     \edef\bbl at tempa{%
-       \noexpand\AfterBabelLanguage\noexpand\CurrentOption
+     \bbl at exp{%
+       \\\AfterBabelLanguage\\\CurrentOption
          {\catcode`#1=\the\catcode`#1\relax}%
-       \noexpand\AtEndOfPackage{\catcode`#1=\the\catcode`#1\relax}}%
-     \bbl at tempa}%
+       \\\AtEndOfPackage
+         {\catcode`#1=\the\catcode`#1\relax}}}%
    \AtEndOfPackage{\let\bbl at restoreactive\@gobble}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at sh@select}
@@ -4006,9 +4283,11 @@
 %    argument and a shorthand character in its second argument. It
 %    will expand to either |\bbl at firstcs| or |\bbl at scndcs|. Hence two
 %    more arguments need to follow it.
+%
 % \changes{babel~3.8b}{2004/04/19}{Added command}
 % \changes{babel~3.9a}{2012/08/18}{Removed \cs{string}s, because the
 %   char are already string'ed}
+%
 %    \begin{macrocode}
 \def\bbl at sh@select#1#2{%
   \expandafter\ifx\csname#1 at sh@#2 at sel\endcsname\relax
@@ -4017,6 +4296,7 @@
     \bbl at afterfi\csname#1 at sh@#2 at sel\endcsname
   \fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\active at prefix}
@@ -4024,16 +4304,19 @@
 %    active characters has a function similar to |\OT1-cmd| in that it
 %    |\protect|s the active character whenever |\protect| is
 %    \emph{not} |\@typeset at protect|.
+%
 %    \begin{macrocode}
 \def\active at prefix#1{%
   \ifx\protect\@typeset at protect
   \else
 %    \end{macrocode}
+%
 %    When |\protect| is set to |\@unexpandable at protect| we make sure
 %    that the active character is als \emph{not} expanded by inserting
 %    |\noexpand| in front of it. The |\@gobble| is needed to remove
 %    a token such as |\activechar:| (when the double colon was the
 %    active character to be dealt with).
+%
 %    \begin{macrocode}
     \ifx\protect\@unexpandable at protect
       \noexpand#1%
@@ -4043,6 +4326,7 @@
     \expandafter\@gobble
   \fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\if at safe@actives}
@@ -4051,10 +4335,12 @@
 %    switch |@safe at actives| is available. The setting of this switch
 %    should be checked in the first level expansion of
 %    |\active at char|\m{char}.
+%
 %    \begin{macrocode}
 \newif\if at safe@actives
 \@safe at activesfalse
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at restore@actives}
@@ -4062,20 +4348,25 @@
 %    active characters were made ``safe'' this must be undone in
 %    the headers to prevent unexpected typeset results. For this
 %    situation we define a command to make them ``unsafe'' again.
+%
 %    \begin{macrocode}
 \def\bbl at restore@actives{\if at safe@actives\@safe at activesfalse\fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at activate}
 %  \begin{macro}{\bbl at deactivate}
+%
 %  \changes{babel~3.9a}{2013/01/11}{\cs{bbl at withactive} makes sure the
-%    catcode is active} 
+%    catcode is active}
+%
 %    Both macros take one argument, like |\initiate at active@char|. The
 %    macro is used to change the definition of an active character to
 %    expand to |\active at char|\m{char} in the case of |\bbl at activate|,
 %    or |\normal at char|\m{char} in the case of
 %    |\bbl at deactivate|.
+%
 %    \begin{macrocode}
 \def\bbl at activate#1{%
   \bbl at withactive{\expandafter\let\expandafter}#1%
@@ -4084,6 +4375,7 @@
   \bbl at withactive{\expandafter\let\expandafter}#1%
     \csname bbl at normal@\string#1\endcsname}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -4091,10 +4383,12 @@
 %  \begin{macro}{\bbl at scndcs}
 %    These macros have two arguments. They use one of their arguments
 %    to build a control sequence from.
+%
 %    \begin{macrocode}
 \def\bbl at firstcs#1#2{\csname#1\endcsname}
 \def\bbl at scndcs#1#2{\csname#2\endcsname}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -4108,10 +4402,12 @@
 %      i.e. |~| or |"a|;
 %    \item the code to be executed when the shorthand is encountered.
 %    \end{enumerate}
+%
 % \changes{babel~3.8b}{2004/04/19}{We need to support shorthands with
 %    and without argument in different groups; added the name of the
 %    group to the storage macro}
 % \changes{babel~3.9a}{2012/07/03}{Check if shorthands are redefined}
+%
 %    \begin{macrocode}
 \def\declare at shorthand#1#2{\@decl at short{#1}#2\@nil}
 \def\@decl at short#1#2#3\@nil#4{%
@@ -4140,6 +4436,7 @@
     \@namedef{#1 at sh@\string#2@\string#3@}{#4}%
   \fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\textormath}
@@ -4146,8 +4443,10 @@
 %    Some of the shorthands that will be declared by the language
 %    definition files have to be usable in both text and mathmode. To
 %    achieve this the helper macro |\textormath| is provided.
+%
 % \changes{babel~3.9a}{2012/12/29}{Failed if an argument had a
 %    condicional. Use the more robust mechanism of \cs{XXXoftwo}} 
+%
 %    \begin{macrocode}
 \def\textormath{%
   \ifmmode
@@ -4156,6 +4455,7 @@
     \expandafter\@firstoftwo
   \fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\user at group}
@@ -4166,11 +4466,13 @@
 %    group is stored in a macro. The default is to have a user group;
 %    use language group `english' and have a system group called
 %    `system'.
+%
 %    \begin{macrocode}
 \def\user at group{user}
 \def\language at group{english}
 \def\system at group{system}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %  \end{macro}
@@ -4189,6 +4491,7 @@
 %    the catcode is active, so this part is simplified}
 % \changes{babel~3.9a}{2012/08/12}{User shorhands can be
 %   defined even with shorthands=off}
+%
 %    \begin{macrocode}
 \def\useshorthands{%
   \@ifstar\bbl at usesh@s{\bbl at usesh@x{}}}
@@ -4207,13 +4510,16 @@
        {Sorry, but you cannot use shorthands which have been\\%
         turned off in the package options}}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\defineshorthand}
+%
 % \changes{babel~3.9a}{2012/08/05}{Added optional argument, to provide
 %    a way to (re)define language shorthands} 
 % \changes{babel~3.9a}{2012/08/25}{Extended for language-dependent
 %    user macros, with two new auxiliary macros}
+%
 %    Currently we only support two groups of user level shorthands,
 %    named internally |user| and |user@<lang>| (language-dependent
 %    user shorthands). By default, only the first one is taken into
@@ -4222,6 +4528,7 @@
 %    (|user at generic|, done by |\bbl at set@user at generic|); we make also
 %    sure |{}| and |\protect| are taken into account in this new top
 %    level.
+%
 %    \begin{macrocode}
 \def\user at language@group{user@\language at group}
 \def\bbl at set@user at generic#1#2{%
@@ -4243,6 +4550,7 @@
     \fi
     \declare at shorthand{\bbl at tempb}{#2}{#3}}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\languageshorthands}
@@ -4250,13 +4558,16 @@
 %    are used. Unfortunately, \babel{} currently does not keep track
 %    of defined groups, and therefore there is no way to catch a
 %    possible change in casing.
+%
 %    \begin{macrocode}
 \def\languageshorthands#1{\def\language at group{#1}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\aliasshorthand}
 %    First the new shorthand needs to be initialized,
+%
 %    \begin{macrocode}
 \def\aliasshorthand#1#2{%
   \bbl at ifshorthand{#2}%
@@ -4266,15 +4577,18 @@
        \else
          \initiate at active@char{#2}%
 %    \end{macrocode}
+%
 % \changes{babel~3.9a}{2012/08/06}{Instead of letting the new shorthand to
 %    the original char, which very often didn't work, we define it
 %    directly}
 % \changes{babel~3.9a}{2012/08/20}{Make sure both characters (old an
 %    new) are active}
+%
 %    Then, we define the new shorthand in terms of the original
 %    one, but note with |\aliasshorthands{"}{/}| is
 %    |\active at prefix /\active at char/|, so we still need to let the
 %    lattest to |\active at char"|.
+%
 %    \begin{macrocode}
          \expandafter\let\csname active at char\string#2\expandafter\endcsname
            \csname active at char\string#1\endcsname
@@ -4288,9 +4602,11 @@
        {Sorry, but you cannot use shorthands which have been\\%
         turned off in the package options}}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\@notshorthand}
+%
 % \changes{v3.8d}{2004/11/20}{Error message added}
 %    
 %    \begin{macrocode}
@@ -4302,6 +4618,7 @@
     I will ignore your instruction}%
    {You may proceed, but expect unexpected results}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\shorthandon}
@@ -4309,6 +4626,7 @@
 %    The first level definition of these macros just passes the
 %    argument on to |\bbl at switch@sh|, adding |\@nil| at the end to
 %    denote the end of the list of characters.
+%
 %    \begin{macrocode}
 \newcommand*\shorthandon[1]{\bbl at switch@sh\@ne#1\@nnil}
 \DeclareRobustCommand*\shorthandoff{%
@@ -4317,7 +4635,9 @@
 %    \end{macrocode}
 %
 %  \begin{macro}{\bbl at switch@sh}
-% \changes{babel~3.9a}{2013/02/21}{Code revised}
+%
+%   \changes{babel~3.9a}{2013/02/21}{Code revised}
+%
 %    The macro |\bbl at switch@sh| takes the list of characters apart one
 %    by  one and subsequently switches the category code of the
 %    shorthand character according to the first argument of
@@ -4352,6 +4672,7 @@
     \bbl at afterfi\bbl at switch@sh#1%
   \fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %  \end{macro}
@@ -4360,6 +4681,7 @@
 %
 % Note the value is that at the expansion time, eg, in the preample
 % shorhands are usually deactivated.
+%
 %    \begin{macrocode}
 \def\babelshorthand{\active at prefix\babelshorthand\bbl at putsh}
 \def\bbl at putsh#1{%
@@ -4392,8 +4714,10 @@
 %
 %  \begin{macro}{\bbl at prim@s}
 %  \begin{macro}{\bbl at pr@m at s}
+%
 % \changes{babel~3.9a}{2012/07/29}{\cs{bbl at pr@m at s} rewritten to
 %    take into account catcodes for both the quote and the hat}
+%
 %    One of the internal macros that are involved in substituting
 %    |\prime| for each right quote in mathmode is |\prim at s|. This
 %    checks if the next character is a right quote. When the right
@@ -4400,6 +4724,7 @@
 %    quote is active, the definition of this macro needs to be adapted
 %    to look also for an active right quote; the hat could be active,
 %    too.
+%
 %    \begin{macrocode}
 \def\bbl at prim@s{%
   \prime\futurelet\@let at token\bbl at pr@m at s}
@@ -4421,6 +4746,7 @@
         {\bbl at if@primes*^\pr@@@t\egroup}}}
 \endgroup
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -4433,9 +4759,11 @@
 %    and in some cases is inconvenient (if |~| has been redefined);
 %    however, for backward compatibility it is maintained (some
 %    existing documents may rely on the \babel{} value).
+%
 % \changes{babel~3.9i}{2014/02/06}{Moved from above, after
 %    \cs{bbl at usehook} has been defined}
 % \changes{babel~3.9k}{2014/02/06}{Moved again at the original place}
+%
 %    \begin{macrocode}
 \initiate at active@char{~}
 \declare at shorthand{system}{~}{\leavevmode\nobreak\ }
@@ -4448,17 +4776,21 @@
 %    OT1 and T1 encodings. It will later be selected using the
 %    |\f at encoding| macro. Therefore we define two macros here to store
 %    the position of the character in these encodings.
+%
 %    \begin{macrocode}
 \expandafter\def\csname OT1dqpos\endcsname{127}
 \expandafter\def\csname T1dqpos\endcsname{4}
 %    \end{macrocode}
+%
 %    When the macro |\f at encoding| is undefined (as it is in plain
 %    \TeX) we define it here to expand to \texttt{OT1}
+%
 %    \begin{macrocode}
 \ifx\f at encoding\@undefined
   \def\f at encoding{OT1}
 \fi
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -4468,62 +4800,76 @@
 %    which features of the language definition files he wants to
 %    enable.
 %  \begin{macro}{\languageattribute}
-% \changes{babel~3.9a}{2012/09/07}{Use \cs{@expandtwoargs} with \cs{in@}}
+%
+% \changes{babel~3.9a}{2012/09/07}{Use \cs{@expandtwoargs} with
+%   \cs{in@}}
+%
 %    The macro |\languageattribute| checks whether its arguments are
 %    valid and then activates the selected language attribute.
 %    First check whether the language is known, and then process each
 %    attribute in the list.
+%
 %    \begin{macrocode}
 \newcommand\languageattribute[2]{%
   \def\bbl at tempc{#1}%
   \bbl at fixname\bbl at tempc
   \bbl at iflanguage\bbl at tempc{%
-    \bbl at loopx\bbl at attr{#2}{%
+    \bbl at vforeach{#2}{%
 %    \end{macrocode}
+%
 %    We want to make sure that each attribute is selected only once;
 %    therefore we store the already selected attributes in
 %    |\bbl at known@attribs|. When that control sequence is not yet
 %    defined this attribute is certainly not selected before.
+%
 %    \begin{macrocode}
       \ifx\bbl at known@attribs\@undefined
         \in at false
       \else
 %    \end{macrocode}
+%
 %    Now we need to see if the attribute occurs in the list of
 %    already selected attributes.
+%
 %    \begin{macrocode}
-        \@expandtwoargs\in@{,\bbl at tempc-\bbl at attr,}{,\bbl at known@attribs,}%
+        \@expandtwoargs\in@{,\bbl at tempc-##1,}{,\bbl at known@attribs,}%
       \fi
 %    \end{macrocode}
+%
 %    When the attribute was in the list we issue a warning; this might
 %    not be the users intention.
+%
 %    \begin{macrocode}
       \ifin@
         \bbl at warning{%
-          You have more than once selected the attribute '\bbl at attr'\\%
+          You have more than once selected the attribute '##1'\\%
           for language #1}%
       \else
 %    \end{macrocode}
+%
 %    When we end up here the attribute is not selected before. So, we
 %    add it to the list of selected attributes and execute the
 %    associated \TeX-code.
+%
 %    \begin{macrocode}
-        \edef\bbl at tempa{%
-          \noexpand\bbl at add@list
-          \noexpand\bbl at known@attribs{\bbl at tempc-\bbl at attr}}%
-        \bbl at tempa
-        \edef\bbl at tempa{\bbl at tempc-\bbl at attr}%
+        \bbl at exp{%
+          \\\bbl at add@list\\\bbl at known@attribs{\bbl at tempc-##1}}%
+        \edef\bbl at tempa{\bbl at tempc-##1}%
         \expandafter\bbl at ifknown@ttrib\expandafter{\bbl at tempa}\bbl at attributes%
-        {\csname\bbl at tempc @attr@\bbl at attr\endcsname}%
-        {\@attrerr{\bbl at tempc}{\bbl at attr}}%
+        {\csname\bbl at tempc @attr@##1\endcsname}%
+        {\@attrerr{\bbl at tempc}{##1}}%
      \fi}}}
 %    \end{macrocode}
+%
 %    This command should only be used in the preamble of a document.
+%
 %    \begin{macrocode}
 \@onlypreamble\languageattribute
 %    \end{macrocode}
+%
 %    The error text to be issued when an unknown attribute is
 %    selected.
+%
 %    \begin{macrocode}
 \newcommand*{\@attrerr}[2]{%
   \bbl at error
@@ -4530,6 +4876,7 @@
     {The attribute #2 is unknown for language #1.}%
     {Your command will be ignored, type <return> to proceed}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at declare@ttribute}
@@ -4541,6 +4888,7 @@
 %    that the macro |\extras...| for the current language is extended,
 %    otherwise the attribute will not work as its code is removed from
 %    memory at |\begin{document}|.
+%
 %    \begin{macrocode}
 \def\bbl at declare@ttribute#1#2#3{%
   \@expandtwoargs\in@{,#2,}{,\BabelModifiers,}%
@@ -4550,6 +4898,7 @@
   \bbl at add@list\bbl at attributes{#1-#2}%
   \expandafter\def\csname#1 at attr@#2\endcsname{#3}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at ifattributeset}
@@ -4562,24 +4911,31 @@
 %    The first argument is the language, the second argument the
 %    attribute being checked, and the third and fourth arguments are
 %    the true and false clauses.
+%
 %    \begin{macrocode}
 \def\bbl at ifattributeset#1#2#3#4{%
 %    \end{macrocode}
+%
 %    First we need to find out if any attributes were set; if not
 %    we're done.
+%
 %    \begin{macrocode}
   \ifx\bbl at known@attribs\@undefined
     \in at false
   \else
 %    \end{macrocode}
+%
 %    The we need to check the list of known attributes.
+%
 %    \begin{macrocode}
     \@expandtwoargs\in@{,#1-#2,}{,\bbl at known@attribs,}%
   \fi
 %    \end{macrocode}
+%
 %    When we're this far |\ifin@| has a value indicating if the
 %    attribute in question was set or not. Just to be safe the code to
 %    be executed is `thrown over the |\fi|'.
+%
 %    \begin{macrocode}
   \ifin@
     \bbl at afterelse#3%
@@ -4588,6 +4944,7 @@
   \fi
   }
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at ifknown@ttrib}
@@ -4595,36 +4952,47 @@
 %    known. The macro takes 4 arguments, the language/attribute, the
 %    attribute list, the \TeX-code to be executed when the attribute
 %    is known and the \TeX-code to be executed otherwise.
+%
 %    \begin{macrocode}
 \def\bbl at ifknown@ttrib#1#2{%
 %    \end{macrocode}
+%
 %    We first assume the attribute is unknown.
+%
 %    \begin{macrocode}
   \let\bbl at tempa\@secondoftwo
 %    \end{macrocode}
+%
 %    Then we loop over the list of known attributes, trying to find a
 %    match.
+%
 %    \begin{macrocode}
   \bbl at loopx\bbl at tempb{#2}{%
     \expandafter\in@\expandafter{\expandafter,\bbl at tempb,}{,#1,}%
     \ifin@
 %    \end{macrocode}
+%
 %    When a match is found the definition of |\bbl at tempa| is changed.
+%
 %    \begin{macrocode}
       \let\bbl at tempa\@firstoftwo
     \else
     \fi}%
 %    \end{macrocode}
+%
 %    Finally we execute |\bbl at tempa|.
+%
 %    \begin{macrocode}
   \bbl at tempa
 }
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at clear@ttribs}
 %    This macro removes all the attribute code from \LaTeX's memory at
 %    |\begin{document}| time (if any is present).
+%
 %    \begin{macrocode}
 \def\bbl at clear@ttribs{%
   \ifx\bbl at attributes\@undefined\else
@@ -4637,6 +5005,7 @@
   \expandafter\let\csname#1 at attr@#2\endcsname\@undefined}
 \AtBeginDocument{\bbl at clear@ttribs}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \subsection{Support for saving macro definitions}
@@ -4656,14 +5025,18 @@
 %  \begin{macro}{\babel at beginsave}
 %    The initialization of a new save cycle: reset the counter to
 %    zero.
+%
 %    \begin{macrocode}
 \def\babel at beginsave{\babel at savecnt\z@}
 %    \end{macrocode}
+%
 %    Before it's forgotten, allocate the counter and initialize all.
+%
 %    \begin{macrocode}
 \newcount\babel at savecnt
 \babel at beginsave
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -4675,31 +5048,30 @@
 %    To do this, we let the current meaning to a temporary control
 %    sequence, the restore commands are appended to |\originalTeX| and
 %    the counter is incremented.
+%
 %    \begin{macrocode}
 \def\babel at save#1{%
   \expandafter\let\csname babel@\number\babel at savecnt\endcsname#1\relax
-  \begingroup
-    \toks@\expandafter{\originalTeX\let#1=}%
-    \edef\x{\endgroup
-      \def\noexpand\originalTeX{\the\toks@ \expandafter\noexpand
-         \csname babel@\number\babel at savecnt\endcsname\relax}}%
-  \x
+  \toks@\expandafter{\originalTeX\let#1=}%
+  \bbl at exp{%
+    \def\\\originalTeX{\the\toks@\<babel@\number\babel at savecnt>\relax}}%
   \advance\babel at savecnt\@ne}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\babel at savevariable}
-% \changes{babel~3.2}{1991/11/10}{Added macro}
+%
 %    The macro |\babel at savevariable|\meta{variable} saves the value of
 %    the variable.  \meta{variable} can be anything allowed after the
 %    |\the| primitive.
+%
 %    \begin{macrocode}
-\def\babel at savevariable#1{\begingroup
-    \toks@\expandafter{\originalTeX #1=}%
-    \edef\x{\endgroup
-      \def\noexpand\originalTeX{\the\toks@ \the#1\relax}}%
-  \x}
+\def\babel at savevariable#1{%
+  \toks@\expandafter{\originalTeX #1=}%
+  \bbl at exp{\def\\\originalTeX{\the\toks@\the#1\relax}}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at frenchspacing}
@@ -4708,6 +5080,7 @@
 %    don't want that. The command |\bbl at frenchspacing| switches it on
 %    when it isn't already in effect and |\bbl at nonfrenchspacing|
 %    switches it off if necessary.
+%
 %    \begin{macrocode}
 \def\bbl at frenchspacing{%
   \ifnum\the\sfcode`\.=\@m
@@ -4718,6 +5091,7 @@
   \fi}
 \let\bbl at nonfrenchspacing\nonfrenchspacing
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -4727,7 +5101,8 @@
 % This macro is straightforward. After zapping spaces, we
 % loop over the list and define the macros |\text|\m{tag} and
 % |\|\m{tag}. Definitions are first expanded so that they don't
-% contain |\csname| but the actual macro. 
+% contain |\csname| but the actual macro.
+%
 % \changes{babel~3.9i}{2014/02/21}{Macro \cs{babeltags} added}
 %
 %   \begin{macrocode}
@@ -4746,6 +5121,7 @@
   \bbl at for\bbl at tempa\bbl at tempa{%
     \expandafter\bbl at tempb\bbl at tempa\@@}}
 %    \end{macrocode}
+%
 % \end{macro}
 %
 %   \subsection{Hyphens}
@@ -4757,6 +5133,7 @@
 %     |\bbl at hyphenation<lang>| for language ones. See |\bbl at patterns|
 %     above for further details. We make sure there is a space between
 %     words when multiple commands are used.
+%
 %     \changes{babel~3.9a}{2012/08/28}{Macro added}
 %
 %    \begin{macrocode}
@@ -4775,8 +5152,8 @@
     \ifx\@empty#1%
       \protected at edef\bbl at hyphenation@{\bbl at hyphenation@\space#2}%
     \else
-      \edef\bbl at tempb{\zap at space#1 \@empty}%
-      \bbl at for\bbl at tempa\bbl at tempb{%
+      \bbl at vforeach{#1}{%
+        \def\bbl at tempa{##1}%
         \bbl at fixname\bbl at tempa
         \bbl at iflanguage\bbl at tempa{%
           \bbl at csarg\protected at edef{hyphenation@\bbl at tempa}{%
@@ -4786,6 +5163,7 @@
             #2}}}%
     \fi}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at allowhyphens}
@@ -4807,10 +5185,12 @@
 \def\bbl at t@one{T1}
 \def\allowhyphens{\ifx\cf at encoding\bbl at t@one\else\bbl at allowhyphens\fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 % \changes{babel-3.9a}{2012/08/27}{Added \cs{babelhyphen} and related
 %    macros}
+%
 % \begin{macro}{\babelhyphen}
 %
 %    Macros to insert common hyphens. Note the space before |@| in
@@ -4882,6 +5262,7 @@
 \def\bbl at hy@empty{\hskip\z at skip}
 \def\bbl at hy@@empty{\discretionary{}{}{}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at disc}
@@ -4888,9 +5269,11 @@
 %    For some languages the macro |\bbl at disc| is used to ease the
 %    insertion of discretionaries for letters that behave `abnormally'
 %    at a breakpoint.
+%
 %    \begin{macrocode}
 \def\bbl at disc#1#2{\nobreak\discretionary{#2-}{}{#1}\bbl at allowhyphens}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \subsection{Multiencoding strings}
 %
@@ -4907,6 +5290,7 @@
 %
 % But first, a couple of tools. The first one makes global a local
 % variable. This is not the best solution, but it works.
+%
 %    \begin{macrocode}
 \def\bbl at toglobal#1{\global\let#1#1}
 \def\bbl at recatcode#1{%
@@ -4934,8 +5318,10 @@
 % \let\bbl at tolower\@empty\bbl at toupper\@empty
 % \end{verbatim}
 % and starts over (and similarly when lowercasing).
+%
 %    \changes{babel~3.9l}{2014/07/29}{Now tries to catch the parsing
 %    macro. Removed some redundant code. Option |nocase|.}
+%
 %    \begin{macrocode}
 \@ifpackagewith{babel}{nocase}%
   {\let\bbl at patchuclc\relax}%
@@ -4974,10 +5360,12 @@
 %    first use it is redefined to omit the basic setup in subsequent
 %    blocks. We make sure strings contain actual letters in the range
 %    128-255, not active characters.
+%
 %    \changes{babel~3.9g}{2013/07/29}{Added starred variant. A bit of
 %    clean up. Removed \cs{UseString}, which didn't work.}
 %    \changes{babel~3.9g}{2013/08/01}{Now several languages can be
 %    processed with \cs{BabelLanguages}, if set in the ldf.}
+%
 %    \begin{macrocode}
 \@onlypreamble\StartBabelCommands
 \def\StartBabelCommands{%
@@ -5012,6 +5400,7 @@
   \edef\bbl at G{\zap at space#2 \@empty}%
   \bbl at startcmds@ii}
 %    \end{macrocode}
+%
 %    Parse the encoding info to get the label, input, and font parts.
 %
 %    Select the behaviour of |\SetString|. Thre are two main cases,
@@ -5028,6 +5417,7 @@
 %    (above) a couple of default values to gobble the arguments. Then,
 %    these macros are redefined if necessary according to several
 %    parameters.
+%
 % \changes{babel~3.9g}{2013/08/04}{Use \cs{ProvideTextCommand}, which
 %   does with encoded strings what the manual says.}
 % \changes{babel~3.9h}{2013/11/08}{Tidied up code related to
@@ -5050,7 +5440,7 @@
     \let\bbl at sc@fontenc\space % <-   "      "
     \def\bbl at tempa##1=##2\@nil{%
       \bbl at csarg\edef{sc@\zap at space##1 \@empty}{##2 }}%
-    \bbl at for\bbl at tempb{label=#1}{\expandafter\bbl at tempa\bbl at tempb\@nil}%
+    \bbl at vforeach{label=#1}{\bbl at tempa##1\@nil}%
     \def\bbl at tempa##1 ##2{% space -> comma
       ##1%
       \ifx\@empty##2\else\ifx,##1,\else,\fi\bbl at afterfi\bbl at tempa##2\fi}%
@@ -5058,13 +5448,13 @@
     \edef\bbl at sc@label{\expandafter\zap at space\bbl at sc@label\@empty}%
     \edef\bbl at sc@charset{\expandafter\zap at space\bbl at sc@charset\@empty}%
     \def\bbl at encstring##1##2{%
-      \bbl at for\bbl at tempc\bbl at sc@fontenc{%
-        \bbl at ifunset{T@\bbl at tempc}%
+      \bbl at foreach\bbl at sc@fontenc{%
+        \bbl at ifunset{T@####1}%
           {}%
-          {\ProvideTextCommand##1\bbl at tempc{##2}%
+          {\ProvideTextCommand##1{####1}{##2}%
            \bbl at toglobal##1%
            \expandafter
-           \bbl at toglobal\csname\bbl at tempc\string##1\endcsname}}}%
+           \bbl at toglobal\csname####1\string##1\endcsname}}}%
     \def\bbl at sctest{%
       \@expandtwoargs
       \in@{,\bbl at opt@strings,}{,\bbl at sc@label,\bbl at sc@fontenc,}}%
@@ -5148,6 +5538,7 @@
 %    manipulating the value of |\BabelString|. If there are several
 %    hooks assigned to this event, preprocessing is done in the same
 %    order as defined.  Finally, the string is set.
+%
 % \changes{babel~3.9g}{2013/07/29}{Added \cs{bbl at forlang} to ignore in
 %   the preamble unknown languages, as described in the doc.}
 % 
@@ -5156,7 +5547,7 @@
   \bbl at forlang\bbl at tempa{%
     \edef\bbl at LC{\bbl at tempa\bbl at stripslash#1}%
     \bbl at ifunset{\bbl at LC}% eg, \germanchaptername
-      {\global\expandafter
+      {\global\expandafter  % TODO - con \bbl at exp ?
        \bbl at add\csname\bbl at G\bbl at tempa\expandafter\endcsname\expandafter
          {\expandafter\bbl at scset\expandafter#1\csname\bbl at LC\endcsname}}%
       {}%
@@ -5214,10 +5605,9 @@
     \bbl at loop\bbl at tempa{##2}{% empty items and spaces are ok
       \advance\count@\@ne
       \toks@\expandafter{\bbl at tempa}%
-      \edef\bbl at tempb{%
-        \bbl at templ{\romannumeral\count@}{\the\toks@}%
-        \count@=\the\count@\relax}%
-      \expandafter\SetString\bbl at tempb}}%
+      \bbl at exp{%
+        \\\SetString\bbl at templ{\romannumeral\count@}{\the\toks@}%
+        \count@=\the\count@\relax}}}%
 %<</Macros local to BabelCommands>>
 %    \end{macrocode}
 %
@@ -5238,6 +5628,7 @@
 %
 % \changes{babel~3.9h}{2013/11/08}{Use \cs{bbl at encstrings} - they
 % should be defined always, even if no `strings'}
+%
 %    \begin{macrocode}
 %<<*Macros local to BabelCommands>>
   \newcommand\SetCase[3][]{%
@@ -5299,13 +5690,16 @@
 %    The following package options control the behaviour of
 %    hyphenation mapping.
 %
+% \changes{babel~3.9t}{2017/04/28}{Renamed \cs{bbl at hymapopt} to
+%    \cs{bbl at opt@hyphenmap} for consistency}
+%
 %    \begin{macrocode}
 %<<*More package options>>    
-\DeclareOption{hyphenmap=off}{\chardef\bbl at hymapopt\z@}
-\DeclareOption{hyphenmap=first}{\chardef\bbl at hymapopt\@ne}
-\DeclareOption{hyphenmap=select}{\chardef\bbl at hymapopt\tw@}      
-\DeclareOption{hyphenmap=other}{\chardef\bbl at hymapopt\thr@@}
-\DeclareOption{hyphenmap=other*}{\chardef\bbl at hymapopt4\relax}
+\DeclareOption{hyphenmap=off}{\chardef\bbl at opt@hyphenmap\z@}
+\DeclareOption{hyphenmap=first}{\chardef\bbl at opt@hyphenmap\@ne}
+\DeclareOption{hyphenmap=select}{\chardef\bbl at opt@hyphenmap\tw@}      
+\DeclareOption{hyphenmap=other}{\chardef\bbl at opt@hyphenmap\thr@@}
+\DeclareOption{hyphenmap=other*}{\chardef\bbl at opt@hyphenmap4\relax}
 %<</More package options>>    
 %    \end{macrocode}
 %
@@ -5314,9 +5708,9 @@
 %
 %    \begin{macrocode}
 \AtEndOfPackage{%
-  \ifx\bbl at hymapopt\@undefined
+  \ifx\bbl at opt@hyphenmap\@undefined
     \@expandtwoargs\in@{,}{\bbl at language@opts}%
-    \chardef\bbl at hymapopt\ifin at 4\else\@ne\fi
+    \chardef\bbl at opt@hyphenmap\ifin at 4\else\@ne\fi
   \fi}
 %    \end{macrocode}
 %
@@ -5325,16 +5719,19 @@
 %  \begin{macro}{\set at low@box}
 %    The following macro is used to lower quotes to the same level as
 %    the comma.  It prepares its argument in box register~0.
+%
 %    \begin{macrocode}
 \def\set at 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@}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\save at sf@q}
 %    The macro |\save at sf@q| is used to save and reset the current
 %    space factor.
+%
 %    \begin{macrocode}
 \def\save at sf@q#1{\leavevmode
   \begingroup 
@@ -5341,6 +5738,7 @@
     \edef\@SF{\spacefactor\the\spacefactor}#1\@SF
   \endgroup}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \subsection{Making glyphs available}
@@ -5357,32 +5755,40 @@
 %    |\quotedblbase|. In the \texttt{OT1} encoding it is not
 %    available, therefore we make it available by lowering the normal
 %    open quote character to the baseline.
+%
 %    \begin{macrocode}
 \ProvideTextCommand{\quotedblbase}{OT1}{%
   \save at sf@q{\set at low@box{\textquotedblright\/}%
     \box\z@\kern-.04em\bbl at allowhyphens}}
 %    \end{macrocode}
+%
 %    Make sure that when an encoding other than \texttt{OT1} or
 %    \texttt{T1} is used this glyph can still be typeset.
+%
 %    \begin{macrocode}
 \ProvideTextCommandDefault{\quotedblbase}{%
   \UseTextSymbol{OT1}{\quotedblbase}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\quotesinglbase}
 %    We also need the single quote character at the baseline.
+%
 %    \begin{macrocode}
 \ProvideTextCommand{\quotesinglbase}{OT1}{%
   \save at sf@q{\set at low@box{\textquoteright\/}%
     \box\z@\kern-.04em\bbl at allowhyphens}}
 %    \end{macrocode}
+%
 %    Make sure that when an encoding other than \texttt{OT1} or
 %    \texttt{T1} is used this glyph can still be typeset.
+%
 %    \begin{macrocode}
 \ProvideTextCommandDefault{\quotesinglbase}{%
   \UseTextSymbol{OT1}{\quotesinglbase}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\guillemotleft}
@@ -5389,6 +5795,7 @@
 %  \begin{macro}{\guillemotright}
 %    The guillemet characters are not available in \texttt{OT1}
 %    encoding. They are faked.
+%
 %    \begin{macrocode}
 \ProvideTextCommand{\guillemotleft}{OT1}{%
   \ifmmode
@@ -5405,8 +5812,10 @@
       \raise.2ex\hbox{$\scriptscriptstyle\gg$}\bbl at allowhyphens}%
   \fi}
 %    \end{macrocode}
+%
 %    Make sure that when an encoding other than \texttt{OT1} or
 %    \texttt{T1} is used these glyphs can still be typeset.
+%
 %    \begin{macrocode}
 \ProvideTextCommandDefault{\guillemotleft}{%
   \UseTextSymbol{OT1}{\guillemotleft}}
@@ -5413,6 +5822,7 @@
 \ProvideTextCommandDefault{\guillemotright}{%
   \UseTextSymbol{OT1}{\guillemotright}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -5420,6 +5830,7 @@
 %  \begin{macro}{\guilsinglright}
 %    The single guillemets are not available in \texttt{OT1}
 %    encoding. They are faked.
+%
 %    \begin{macrocode}
 \ProvideTextCommand{\guilsinglleft}{OT1}{%
   \ifmmode
@@ -5436,8 +5847,10 @@
       \raise.2ex\hbox{$\scriptscriptstyle>$}\bbl at allowhyphens}%
   \fi}
 %    \end{macrocode}
+%
 %    Make sure that when an encoding other than \texttt{OT1} or
 %    \texttt{T1} is used these glyphs can still be typeset.
+%
 %    \begin{macrocode}
 \ProvideTextCommandDefault{\guilsinglleft}{%
   \UseTextSymbol{OT1}{\guilsinglleft}}
@@ -5444,10 +5857,10 @@
 \ProvideTextCommandDefault{\guilsinglright}{%
   \UseTextSymbol{OT1}{\guilsinglright}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
-%
 %  \subsubsection{Letters}
 %
 %  \begin{macro}{\ij}
@@ -5455,8 +5868,10 @@
 %    The dutch language uses the letter `ij'. It is available in
 %    \texttt{T1} encoded fonts, but not in the \texttt{OT1} encoded
 %    fonts. Therefore we fake it for the \texttt{OT1} encoding.
+%
 % \changes{babel~3.9a}{2012/07/28}{Removed the first \cs{allowhyphens}.
 %    Moved the second one just after the kern.}
+%
 %    \begin{macrocode}
 \DeclareTextCommand{\ij}{OT1}{%
   i\kern-0.02em\bbl at allowhyphens j}
@@ -5465,8 +5880,10 @@
 \DeclareTextCommand{\ij}{T1}{\char188}
 \DeclareTextCommand{\IJ}{T1}{\char156}
 %    \end{macrocode}
+%
 %    Make sure that when an encoding other than \texttt{OT1} or
 %    \texttt{T1} is used these glyphs can still be typeset.
+%
 %    \begin{macrocode}
 \ProvideTextCommandDefault{\ij}{%
   \UseTextSymbol{OT1}{\ij}}
@@ -5473,6 +5890,7 @@
 \ProvideTextCommandDefault{\IJ}{%
   \UseTextSymbol{OT1}{\IJ}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -5485,6 +5903,7 @@
 %    Some code to construct these glyphs for the \texttt{OT1} encoding
 %    was made available to me by Stipcevic Mario,
 %    (\texttt{stipcevic at olimp.irb.hr}).
+%
 %    \begin{macrocode}
 \def\crrtic@{\hrule height0.1ex width0.3em}
 \def\crttic@{\hrule height0.1ex width0.33em}
@@ -5506,8 +5925,10 @@
 \DeclareTextCommand{\dj}{OT1}{\ddj@ d}
 \DeclareTextCommand{\DJ}{OT1}{\DDJ@ D}
 %    \end{macrocode}
+%
 %    Make sure that when an encoding other than \texttt{OT1} or
 %    \texttt{T1} is used these glyphs can still be typeset.
+%
 %    \begin{macrocode}
 \ProvideTextCommandDefault{\dj}{%
   \UseTextSymbol{OT1}{\dj}}
@@ -5514,6 +5935,7 @@
 \ProvideTextCommandDefault{\DJ}{%
   \UseTextSymbol{OT1}{\DJ}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -5521,10 +5943,12 @@
 %    For the \texttt{T1} encoding |\SS| is defined and selects a
 %    specific glyph from the font, but for other encodings it is not
 %    available. Therefore we make it available here.
+%
 %    \begin{macrocode}
 \DeclareTextCommand{\SS}{OT1}{SS}
 \ProvideTextCommandDefault{\SS}{\UseTextSymbol{OT1}{\SS}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 % \subsubsection{Shorthands for quotation marks}
@@ -5534,9 +5958,12 @@
 %
 %  \begin{macro}{\glq}
 %  \begin{macro}{\grq}
+%
 % \changes{babel~3.8b}{2004/05/02}{Made \cs{glq} fontencoding
-%    dependent as well} 
+%    dependent as well}
+%
 %    The `german' single quotes.
+%
 %    \begin{macrocode}
 \ProvideTextCommand{\glq}{OT1}{%
   \textormath{\quotesinglbase}{\mbox{\quotesinglbase}}}
@@ -5544,8 +5971,10 @@
   \textormath{\quotesinglbase}{\mbox{\quotesinglbase}}}
 \ProvideTextCommandDefault{\glq}{\UseTextSymbol{OT1}\glq}
 %    \end{macrocode}
+%
 %    The definition of |\grq| depends on the fontencoding. With
 %    \texttt{T1} encoding no extra kerning is needed.
+%
 %    \begin{macrocode}
 \ProvideTextCommand{\grq}{T1}{%
   \textormath{\textquoteleft}{\mbox{\textquoteleft}}}
@@ -5555,14 +5984,18 @@
   \kern.07em\relax}}
 \ProvideTextCommandDefault{\grq}{\UseTextSymbol{OT1}\grq}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
 %  \begin{macro}{\glqq}
 %  \begin{macro}{\grqq}
+%
 % \changes{babel~3.8b}{2004/05/02}{Made \cs{grqq} fontencoding
-%    dependent as well} 
+%    dependent as well}
+%
 %    The `german' double quotes.
+%
 %    \begin{macrocode}
 \ProvideTextCommand{\glqq}{OT1}{%
   \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
@@ -5570,8 +6003,10 @@
   \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
 \ProvideTextCommandDefault{\glqq}{\UseTextSymbol{OT1}\glqq}
 %    \end{macrocode}
+%
 %    The definition of |\grqq| depends on the % fontencoding. With
 %    \texttt{T1} encoding no extra kerning is needed.
+%
 %    \begin{macrocode}
 \ProvideTextCommand{\grqq}{T1}{%
   \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
@@ -5581,14 +6016,18 @@
   \kern.07em\relax}}
 \ProvideTextCommandDefault{\grqq}{\UseTextSymbol{OT1}\grqq}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
 %  \begin{macro}{\flq}
 %  \begin{macro}{\frq}
+%
 % \changes{babel~3.8b}{2004/05/02}{Made \cs{flq} and \cs{frq}
-%    fontencoding dependent} 
+%    fontencoding dependent}
+%
 %    The `french' single guillemets.
+%
 %    \begin{macrocode}
 \ProvideTextCommand{\flq}{OT1}{%
   \textormath{\guilsinglleft}{\mbox{\guilsinglleft}}}
@@ -5604,14 +6043,18 @@
   \textormath{\guilsinglright}{\mbox{\guilsinglright}}}
 \ProvideTextCommandDefault{\frq}{\UseTextSymbol{OT1}\frq}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
 %  \begin{macro}{\flqq}
 %  \begin{macro}{\frqq}
+%
 % \changes{babel~3.8b}{2004/05/02}{Made \cs{flqq} and \cs{frqq}
-%    fontencoding dependent} 
+%    fontencoding dependent}
+%
 %    The `french' double guillemets.
+%
 %    \begin{macrocode}
 \ProvideTextCommand{\flqq}{OT1}{%
   \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
@@ -5627,6 +6070,7 @@
   \textormath{\guillemotright}{\mbox{\guillemotright}}}
 \ProvideTextCommandDefault{\frqq}{\UseTextSymbol{OT1}\frqq}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -5640,12 +6084,15 @@
 %    always placed in the lower position.
 %
 %  \begin{macro}{\umlauthigh}
+%
 % \changes{v3.8a}{2004/02/19}{Use \cs{leavevmode}\cs{bgroup} to
 %    prevent problems when this command occurs in vertical mode.}
+%
 %  \begin{macro}{\umlautlow}
 %    To be able to provide both positions of |\"| we provide two
 %    commands to switch the positioning, the default will be
 %    |\umlauthigh| (the normal positioning).
+%
 %    \begin{macrocode}
 \def\umlauthigh{%
   \def\bbl at umlauta##1{\leavevmode\bgroup%
@@ -5658,6 +6105,7 @@
   \def\bbl at umlaute{\protect\lower at umlaut}}
 \umlauthigh
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -5667,11 +6115,13 @@
 %
 %    We want the umlaut character lowered, nearer to the letter. To do
 %    this we need an extra \meta{dimen} register.
+%
 %    \begin{macrocode}
 \expandafter\ifx\csname U at D\endcsname\relax
   \csname newdimen\endcsname\U at D
 \fi
 %    \end{macrocode}
+%
 %    The following code fools \TeX's \texttt{make\_accent} procedure
 %    about the current x-height of the font to force another placement
 %    of the umlaut character.
@@ -5678,6 +6128,7 @@
 %    First we have to save the current x-height of the font, because
 %    we'll change this font dimension and this is always done
 %    globally.
+%
 % \changes{v3.8a}{2004/02/19}{Use \cs{leavevmode}\cs{bgroup} to
 %    prevent problems when this command occurs in vertical mode.}
 %
@@ -5688,6 +6139,7 @@
 %    If the new x-height is too low, it is not changed.
 %    Finally we call the |\accent| primitive, reset the old x-height
 %    and insert the base character in the argument.
+%
 %    \begin{macrocode}
 \def\lower at umlaut#1{%
   \leavevmode\bgroup
@@ -5700,6 +6152,7 @@
     \fontdimen5\font\U at D #1%
   \egroup}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %    For all vowels we declare |\"| to be a composite command which
@@ -5713,6 +6166,7 @@
 %    redefine |\bbl at umlauta| and/or |\bbl at umlaute| for a language
 %    in the corresponding |ldf| (using the babel switching mechanism,
 %    of course).
+%
 %    \begin{macrocode}
 \AtBeginDocument{%
   \DeclareTextCompositeCommand{\"}{OT1}{a}{\bbl at umlauta{a}}%
@@ -5730,8 +6184,10 @@
 %    \end{macrocode}
 %
 %    Finally, the default is to use English as the main language.
+%
 % \changes{babel~3.9a}{2012-05-17}{Languages are best assigned with
 %    \cs{chardef}, not \cs{let}}
+%
 %    \begin{macrocode}
 \ifx\l at english\@undefined
   \chardef\l at english\z@
@@ -5762,6 +6218,7 @@
 %    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
@@ -5774,6 +6231,192 @@
 \fi}
 %    \end{macrocode}
 %
+% \section{Creating languages}
+%
+% |\babelprovide| is a general purpose tool for creating
+% languages. Currently it just creates the language infrastructure,
+% but in the future it will be able to read data from |ini| files, as
+% well as to create variants. Unlike the \textsf{nil} pseudo-language,
+% captions are defined, but with a warning to invite the user to
+% provide the real string.
+%
+% \changes{3.10}{2017/05/19}{Added \cs{babelprovide}}
+%
+%    \begin{macrocode}
+\newcommand\babelprovide[2][]{%  
+  \let\bbl at savelangname\languagename
+  \def\languagename{#2}%
+  \let\bbl at KVP@captions\@nil
+  \let\bbl at KVP@main\@nil
+  \let\bbl at KVP@hyphenrules\@nil
+  \bbl at forkv{#1}{\bbl at csarg\def{KVP@##1}{##2}}%  TODO - error handling
+  \bbl at ifunset{date#2}%
+    {\bbl at provide@new{#2}}%
+    {\bbl at ifblank{#1}%
+      {\bbl at error
+        {If you want to modify `#2' you must tell how in\\%
+         the optional argument. Currently there are two\\%
+         options: captions=lang-tag, hyphenrules=lang-list}%
+        {Use this macro as documented}
+}%
+      {\bbl at provide@renew{#2}}}% 
+  \babelensure{#2}%
+  \let\languagename\bbl at savelangname}
+%    \end{macrocode}
+%
+% Depending on whether or not the language exists, we define two macros.
+%
+%    \begin{macrocode}
+\def\bbl at provide@new#1{%
+  \bbl at provide@hyphens{#1}%
+  \@namedef{date#1}{}% marks lang exists - required by \StartBabelCommands
+  \@namedef{extras#1}{}%
+  \@namedef{noextras#1}{}%
+  \StartBabelCommands*{#1}{captions}%
+    \ifx\bbl at KVP@captions\@nil
+      \def\bbl at tempb##1{%               elt for \bbl at captionslist
+        \ifx##1\@empty\else
+          \bbl at exp{%
+            \\\SetString\\##1{%
+              \\\bbl at nocaption{\bbl at stripslash##1}{\<#1\bbl at stripslash##1>}}}%
+          \expandafter\bbl at tempb
+        \fi}%  
+      \expandafter\bbl at tempb\bbl at captionslist\@empty
+    \else
+      \bbl at read@ini{\bbl at KVP@captions}%  Here all letters cat = 11
+      \bbl at after@ini
+      \bbl at savestrings
+    \fi
+  \StartBabelCommands*{#1}{date}%
+    \bbl at exp{%
+      \\\SetString\\\today{\\\bbl at nocaption{today}{\<#1today>}}}%
+  \EndBabelCommands
+  \expandafter\gdef\csname#1hyphenmins\endcsname{23}%
+  \ifx\bbl at KVP@main\@nil\else
+     \expandafter\main at language\expandafter{#1}%
+  \fi}
+\def\bbl at provide@renew#1{%
+  \bbl at provide@hyphens{#1}%
+  \ifx\bbl at KVP@captions\@nil\else
+    \StartBabelCommands*{#1}{captions}%
+      \bbl at read@ini{\bbl at KVP@captions}%   Here all letters cat = 11
+      \bbl at after@ini
+      \bbl at savestrings
+    \EndBabelCommands
+  \fi} 
+%    \end{macrocode}
+%
+% The |hyphenrules| options is handled with an auxiliary macro.
+%
+%    \begin{macrocode}
+\def\bbl at provide@hyphens#1{%
+  \let\bbl at tempa\relax
+  \ifx\bbl at KVP@hyphenrules\@nil\else
+    \bbl at replace\bbl at KVP@hyphenrules{ }{,}%
+    \bbl at foreach\bbl at KVP@hyphenrules{%
+      \ifx\bbl at tempa\relax    %  if not yet found
+        \bbl at ifsamestring{##1}{+}%
+          {{\bbl at exp{\\\addlanguage\<l@##1>}}}%
+          {}%
+        \bbl at ifunset{l@##1}%
+           {}%
+           {\bbl at exp{\let\bbl at tempa\<l@##1>}}%
+      \fi}%
+  \fi
+  \ifx\bbl at tempa\relax %        if no option or no language found
+    \bbl at ifunset{l@#1}%         no hyphenrules found - fallback
+      {\bbl at exp{\\\adddialect\<l@#1>\language}}%
+      {}%
+  \else
+    \bbl at exp{\\\adddialect\<l@#1>\bbl at tempa}%  found in opt list
+  \fi}
+%    \end{macrocode}
+%
+% The reader of |ini| files. There are 3 possible cases: a section name
+% (in the form |[...]|), a comment (starting with |;|) and a
+% key/value pair. \textit{TODO - Work in progress.}
+%
+%    \begin{macrocode}
+\def\bbl at read@ini#1{%
+  \openin1=babel-#1.ini
+  \ifeof1
+    \bbl at error
+      {There is no ini file for the requested language\\%
+       (#1). Perhaps you misspelled it or your installation\\%
+       is not complete.}%
+      {Fix the name or reinstall babel.}%
+  \else
+    \let\bbl at section\@empty
+    \let\bbl at savestrings\@empty
+    \loop
+      \endlinechar\m at ne
+      \read1 to \bbl at line
+      \endlinechar`\^^M
+    \if T\ifeof1F\fi T\relax % Trick, because inside \loop
+      \ifx\bbl at line\@empty\else
+        \expandafter\bbl at iniline\bbl at line\bbl at iniline
+      \fi
+    \repeat
+  \fi}
+\def\bbl at iniline#1\bbl at iniline{%
+  \@ifnextchar[\bbl at inisec{\@ifnextchar;\bbl at iniskip\bbl at inikv}#1\@@} %]
+\def\bbl at iniskip#1\@@{}%      if starts with ;
+\def\bbl at inisec[#1]#2\@@{%    if starts with opening bracket
+  \def\bbl at section{#1}%
+  \bbl at debug{\message{[[ #1 ]]^^J}}}
+\def\bbl at inikv#1=#2\@@{%      otherwise, key=value
+  \bbl at trim@def\bbl at tempa{#1}%
+  \bbl at trim\toks@{#2}%
+  \bbl at ifunset{bbl at ini@\bbl at section}%
+    {}%
+    {\bbl at exp{%
+       \<bbl at ini@\bbl at section>\bbl at tempa=\the\toks@\\\@nil}}}
+\def\bbl at after@ini{%
+  % make sure Script and Language takes some value
+  \bbl at exp{\\\bbl at ifblank{\@nameuse{bbl at lotf@\languagename}}}%
+    {\bbl at csarg\gdef{lotf@\languagename}{dflt}}{}%
+  \bbl at exp{\\\bbl at ifblank{\@nameuse{bbl at sotf@\languagename}}}%
+    {\bbl at csarg\gdef{sotf@\languagename}{DFLT}}{}}
+%    \end{macrocode}
+%
+% Key-value pairs are treated differently depending on the section in
+% the |ini| file.  The following macros are the readers for
+% |captions| (with Unicode) or |captions.licr| (for 8-bit) and for
+% |identification|. But first, an auxiliary macros.
+%
+%    \begin{macrocode}
+\def\bbl at exportkey#1#2#3#4{% 1:bbl id,2:ini name,3:ini key,4:ini val
+  \bbl at ifsamestring{#2}{#3}%
+    {\bbl at csarg\gdef{#1@\languagename}{#4}}%
+    {}}
+\ifcase\bbl at engine
+  \bbl at csarg\def{ini at captions.licr}#1=#2\@nil{% TODO - copypaste pattern
+    \bbl at ifblank{#2}%
+      {\bbl at exp{%
+         \toks@{\\\bbl at nocaption{#1}\<\languagename#1name>}}}%
+      {\toks@{#2}}%
+    \bbl at exp{%
+      \\\bbl at add\\\bbl at savestrings{% NOTE - with date will be global
+        \\\SetString\<#1name>{\the\toks@}}}}
+\else
+  \def\bbl at ini@captions#1=#2\@nil{%
+    \bbl at ifblank{#2}%
+      {\bbl at exp{%
+         \toks@{\\\bbl at nocaption{#1}\<\languagename#1name>}}}%
+      {\toks@{#2}}%
+    \bbl at exp{%
+      \\\bbl at add\\\bbl at savestrings{%
+        \\\SetString\<#1name>{\the\toks@}}}}
+\fi
+\def\bbl at ini@identification#1=#2\@nil{% TODO - not only with captions
+  \bbl at exportkey{lname}{name.english}{#1}{#2}%
+  \bbl at exportkey{lbcp}{tag.bcp47}{#1}{#2}%
+  \bbl at exportkey{lotf}{tag.opentype}{#1}{#2}%
+  \bbl at exportkey{sname}{script.name}{#1}{#2}%
+  \bbl at exportkey{sbcp}{script.tag.bcp47}{#1}{#2}%
+  \bbl at exportkey{sotf}{script.tag.opentype}{#1}{#2}}
+%    \end{macrocode}
+%
 % \subsection{Cross referencing macros}
 %
 %    The \LaTeX\ book states:
@@ -5801,10 +6444,12 @@
 %  \begin{macro}{\newlabel}
 %    The macro |\label| writes a line with a |\newlabel| command
 %    into the |.aux| file to define labels.
+%
 %    \begin{macrocode}
 %\bbl at redefine\newlabel#1#2{%
 %  \@safe at activestrue\org at newlabel{#1}{#2}\@safe at activesfalse}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\@newl at bel}
@@ -5814,6 +6459,7 @@
 %
 %    The following package options control which macros are to be
 %    redefined.
+%
 %    \begin{macrocode}
 %<<*More package options>>
 \DeclareOption{safe=none}{\let\bbl at opt@safe\@empty}
@@ -5826,6 +6472,7 @@
 %    |\protect| local and then we set the |@safe at actives| switch to
 %    true to make sure that any shorthand that appears in any of the
 %    arguments immediately expands to its non-active self.
+%
 %    \begin{macrocode}
 \ifx\bbl at opt@safe\@empty\else
   \def\@newl at bel#1#2#3{%
@@ -5837,6 +6484,7 @@
         \@latex at warning@no at line{Label `#2' multiply defined}}%
     \global\@namedef{#1@#2}{#3}}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\@testdef}
@@ -5847,6 +6495,7 @@
 %    cases the expansion of |\#1@#2| contains the same characters as
 %    the |#3|; but the character codes differ. Therefore \LaTeX\ keeps
 %    reporting that the labels may have changed.
+%
 %    \begin{macrocode}
   \CheckCommand*\@testdef[3]{%
     \def\reserved at a{#3}%
@@ -5855,25 +6504,33 @@
       \@tempswatrue
     \fi}
 %    \end{macrocode}
+%
 %    Now that we made sure that |\@testdef| still has the same
 %    definition we can rewrite it. First we make the shorthands
 %    `safe'.
+%
 %    \begin{macrocode}
   \def\@testdef#1#2#3{%
     \@safe at activestrue
 %    \end{macrocode}
+%
 %    Then we use |\bbl at tempa| as an `alias' for the macro that
 %    contains the label which is being checked.
+%
 %    \begin{macrocode}
     \expandafter\let\expandafter\bbl at tempa\csname #1@#2\endcsname
 %    \end{macrocode}
+%
 %    Then we define |\bbl at tempb| just as |\@newl at bel| does it.
+%
 %    \begin{macrocode}
     \def\bbl at tempb{#3}%
     \@safe at activesfalse
 %    \end{macrocode}
+%
 %    When the label is defined we replace the definition of
 %    |\bbl at tempa| by its meaning.
+%
 %    \begin{macrocode}
     \ifx\bbl at tempa\relax
     \else
@@ -5880,12 +6537,16 @@
       \edef\bbl at tempa{\expandafter\strip at prefix\meaning\bbl at tempa}%
     \fi
 %    \end{macrocode}
+%
 %    We do the same for |\bbl at tempb|.
+%
 %    \begin{macrocode}
     \edef\bbl at tempb{\expandafter\strip at prefix\meaning\bbl at tempb}%
 %    \end{macrocode}
+%
 %    If the label didn't change, |\bbl at tempa| and |\bbl at tempb| should
 %    be identical macros.
+%
 %    \begin{macrocode}
     \ifx\bbl at tempa\bbl at tempb
     \else
@@ -5893,6 +6554,7 @@
     \fi}
 \fi
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\ref}
@@ -5902,6 +6564,7 @@
 %    |\pageref|. While we change these macros, we make them robust as
 %    well (if they weren't already) to prevent problems if they should
 %    become expanded at the wrong moment.
+%
 %    \begin{macrocode}
 \@expandtwoargs\in@{R}\bbl at opt@safe
 \ifin@
@@ -5914,6 +6577,7 @@
   \let\org at pageref\pageref
 \fi
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -5924,6 +6588,7 @@
 %    so we redefine this internal macro and leave |\cite| alone. The
 %    first argument is used for typesetting, so the shorthands need
 %    only be deactivated in the second argument.
+%
 %    \begin{macrocode}
 \@expandtwoargs\in@{B}\bbl at opt@safe
 \ifin@
@@ -5931,6 +6596,7 @@
     \@safe at activestrue\edef\@tempa{#2}\@safe at activesfalse
     \org@@citex[#1]{\@tempa}}
 %    \end{macrocode}
+%
 %    Unfortunately, the packages \pkg{natbib} and \pkg{cite} need a
 %    different definition of |\@citex|...
 %    To begin with, \pkg{natbib} has a definition for |\@citex| with
@@ -5937,10 +6603,12 @@
 %    \emph{three} arguments... We only know that a package is loaded
 %    when |\begin{document}| is executed, so we need to postpone the
 %    different redefinition.
+%
 %    \begin{macrocode}
   \AtBeginDocument{%
     \@ifpackageloaded{natbib}{%
 %    \end{macrocode}
+%
 %    Notice that we use |\def| here instead of |\bbl at redefine| because
 %    |\org@@citex| is already defined and we don't want to overwrite
 %    that definition (it would result in parameter stack overflow
@@ -5948,6 +6616,7 @@
 %
 %   (Recent versions of natbib change dynamically |\@citex|, so PR4087
 %     doesn't seem fixable in a simple way. Just load natbib before.)
+%
 %    \begin{macrocode}
     \def\@citex[#1][#2]#3{%
       \@safe at activestrue\edef\@tempa{#3}\@safe at activesfalse
@@ -5954,8 +6623,10 @@
       \org@@citex[#1][#2]{\@tempa}}%
     }{}}
 %    \end{macrocode}
+%
 %    The package \pkg{cite} has a definition of |\@citex| where the
 %    shorthands need to be turned off in both arguments.
+%
 %    \begin{macrocode}
   \AtBeginDocument{%
     \@ifpackageloaded{cite}{%
@@ -5963,15 +6634,18 @@
         \@safe at activestrue\org@@citex[#1]{#2}\@safe at activesfalse}%
       }{}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\nocite}
 %    The macro |\nocite| which is used to instruct BiB\TeX\ to
 %    extract uncited references from the database.
+%
 %    \begin{macrocode}
   \bbl at redefine\nocite#1{%
     \@safe at activestrue\org at nocite{#1}\@safe at activesfalse}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bibcite}
@@ -5985,46 +6659,61 @@
 %    determine during \file{.aux} file processing which definition of
 %    |\bibcite| is needed we define |\bibcite| in such a way that it
 %    redefines itself with the proper definition.
+%
 %    \begin{macrocode}
   \bbl at redefine\bibcite{%
 %    \end{macrocode}
+%
 %    We call |\bbl at cite@choice| to select the proper definition for
 %    |\bibcite|. This new definition is then activated.
+%
 %    \begin{macrocode}
     \bbl at cite@choice
     \bibcite}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at bibcite}
 %    The macro |\bbl at bibcite| holds the definition of |\bibcite|
 %    needed when neither \pkg{natbib} nor \pkg{cite} is loaded.
+%
 %    \begin{macrocode}
   \def\bbl at bibcite#1#2{%
     \org at bibcite{#1}{\@safe at activesfalse#2}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at cite@choice}
 %    The macro |\bbl at cite@choice| determines which definition of
 %    |\bibcite| is needed.
+%
 %    \begin{macrocode}
   \def\bbl at cite@choice{%
 %    \end{macrocode}
+%
 %    First we give |\bibcite| its default definition.
+%
 %    \begin{macrocode}
     \global\let\bibcite\bbl at bibcite
 %    \end{macrocode}
+%
 %    Then, when \pkg{natbib} is loaded we restore the original
 %    definition of |\bibcite|.
+%
 %    \begin{macrocode}
     \@ifpackageloaded{natbib}{\global\let\bibcite\org at bibcite}{}%
 %    \end{macrocode}
+%
 %    For \pkg{cite} we do the same.
+%
 %    \begin{macrocode}
     \@ifpackageloaded{cite}{\global\let\bibcite\org at bibcite}{}%
 %    \end{macrocode}
+%
 %    Make sure this only happens once.
+%
 %    \begin{macrocode}
     \global\let\bbl at cite@choice\relax}
 %    \end{macrocode}
@@ -6032,14 +6721,17 @@
 %    When a document is run for the first time, no \file{.aux} file is
 %    available, and |\bibcite| will not yet be properly defined. In
 %    this case, this has to happen before the document starts.
+%
 %    \begin{macrocode}
   \AtBeginDocument{\bbl at cite@choice}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\@bibitem}
 %    One of the two internal \LaTeX\ macros called by |\bibitem|
 %    that write the citation label on the |.aux| file.
+%
 %    \begin{macrocode}
   \bbl at redefine\@bibitem#1{%
     \@safe at activestrue\org@@bibitem{#1}\@safe at activesfalse}
@@ -6050,6 +6742,7 @@
   \let\org@@bibitem\@bibitem
 \fi
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \subsection{Marks}
@@ -6059,6 +6752,7 @@
 %    pass the current language attribute to the head lines, together
 %    with the text that is put into them. To achieve this we need to
 %    adapt the definition of |\markright| and |\markboth| somewhat.
+%
 % \changes{babel~3.8c}{2004/05/26}{No need to add \emph{anything} to
 %    an empty mark; prevented this by checking the contents of the
 %    argument}
@@ -6076,6 +6770,7 @@
 %    doing so, we make sure that active characters that may end up in
 %    the mark are not disabled by the output routine kicking in while
 %    \cs{@safe at activestrue} is in effect.
+%
 %    \begin{macrocode}
 \bbl at redefine\markright#1{%
   \bbl at ifblank{#1}%
@@ -6085,6 +6780,7 @@
        \\\org at markright{\\\protect\\\foreignlanguage{\languagename}%
          {\\\protect\\\bbl at restore@actives\the\toks@}}}}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\markboth}
@@ -6096,6 +6792,7 @@
 %    |\markboth| in |\@mkboth|. Therefore we need to check whether
 %    |\@mkboth| has already been set. If so we neeed to do that again
 %    with the new definition of |\markboth|.
+%
 % \changes{babel~3.8c}{2004/05/26}{No need to add \emph{anything} to
 %    an empty mark, prevented this by checking the contents of the
 %    arguments} 
@@ -6104,6 +6801,7 @@
 %    it into the token registers} 
 % \changes{babel~3.8j}{2008/03/21}{Added setting of \cs{@mkboth} (PR
 %    3826)} 
+%
 %    \begin{macrocode}
 \ifx\@mkboth\markboth
   \def\bbl at tempc{\let\@mkboth\markboth}
@@ -6111,7 +6809,9 @@
   \def\bbl at tempc{}
 \fi
 %    \end{macrocode}
+%
 %    Now we can start the new definition of |\markboth|
+%
 %    \begin{macrocode}
 \bbl at redefine\markboth#1#2{%
   \protected at edef\bbl at tempb##1{%
@@ -6124,10 +6824,13 @@
     {\@temptokena\expandafter{\bbl at tempb{#2}}}%
   \bbl at exp{\\\org at markboth{\the\toks@}{\the\@temptokena}}}
 %    \end{macrocode}
+%
 %    and copy it to |\@mkboth| if necessary.
+%
 %    \begin{macrocode}
 \bbl at tempc
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %
@@ -6136,8 +6839,10 @@
 %  \subsubsection{\pkg{ifthen}}
 %
 %  \begin{macro}{\ifthenelse}
-% \changes{babel~3.9a}{2012/09/07}{Redefine only if `ref' is `safe'}%
+%
+% \changes{babel~3.9a}{2012/09/07}{Redefine only if `ref' is `safe'}
 % \changes{babel~3.9a}{2013/01/03}{Moved to babel.def}
+%
 %    Sometimes a document writer wants to create a special effect
 %    depending on the page a certain fragment of text appears on. This
 %    can be achieved by the following piece of code:
@@ -6154,6 +6859,7 @@
 %    The first thing we need to do is check if the package
 %    \pkg{ifthen} is loaded. This should be done at |\begin{document}|
 %    time.
+%
 %    \begin{macrocode}
 \@expandtwoargs\in@{R}\bbl at opt@safe
 \ifin@
@@ -6160,16 +6866,21 @@
   \AtBeginDocument{%
     \@ifpackageloaded{ifthen}{%
 %    \end{macrocode}
+%
 %    Then we can redefine |\ifthenelse|:
+%
 % \changes{babel~3.9a}{2012/06/22}{\cs{ref} is also taken into account}
 % \changes{babel~3.9n}{2015/12/14}{Don't use generic temp
 %    macros. babel/4441}
+%
 %    \begin{macrocode}
       \bbl at redefine@long\ifthenelse#1#2#3{%
 %    \end{macrocode}
+%
 %    We want to revert the definition of |\pageref| and |\ref| to
 %    their original definition for the first argument of |\ifthenelse|,
 %    so we first need to store their current meanings.
+%
 %    \begin{macrocode}
         \let\bbl at temp@pref\pageref
         \let\pageref\org at pageref
@@ -6176,11 +6887,13 @@
         \let\bbl at temp@ref\ref
         \let\ref\org at ref
 %    \end{macrocode}
+%
 %    Then we can set the |\@safe at actives| switch and call the original
 %    |\ifthenelse|. In order to be able to use shorthands in the
 %    second and third arguments of |\ifthenelse| the resetting of the
 %    switch \emph{and} the definition of |\pageref| happens inside
 %    those arguments.  When the package wasn't loaded we do nothing.
+%
 %    \begin{macrocode}
         \@safe at activestrue
         \org at ifthenelse{#1}%
@@ -6196,6 +6909,7 @@
       }{}%
     }
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \subsubsection{\pkg{varioref}}
@@ -6203,12 +6917,15 @@
 %  \begin{macro}{\@@vpageref}
 %  \begin{macro}{\vrefpagenum}
 %  \begin{macro}{\Ref}
+%
 % \changes{babel~3.8g}{2005/05/21}{We also need to adapt \cs{Ref}
 %    which needs to be able to uppercase the first letter of the
-%    expansion of \cs{ref}} 
+%    expansion of \cs{ref}}
+%
 %    When the package varioref is in use we need to modify its
 %    internal command |\@@vpageref| in order to prevent problems when
 %    an active character ends up in the argument of |\vref|.
+%
 %    \begin{macrocode}
   \AtBeginDocument{%
     \@ifpackageloaded{varioref}{%
@@ -6217,7 +6934,9 @@
         \org@@@vpageref{#1}[#2]{#3}%
         \@safe at activesfalse}%
 %    \end{macrocode}
+%
 %    The same needs to happen for |\vrefpagenum|.
+%
 %    \begin{macrocode}
       \bbl at redefine\vrefpagenum#1#2{%
         \@safe at activestrue
@@ -6224,6 +6943,7 @@
         \org at vrefpagenum{#1}{#2}%
         \@safe at activesfalse}%
 %    \end{macrocode}
+%
 %    The package \pkg{varioref} defines |\Ref| to be a robust command
 %    wich uppercases the first character of the reference text. In
 %    order to be able to do that it needs to access the exandable form
@@ -6232,6 +6952,7 @@
 %    |\ref|. The disadvantgage of this solution is that whenever the
 %    derfinition of |\Ref| changes, this definition needs to be updated
 %    as well.
+%
 %    \begin{macrocode}
       \expandafter\def\csname Ref \endcsname#1{%
         \protected at edef\@tempa{\org at ref{#1}}\expandafter\MakeUppercase\@tempa}
@@ -6239,6 +6960,7 @@
     }
 \fi
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %  \end{macro}
@@ -6253,22 +6975,28 @@
 %    the `:' is an active character.
 %
 %    So at |\begin{document}| we check whether \pkg{hhline} is loaded.
+%
 %    \begin{macrocode}
 \AtEndOfPackage{%
   \AtBeginDocument{%
     \@ifpackageloaded{hhline}%
 %    \end{macrocode}
+%
 %    Then we check whether the expansion of |\normal at char:| is not
 %    equal to |\relax|.
+%
 % \changes{babel~3.8b}{2004/04/19}{added \cs{string} to prevent
 %    unwanted expansion of the colon}
+%
 %    \begin{macrocode}
       {\expandafter\ifx\csname normal at char\string:\endcsname\relax
        \else
 %    \end{macrocode}
+%
 %    In that case we simply reload the package. Note that this happens
 %    \emph{after} the category code of the @-sign has been changed to
 %    other, so we need to temporarily change it to letter again.
+%
 %    \begin{macrocode}
          \makeatletter
          \def\@currname{hhline}\input{hhline.sty}\makeatother
@@ -6275,11 +7003,13 @@
        \fi}%
       {}}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \subsubsection{\pkg{hyperref}}
 %
 %  \begin{macro}{\pdfstringdefDisableCommands}
+%
 % \changes{babel~3.8j}{2008/03/16}{Inform \pkg{hyperref} to use
 %    shorthands at system level (PR4006)}
 %
@@ -6296,6 +7026,7 @@
     \pdfstringdefDisableCommands{\languageshorthands{system}}%
   \fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \subsubsection{\pkg{fancyhdr}}
@@ -6307,10 +7038,12 @@
 %    marks can end up inside the argument of |\MakeUppercase|. To
 %    prevent unexpected results we need to define |\FOREIGNLANGUAGE|
 %    here.
+%
 %    \begin{macrocode}
 \DeclareRobustCommand{\FOREIGNLANGUAGE}[1]{%
   \lowercase{\foreignlanguage{#1}}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\substitutefontfamily}
@@ -6317,6 +7050,7 @@
 %    The command |\substitutefontfamily| creates an
 %    \file{.fd} file on the fly. The first argument is an encoding
 %    mnemonic, the second and third arguments are font family names.
+%
 %    \begin{macrocode}
 \def\substitutefontfamily#1#2#3{%
   \lowercase{\immediate\openout15=#1#2.fd\relax}%
@@ -6337,10 +7071,13 @@
   \closeout15
   }
 %    \end{macrocode}
+%
 %    This command should only be used in the preamble of a document.
+%
 %    \begin{macrocode}
 \@onlypreamble\substitutefontfamily
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \subsection{Encoding and fonts}
@@ -6357,10 +7094,12 @@
 %  loaded, or |OT1|.
 %
 %  \begin{macro}{\ensureascii}
+%
 % \changes{babel~3.9i}{2014/02/14}{Macro added, to replace
 %    \cs{textlatin} and friends}
 % \changes{babel~3.9j}{2014/03/17}{Moved mispaced code - it should be
 %    executed only with LaTeX}
+%
 %    \begin{macrocode}
 \newcommand\BabelNonASCII{LGR,X2,OT2,OT3,OT6,LHE,LWN,LMA,LMC,LMS,LMU,}
 \let\org at TeX\TeX
@@ -6368,11 +7107,10 @@
 \let\ensureascii\@firstofone
 \AtBeginDocument{%
   \in at false
-  \bbl at loopx\bbl at tempa\BabelNonASCII{% is there a non-ascii enc?
+  \bbl at foreach\BabelNonASCII{% is there a non-ascii enc?
     \ifin@\else
-      \edef\bbl at tempb{{,\bbl at tempa enc.def,}{,\@filelist,}}%
-      \lowercase\expandafter{\expandafter\in@\bbl at tempb}%
-    \fi}
+      \lowercase{\@expandtwoargs\in@{,#1enc.def,}{,\@filelist,}}%
+    \fi}%
   \ifin@ % if a non-ascii has been loaded
     \def\ensureascii#1{{\fontencoding{OT1}\selectfont#1}}%
     \DeclareTextCommandDefault{\TeX}{\org at TeX}%
@@ -6390,7 +7128,7 @@
              \def\ensureascii##1{{\fontencoding{#1}\selectfont##1}}%
            \fi}%
       \fi}%
-    \bbl at loopx\bbl at tempa\@filelist{\expandafter\bbl at tempb\bbl at tempa\@@}%
+    \bbl at foreach\@filelist{\bbl at tempb#1\@@}%  TODO - \@@ de mas??
     \@expandtwoargs\in@{,\cf at encoding,}{,\BabelNonASCII,}%
     \ifin@\else
       \edef\ensureascii#1{{%
@@ -6398,6 +7136,7 @@
     \fi
   \fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  Now comes the old deprecated stuff (with a little change in 3.9l,
@@ -6410,9 +7149,11 @@
 %    Roman numerals come out in the Latin encoding.
 %    So we first assume that the current encoding at the end
 %    of processing the package is the Latin encoding.
+%
 %    \begin{macrocode}
 \AtEndOfPackage{\edef\latinencoding{\cf at encoding}}
 %    \end{macrocode}
+%
 %    But this might be overruled with a later loading of the package
 %    \pkg{fontenc}. Therefore we check at the execution of
 %    |\begin{document}| whether it was loaded with the \Lopt{T1}
@@ -6420,11 +7161,13 @@
 %    disabled for this package. Now we have to revert to parsing the
 %    internal macro |\@filelist| which contains all the filenames
 %    loaded.
+%
 % \changes{babel~3.9l}{2014/08/02}{fontspec used to set
 %    \cs{latinencoding} to EUx, but now it doesn't. So, it's done
 %    here.}
 % \changes{babel~3.9o}{2016/01/27}{With fontspec, first check if
 %   \cs{UTFencname} exists.}
+%
 %    \begin{macrocode}
 \AtBeginDocument{%
   \@ifpackageloaded{fontspec}%
@@ -6441,6 +7184,7 @@
        \@ifl at aded{def}{t1enc}{\xdef\latinencoding{\bbl at t@one}}{}%
      \fi}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\latintext}
@@ -6447,11 +7191,13 @@
 %    Then we can define the command |\latintext| which is a
 %    declarative switch to a latin font-encoding. Usage of this macro
 %    is deprecated.
+%
 %    \begin{macrocode}
 \DeclareRobustCommand{\latintext}{%
   \fontencoding{\latinencoding}\selectfont
   \def\encodingdefault{\latinencoding}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\textlatin}
@@ -6458,6 +7204,7 @@
 %    This command takes an argument which is then typeset using the
 %    requested font encoding. In order to avoid many encoding switches
 %    it operates in a local scope.
+%
 %    \begin{macrocode}
 \ifx\@undefined\DeclareTextFontCommand
   \DeclareRobustCommand{\textlatin}[1]{\leavevmode{\latintext #1}}
@@ -6465,6 +7212,7 @@
   \DeclareTextFontCommand{\textlatin}{\latintext}
 \fi
 %    \end{macrocode}
+%
 % \end{macro}
 %
 % \subsection{Local Language Configuration}
@@ -6479,6 +7227,7 @@
 %
 %    For plain-based formats we don't want to override the definition
 %    of |\loadlocalcfg| from \file{plain.def}.
+%
 %    \begin{macrocode}
 \ifx\loadlocalcfg\@undefined
   \@ifpackagewith{babel}{noconfigs}%
@@ -6491,8 +7240,10 @@
         \@empty}}
 \fi
 %    \end{macrocode}
+%
 %    Just to be compatible with \LaTeX$\:$2.09 we add a few more lines
 %    of code:
+%
 %    \begin{macrocode}
 \ifx\@unexpandable at protect\@undefined
   \def\@unexpandable at protect{\noexpand\protect\noexpand}
@@ -6510,331 +7261,6 @@
 %    \end{macrocode}%
 %    \end{macro}
 %
-%    \section{Internationalizing \LaTeX{} 2.09}
-%
-%    Now that we're sure that the code is seen by \LaTeX\ only, we
-%    have to find out what the main (primary) document style is
-%    because we want to redefine some macros.  This is only necessary
-%    for releases of \LaTeX\ dated before December~1991. Therefore
-%    this part of the code can optionally be included in
-%    \file{babel.def} by specifying the \texttt{docstrip} option
-%    \texttt{names}.
-%
-%    The standard styles can be distinguished by checking whether some
-%    macros are defined. In table~\ref{styles} an overview is given of
-%    the macros that can be used for this purpose.
-%  \begin{table}[htb]
-%  \begin{center}
-% \DeleteShortVerb{\|}
-%  \begin{tabular}{|lcp{8cm}|}
-%   \hline
-%   article         & : & both the \verb+\chapter+ and \verb+\opening+
-%                         macros are undefined\\
-%   report and book & : & the \verb+\chapter+ macro is defined and
-%                         the \verb+\opening+ is undefined\\
-%   letter          & : & the \verb+\chapter+ macro is undefined and
-%                         the \verb+\opening+ is defined\\
-%   \hline
-%  \end{tabular}
-% \caption{How to determine the main document style}\label{styles}
-% \MakeShortVerb{\|}
-%  \end{center}
-%  \end{table}
-%
-%    \noindent The macros that have to be redefined for the
-%    \texttt{report} and \texttt{book} document styles happen to be
-%    the same, so there is no need to distinguish between those two
-%    styles.
-%
-%  \begin{macro}{\doc at style}
-%    First a parameter |\doc at style| is defined to identify the current
-%    document style. This parameter might have been defined by a
-%    document style that already uses macros instead of hard-wired
-%    texts, such as \file{artikel1.sty}~\cite{BEP}, so the existence of
-%    |\doc at style| is checked. If this macro is undefined, i.\,e., if
-%    the document style is unknown and could therefore contain
-%    hard-wired texts, |\doc at style| is defined to the default
-%    value~`0'.
-% \changes{babel~3.0d}{1991/10/29}{Removed use of \cs{@ifundefined}}
-%    \begin{macrocode}
-%<*names>
-\ifx\@undefined\doc at style
-  \def\doc at style{0}%
-%    \end{macrocode}
-%    This parameter is defined in the following \texttt{if}
-%    construction (see table~\ref{styles}):
-%
-%    \begin{macrocode}
-  \ifx\@undefined\opening
-    \ifx\@undefined\chapter
-      \def\doc at style{1}%
-    \else
-      \def\doc at style{2}%
-    \fi
-  \else
-    \def\doc at style{3}%
-  \fi%
-\fi%
-%    \end{macrocode}
-%  \end{macro}
-%
-% \changes{babel~3.1}{1991/11/05}{Removed definition of
-%    \cs{if at restonecol}}
-%
-%    Now here comes the real work: we start to redefine things and
-%    replace hard-wired texts by macros. These redefinitions should be
-%    carried out conditionally, in case it has already been done.
-%
-%    For the \texttt{figure} and \texttt{table} environments we have
-%    in all styles:
-%    \begin{macrocode}
-\@ifundefined{figurename}{\def\fnum at figure{\figurename{} \thefigure}}{}
-\@ifundefined{tablename}{\def\fnum at table{\tablename{} \thetable}}{}
-%    \end{macrocode}
-%
-%    The rest of the macros have to be treated differently for each
-%    style.  When |\doc at style| still has its default value nothing
-%    needs to be done.
-%    \begin{macrocode}
-\ifcase \doc at style\relax
-\or
-%    \end{macrocode}
-%
-%    This means that \file{babel.def} is read after the
-%    \texttt{article} style, where no |\chapter| and |\opening|
-%    commands are defined\footnote{A fact that was pointed out to me
-%    by Nico Poppelier and was already used in Piet van Oostrum's
-%    document style option~\texttt{nl}.}.
-%
-%    First we have the |\tableofcontents|,
-%    |\listoffigures| and |\listoftables|:
-%    \begin{macrocode}
-\@ifundefined{contentsname}%
-    {\def\tableofcontents{\section*{\contentsname\@mkboth
-          {\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
-      \@starttoc{toc}}}{}
-\@ifundefined{listfigurename}%
-    {\def\listoffigures{\section*{\listfigurename\@mkboth
-          {\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}%
-     \@starttoc{lof}}}{}
-\@ifundefined{listtablename}%
-    {\def\listoftables{\section*{\listtablename\@mkboth
-          {\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
-      \@starttoc{lot}}}{}
-%    \end{macrocode}
-%
-% Then the |\thebibliography| and |\theindex| environments.
-%
-%    \begin{macrocode}
-\@ifundefined{refname}%
-    {\def\thebibliography#1{\section*{\refname
-      \@mkboth{\uppercase{\refname}}{\uppercase{\refname}}}%
-      \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}%
-        \leftmargin\labelwidth
-        \advance\leftmargin\labelsep
-        \usecounter{enumi}}%
-        \def\newblock{\hskip.11em plus.33em minus.07em}%
-        \sloppy\clubpenalty4000\widowpenalty\clubpenalty
-        \sfcode`\.=1000\relax}}{}
-\@ifundefined{indexname}%
-    {\def\theindex{\@restonecoltrue\if at twocolumn\@restonecolfalse\fi
-     \columnseprule \z@
-     \columnsep 35pt\twocolumn[\section*{\indexname}]%
-       \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}%
-       \thispagestyle{plain}%
-       \parskip\z@ plus.3pt\parindent\z@\let\item\@idxitem}}{}
-%    \end{macrocode}
-%
-% The |abstract| environment:
-%
-%    \begin{macrocode}
-\@ifundefined{abstractname}%
-    {\def\abstract{\if at twocolumn
-    \section*{\abstractname}%
-    \else \small
-    \begin{center}%
-    {\bf \abstractname\vspace{-.5em}\vspace{\z@}}%
-    \end{center}%
-    \quotation
-    \fi}}{}
-%    \end{macrocode}
-%
-% And last but not least, the macro |\part|:
-%
-%    \begin{macrocode}
-\@ifundefined{partname}%
-{\def\@part[#1]#2{\ifnum \c at secnumdepth >\m at ne
-        \refstepcounter{part}%
-        \addcontentsline{toc}{part}{\thepart
-        \hspace{1em}#1}\else
-      \addcontentsline{toc}{part}{#1}\fi
-   {\parindent\z@ \raggedright
-    \ifnum \c at secnumdepth >\m at ne
-      \Large \bf \partname{} \thepart
-      \par \nobreak
-    \fi
-    \huge \bf
-    #2\markboth{}{}\par}%
-    \nobreak
-    \vskip 3ex\@afterheading}%
-}{}
-%    \end{macrocode}
-%
-%    This is all that needs to be done for the \texttt{article} style.
-%
-%    \begin{macrocode}
-\or
-%    \end{macrocode}
-%
-%    The next case is formed by the two styles \texttt{book} and
-%    \texttt{report}.  Basically we have to do the same as for the
-%    \texttt{article} style, except now we must also change the
-%    |\chapter| command.
-%
-%    The tables of contents, figures and tables:
-%    \begin{macrocode}
-\@ifundefined{contentsname}%
-    {\def\tableofcontents{\@restonecolfalse
-      \if at twocolumn\@restonecoltrue\onecolumn
-      \fi\chapter*{\contentsname\@mkboth
-          {\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
-      \@starttoc{toc}%
-      \csname if at restonecol\endcsname\twocolumn
-      \csname fi\endcsname}}{}
-\@ifundefined{listfigurename}%
-    {\def\listoffigures{\@restonecolfalse
-      \if at twocolumn\@restonecoltrue\onecolumn
-      \fi\chapter*{\listfigurename\@mkboth
-          {\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}%
-      \@starttoc{lof}%
-      \csname if at restonecol\endcsname\twocolumn
-      \csname fi\endcsname}}{}
-\@ifundefined{listtablename}%
-    {\def\listoftables{\@restonecolfalse
-      \if at twocolumn\@restonecoltrue\onecolumn
-      \fi\chapter*{\listtablename\@mkboth
-          {\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
-      \@starttoc{lot}%
-      \csname if at restonecol\endcsname\twocolumn
-      \csname fi\endcsname}}{}
-%    \end{macrocode}
-%
-%    Again, the |bibliography| and |index| environments; notice that
-%    in this case we use |\bibname| instead of |\refname| as in the
-%    definitions for the \texttt{article} style.  The reason for this
-%    is that in the \texttt{article} document style the term
-%    `References' is used in the definition of |\thebibliography|. In
-%    the \texttt{report} and \texttt{book} document styles the term
-%    `Bibliography' is used.
-%    \begin{macrocode}
-\@ifundefined{bibname}%
-    {\def\thebibliography#1{\chapter*{\bibname
-     \@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}%
-     \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}%
-     \leftmargin\labelwidth \advance\leftmargin\labelsep
-     \usecounter{enumi}}%
-     \def\newblock{\hskip.11em plus.33em minus.07em}%
-     \sloppy\clubpenalty4000\widowpenalty\clubpenalty
-     \sfcode`\.=1000\relax}}{}
-\@ifundefined{indexname}%
-    {\def\theindex{\@restonecoltrue\if at twocolumn\@restonecolfalse\fi
-    \columnseprule \z@
-    \columnsep 35pt\twocolumn[\@makeschapterhead{\indexname}]%
-      \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}%
-    \thispagestyle{plain}%
-    \parskip\z@ plus.3pt\parindent\z@ \let\item\@idxitem}}{}
-%    \end{macrocode}
-%
-% Here is the |abstract| environment:
-%    \begin{macrocode}
-\@ifundefined{abstractname}%
-    {\def\abstract{\titlepage
-    \null\vfil
-    \begin{center}%
-    {\bf \abstractname}%
-    \end{center}}}{}
-%    \end{macrocode}
-%
-%     And last but not least the |\chapter|, |\appendix| and
-%    |\part| macros.
-%    \begin{macrocode}
-\@ifundefined{chaptername}{\def\@chapapp{\chaptername}}{}
-%
-\@ifundefined{appendixname}%
-    {\def\appendix{\par
-      \setcounter{chapter}{0}%
-      \setcounter{section}{0}%
-      \def\@chapapp{\appendixname}%
-      \def\thechapter{\Alph{chapter}}}}{}
-%
-\@ifundefined{partname}%
-    {\def\@part[#1]#2{\ifnum \c at secnumdepth >-2\relax
-            \refstepcounter{part}%
-            \addcontentsline{toc}{part}{\thepart
-            \hspace{1em}#1}\else
-            \addcontentsline{toc}{part}{#1}\fi
-       \markboth{}{}%
-       {\centering
-        \ifnum \c at secnumdepth >-2\relax
-          \huge\bf \partname{} \thepart
-        \par
-        \vskip 20pt \fi
-        \Huge \bf
-        #1\par}\@endpart}}{}%
-%    \end{macrocode}
-%
-%    \begin{macrocode}
-\or
-%    \end{macrocode}
-%
-%    Now we address the case where \file{babel.def} is read after the
-%    \texttt{letter} style. The \texttt{letter} document style
-%    defines the macro |\opening| and some other macros that are
-%    specific to \texttt{letter}. This means that we have to redefine
-%    other macros, compared to the previous two cases.
-%
-%    First two macros for the material at the end of a letter, the
-%    |\cc| and |\encl| macros.
-%    \begin{macrocode}
-\@ifundefined{ccname}%
-    {\def\cc#1{\par\noindent
-     \parbox[t]{\textwidth}%
-     {\@hangfrom{\rm \ccname : }\ignorespaces #1\strut}\par}}{}
-\@ifundefined{enclname}%
-    {\def\encl#1{\par\noindent
-     \parbox[t]{\textwidth}%
-     {\@hangfrom{\rm \enclname : }\ignorespaces #1\strut}\par}}{}
-%    \end{macrocode}
-%
-%    The last thing we have to do here is to redefine the
-%    \texttt{headings} pagestyle:
-% \changes{babel~3.3}{1993/07/11}{\cs{headpagename} should be
-%    \cs{pagename}}
-%    \begin{macrocode}
-\@ifundefined{headtoname}%
-  {\def\ps at headings{%
-     \def\@oddhead{\sl \headtoname{} \ignorespaces\toname \hfil
-                      \@date \hfil \pagename{} \thepage}%
-     \def\@oddfoot{}}}{}
-%    \end{macrocode}
-%
-%    This was the last of the four standard document styles, so if
-%    |\doc at style| has another value we do nothing and just close the
-%    \texttt{if} construction.
-%    \begin{macrocode}
-\fi
-%</names>
-%    \end{macrocode}
-%    Here ends the code that can be optionally included when a version
-%    of \LaTeX\ is in use that is dated \emph{before} December~1991.
-%
-%
-%    We also need to redefine a number of commands to ensure that the
-%    right font encoding is used, but this can't be done before
-%    \file{babel.def} is loaded.
-% \changes{babel~3.6o}{1999/04/07}{Moved the rest of the font encoding
-%    related definitions to their original place}
-%
 % \section{Multiple languages}
 %
 %    Plain \TeX\ version~3.0 provides the primitive |\language| that
@@ -6841,6 +7267,7 @@
 %    is used to store the current language. When used with a pre-3.0
 %    version this function has to be implemented by allocating a
 %    counter.
+%
 %    \begin{macrocode}
 %<*kernel>
 <@Make sure ProvidesFile is defined@>
@@ -6853,6 +7280,7 @@
 %    The macro |\adddialect| can be used to add the name of a dialect
 %    or variant language, for which an already defined hyphenation
 %    table can be used.
+%
 %    \begin{macrocode}
 \def\bbl at version{<@version@>}
 \def\bbl at date{<@date@>}
@@ -6861,7 +7289,9 @@
   \bbl at usehooks{adddialect}{{#1}{#2}}%
   \wlog{\string#1 = a dialect from \string\language#2}}
 %    \end{macrocode}
+%
 %  \end{macro}
+%
 % \changes{babel~3.9a}{2012/09/07}{Added macro}
 % \changes{babel~3.9a}{2013/01/23}{New macro to normalize 
 %    a macro (eg, \cs{languagename}) to lowercase if necessary}
@@ -6877,6 +7307,7 @@
 %    named |MYLANG|, but unfortunately mixed case names cannot be
 %    trapped). Note |l@| is encapsulated, so that its case does not
 %    change.
+%
 %    \begin{macrocode}
 \def\bbl at fixname#1{%
   \begingroup
@@ -6905,6 +7336,7 @@
 %    compares the first argument with the value of |\language|. Then,
 %    depending on the result of the comparison, it executes either the
 %    second or the third argument.
+%
 %    \begin{macrocode}
 \def\iflanguage#1{%
   \bbl at iflanguage{#1}{%
@@ -6914,6 +7346,7 @@
       \expandafter\@secondoftwo
     \fi}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %   \subsection{Selecting the language}
@@ -6948,6 +7381,7 @@
 %
 % \changes{babel~3.9a}{2012/11/16}{\cs{bbl at select@type} keep tracks of
 %    the selection method: 0 is select, 1 is foreign}
+%
 %    \begin{macrocode}
 \let\bbl at select@type\z@
 \edef\selectlanguage{%
@@ -6954,13 +7388,16 @@
   \noexpand\protect
   \expandafter\noexpand\csname selectlanguage \endcsname}
 %    \end{macrocode}
+%
 %    Because the command |\selectlanguage| could be used in a moving
 %    argument it expands to \verb*=\protect\selectlanguage =.
 %    Therefore, we have to make sure that a macro |\protect| exists.
 %    If it doesn't it is |\let| to |\relax|.
+%
 %    \begin{macrocode}
 \ifx\@undefined\protect\let\protect\relax\fi
 %    \end{macrocode}
+%
 %    As \LaTeX$\:$2.09 writes to files \textit{expanded} whereas
 %    \LaTeXe\ takes care \textit{not} to expand the arguments of
 %    |\write| statements we need to be a bit clever about the way we
@@ -6967,6 +7404,7 @@
 %    add information to \file{.aux} files. Therefore we introduce the
 %    macro |\xstring| which should expand to the right amount of
 %    |\string|'s.
+%
 %    \begin{macrocode}
 \ifx\documentclass\@undefined
   \def\xstring{\string\string\string}
@@ -6974,6 +7412,7 @@
   \let\xstring\string
 \fi
 %    \end{macrocode}
+%
 % \end{macro}
 %
 %    Since version 3.5 \babel\ writes entries to the auxiliary files in
@@ -6995,9 +7434,11 @@
 %    that case we need to keep track of the nested languages using a
 %    stack mechanism. This stack is called |\bbl at language@stack| and
 %    initially empty.
+%
 %    \begin{macrocode}
 \def\bbl at language@stack{}
 %    \end{macrocode}
+%
 %    When using a stack we need a mechanism to push an element on the
 %    stack and to retrieve the information afterwards.
 %  \begin{macro}{\bbl at push@language}
@@ -7004,10 +7445,12 @@
 %  \begin{macro}{\bbl at pop@language}
 %    The stack is simply a list of languagenames, separated with a `+'
 %    sign; the push function can be simple:
+%
 %    \begin{macrocode}
 \def\bbl at push@language{%
   \xdef\bbl at language@stack{\languagename+\bbl at language@stack}}
 %    \end{macrocode}
+%
 %    Retrieving information from the stack is a little bit less simple,
 %    as we need to remove the element from the stack while storing it
 %    in the macro |\languagename|. For this we first define a helper function.
@@ -7015,10 +7458,12 @@
 %    This macro stores its first element (which is delimited by the
 %    `+'-sign) in |\languagename| and stores the rest of the string
 %    (delimited by `-') in its third argument.
+%
 %    \begin{macrocode}
 \def\bbl at pop@lang#1+#2-#3{%
   \edef\languagename{#1}\xdef#3{#2}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %    The reason for the somewhat weird arrangement of arguments to the
 %    helper function is the fact it is called in the following way.
@@ -7029,11 +7474,13 @@
 %    (zero language names won't occur as this macro will only be
 %    called after something has been pushed on the stack) followed by
 %    the `-'-sign and finally the reference to the stack.
+%
 %    \begin{macrocode}
 \def\bbl at pop@language{%
   \expandafter\bbl at pop@lang\bbl at language@stack-\bbl at language@stack
   \expandafter\bbl at set@language\expandafter{\languagename}}
 %    \end{macrocode}
+%
 %    Once the name of the previous language is retrieved from the stack,
 %    it is fed to |\bbl at set@language| to do the actual work of
 %    switching everything that needs switching.
@@ -7048,6 +7495,7 @@
   \aftergroup\bbl at pop@language
   \bbl at set@language{#1}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at set@language}
@@ -7065,6 +7513,7 @@
 %
 %    We also write a command to change the current language in the
 %    auxiliary files.
+%
 % \changes{babel~3.9a}{2012/09/09}{Added hook}
 % \changes{babel~3.9a}{2012/11/07}{Use a loop for contents files, with
 %    the help of \cs{BabelContentsFiles}}
@@ -7071,6 +7520,7 @@
 % \changes{babel~3.9a}{2013/03/08}{Don't write to aux if language is
 %    unknown}
 % \changes{babel~3.9h}{2013/11/20}{Error with a more helpful text }
+%
 %    \begin{macrocode}
 \def\BabelContentsFiles{toc,lof,lot}
 \def\bbl at set@language#1{%
@@ -7081,8 +7531,8 @@
   \expandafter\ifx\csname date\languagename\endcsname\relax\else
     \if at filesw
       \protected at write\@auxout{}{\string\select at language{\languagename}}%
-      \bbl at for\bbl at tempa\BabelContentsFiles{%
-        \addtocontents{\bbl at tempa}{\xstring\select at language{\languagename}}}%
+      \bbl at foreach\BabelContentsFiles{%
+        \addtocontents{##1}{\xstring\select at language{\languagename}}}%
       \bbl at usehooks{write}{}%
     \fi
   \fi}
@@ -7110,11 +7560,13 @@
 %    \begin{macrocode}
 \let\select at language@x\select at language
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %    First, check if the user asks for a known language. If so,
 %    update the value of |\language| and call |\originalTeX|
 %    to bring \TeX\ in a certain pre-defined state.
+%
 % \changes{babel~3.8l}{2008/07/06}{Use \cs{bbl at patterns}}
 % \changes{babel~3.9a}{2012/07/27}{Moved \cs{bbl at patterns} to the
 %    correct place, after setting the extras for the current
@@ -7121,8 +7573,7 @@
 %    language}
 % \changes{babel~3.9a}{2012/08/01}{Created \cs{bbl at switch} with code
 %    shared by \cs{select at language} and \cs{foreing at language}}
-%    \begin{macrocode}
-%    \end{macrocode}
+%
 %    The name of the language is stored in the control sequence
 %    |\languagename|.
 %
@@ -7138,13 +7589,14 @@
 %    macros. \nb{What if \cs{hyphenation} was used in |extras|? Patch
 %    temply set at hyphenmins and hyphenation. It can be done in hooks if
 %    necessary.}
-% \changes{babel~3.9c}{2013/04/08}{Removed an extra empty line}
 %
+%
 %    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
 %    defined. If it is not, we set default values (2 and 3), otherwise
 %    the values in |\|\langvar|hyphenmins| will be used.
+%
 % \changes{babel~3.9a}{2012/08/01}{Adddd \cs{bbl at iflanguagename} and
 %   \cs{select at language@x}, which is no-op if the language is the same}
 % \changes{babel~3.9a}{2013/01/23}{\cs{select at language} sets 
@@ -7152,9 +7604,11 @@
 %   file (eg, shorthand expansion was wrong)}
 % \changes{babel~3.9a}{2012/08/14}{Make sure the save counter is reset
 %    even if \cs{originalTeX} is used in other contexts}
+% \changes{babel~3.9c}{2013/04/08}{Removed an extra empty line}
 % \changes{babel~3.9h}{2013/11/29}{Use \cs{def} instead of
 %    \cs{renewcommand} for \cs{BabelLower}}
 % \changes{babel~3.9i}{2014/03/04}{Added `afterreset' hook}
+%
 %    \begin{macrocode}
 \def\bbl at switch#1{%
   \originalTeX
@@ -7171,14 +7625,14 @@
   \bbl at usehooks{beforeextras}{}%
   \csname extras#1\endcsname\relax
   \bbl at usehooks{afterextras}{}%
-  \ifcase\bbl at hymapopt\or
+  \ifcase\bbl at opt@hyphenmap\or
     \def\BabelLower##1##2{\lccode##1=##2\relax}%
     \ifnum\bbl at hymapsel>4\else
       \csname\languagename @bbl at hyphenmap\endcsname
     \fi
-    \chardef\bbl at hymapopt\z@
+    \chardef\bbl at opt@hyphenmap\z@
   \else
-    \ifnum\bbl at hymapsel>\bbl at hymapopt\else
+    \ifnum\bbl at hymapsel>\bbl at opt@hyphenmap\else
       \csname\languagename @bbl at hyphenmap\endcsname
     \fi
   \fi
@@ -7206,7 +7660,9 @@
 %    \verb*=\selectlanguage = to switch on everything that is needed for
 %    this language The |\ignorespaces| command is necessary to hide
 %    the environment when it is entered in horizontal mode.
+%
 % \changes{babel~3.9a}{2012/07/31}{Removed \cs{originalTeX}}
+%
 %    \begin{macrocode}
 \long\def\otherlanguage#1{%
   \ifnum\bbl at hymapsel=\@cclv\let\bbl at hymapsel\thr@@\fi
@@ -7213,12 +7669,15 @@
   \csname selectlanguage \endcsname{#1}%
   \ignorespaces}
 %    \end{macrocode}
+%
 %    The |\endotherlanguage| part of the environment tries to hide
 %    itself when it is called in horizontal mode.
+%
 %    \begin{macrocode}
 \long\def\endotherlanguage{%
   \global\@ignoretrue\ignorespaces}
 %    \end{macrocode}
+%
 %  \end{environment}
 %
 %  \begin{environment}{otherlanguage*}
@@ -7226,17 +7685,21 @@
 %    large part of text from a different language needs to be typeset,
 %    but without changing the translation of words such as `figure'.
 %    This environment makes use of |\foreign at language|.
+%
 %    \begin{macrocode}
 \expandafter\def\csname otherlanguage*\endcsname#1{%
   \ifnum\bbl at hymapsel=\@cclv\chardef\bbl at hymapsel4\relax\fi
   \foreign at language{#1}}
 %    \end{macrocode}
+%
 %    At the end of the environment we need to switch off the extra
 %    definitions. The grouping mechanism of the environment will take
 %    care of resetting the correct hyphenation rules and ``extras''.
+%
 %    \begin{macrocode} 
 \expandafter\let\csname endotherlanguage*\endcsname\relax
 %    \end{macrocode}
+%
 %  \end{environment}
 %
 %  \begin{macro}{\foreignlanguage}
@@ -7251,6 +7714,7 @@
 %    a group and assumes the |\extras|\langvar\ command doesn't make
 %    any |\global| changes. The coding is very similar to part of
 %    |\selectlanguage|.
+%
 % \changes{babel~3.9a}{2012/07/30}{Removed unnecesary \cs{noextras}
 %    just before closing the group}
 % \changes{babel~3.9a}{2012/07/31}{Moved \cs{originalTeX} to
@@ -7258,6 +7722,7 @@
 %    \texttt{otherlanguage*}}
 % \changes{babel~3.9a}{2012/12/24}{\cs{foreignlanguage} defined
 %    similarly to \cs{selectlanguage}, protecting the whole macro}
+%
 %    \begin{macrocode}
 \edef\foreignlanguage{%
   \noexpand\protect
@@ -7268,6 +7733,7 @@
     #2%
   \endgroup}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\foreign at language}
@@ -7276,8 +7742,10 @@
 %    environment. First we need to store the name of the language and
 %    check that it is a known language. Then it just calls
 %    |bbl at switch|.
+%
 % \changes{babel~3.9h}{2013/11/29}{The warning shows the language
 %    actually selected (with fixed case)}
+%
 %    \begin{macrocode}
 \def\foreign at language#1{%
   \edef\languagename{#1}%
@@ -7295,14 +7763,17 @@
     \let\bbl at select@type\@ne
     \expandafter\bbl at switch\expandafter{\languagename}}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\bbl at patterns}
+%
 % \changes{babel~3.8l}{2008/07/06}{Macro added}
 % \changes{babel~3.9a}{2012/08/28}{Extended to set hyphenation
 %    exceptions as defined with \cs{babelhyphenation}}
 % \changes{babel~3.9m}{2015/07/25}{Preset \cs{bbl at pttnlist} and
-%    \cs{bbl at patterns@} to relax, for luatex.} 
+%    \cs{bbl at patterns@} to relax, for luatex.}
+%
 %    This macro selects the hyphenation patterns by changing the
 %    \cs{language} register.  If special hyphenation patterns
 %    are available specifically for the current font encoding,
@@ -7316,6 +7787,7 @@
 %    |:ENC| is taken into account) has been set, then use
 %    |\hyphenation| with both global and language exceptions and empty
 %    the latter to mark they must not be set again.
+%
 %    \begin{macrocode}
 \let\bbl at hyphlist\@empty
 \let\bbl at hyphenation@\relax
@@ -7345,6 +7817,7 @@
       \fi
     \endgroup}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{environment}{hyphenrules}
@@ -7354,9 +7827,11 @@
 %    specified were not loaded it has no effect. Note however,
 %    |\lccode|'s and font encodings are not set at all, so in most
 %    cases you should use |otherlanguage*|.
+%
 % \changes{babel~3.8j}{2008/03/16}{Also set the hyphenmin parameters to
 %    the correct value (PR3997)} 
 % \changes{babel~3.8l}{2008/07/06}{Use \cs{bbl at patterns}}
+%
 %    \begin{macrocode}
 \def\hyphenrules#1{%
   \edef\languagename{#1}%
@@ -7372,6 +7847,7 @@
     \fi}}
 \let\endhyphenrules\@empty
 %    \end{macrocode}
+%
 %  \end{environment}
 %
 %  \begin{macro}{\providehyphenmins}
@@ -7380,6 +7856,7 @@
 %    hyphenation parameters |\lefthyphenmin| and |\righthyphenmin|. If
 %    the macro |\|\langvar|hyphenmins| is already defined this command
 %    has no effect.
+%
 %    \begin{macrocode}
 \def\providehyphenmins#1#2{%
   \expandafter\ifx\csname #1hyphenmins\endcsname\relax
@@ -7386,14 +7863,17 @@
     \@namedef{#1hyphenmins}{#2}%
   \fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\set at hyphenmins}
 %    This macro sets the values of |\lefthyphenmin| and
 %    |\righthyphenmin|. It expects two values as its argument.
+%
 %    \begin{macrocode}
 \def\set at hyphenmins#1#2{\lefthyphenmin#1\relax\righthyphenmin#2\relax}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\ProvidesLanguage}
@@ -7405,9 +7885,11 @@
 %
 %    Depending on the format, ie, on if the former is defined, we use
 %    a similar definition or not.
+%
 %    \changes{babel~3.9a}{2012/12/09}{Save info about the babel
 %    version in the format (switch.def) so that it can be checked
 %    later if necessary}
+%
 %    \begin{macrocode}
 \ifx\ProvidesFile\@undefined
   \def\ProvidesLanguage#1[#2 #3 #4]{%
@@ -7426,6 +7908,7 @@
     \endgroup}
 \fi
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\LdfInit}
@@ -7438,6 +7921,7 @@
 %    The category code of the ampersand is restored and the macro
 %    calls itself again with the new definition from
 %    \file{babel.def}
+%
 %    \begin{macrocode}
 \def\LdfInit{%
   \chardef\atcatcode=\catcode`\@
@@ -7446,6 +7930,7 @@
   \catcode`\@=\atcatcode \let\atcatcode\relax
   \LdfInit}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\originalTeX}
@@ -7452,20 +7937,26 @@
 %    The macro|\originalTeX| should be known to \TeX\ at this moment.
 %    As it has to be expandable we |\let| it to |\@empty| instead of
 %    |\relax|.
+%
 %    \begin{macrocode}
 \ifx\originalTeX\@undefined\let\originalTeX\@empty\fi
 %    \end{macrocode}
+%
 %    Because this part of the code can be included in a format, we
 %    make sure that the macro which initialises the save mechanism,
 %    |\babel at beginsave|, is not considered to be undefined.
+%
 %    \begin{macrocode}
 \ifx\babel at beginsave\@undefined\let\babel at beginsave\relax\fi
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 % A few macro names are reserved for future releases of \babel, which
 % will use the concept of `locale':
-% \changes{babel~3.9s}{2017/04/13}{Reserved macros}
+%
+% \changes{babel~3.9s}{2017/04/13}{Reserved macro names for `locale'}
+%
 %    \begin{macrocode}
 \newcommand\setlocale{%
   \bbl at error
@@ -7497,10 +7988,12 @@
 %    When the format knows about |\PackageError| it must be \LaTeXe,
 %    so we can safely use its error handling interface. Otherwise
 %    we'll have to `keep it simple'.
+%
 % \changes{babel~3.9a}{2012/07/30}{\cs{newcommand}s replaced by
 %    \cs{def}'s, so that the file can be loaded twice}
 % \changes{babel~3.9a}{2013/01/26}{Define generic variants instead of
 %    duplicating each predefined message}    
+%
 %    \begin{macrocode}
 \edef\bbl at nulllanguage{\string\language=0}
 \ifx\PackageError\@undefined
@@ -7543,6 +8036,14 @@
   {\let\bbl at info\@gobble
    \let\bbl at warning\@gobble}
   {}
+\def\bbl at nocaption#1#2{% 1: text to be printed 2: caption macro \langXname
+  \gdef#2{\textbf{?#1?}}%
+  #2%
+  \bbl at warning{%
+    \string#2 not set. Please, define\\%
+    it in the preamble with something like:\\%
+    \string\renewcommand\string#2{..}\\%
+    Reported}}
 \def\@nolanerr#1{%
   \bbl at error
     {You haven't defined the language #1\space yet}%
@@ -7557,6 +8058,7 @@
 \let\bbl at usehooks\@gobbletwo
 %</kernel>
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %  \end{macro}
@@ -7572,6 +8074,7 @@
 %    |toks8| stores info to be shown when the program is run.
 %
 % \changes{babel~3.9g}{2013/05/30}{Code moved from plain.def}
+%
 %    We want to add a message to the message \LaTeX$\:$2.09 puts in
 %    the |\everyjob| register. This could be done by the following
 %    code: 
@@ -7645,8 +8148,10 @@
 %    When the first token of a line is an \texttt{=}, the macro
 %    |\process at synonym| is called; otherwise the macro
 %    |\process at language| will continue.
+%
 % \changes{babel~3.9a}{2012/12/12}{Use spaces as delimiters, to avoid
 %    extra spaces. Once parsed, pass them in the traditional way}
+%
 %    \begin{macrocode}   
 \def\process at line#1#2 #3 #4 {%
   \ifx=#1%
@@ -7656,6 +8161,7 @@
   \fi
   \ignorespaces}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\process at synonym}
@@ -7663,10 +8169,12 @@
 %    This macro takes care of the lines which start with an
 %    \texttt{=}. It needs an empty token register to begin with.
 %    |\bbl at languages| is also set to empty. 
+%
 %    \begin{macrocode}
 \toks@{}
 \def\bbl at languages{}
 %    \end{macrocode}
+%
 %    When no languages have been loaded yet, the name following the
 %    \texttt{=} will be a synonym for hyphenation register 0. So, it is stored
 %    in a token register and executed when the first pattern file has
@@ -7676,7 +8184,9 @@
 %    Otherwise the name will be a synonym for the language loaded last.
 %
 %    We also need to copy the hyphenmin parameters for the synonym.
+%
 % \changes{babel~3.9a}{2012/06/25}{Added \cs{bbl at languages}}
+%
 %    \begin{macrocode}
 \def\process at synonym#1{%
   \ifnum\last at language=\m at ne
@@ -7690,6 +8200,7 @@
     \edef\bbl at languages{\bbl at languages\bbl at elt{#1}{\the\last at language}{}{}}%
   \fi}
 %    \end{macrocode}
+%
 %  \end{macro}
 %
 %  \begin{macro}{\process at language}
@@ -7705,6 +8216,7 @@
 %    Then the `name' of the language that will be loaded now is
 %    added to the token register |\toks8|. and finally
 %    the pattern file is read.
+%
 % \changes{babel~3.9a}{2012/12/10}{Removed \cs{selectfont} (I presume
 %    it was intended to catch wrong encoding codes, but I don't think
 %    this is necessary and as a side effect it might preload fonts)}
@@ -7740,7 +8252,8 @@
 %
 % \changes{babel~3.9a}{2012/06/25}{Added \cs{bbl at languages}}
 % \changes{babel~3.9f}{2013/05/16}{Restored code to set default
-%    hyphenmins, which was deleted mistakenly} 
+%    hyphenmins, which was deleted mistakenly}
+%
 %    \cs{bbl at languages} saves a snapshot of the loaded languagues in the
 %    form  \cs{bbl at elt}\marg{language-name}\marg{number}%
 %    \marg{patterns-file}\marg{exceptions-file}. Note the last 2
@@ -7749,6 +8262,7 @@
 %
 %    Finally, if the counter |\language| is equal to zero we execute the
 %    synonyms stored.
+%
 %    \begin{macrocode}
 \def\process at language#1#2#3{%
   \expandafter\addlanguage\csname l@#1\endcsname
@@ -7785,14 +8299,18 @@
 %    \end{macrocode}
 %
 %  \begin{macro}{\bbl at get@enc}
-% \changes{babel~3.9a}{2012/12/11}{Code much simplified}
+%
+%   \changes{babel~3.9a}{2012/12/11}{Code much simplified}
+%
 %  \begin{macro}{\bbl at hyph@enc}
 %    The macro |\bbl at get@enc| extracts the font encoding from the
 %    language name and stores it in |\bbl at hyph@enc|. It uses delimited
 %    arguments to achieve this.
+%
 %    \begin{macrocode}
 \def\bbl at get@enc#1:#2:#3\@@@{\def\bbl at hyph@enc{#2}}
 %    \end{macrocode}
+%
 %  \end{macro}
 %  \end{macro}
 %  \end{macro}
@@ -7800,8 +8318,10 @@
 %    Now, hooks are defined. For efficiency reasons, they are dealt
 %    here in a special way. Besides \luatex, format specific
 %    configuration files are taken into account.
+%
 % \changes{babel~3.9b}{2013/03/25}{Fixed an idiot slip: \cs{def}
 %   intead of \cs{let}}
+%
 %    \begin{macrocode}
 \def\bbl at hook@everylanguage#1{}
 \def\bbl at hook@loadpatterns#1{\input #1\relax}
@@ -7831,8 +8351,10 @@
 \endgroup
 \bbl at hook@loadkernel{switch.def}
 %    \end{macrocode}
+%
 %  \begin{macro}{\readconfigfile}
 %    The configuration file can now be opened for reading.
+%
 %    \begin{macrocode}
 \openin1 = language.dat
 %    \end{macrocode}
@@ -7897,9 +8419,11 @@
 %    \end{macrocode}
 %
 %    Check for the end of the file. We must reverse the test for
-%    |\ifeof| without |\else|. Then reactivate the default patterns,
+%    |\ifeof| without |\else|. Then reactivate the default patterns.
+%
 % \changes{babel~3.8m}{2008/07/08}{Also restore the name of the
 %    language in \cs{languagename} (PR 4039)} 
+%
 %    \begin{macrocode}
   \begingroup
     \def\bbl at elt#1#2#3#4{%
@@ -7910,7 +8434,9 @@
   \endgroup
 \fi
 %    \end{macrocode}
+%
 %    and close the configuration file.
+%
 %    \begin{macrocode}
 \closein1
 %    \end{macrocode}
@@ -7918,6 +8444,7 @@
 %    We add a message about the fact that babel is loaded in the
 %    format and with which language patterns to the \cs{everyjob}
 %    register.
+%
 % \changes{babel~3.9a}{2012/09/25}{The list of languages is not
 %    printed every job any more (it is saved in \cs{bbl at languages}).} 
 % \changes{babel~3.9g}{2013/07/28}{In non-LaTeX formats the number of
@@ -7925,6 +8452,7 @@
 %    now \cs{toks}8 is expanded here.} 
 % \changes{babel~3.9o}{2016/01/25}{The number of languages loaded was
 %    off by 1.} 
+%
 %    \begin{macrocode}
 \if/\the\toks@/\else
   \errhelp{language.dat loads no language, only synonyms}
@@ -7943,11 +8471,15 @@
 \advance\last at language\m at ne
 \bbl at tempa
 %    \end{macrocode}
+%
 %    Also remove some macros from memory and raise an error
 %    if |\toks@| is not empty. Finally load \file{switch.def}, but the
-%    letter is not required and the line inputting it may be commented out.
+%    letter is not required and the line inputting it may be commented
+%    out.
+%
 % \changes{babel~3.9a}{2012/12/11}{Raise error if there are synonyms
 %    without languages}
+%
 %    \begin{macrocode}
 \let\bbl at line\@undefined
 \let\process at line\@undefined
@@ -7962,6 +8494,7 @@
 \let\bbl at hook@loadexceptions\@undefined
 %</patterns>
 %    \end{macrocode}
+%
 %    Here the code for ini\TeX\ ends.
 %  \end{macro}
 %
@@ -7976,6 +8509,7 @@
 %    The macro |\LdfInit| takes care of preventing that this file is
 %    loaded more than once, checking the category code of the
 %    \texttt{@} sign, etc.
+%
 %    \begin{macrocode}
 %<*nil>
 \ProvidesLanguage{nil}[<@date@> <@version@> Nil language]
@@ -7985,6 +8519,7 @@
 %    When this file is read as an option, i.e. by the |\usepackage|
 %    command, \texttt{nil} could be an `unknown' language in which
 %    case we have to make it known. 
+%
 %    \begin{macrocode}
 \ifx\l at nohyphenation\@undefined
    \@nopatterns{nil}
@@ -7993,8 +8528,10 @@
    \let\l at nil\l at nohyphenation
 \fi
 %    \end{macrocode}
+%
 %    This macro is used to store the values of the hyphenation
 %    parameters |\lefthyphenmin| and |\righthyphenmin|.
+%
 %    \begin{macrocode}
 \providehyphenmins{\CurrentOption}{\m at ne\m at ne}
 %    \end{macrocode}
@@ -8003,10 +8540,12 @@
 %    from) the `nil' language.
 % \begin{macro}{\captionnil}
 % \begin{macro}{\datenil}
+%
 %    \begin{macrocode}
 \let\captionsnil\@empty
 \let\datenil\@empty
 %    \end{macrocode}
+%
 % \end{macro}
 % \end{macro}
 %  
@@ -8014,6 +8553,7 @@
 %    configuration file, setting the main language to be switched on
 %    at |\begin{document}| and resetting the category code of
 %    \texttt{@} to its original value.
+%
 %    \begin{macrocode}
 \ldf at finish{nil}
 %</nil>
@@ -8049,6 +8589,7 @@
 %    As these files are going to be read as the first thing ini\TeX\
 %    sees, we need to set some category codes just to be able to
 %    change the definition of |\input|
+%
 %    \begin{macrocode}
 %<*bplain|blplain>
 \catcode`\{=1 % left brace is begin-group character
@@ -8055,17 +8596,22 @@
 \catcode`\}=2 % right brace is end-group character
 \catcode`\#=6 % hash mark is macro parameter character
 %    \end{macrocode}
+%
 %    Now let's see if a file called \file{hyphen.cfg} can be found
 %    somewhere on \TeX's input path by trying to open it for
 %    reading... 
+%
 %    \begin{macrocode}
 \openin 0 hyphen.cfg
 %    \end{macrocode}
+%
 %    If the file wasn't found the following test turns out true.
+%
 %    \begin{macrocode}
 \ifeof0
 \else
 %    \end{macrocode}
+%
 %    When \file{hyphen.cfg} could be opened we make sure that
 %    \emph{it} will be read instead of the file \file{hyphen.tex}
 %    which should (according to Don Knuth's ruling) contain the
@@ -8074,18 +8620,23 @@
 %    We do this by first saving the original meaning of |\input| (and
 %    I use a one letter control sequence for that so as not to waste
 %    multi-letter control sequence on this in the format).
+%
 %    \begin{macrocode}
   \let\a\input
 %    \end{macrocode}
+%
 %    Then |\input| is defined to forget about its argument and load
 %    \file{hyphen.cfg} instead.
+%
 %    \begin{macrocode}
   \def\input #1 {%
     \let\input\a
     \a hyphen.cfg
 %    \end{macrocode}
+%
 %    Once that's done the original meaning of |\input| can be restored
 %    and the definition of |\a| can be forgotten.
+%
 %    \begin{macrocode}
     \let\a\undefined
   }
@@ -8092,15 +8643,19 @@
 \fi
 %</bplain|blplain>
 %    \end{macrocode}
+%
 %    Now that we have made sure that \file{hyphen.cfg} will be loaded
 %    at the right moment it is time to load \file{plain.tex}.
+%
 %    \begin{macrocode}
 %<bplain>\a plain.tex
 %<blplain>\a lplain.tex
 %    \end{macrocode}
+%
 %    Finally we change the contents of |\fmtname| to indicate that
 %    this is \emph{not} the plain format, but a format based on plain
 %    with the \pkg{babel} package preloaded.
+%
 %    \begin{macrocode}
 %<bplain>\def\fmtname{babel-plain}
 %<blplain>\def\fmtname{babel-lplain}
@@ -8117,6 +8672,7 @@
 %
 % \changes{bbplain-1.0s}{2012/12/21}{\cs{loadlocalcfg} not loaded in
 %    the format} 
+%
 %    \begin{macrocode}
 %<*plain>
 \def\@empty{}
@@ -8138,11 +8694,13 @@
 % \subsection{General tools}
 %
 %    A number of \LaTeX\ macro's that are needed later on.
+%
 % \changes{bbplain-1.0t}{2013/04/10}{Added \cs{@expandtwoargs}}
 % \changes{babel~3.9h}{2013/12/02}{Added \cs{zap at space}}
 % \changes{babel~3.9k}{2014/03/22}{Added \cs{@nnil}}
 % \changes{babel~3.9k}{2014/03/22}{Added \cs{@gobbletwo}}
 % \changes{babel~3.9k}{2014/03/22}{Added \cs{protected at edef}}
+%
 %    \begin{macrocode}
 \long\def\@firstofone#1{#1}
 \long\def\@firstoftwo#1#2{#1}
@@ -8180,9 +8738,11 @@
   \ifx#2\@empty\else\expandafter\zap at space\fi
   #2}
 %    \end{macrocode}
+%
 %    \LaTeXe\ has the command |\@onlypreamble| which adds commands to
 %    a list of commands that are no longer needed after
 %    |\begin{document}|.
+%
 %    \begin{macrocode}
 \ifx\@preamblecmds\@undefined
   \def\@preamblecmds{}
@@ -8192,8 +8752,10 @@
     \@preamblecmds\do#1}}
 \@onlypreamble\@onlypreamble
 %    \end{macrocode}
+%
 %    Mimick \LaTeX's |\AtBeginDocument|; for this to work the user
 %    needs to add |\begindocument| to his file.
+%
 %    \begin{macrocode}
 \def\begindocument{%
   \@begindocumenthook
@@ -8210,11 +8772,14 @@
 \@onlypreamble\@begindocumenthook
 \def\AtBeginDocument{\g at addto@macro\@begindocumenthook}
 %    \end{macrocode}
+%
 %    We also have to mimick \LaTeX's |\AtEndOfPackage|. Our
 %    replacement macro is much simpler; it stores its argument in
 %    |\@endofldf|.
-%  \changes{babel~3.9h}{2013/11/28}{Set \cs{bbl at hymapopt} to 0 - we
+%
+%  \changes{babel~3.9h}{2013/11/28}{Set \cs{bbl at opt@hyphenmap} to 0 - we
 %     presume hyphenmap=off in plain}
+%
 %    \begin{macrocode}
 \def\AtEndOfPackage#1{\g at addto@macro\@endofldf{#1}}
 \@onlypreamble\AtEndOfPackage
@@ -8221,10 +8786,12 @@
 \def\@endofldf{}
 \@onlypreamble\@endofldf
 \let\bbl at afterlang\@empty
-\chardef\bbl at hymapopt\z@
+\chardef\bbl at opt@hyphenmap\z@
 %    \end{macrocode}
+%
 %    \LaTeX\ needs to be able to switch off writing to its auxiliary
 %    files; plain doesn't have them by default.
+%
 %    \begin{macrocode}
 \ifx\if at filesw\@undefined
   \expandafter\let\csname if at filesw\expandafter\endcsname
@@ -8231,7 +8798,9 @@
     \csname iffalse\endcsname
 \fi
 %    \end{macrocode}
+%
 %    Mimick \LaTeX's commands to define control sequences.
+%
 %    \begin{macrocode}
 \def\newcommand{\@star at or@long\new at command}
 \def\new at command#1{%
@@ -8302,8 +8871,10 @@
 %    argument. It uses the boolean |\in@|; allocating a new boolean
 %    inside conditionally executed code is not possible, hence the
 %    construct with the temporary definition of |\bbl at tempa|.
+%
 % \changes{bbplain-1.0s}{2013/01/15}{Use \cs{bbl at tempa} as
 %    documented}
+%
 %    \begin{macrocode}
 \def\bbl at tempa{\csname newif\endcsname\ifin@}
 \ifx\in@\@undefined
@@ -8352,9 +8923,11 @@
   \csname newcount\endcsname\@tempcntb\relax
 \fi
 %    \end{macrocode}
+%
 %    To prevent wasting two counters in \LaTeX$\:$2.09 (because
 %    counters with the same name are allocated later by it) we reset
 %    the counter that holds the next free counter (|\count10|).
+%
 %    \begin{macrocode}
 \ifx\bye\@undefined
   \advance\count10 by -2\relax
@@ -8396,6 +8969,7 @@
 %
 %    Code from \file{ltoutenc.dtx}, adapted for use in the plain \TeX\
 %    environment. 
+%
 %    \begin{macrocode}
 \def\DeclareTextCommand{%
    \@dec at text@cmd\providecommand
@@ -8534,9 +9108,11 @@
 }
 \def\cf at encoding{OT1}
 %    \end{macrocode}
+%
 %    Currently we only use the \LaTeXe\ method for accents for those
 %    that are known to be made active in \emph{some} language
 %    definition file.
+%
 %    \begin{macrocode}
 \DeclareTextAccent{\"}{OT1}{127}
 \DeclareTextAccent{\'}{OT1}{19}
@@ -8544,8 +9120,10 @@
 \DeclareTextAccent{\`}{OT1}{18}
 \DeclareTextAccent{\~}{OT1}{126}
 %    \end{macrocode}
+%
 %    The following control sequences are used in \file{babel.def}
 %    but are not defined for \textsc{plain} \TeX.
+%
 %    \begin{macrocode}
 \DeclareTextSymbol{\textquotedblleft}{OT1}{92}
 \DeclareTextSymbol{\textquotedblright}{OT1}{`\"}
@@ -8554,10 +9132,12 @@
 \DeclareTextSymbol{\i}{OT1}{16}
 \DeclareTextSymbol{\ss}{OT1}{25}
 %    \end{macrocode}
+%
 %    For a couple of languages we need the \LaTeX-control sequence
 %    |\scriptsize| to be available. Because plain \TeX\ doesn't have
 %    such a sofisticated font mechanism as \LaTeX\ has, we just |\let|
 %    it to |\sevenrm|.
+%
 %    \begin{macrocode}
 \ifx\scriptsize\@undefined
   \let\scriptsize\sevenrm

Modified: trunk/Master/texmf-dist/source/latex/babel/babel.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/babel.ins	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/source/latex/babel/babel.ins	2017-05-19 21:04:34 UTC (rev 44427)
@@ -217,7 +217,7 @@
          }
 
 % compatibility files
-\def\compatfile#1{\file{#1.sty}{\from{bbcompat.dtx}{#1}}}
+\def\compatfile#1{\file{#1.sty}{\from{bbcompat.dtx}{styfile,#1}}}
 
 \generate{%
           \compatfile{esperanto}

Modified: trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx	2017-05-19 21:04:34 UTC (rev 44427)
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2017/04/28 v3.9t]
+\ProvidesFile{bbcompat.dtx}[2017/05/19 v3.10]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
@@ -256,6 +256,326 @@
 %<+hebrew>\def\CurrentOption{hebrew}
 %<+hebrew>\input rlbabel.def\input hebrew.ldf\relax
 %    \end{macrocode}
+%
+%    \section{Internationalizing \LaTeX{} 2.09}
+%
+%    Now that we're sure that the code is seen by \LaTeX\ only, we
+%    have to find out what the main (primary) document style is
+%    because we want to redefine some macros.  This is only necessary
+%    for releases of \LaTeX\ dated before December~1991. Therefore
+%    this part of the code can optionally be included in
+%    \file{babel.def} by specifying the \texttt{docstrip} option
+%    \texttt{names}.
+%
+%    The standard styles can be distinguished by checking whether some
+%    macros are defined. In table~\ref{styles} an overview is given of
+%    the macros that can be used for this purpose.
+%  \begin{table}[htb]
+%  \begin{center}
+% \DeleteShortVerb{\|}
+%  \begin{tabular}{|lcp{8cm}|}
+%   \hline
+%   article         & : & both the \verb+\chapter+ and \verb+\opening+
+%                         macros are undefined\\
+%   report and book & : & the \verb+\chapter+ macro is defined and
+%                         the \verb+\opening+ is undefined\\
+%   letter          & : & the \verb+\chapter+ macro is undefined and
+%                         the \verb+\opening+ is defined\\
+%   \hline
+%  \end{tabular}
+% \caption{How to determine the main document style}\label{styles}
+% \MakeShortVerb{\|}
+%  \end{center}
+%  \end{table}
+%
+%    \noindent The macros that have to be redefined for the
+%    \texttt{report} and \texttt{book} document styles happen to be
+%    the same, so there is no need to distinguish between those two
+%    styles.
+%
+%  \begin{macro}{\doc at style}
+%    First a parameter |\doc at style| is defined to identify the current
+%    document style. This parameter might have been defined by a
+%    document style that already uses macros instead of hard-wired
+%    texts, such as \file{artikel1.sty}~\cite{BEP}, so the existence of
+%    |\doc at style| is checked. If this macro is undefined, i.\,e., if
+%    the document style is unknown and could therefore contain
+%    hard-wired texts, |\doc at style| is defined to the default
+%    value~`0'.
+% \changes{babel~3.0d}{1991/10/29}{Removed use of \cs{@ifundefined}}
+%    \begin{macrocode}
+%<*names>
+\ifx\@undefined\doc at style
+  \def\doc at style{0}%
+%    \end{macrocode}
+%    This parameter is defined in the following \texttt{if}
+%    construction (see table~\ref{styles}):
+%
+%    \begin{macrocode}
+  \ifx\@undefined\opening
+    \ifx\@undefined\chapter
+      \def\doc at style{1}%
+    \else
+      \def\doc at style{2}%
+    \fi
+  \else
+    \def\doc at style{3}%
+  \fi%
+\fi%
+%    \end{macrocode}
+%  \end{macro}
+%
+% \changes{babel~3.1}{1991/11/05}{Removed definition of
+%    \cs{if at restonecol}}
+%
+%    Now here comes the real work: we start to redefine things and
+%    replace hard-wired texts by macros. These redefinitions should be
+%    carried out conditionally, in case it has already been done.
+%
+%    For the \texttt{figure} and \texttt{table} environments we have
+%    in all styles:
+%    \begin{macrocode}
+\@ifundefined{figurename}{\def\fnum at figure{\figurename{} \thefigure}}{}
+\@ifundefined{tablename}{\def\fnum at table{\tablename{} \thetable}}{}
+%    \end{macrocode}
+%
+%    The rest of the macros have to be treated differently for each
+%    style.  When |\doc at style| still has its default value nothing
+%    needs to be done.
+%    \begin{macrocode}
+\ifcase\doc at style\relax
+\or
+%    \end{macrocode}
+%
+%    This means that \file{babel.def} is read after the
+%    \texttt{article} style, where no |\chapter| and |\opening|
+%    commands are defined\footnote{A fact that was pointed out to me
+%    by Nico Poppelier and was already used in Piet van Oostrum's
+%    document style option~\texttt{nl}.}.
+%
+%    First we have the |\tableofcontents|,
+%    |\listoffigures| and |\listoftables|:
+%    \begin{macrocode}
+\@ifundefined{contentsname}%
+    {\def\tableofcontents{\section*{\contentsname\@mkboth
+          {\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
+      \@starttoc{toc}}}{}
+\@ifundefined{listfigurename}%
+    {\def\listoffigures{\section*{\listfigurename\@mkboth
+          {\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}%
+     \@starttoc{lof}}}{}
+\@ifundefined{listtablename}%
+    {\def\listoftables{\section*{\listtablename\@mkboth
+          {\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
+      \@starttoc{lot}}}{}
+%    \end{macrocode}
+%
+% Then the |\thebibliography| and |\theindex| environments.
+%
+%    \begin{macrocode}
+\@ifundefined{refname}%
+    {\def\thebibliography#1{\section*{\refname
+      \@mkboth{\uppercase{\refname}}{\uppercase{\refname}}}%
+      \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}%
+        \leftmargin\labelwidth
+        \advance\leftmargin\labelsep
+        \usecounter{enumi}}%
+        \def\newblock{\hskip.11em plus.33em minus.07em}%
+        \sloppy\clubpenalty4000\widowpenalty\clubpenalty
+        \sfcode`\.=1000\relax}}{}
+\@ifundefined{indexname}%
+    {\def\theindex{\@restonecoltrue\if at twocolumn\@restonecolfalse\fi
+     \columnseprule \z@
+     \columnsep 35pt\twocolumn[\section*{\indexname}]%
+       \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}%
+       \thispagestyle{plain}%
+       \parskip\z@ plus.3pt\parindent\z@\let\item\@idxitem}}{}
+%    \end{macrocode}
+%
+% The |abstract| environment:
+%
+%    \begin{macrocode}
+\@ifundefined{abstractname}%
+    {\def\abstract{\if at twocolumn
+    \section*{\abstractname}%
+    \else \small
+    \begin{center}%
+    {\bf \abstractname\vspace{-.5em}\vspace{\z@}}%
+    \end{center}%
+    \quotation
+    \fi}}{}
+%    \end{macrocode}
+%
+% And last but not least, the macro |\part|:
+%
+%    \begin{macrocode}
+\@ifundefined{partname}%
+{\def\@part[#1]#2{\ifnum \c at secnumdepth >\m at ne
+        \refstepcounter{part}%
+        \addcontentsline{toc}{part}{\thepart
+        \hspace{1em}#1}\else
+      \addcontentsline{toc}{part}{#1}\fi
+   {\parindent\z@ \raggedright
+    \ifnum \c at secnumdepth >\m at ne
+      \Large \bf \partname{} \thepart
+      \par \nobreak
+    \fi
+    \huge \bf
+    #2\markboth{}{}\par}%
+    \nobreak
+    \vskip 3ex\@afterheading}%
+}{}
+%    \end{macrocode}
+%
+%    This is all that needs to be done for the \texttt{article} style.
+%
+%    \begin{macrocode}
+\or
+%    \end{macrocode}
+%
+%    The next case is formed by the two styles \texttt{book} and
+%    \texttt{report}.  Basically we have to do the same as for the
+%    \texttt{article} style, except now we must also change the
+%    |\chapter| command.
+%
+%    The tables of contents, figures and tables:
+%    \begin{macrocode}
+\@ifundefined{contentsname}%
+    {\def\tableofcontents{\@restonecolfalse
+      \if at twocolumn\@restonecoltrue\onecolumn
+      \fi\chapter*{\contentsname\@mkboth
+          {\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
+      \@starttoc{toc}%
+      \csname if at restonecol\endcsname\twocolumn
+      \csname fi\endcsname}}{}
+\@ifundefined{listfigurename}%
+    {\def\listoffigures{\@restonecolfalse
+      \if at twocolumn\@restonecoltrue\onecolumn
+      \fi\chapter*{\listfigurename\@mkboth
+          {\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}%
+      \@starttoc{lof}%
+      \csname if at restonecol\endcsname\twocolumn
+      \csname fi\endcsname}}{}
+\@ifundefined{listtablename}%
+    {\def\listoftables{\@restonecolfalse
+      \if at twocolumn\@restonecoltrue\onecolumn
+      \fi\chapter*{\listtablename\@mkboth
+          {\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
+      \@starttoc{lot}%
+      \csname if at restonecol\endcsname\twocolumn
+      \csname fi\endcsname}}{}
+%    \end{macrocode}
+%
+%    Again, the |bibliography| and |index| environments; notice that
+%    in this case we use |\bibname| instead of |\refname| as in the
+%    definitions for the \texttt{article} style.  The reason for this
+%    is that in the \texttt{article} document style the term
+%    `References' is used in the definition of |\thebibliography|. In
+%    the \texttt{report} and \texttt{book} document styles the term
+%    `Bibliography' is used.
+%    \begin{macrocode}
+\@ifundefined{bibname}%
+    {\def\thebibliography#1{\chapter*{\bibname
+     \@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}%
+     \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}%
+     \leftmargin\labelwidth \advance\leftmargin\labelsep
+     \usecounter{enumi}}%
+     \def\newblock{\hskip.11em plus.33em minus.07em}%
+     \sloppy\clubpenalty4000\widowpenalty\clubpenalty
+     \sfcode`\.=1000\relax}}{}
+\@ifundefined{indexname}%
+    {\def\theindex{\@restonecoltrue\if at twocolumn\@restonecolfalse\fi
+    \columnseprule \z@
+    \columnsep 35pt\twocolumn[\@makeschapterhead{\indexname}]%
+      \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}%
+    \thispagestyle{plain}%
+    \parskip\z@ plus.3pt\parindent\z@ \let\item\@idxitem}}{}
+%    \end{macrocode}
+%
+% Here is the |abstract| environment:
+%    \begin{macrocode}
+\@ifundefined{abstractname}%
+    {\def\abstract{\titlepage
+    \null\vfil
+    \begin{center}%
+    {\bf \abstractname}%
+    \end{center}}}{}
+%    \end{macrocode}
+%
+%     And last but not least the |\chapter|, |\appendix| and
+%    |\part| macros.
+%    \begin{macrocode}
+\@ifundefined{chaptername}{\def\@chapapp{\chaptername}}{}
+%
+\@ifundefined{appendixname}%
+    {\def\appendix{\par
+      \setcounter{chapter}{0}%
+      \setcounter{section}{0}%
+      \def\@chapapp{\appendixname}%
+      \def\thechapter{\Alph{chapter}}}}{}
+%
+\@ifundefined{partname}%
+    {\def\@part[#1]#2{\ifnum \c at secnumdepth >-2\relax
+            \refstepcounter{part}%
+            \addcontentsline{toc}{part}{\thepart
+            \hspace{1em}#1}\else
+            \addcontentsline{toc}{part}{#1}\fi
+       \markboth{}{}%
+       {\centering
+        \ifnum \c at secnumdepth >-2\relax
+          \huge\bf \partname{} \thepart
+        \par
+        \vskip 20pt \fi
+        \Huge \bf
+        #1\par}\@endpart}}{}%
+\or
+%    \end{macrocode}
+%
+%    Now we address the case where \file{babel.def} is read after the
+%    \texttt{letter} style. The \texttt{letter} document style
+%    defines the macro |\opening| and some other macros that are
+%    specific to \texttt{letter}. This means that we have to redefine
+%    other macros, compared to the previous two cases.
+%
+%    First two macros for the material at the end of a letter, the
+%    |\cc| and |\encl| macros.
+%    \begin{macrocode}
+\@ifundefined{ccname}%
+    {\def\cc#1{\par\noindent
+     \parbox[t]{\textwidth}%
+     {\@hangfrom{\rm \ccname : }\ignorespaces #1\strut}\par}}{}
+\@ifundefined{enclname}%
+    {\def\encl#1{\par\noindent
+     \parbox[t]{\textwidth}%
+     {\@hangfrom{\rm \enclname : }\ignorespaces #1\strut}\par}}{}
+%    \end{macrocode}
+%
+%    The last thing we have to do here is to redefine the
+%    \texttt{headings} pagestyle:
+% \changes{babel~3.3}{1993/07/11}{\cs{headpagename} should be
+%    \cs{pagename}}
+%    \begin{macrocode}
+\@ifundefined{headtoname}%
+  {\def\ps at headings{%
+     \def\@oddhead{\sl \headtoname{} \ignorespaces\toname \hfil
+                      \@date \hfil \pagename{} \thepage}%
+     \def\@oddfoot{}}}{}
+\fi
+%</names>
+%    \end{macrocode}
+%
+% This was the last of the four standard document styles, so if
+% |\doc at style| has another value we do nothing and just close the
+% \texttt{if} construction.  Here ends the code that can be optionally
+% included when a version of \LaTeX\ is in use that is dated
+% \emph{before} December~1991.
+%
+%    We also need to redefine a number of commands to ensure that the
+%    right font encoding is used, but this can't be done before
+%    \file{babel.def} is loaded.
+% \changes{babel~3.6o}{1999/04/07}{Moved the rest of the font encoding
+%    related definitions to their original place}
+%
 %%
 %% \CharacterTable
 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z

Modified: trunk/Master/texmf-dist/source/latex/babel/bbunicode.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/bbunicode.dtx	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/source/latex/babel/bbunicode.dtx	2017-05-19 21:04:34 UTC (rev 44427)
@@ -31,7 +31,7 @@
 % \iffalse
 %<*dtx>
 \ProvidesFile{bbunicode.dtx}
-       [2017/04/28 v3.9t Babel hooks for Unicode engines]
+       [2017/05/19 v3.10 Babel hooks for Unicode engines]
 %</dtx>
 %
 %% File `bbunicode.dtx'

Modified: trunk/Master/texmf-dist/tex/generic/babel/UKenglish.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/UKenglish.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/UKenglish.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `UKenglish')
+%% bbcompat.dtx  (with options: `styfile,UKenglish')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/USenglish.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/USenglish.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/USenglish.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `USenglish')
+%% bbcompat.dtx  (with options: `styfile,USenglish')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/afrikaans.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/afrikaans.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/afrikaans.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `afrikaans')
+%% bbcompat.dtx  (with options: `styfile,afrikaans')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/albanian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/albanian.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/albanian.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `albanian')
+%% bbcompat.dtx  (with options: `styfile,albanian')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/american.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/american.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/american.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `american')
+%% bbcompat.dtx  (with options: `styfile,american')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/austrian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/austrian.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/austrian.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `austrian')
+%% bbcompat.dtx  (with options: `styfile,austrian')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/babel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/babel.def	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/babel.def	2017-05-19 21:04:34 UTC (rev 44427)
@@ -38,7 +38,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %% File 'babel.dtx'
-%%\ProvidesFile{babel.dtx}[2017/04/28 v3.9t The Babel package]
+%%\ProvidesFile{babel.dtx}[2017/05/19 v3.10 The Babel package]
 %% Babel package for LaTeX2e.
 %% Copyright (C) 1989-2008 by Johannes Braams,
 %%                            TeXniek
@@ -56,7 +56,7 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{babel.def}[2017/04/28 3.9t Babel common definitions]
+\ProvidesFile{babel.def}[2017/05/19 3.10 Babel common definitions]
 \ifx\AtBeginDocument\@undefined
   \input plain.def\relax
 \fi
@@ -67,7 +67,7 @@
   \let\bbl at afterlang\relax
   \let\bbl at language@opts\@empty
 \fi
-\def\bbl at tempa{3.9t}%
+\def\bbl at tempa{3.10}%
 \ifx\bbl at version\bbl at tempa\else
   \input switch.def\relax
 \fi
@@ -152,6 +152,38 @@
 \def\bbl at ifblank#1{%
   \bbl at ifblank@i#1\@nil\@nil\@secondoftwo\@firstoftwo\@nil}
 \long\def\bbl at ifblank@i#1#2\@nil#3#4#5\@nil{#4}
+\def\bbl at forkv#1#2{%
+  \def\bbl at kvcmd##1##2##3{#2}%
+  \bbl at kvnext#1,\@nil,}
+\def\bbl at kvnext#1,{%
+  \ifx\@nil#1\relax\else
+    \bbl at ifblank{#1}{}{\bbl at forkv@eq#1=\@empty=\@nil{#1}}%
+    \expandafter\bbl at kvnext
+  \fi}
+\def\bbl at forkv@eq#1=#2=#3\@nil#4{%
+  \bbl at trim@def\bbl at forkv@a{#1}%
+  \bbl at trim{\expandafter\bbl at kvcmd\expandafter{\bbl at forkv@a}}{#2}{#4}}
+\def\bbl at vforeach#1#2{%
+  \def\bbl at forcmd##1{#2}%
+  \bbl at fornext#1,\@nil,}
+\def\bbl at fornext#1,{%
+  \ifx\@nil#1\relax\else
+    \bbl at ifblank{#1}{}{\bbl at trim\bbl at forcmd{#1}}%
+    \expandafter\bbl at fornext
+  \fi}
+\def\bbl at foreach#1{\expandafter\bbl at vforeach\expandafter{#1}}
+\def\bbl at replace#1#2#3{% in #1 -> repl #2 by #3
+  \toks@{}%
+  \def\bbl at replace@aux##1#2##2#2{%
+    \ifx\bbl at nil##2%
+      \toks@\expandafter{\the\toks@##1}%
+    \else
+      \toks@\expandafter{\the\toks@##1#3}%
+      \bbl at afterfi
+      \bbl at replace@aux##2#2%
+    \fi}%
+  \expandafter\bbl at replace@aux#1#2\bbl at nil#2%
+  \edef#1{\the\toks@}}
 \def\bbl at exp#1{%
   \begingroup
     \let\\\noexpand
@@ -234,7 +266,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}
-\newcommand\babelensure[2][]{%
+\newcommand\babelensure[2][]{%  TODO - revise test files
   \AddBabelHook{babel-ensure}{afterextras}{%
     \ifcase\bbl at select@type
       \@nameuse{bbl at e@\languagename}%
@@ -247,7 +279,7 @@
       \ifx\@empty##1\else\noexpand##1\expandafter\bbl at tempb\fi}%
     \edef\bbl at tempa{\bbl at tempb#1\@empty}%
     \def\bbl at tempb##1=##2\@@{\@namedef{bbl at ens@##1}{##2}}%
-    \bbl at for\bbl at tempa\bbl at tempa{\expandafter\bbl at tempb\bbl at tempa\@@}%
+    \bbl at foreach\bbl at tempa{\bbl at tempb##1\@@}%
     \def\bbl at tempc{\bbl at ensure}%
     \expandafter\bbl at add\expandafter\bbl at tempc\expandafter{%
       \expandafter{\bbl at ens@include}}%
@@ -257,8 +289,8 @@
     \bbl at exp{%
   \endgroup
   \def\<bbl at e@#2>{\the\toks@{\bbl at ens@fontenc}}}}
-\def\bbl at ensure#1#2#3{%
-  \def\bbl at tempb##1{% elt for \bbl at ensured list
+\def\bbl at ensure#1#2#3{% 1: include 2: exclude 3: fontenc
+  \def\bbl at tempb##1{% elt for (excluding) \bbl at captionslist list
     \ifx##1\@empty\else
       \in@{##1}{#2}%
       \ifin@\else
@@ -278,7 +310,7 @@
       \fi
       \expandafter\bbl at tempb
     \fi}%
-  \expandafter\bbl at tempb\bbl at ensured\@empty
+  \expandafter\bbl at tempb\bbl at captionslist\today\@empty
   \def\bbl at tempa##1{% elt for include list
     \ifx##1\@empty\else
       \bbl at csarg\in@{ensure@\languagename\expandafter}\expandafter{##1}%
@@ -288,11 +320,21 @@
       \expandafter\bbl at tempa
     \fi}%
   \bbl at tempa#1\@empty}
-\def\bbl at ensured{%
+\def\bbl at captionslist{%
   \prefacename\refname\abstractname\bibname\chaptername\appendixname
   \contentsname\listfigurename\listtablename\indexname\figurename
   \tablename\partname\enclname\ccname\headtoname\pagename\seename
-  \alsoname\proofname\glossaryname\today}
+  \alsoname\proofname\glossaryname}
+\def\bbl at ldfinit{%
+  \let\bbl at screset\@empty
+  \let\BabelStrings\bbl at opt@string
+  \let\BabelOptions\@empty
+  \let\BabelLanguages\relax
+  \ifx\originalTeX\@undefined
+    \let\originalTeX\@empty
+  \else
+    \originalTeX
+  \fi}
 \def\LdfInit#1#2{%
   \chardef\atcatcode=\catcode`\@
   \catcode`\@=11\relax
@@ -308,26 +350,20 @@
       \ldf at quit{#1}%
     \fi
   \fi
-  \let\bbl at screset\@empty
-  \let\BabelStrings\bbl at opt@strings
-  \let\BabelOptions\@empty
-  \let\BabelLanguages\relax
-  \ifx\originalTeX\@undefined
-    \let\originalTeX\@empty
-  \else
-    \originalTeX
-  \fi}
+  \bbl at ldfinit}
 \def\ldf at quit#1{%
   \expandafter\main at language\expandafter{#1}%
   \catcode`\@=\atcatcode \let\atcatcode\relax
   \catcode`\==\eqcatcode \let\eqcatcode\relax
   \endinput}
-\def\ldf at finish#1{%
-  \loadlocalcfg{#1}%
+\def\bbl at afterldf#1{%
   \bbl at afterlang
   \let\bbl at afterlang\relax
   \let\BabelModifiers\relax
-  \let\bbl at screset\relax
+  \let\bbl at screset\relax}%
+\def\ldf at finish#1{%
+  \loadlocalcfg{#1}%
+  \bbl at afterldf{#1}%
   \expandafter\main at language\expandafter{#1}%
   \catcode`\@=\atcatcode \let\atcatcode\relax
   \catcode`\==\eqcatcode \let\eqcatcode\relax}
@@ -346,16 +382,20 @@
   \else
     \select at language{#1}%
   \fi}
-\def\bbl at add@special#1{%
-  \begingroup
-    \def\do{\noexpand\do\noexpand}%
-    \def\@makeother{\noexpand\@makeother\noexpand}%
-  \edef\x{\endgroup
-    \def\noexpand\dospecials{\dospecials\do#1}%
-    \expandafter\ifx\csname @sanitize\endcsname\relax \else
-      \def\noexpand\@sanitize{\@sanitize\@makeother#1}%
-    \fi}%
-  \x}
+\def\bbl at add@special#1{% 1:a macro like \", \?, etc.
+  \bbl at add\dospecials{\do#1}% test @sanitize = \relax, for back. compat.
+  \bbl at ifunset{@sanitize}{}{\bbl at add\@sanitize{\@makeother#1}}%
+  \ifx\nfss at catcodes\@undefined\else % TODO - same for above
+    \begingroup
+      \catcode`#1\active
+      \nfss at catcodes
+      \ifnum\catcode`#1=\active
+        \endgroup
+        \bbl at add\nfss at catcodes{\@makeother#1}%
+      \else
+        \endgroup
+      \fi
+  \fi}
 \def\bbl at remove@special#1{%
   \begingroup
     \def\x##1##2{\ifnum`#1=`##2\noexpand\@empty
@@ -457,11 +497,11 @@
 \@ifpackagewith{babel}{KeepShorthandsActive}%
   {\let\bbl at restoreactive\@gobble}%
   {\def\bbl at restoreactive#1{%
-     \edef\bbl at tempa{%
-       \noexpand\AfterBabelLanguage\noexpand\CurrentOption
+     \bbl at exp{%
+       \\\AfterBabelLanguage\\\CurrentOption
          {\catcode`#1=\the\catcode`#1\relax}%
-       \noexpand\AtEndOfPackage{\catcode`#1=\the\catcode`#1\relax}}%
-     \bbl at tempa}%
+       \\\AtEndOfPackage
+         {\catcode`#1=\the\catcode`#1\relax}}}%
    \AtEndOfPackage{\let\bbl at restoreactive\@gobble}}
 \def\bbl at sh@select#1#2{%
   \expandafter\ifx\csname#1 at sh@#2 at sel\endcsname\relax
@@ -663,25 +703,23 @@
   \def\bbl at tempc{#1}%
   \bbl at fixname\bbl at tempc
   \bbl at iflanguage\bbl at tempc{%
-    \bbl at loopx\bbl at attr{#2}{%
+    \bbl at vforeach{#2}{%
       \ifx\bbl at known@attribs\@undefined
         \in at false
       \else
-        \@expandtwoargs\in@{,\bbl at tempc-\bbl at attr,}{,\bbl at known@attribs,}%
+        \@expandtwoargs\in@{,\bbl at tempc-##1,}{,\bbl at known@attribs,}%
       \fi
       \ifin@
         \bbl at warning{%
-          You have more than once selected the attribute '\bbl at attr'\\%
+          You have more than once selected the attribute '##1'\\%
           for language #1}%
       \else
-        \edef\bbl at tempa{%
-          \noexpand\bbl at add@list
-          \noexpand\bbl at known@attribs{\bbl at tempc-\bbl at attr}}%
-        \bbl at tempa
-        \edef\bbl at tempa{\bbl at tempc-\bbl at attr}%
+        \bbl at exp{%
+          \\\bbl at add@list\\\bbl at known@attribs{\bbl at tempc-##1}}%
+        \edef\bbl at tempa{\bbl at tempc-##1}%
         \expandafter\bbl at ifknown@ttrib\expandafter{\bbl at tempa}\bbl at attributes%
-        {\csname\bbl at tempc @attr@\bbl at attr\endcsname}%
-        {\@attrerr{\bbl at tempc}{\bbl at attr}}%
+        {\csname\bbl at tempc @attr@##1\endcsname}%
+        {\@attrerr{\bbl at tempc}{##1}}%
      \fi}}}
 \@onlypreamble\languageattribute
 \newcommand*{\@attrerr}[2]{%
@@ -732,18 +770,13 @@
 \babel at beginsave
 \def\babel at save#1{%
   \expandafter\let\csname babel@\number\babel at savecnt\endcsname#1\relax
-  \begingroup
-    \toks@\expandafter{\originalTeX\let#1=}%
-    \edef\x{\endgroup
-      \def\noexpand\originalTeX{\the\toks@ \expandafter\noexpand
-         \csname babel@\number\babel at savecnt\endcsname\relax}}%
-  \x
+  \toks@\expandafter{\originalTeX\let#1=}%
+  \bbl at exp{%
+    \def\\\originalTeX{\the\toks@\<babel@\number\babel at savecnt>\relax}}%
   \advance\babel at savecnt\@ne}
-\def\babel at savevariable#1{\begingroup
-    \toks@\expandafter{\originalTeX #1=}%
-    \edef\x{\endgroup
-      \def\noexpand\originalTeX{\the\toks@ \the#1\relax}}%
-  \x}
+\def\babel at savevariable#1{%
+  \toks@\expandafter{\originalTeX #1=}%
+  \bbl at exp{\def\\\originalTeX{\the\toks@\the#1\relax}}}
 \def\bbl at frenchspacing{%
   \ifnum\the\sfcode`\.=\@m
     \let\bbl at nonfrenchspacing\relax
@@ -781,8 +814,8 @@
     \ifx\@empty#1%
       \protected at edef\bbl at hyphenation@{\bbl at hyphenation@\space#2}%
     \else
-      \edef\bbl at tempb{\zap at space#1 \@empty}%
-      \bbl at for\bbl at tempa\bbl at tempb{%
+      \bbl at vforeach{#1}{%
+        \def\bbl at tempa{##1}%
         \bbl at fixname\bbl at tempa
         \bbl at iflanguage\bbl at tempa{%
           \bbl at csarg\protected at edef{hyphenation@\bbl at tempa}{%
@@ -863,10 +896,9 @@
     \bbl at loop\bbl at tempa{##2}{% empty items and spaces are ok
       \advance\count@\@ne
       \toks@\expandafter{\bbl at tempa}%
-      \edef\bbl at tempb{%
-        \bbl at templ{\romannumeral\count@}{\the\toks@}%
-        \count@=\the\count@\relax}%
-      \expandafter\SetString\bbl at tempb}}%
+      \bbl at exp{%
+        \\\SetString\bbl at templ{\romannumeral\count@}{\the\toks@}%
+        \count@=\the\count@\relax}}}%
   \newcommand\SetCase[3][]{%
     \bbl at patchuclc
     \bbl at forlang\bbl at tempa{%
@@ -923,7 +955,7 @@
     \let\bbl at sc@fontenc\space % <-   "      "
     \def\bbl at tempa##1=##2\@nil{%
       \bbl at csarg\edef{sc@\zap at space##1 \@empty}{##2 }}%
-    \bbl at for\bbl at tempb{label=#1}{\expandafter\bbl at tempa\bbl at tempb\@nil}%
+    \bbl at vforeach{label=#1}{\bbl at tempa##1\@nil}%
     \def\bbl at tempa##1 ##2{% space -> comma
       ##1%
       \ifx\@empty##2\else\ifx,##1,\else,\fi\bbl at afterfi\bbl at tempa##2\fi}%
@@ -931,13 +963,13 @@
     \edef\bbl at sc@label{\expandafter\zap at space\bbl at sc@label\@empty}%
     \edef\bbl at sc@charset{\expandafter\zap at space\bbl at sc@charset\@empty}%
     \def\bbl at encstring##1##2{%
-      \bbl at for\bbl at tempc\bbl at sc@fontenc{%
-        \bbl at ifunset{T@\bbl at tempc}%
+      \bbl at foreach\bbl at sc@fontenc{%
+        \bbl at ifunset{T@####1}%
           {}%
-          {\ProvideTextCommand##1\bbl at tempc{##2}%
+          {\ProvideTextCommand##1{####1}{##2}%
            \bbl at toglobal##1%
            \expandafter
-           \bbl at toglobal\csname\bbl at tempc\string##1\endcsname}}}%
+           \bbl at toglobal\csname####1\string##1\endcsname}}}%
     \def\bbl at sctest{%
       \@expandtwoargs
       \in@{,\bbl at opt@strings,}{,\bbl at sc@label,\bbl at sc@fontenc,}}%
@@ -996,7 +1028,7 @@
   \bbl at forlang\bbl at tempa{%
     \edef\bbl at LC{\bbl at tempa\bbl at stripslash#1}%
     \bbl at ifunset{\bbl at LC}% eg, \germanchaptername
-      {\global\expandafter
+      {\global\expandafter  % TODO - con \bbl at exp ?
        \bbl at add\csname\bbl at G\bbl at tempa\expandafter\endcsname\expandafter
          {\expandafter\bbl at scset\expandafter#1\csname\bbl at LC\endcsname}}%
       {}%
@@ -1051,9 +1083,9 @@
     \fi}%
   \bbl at tempa}
 \AtEndOfPackage{%
-  \ifx\bbl at hymapopt\@undefined
+  \ifx\bbl at opt@hyphenmap\@undefined
     \@expandtwoargs\in@{,}{\bbl at language@opts}%
-    \chardef\bbl at hymapopt\ifin at 4\else\@ne\fi
+    \chardef\bbl at opt@hyphenmap\ifin at 4\else\@ne\fi
   \fi}
 \def\set at low@box#1{\setbox\tw@\hbox{,}\setbox\z@\hbox{#1}%
     \dimen\z@\ht\z@ \advance\dimen\z@ -\ht\tw@%
@@ -1240,6 +1272,153 @@
     \aftergroup\endinput
   \fi
 \fi}
+\newcommand\babelprovide[2][]{%
+  \let\bbl at savelangname\languagename
+  \def\languagename{#2}%
+  \let\bbl at KVP@captions\@nil
+  \let\bbl at KVP@main\@nil
+  \let\bbl at KVP@hyphenrules\@nil
+  \bbl at forkv{#1}{\bbl at csarg\def{KVP@##1}{##2}}%  TODO - error handling
+  \bbl at ifunset{date#2}%
+    {\bbl at provide@new{#2}}%
+    {\bbl at ifblank{#1}%
+      {\bbl at error
+        {If you want to modify `#2' you must tell how in\\%
+         the optional argument. Currently there are two\\%
+         options: captions=lang-tag, hyphenrules=lang-list}%
+        {Use this macro as documented}
+}%
+      {\bbl at provide@renew{#2}}}%
+  \babelensure{#2}%
+  \let\languagename\bbl at savelangname}
+\def\bbl at provide@new#1{%
+  \bbl at provide@hyphens{#1}%
+  \@namedef{date#1}{}% marks lang exists - required by \StartBabelCommands
+  \@namedef{extras#1}{}%
+  \@namedef{noextras#1}{}%
+  \StartBabelCommands*{#1}{captions}%
+    \ifx\bbl at KVP@captions\@nil
+      \def\bbl at tempb##1{%               elt for \bbl at captionslist
+        \ifx##1\@empty\else
+          \bbl at exp{%
+            \\\SetString\\##1{%
+              \\\bbl at nocaption{\bbl at stripslash##1}{\<#1\bbl at stripslash##1>}}}%
+          \expandafter\bbl at tempb
+        \fi}%
+      \expandafter\bbl at tempb\bbl at captionslist\@empty
+    \else
+      \bbl at read@ini{\bbl at KVP@captions}%  Here all letters cat = 11
+      \bbl at after@ini
+      \bbl at savestrings
+    \fi
+  \StartBabelCommands*{#1}{date}%
+    \bbl at exp{%
+      \\\SetString\\\today{\\\bbl at nocaption{today}{\<#1today>}}}%
+  \EndBabelCommands
+  \expandafter\gdef\csname#1hyphenmins\endcsname{23}%
+  \ifx\bbl at KVP@main\@nil\else
+     \expandafter\main at language\expandafter{#1}%
+  \fi}
+\def\bbl at provide@renew#1{%
+  \bbl at provide@hyphens{#1}%
+  \ifx\bbl at KVP@captions\@nil\else
+    \StartBabelCommands*{#1}{captions}%
+      \bbl at read@ini{\bbl at KVP@captions}%   Here all letters cat = 11
+      \bbl at after@ini
+      \bbl at savestrings
+    \EndBabelCommands
+  \fi}
+\def\bbl at provide@hyphens#1{%
+  \let\bbl at tempa\relax
+  \ifx\bbl at KVP@hyphenrules\@nil\else
+    \bbl at replace\bbl at KVP@hyphenrules{ }{,}%
+    \bbl at foreach\bbl at KVP@hyphenrules{%
+      \ifx\bbl at tempa\relax    %  if not yet found
+        \bbl at ifsamestring{##1}{+}%
+          {{\bbl at exp{\\\addlanguage\<l@##1>}}}%
+          {}%
+        \bbl at ifunset{l@##1}%
+           {}%
+           {\bbl at exp{\let\bbl at tempa\<l@##1>}}%
+      \fi}%
+  \fi
+  \ifx\bbl at tempa\relax %        if no option or no language found
+    \bbl at ifunset{l@#1}%         no hyphenrules found - fallback
+      {\bbl at exp{\\\adddialect\<l@#1>\language}}%
+      {}%
+  \else
+    \bbl at exp{\\\adddialect\<l@#1>\bbl at tempa}%  found in opt list
+  \fi}
+\def\bbl at read@ini#1{%
+  \openin1=babel-#1.ini
+  \ifeof1
+    \bbl at error
+      {There is no ini file for the requested language\\%
+       (#1). Perhaps you misspelled it or your installation\\%
+       is not complete.}%
+      {Fix the name or reinstall babel.}%
+  \else
+    \let\bbl at section\@empty
+    \let\bbl at savestrings\@empty
+    \loop
+      \endlinechar\m at ne
+      \read1 to \bbl at line
+      \endlinechar`\^^M
+    \if T\ifeof1F\fi T\relax % Trick, because inside \loop
+      \ifx\bbl at line\@empty\else
+        \expandafter\bbl at iniline\bbl at line\bbl at iniline
+      \fi
+    \repeat
+  \fi}
+\def\bbl at iniline#1\bbl at iniline{%
+  \@ifnextchar[\bbl at inisec{\@ifnextchar;\bbl at iniskip\bbl at inikv}#1\@@} %]
+\def\bbl at iniskip#1\@@{}%      if starts with ;
+\def\bbl at inisec[#1]#2\@@{%    if starts with opening bracket
+  \def\bbl at section{#1}%
+  \bbl at debug{\message{[[ #1 ]]^^J}}}
+\def\bbl at inikv#1=#2\@@{%      otherwise, key=value
+  \bbl at trim@def\bbl at tempa{#1}%
+  \bbl at trim\toks@{#2}%
+  \bbl at ifunset{bbl at ini@\bbl at section}%
+    {}%
+    {\bbl at exp{%
+       \<bbl at ini@\bbl at section>\bbl at tempa=\the\toks@\\\@nil}}}
+\def\bbl at after@ini{%
+  % make sure Script and Language takes some value
+  \bbl at exp{\\\bbl at ifblank{\@nameuse{bbl at lotf@\languagename}}}%
+    {\bbl at csarg\gdef{lotf@\languagename}{dflt}}{}%
+  \bbl at exp{\\\bbl at ifblank{\@nameuse{bbl at sotf@\languagename}}}%
+    {\bbl at csarg\gdef{sotf@\languagename}{DFLT}}{}}
+\def\bbl at exportkey#1#2#3#4{% 1:bbl id,2:ini name,3:ini key,4:ini val
+  \bbl at ifsamestring{#2}{#3}%
+    {\bbl at csarg\gdef{#1@\languagename}{#4}}%
+    {}}
+\ifcase\bbl at engine
+  \bbl at csarg\def{ini at captions.licr}#1=#2\@nil{% TODO - copypaste pattern
+    \bbl at ifblank{#2}%
+      {\bbl at exp{%
+         \toks@{\\\bbl at nocaption{#1}\<\languagename#1name>}}}%
+      {\toks@{#2}}%
+    \bbl at exp{%
+      \\\bbl at add\\\bbl at savestrings{% NOTE - with date will be global
+        \\\SetString\<#1name>{\the\toks@}}}}
+\else
+  \def\bbl at ini@captions#1=#2\@nil{%
+    \bbl at ifblank{#2}%
+      {\bbl at exp{%
+         \toks@{\\\bbl at nocaption{#1}\<\languagename#1name>}}}%
+      {\toks@{#2}}%
+    \bbl at exp{%
+      \\\bbl at add\\\bbl at savestrings{%
+        \\\SetString\<#1name>{\the\toks@}}}}
+\fi
+\def\bbl at ini@identification#1=#2\@nil{% TODO - not only with captions
+  \bbl at exportkey{lname}{name.english}{#1}{#2}%
+  \bbl at exportkey{lbcp}{tag.bcp47}{#1}{#2}%
+  \bbl at exportkey{lotf}{tag.opentype}{#1}{#2}%
+  \bbl at exportkey{sname}{script.name}{#1}{#2}%
+  \bbl at exportkey{sbcp}{script.tag.bcp47}{#1}{#2}%
+  \bbl at exportkey{sotf}{script.tag.opentype}{#1}{#2}}
 \ifx\bbl at opt@safe\@empty\else
   \def\@newl at bel#1#2#3{%
    {\@safe at activestrue
@@ -1417,11 +1596,10 @@
 \let\ensureascii\@firstofone
 \AtBeginDocument{%
   \in at false
-  \bbl at loopx\bbl at tempa\BabelNonASCII{% is there a non-ascii enc?
+  \bbl at foreach\BabelNonASCII{% is there a non-ascii enc?
     \ifin@\else
-      \edef\bbl at tempb{{,\bbl at tempa enc.def,}{,\@filelist,}}%
-      \lowercase\expandafter{\expandafter\in@\bbl at tempb}%
-    \fi}
+      \lowercase{\@expandtwoargs\in@{,#1enc.def,}{,\@filelist,}}%
+    \fi}%
   \ifin@ % if a non-ascii has been loaded
     \def\ensureascii#1{{\fontencoding{OT1}\selectfont#1}}%
     \DeclareTextCommandDefault{\TeX}{\org at TeX}%
@@ -1439,7 +1617,7 @@
              \def\ensureascii##1{{\fontencoding{#1}\selectfont##1}}%
            \fi}%
       \fi}%
-    \bbl at loopx\bbl at tempa\@filelist{\expandafter\bbl at tempb\bbl at tempa\@@}%
+    \bbl at foreach\@filelist{\bbl at tempb#1\@@}%  TODO - \@@ de mas??
     \@expandtwoargs\in@{,\cf at encoding,}{,\BabelNonASCII,}%
     \ifin@\else
       \edef\ensureascii#1{{%

Modified: trunk/Master/texmf-dist/tex/generic/babel/babel.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/babel.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/babel.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -38,7 +38,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %% File 'babel.dtx'
-%%\ProvidesFile{babel.dtx}[2017/04/28 v3.9t The Babel package]
+%%\ProvidesFile{babel.dtx}[2017/05/19 v3.10 The Babel package]
 %% Babel package for LaTeX2e.
 %% Copyright (C) 1989-2008 by Johannes Braams,
 %%                            TeXniek
@@ -48,10 +48,12 @@
 %%                         by Javier Bezos
 %%                            all rights reserved.
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\ProvidesPackage{babel}[2017/04/28 3.9t The Babel package]
+\ProvidesPackage{babel}[2017/05/19 3.10 The Babel package]
 \@ifpackagewith{babel}{debug}
- {\input switch.def\relax}
- {\def\bbl at tempa{3.9t}%
+ {\let\bbl at debug\@firstofone
+  \input switch.def\relax}
+ {\let\bbl at debug\@gobble
+  \def\bbl at tempa{3.10}%
 \ifx\bbl at version\bbl at tempa\else
   \input switch.def\relax
 \fi}
@@ -115,6 +117,38 @@
 \def\bbl at ifblank#1{%
   \bbl at ifblank@i#1\@nil\@nil\@secondoftwo\@firstoftwo\@nil}
 \long\def\bbl at ifblank@i#1#2\@nil#3#4#5\@nil{#4}
+\def\bbl at forkv#1#2{%
+  \def\bbl at kvcmd##1##2##3{#2}%
+  \bbl at kvnext#1,\@nil,}
+\def\bbl at kvnext#1,{%
+  \ifx\@nil#1\relax\else
+    \bbl at ifblank{#1}{}{\bbl at forkv@eq#1=\@empty=\@nil{#1}}%
+    \expandafter\bbl at kvnext
+  \fi}
+\def\bbl at forkv@eq#1=#2=#3\@nil#4{%
+  \bbl at trim@def\bbl at forkv@a{#1}%
+  \bbl at trim{\expandafter\bbl at kvcmd\expandafter{\bbl at forkv@a}}{#2}{#4}}
+\def\bbl at vforeach#1#2{%
+  \def\bbl at forcmd##1{#2}%
+  \bbl at fornext#1,\@nil,}
+\def\bbl at fornext#1,{%
+  \ifx\@nil#1\relax\else
+    \bbl at ifblank{#1}{}{\bbl at trim\bbl at forcmd{#1}}%
+    \expandafter\bbl at fornext
+  \fi}
+\def\bbl at foreach#1{\expandafter\bbl at vforeach\expandafter{#1}}
+\def\bbl at replace#1#2#3{% in #1 -> repl #2 by #3
+  \toks@{}%
+  \def\bbl at replace@aux##1#2##2#2{%
+    \ifx\bbl at nil##2%
+      \toks@\expandafter{\the\toks@##1}%
+    \else
+      \toks@\expandafter{\the\toks@##1#3}%
+      \bbl at afterfi
+      \bbl at replace@aux##2#2%
+    \fi}%
+  \expandafter\bbl at replace@aux#1#2\bbl at nil#2%
+  \edef#1{\the\toks@}}
 \def\bbl at exp#1{%
   \begingroup
     \let\\\noexpand
@@ -192,8 +226,7 @@
     \fi
   \fi}
 \let\bbl at tempc\@empty
-\bbl at for\bbl at tempa\bbl at tempa{%
-  \expandafter\bbl at tempd\bbl at tempa.\@empty\@nnil}
+\bbl at foreach\bbl at tempa{\bbl at tempd#1.\@empty\@nnil}
 \expandafter\let\csname opt at babel.sty\endcsname\bbl at tempc
 \DeclareOption{KeepShorthandsActive}{}
 \DeclareOption{activeacute}{}
@@ -210,11 +243,11 @@
 \DeclareOption{strings}{\def\bbl at opt@strings{\BabelStringsDefault}}
 \DeclareOption{strings=encoded}{\let\bbl at opt@strings\relax}
 \def\BabelStringsDefault{generic}
-\DeclareOption{hyphenmap=off}{\chardef\bbl at hymapopt\z@}
-\DeclareOption{hyphenmap=first}{\chardef\bbl at hymapopt\@ne}
-\DeclareOption{hyphenmap=select}{\chardef\bbl at hymapopt\tw@}
-\DeclareOption{hyphenmap=other}{\chardef\bbl at hymapopt\thr@@}
-\DeclareOption{hyphenmap=other*}{\chardef\bbl at hymapopt4\relax}
+\DeclareOption{hyphenmap=off}{\chardef\bbl at opt@hyphenmap\z@}
+\DeclareOption{hyphenmap=first}{\chardef\bbl at opt@hyphenmap\@ne}
+\DeclareOption{hyphenmap=select}{\chardef\bbl at opt@hyphenmap\tw@}
+\DeclareOption{hyphenmap=other}{\chardef\bbl at opt@hyphenmap\thr@@}
+\DeclareOption{hyphenmap=other*}{\chardef\bbl at opt@hyphenmap4\relax}
 \DeclareOption{safe=none}{\let\bbl at opt@safe\@empty}
 \DeclareOption{safe=bib}{\def\bbl at opt@safe{B}}
 \DeclareOption{safe=ref}{\def\bbl at opt@safe{R}}
@@ -343,16 +376,12 @@
          {\noexpand\bbl at load@language{\bbl at tempa}}}%
      \bbl at tempb}%
      \@empty}
-\bbl at for\bbl at tempa\@classoptionslist{%
-  \bbl at ifunset{ds@\bbl at tempa}%
-    {\IfFileExists{\bbl at tempa.ldf}%
-      {\edef\bbl at tempb{%
-         \noexpand\DeclareOption
-           {\bbl at tempa}%
-           {\noexpand\bbl at load@language{\bbl at tempa}}}%
-       \bbl at tempb}%
-      \@empty}%
-    \@empty}
+\bbl at foreach\@classoptionslist{%
+  \bbl at ifunset{ds@#1}%
+    {\IfFileExists{#1.ldf}%
+      {\DeclareOption{#1}{\bbl at load@language{#1}}}%
+      {}}%
+    {}}
 \ifx\bbl at opt@main\@nnil\else
   \expandafter
   \let\expandafter\bbl at loadmain\csname ds@\bbl at opt@main\endcsname

Modified: trunk/Master/texmf-dist/tex/generic/babel/bahasa.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/bahasa.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/bahasa.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `bahasa')
+%% bbcompat.dtx  (with options: `styfile,bahasa')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/bahasam.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/bahasam.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/bahasam.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `bahasam')
+%% bbcompat.dtx  (with options: `styfile,bahasam')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/basque.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/basque.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/basque.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `basque')
+%% bbcompat.dtx  (with options: `styfile,basque')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/blplain.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/blplain.tex	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/blplain.tex	2017-05-19 21:04:34 UTC (rev 44427)
@@ -38,7 +38,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %% File 'babel.dtx'
-%%\ProvidesFile{babel.dtx}[2017/04/28 v3.9t The Babel package]
+%%\ProvidesFile{babel.dtx}[2017/05/19 v3.10 The Babel package]
 %% Babel package for LaTeX2e.
 %% Copyright (C) 1989-2008 by Johannes Braams,
 %%                            TeXniek

Modified: trunk/Master/texmf-dist/tex/generic/babel/bplain.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/bplain.tex	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/bplain.tex	2017-05-19 21:04:34 UTC (rev 44427)
@@ -38,7 +38,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %% File 'babel.dtx'
-%%\ProvidesFile{babel.dtx}[2017/04/28 v3.9t The Babel package]
+%%\ProvidesFile{babel.dtx}[2017/05/19 v3.10 The Babel package]
 %% Babel package for LaTeX2e.
 %% Copyright (C) 1989-2008 by Johannes Braams,
 %%                            TeXniek

Modified: trunk/Master/texmf-dist/tex/generic/babel/breton.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/breton.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/breton.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `breton')
+%% bbcompat.dtx  (with options: `styfile,breton')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/british.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/british.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/british.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `british')
+%% bbcompat.dtx  (with options: `styfile,british')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/bulgarian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/bulgarian.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/bulgarian.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `bulgarian')
+%% bbcompat.dtx  (with options: `styfile,bulgarian')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/catalan.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/catalan.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/catalan.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `catalan')
+%% bbcompat.dtx  (with options: `styfile,catalan')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/croatian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/croatian.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/croatian.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `croatian')
+%% bbcompat.dtx  (with options: `styfile,croatian')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/czech.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/czech.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/czech.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `czech')
+%% bbcompat.dtx  (with options: `styfile,czech')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/danish.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/danish.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/danish.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `danish')
+%% bbcompat.dtx  (with options: `styfile,danish')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/dutch.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/dutch.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/dutch.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `dutch')
+%% bbcompat.dtx  (with options: `styfile,dutch')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/english.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/english.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/english.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `english')
+%% bbcompat.dtx  (with options: `styfile,english')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/esperanto.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/esperanto.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/esperanto.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `esperanto')
+%% bbcompat.dtx  (with options: `styfile,esperanto')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/estonian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/estonian.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/estonian.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `estonian')
+%% bbcompat.dtx  (with options: `styfile,estonian')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/finnish.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/finnish.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/finnish.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `finnish')
+%% bbcompat.dtx  (with options: `styfile,finnish')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/francais.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/francais.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/francais.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `francais')
+%% bbcompat.dtx  (with options: `styfile,francais')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/galician.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/galician.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/galician.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `galician')
+%% bbcompat.dtx  (with options: `styfile,galician')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/germanb.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/germanb.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/germanb.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `germanb')
+%% bbcompat.dtx  (with options: `styfile,germanb')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/greek.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/greek.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/greek.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `greek')
+%% bbcompat.dtx  (with options: `styfile,greek')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/hebrew.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/hebrew.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/hebrew.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `hebrew')
+%% bbcompat.dtx  (with options: `styfile,hebrew')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg	2017-05-19 21:04:34 UTC (rev 44427)
@@ -38,7 +38,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %% File 'babel.dtx'
-%%\ProvidesFile{babel.dtx}[2017/04/28 v3.9t The Babel package]
+%%\ProvidesFile{babel.dtx}[2017/05/19 v3.10 The Babel package]
 %% Babel package for LaTeX2e.
 %% Copyright (C) 1989-2008 by Johannes Braams,
 %%                            TeXniek
@@ -52,7 +52,7 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{hyphen.cfg}[2017/04/28 3.9t Babel hyphens]
+\ProvidesFile{hyphen.cfg}[2017/05/19 3.10 Babel hyphens]
 \xdef\bbl at format{\jobname}
 \ifx\AtBeginDocument\@undefined
   \def\@empty{}
@@ -83,7 +83,7 @@
   \countdef\last at language=19
   \def\addlanguage{\alloc at 9\language\chardef\@cclvi}
 \fi
-\toks8{Babel <3.9t> and hyphenation patterns for }%
+\toks8{Babel <3.10> and hyphenation patterns for }%
 \def\process at line#1#2 #3 #4 {%
   \ifx=#1%
     \process at synonym{#2}%

Modified: trunk/Master/texmf-dist/tex/generic/babel/icelandic.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/icelandic.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/icelandic.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `icelandic')
+%% bbcompat.dtx  (with options: `styfile,icelandic')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/interlingua.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/interlingua.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/interlingua.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `interlingua')
+%% bbcompat.dtx  (with options: `styfile,interlingua')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/irish.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/irish.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/irish.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `irish')
+%% bbcompat.dtx  (with options: `styfile,irish')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/italian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/italian.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/italian.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `italian')
+%% bbcompat.dtx  (with options: `styfile,italian')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/latin.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/latin.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/latin.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `latin')
+%% bbcompat.dtx  (with options: `styfile,latin')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/lsorbian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/lsorbian.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/lsorbian.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `lsorbian')
+%% bbcompat.dtx  (with options: `styfile,lsorbian')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/magyar.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/magyar.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/magyar.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `magyar')
+%% bbcompat.dtx  (with options: `styfile,magyar')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/naustrian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/naustrian.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/naustrian.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `naustrian')
+%% bbcompat.dtx  (with options: `styfile,naustrian')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/ngermanb.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/ngermanb.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/ngermanb.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `ngermanb')
+%% bbcompat.dtx  (with options: `styfile,ngermanb')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/nil.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/nil.ldf	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/nil.ldf	2017-05-19 21:04:34 UTC (rev 44427)
@@ -38,7 +38,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %% File 'babel.dtx'
-%%\ProvidesFile{babel.dtx}[2017/04/28 v3.9t The Babel package]
+%%\ProvidesFile{babel.dtx}[2017/05/19 v3.10 The Babel package]
 %% Babel package for LaTeX2e.
 %% Copyright (C) 1989-2008 by Johannes Braams,
 %%                            TeXniek
@@ -47,7 +47,7 @@
 %%                            TeXniek
 %%                         by Javier Bezos
 %%                            all rights reserved.
-\ProvidesLanguage{nil}[2017/04/28 3.9t Nil language]
+\ProvidesLanguage{nil}[2017/05/19 3.10 Nil language]
 \LdfInit{nil}{datenil}
 \ifx\l at nohyphenation\@undefined
    \@nopatterns{nil}

Modified: trunk/Master/texmf-dist/tex/generic/babel/norsk.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/norsk.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/norsk.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `norsk')
+%% bbcompat.dtx  (with options: `styfile,norsk')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/plain.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/plain.def	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/plain.def	2017-05-19 21:04:34 UTC (rev 44427)
@@ -38,7 +38,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %% File 'babel.dtx'
-%%\ProvidesFile{babel.dtx}[2017/04/28 v3.9t The Babel package]
+%%\ProvidesFile{babel.dtx}[2017/05/19 v3.10 The Babel package]
 %% Babel package for LaTeX2e.
 %% Copyright (C) 1989-2008 by Johannes Braams,
 %%                            TeXniek
@@ -119,7 +119,7 @@
 \def\@endofldf{}
 \@onlypreamble\@endofldf
 \let\bbl at afterlang\@empty
-\chardef\bbl at hymapopt\z@
+\chardef\bbl at opt@hyphenmap\z@
 \ifx\if at filesw\@undefined
   \expandafter\let\csname if at filesw\expandafter\endcsname
     \csname iffalse\endcsname

Modified: trunk/Master/texmf-dist/tex/generic/babel/polish.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/polish.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/polish.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `polish')
+%% bbcompat.dtx  (with options: `styfile,polish')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/portuges.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/portuges.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/portuges.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `portuges')
+%% bbcompat.dtx  (with options: `styfile,portuges')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/romanian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/romanian.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/romanian.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `romanian')
+%% bbcompat.dtx  (with options: `styfile,romanian')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/russianb.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/russianb.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/russianb.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `russianb')
+%% bbcompat.dtx  (with options: `styfile,russianb')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/samin.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/samin.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/samin.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `samin')
+%% bbcompat.dtx  (with options: `styfile,samin')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/scottish.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/scottish.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/scottish.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `scottish')
+%% bbcompat.dtx  (with options: `styfile,scottish')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/serbian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/serbian.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/serbian.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `serbian')
+%% bbcompat.dtx  (with options: `styfile,serbian')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/slovak.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/slovak.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/slovak.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `slovak')
+%% bbcompat.dtx  (with options: `styfile,slovak')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/slovene.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/slovene.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/slovene.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `slovene')
+%% bbcompat.dtx  (with options: `styfile,slovene')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/spanish.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/spanish.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/spanish.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `spanish')
+%% bbcompat.dtx  (with options: `styfile,spanish')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/swedish.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/swedish.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/swedish.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `swedish')
+%% bbcompat.dtx  (with options: `styfile,swedish')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/switch.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/switch.def	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/switch.def	2017-05-19 21:04:34 UTC (rev 44427)
@@ -38,7 +38,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %% File 'babel.dtx'
-%%\ProvidesFile{babel.dtx}[2017/04/28 v3.9t The Babel package]
+%%\ProvidesFile{babel.dtx}[2017/05/19 v3.10 The Babel package]
 %% Babel package for LaTeX2e.
 %% Copyright (C) 1989-2008 by Johannes Braams,
 %%                            TeXniek
@@ -52,7 +52,7 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{switch.def}[2017/04/28 3.9t Babel switching mechanism]
+\ProvidesFile{switch.def}[2017/05/19 3.10 Babel switching mechanism]
 \ifx\AtBeginDocument\@undefined
   \input plain.def\relax
 \fi
@@ -73,8 +73,8 @@
   \countdef\last at language=19
   \def\addlanguage{\alloc at 9\language\chardef\@cclvi}
 \fi
-\def\bbl at version{3.9t}
-\def\bbl at date{2017/04/28}
+\def\bbl at version{3.10}
+\def\bbl at date{2017/05/19}
 \def\adddialect#1#2{%
   \global\chardef#1#2\relax
   \bbl at usehooks{adddialect}{{#1}{#2}}%
@@ -135,8 +135,8 @@
   \expandafter\ifx\csname date\languagename\endcsname\relax\else
     \if at filesw
       \protected at write\@auxout{}{\string\select at language{\languagename}}%
-      \bbl at for\bbl at tempa\BabelContentsFiles{%
-        \addtocontents{\bbl at tempa}{\xstring\select at language{\languagename}}}%
+      \bbl at foreach\BabelContentsFiles{%
+        \addtocontents{##1}{\xstring\select at language{\languagename}}}%
       \bbl at usehooks{write}{}%
     \fi
   \fi}
@@ -172,14 +172,14 @@
   \bbl at usehooks{beforeextras}{}%
   \csname extras#1\endcsname\relax
   \bbl at usehooks{afterextras}{}%
-  \ifcase\bbl at hymapopt\or
+  \ifcase\bbl at opt@hyphenmap\or
     \def\BabelLower##1##2{\lccode##1=##2\relax}%
     \ifnum\bbl at hymapsel>4\else
       \csname\languagename @bbl at hyphenmap\endcsname
     \fi
-    \chardef\bbl at hymapopt\z@
+    \chardef\bbl at opt@hyphenmap\z@
   \else
-    \ifnum\bbl at hymapsel>\bbl at hymapopt\else
+    \ifnum\bbl at hymapsel>\bbl at opt@hyphenmap\else
       \csname\languagename @bbl at hyphenmap\endcsname
     \fi
   \fi
@@ -346,6 +346,14 @@
   {\let\bbl at info\@gobble
    \let\bbl at warning\@gobble}
   {}
+\def\bbl at nocaption#1#2{% 1: text to be printed 2: caption macro \langXname
+  \gdef#2{\textbf{?#1?}}%
+  #2%
+  \bbl at warning{%
+    \string#2 not set. Please, define\\%
+    it in the preamble with something like:\\%
+    \string\renewcommand\string#2{..}\\%
+    Reported}}
 \def\@nolanerr#1{%
   \bbl at error
     {You haven't defined the language #1\space yet}%

Modified: trunk/Master/texmf-dist/tex/generic/babel/turkish.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/turkish.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/turkish.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `turkish')
+%% bbcompat.dtx  (with options: `styfile,turkish')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/ukraineb.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/ukraineb.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/ukraineb.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `ukraineb')
+%% bbcompat.dtx  (with options: `styfile,ukraineb')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/usorbian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/usorbian.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/usorbian.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `usorbian')
+%% bbcompat.dtx  (with options: `styfile,usorbian')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.

Modified: trunk/Master/texmf-dist/tex/generic/babel/welsh.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/welsh.sty	2017-05-19 21:04:11 UTC (rev 44426)
+++ trunk/Master/texmf-dist/tex/generic/babel/welsh.sty	2017-05-19 21:04:34 UTC (rev 44427)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% bbcompat.dtx  (with options: `welsh')
+%% bbcompat.dtx  (with options: `styfile,welsh')
 %% This is a generated file.
 %% 
 %% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.



More information about the tex-live-commits mailing list