texlive[52194] Master/texmf-dist: babel (27sep19)

commits+karl at tug.org commits+karl at tug.org
Fri Sep 27 23:26:39 CEST 2019


Revision: 52194
          http://tug.org/svn/texlive?view=revision&revision=52194
Author:   karl
Date:     2019-09-27 23:26:38 +0200 (Fri, 27 Sep 2019)
Log Message:
-----------
babel (27sep19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/babel/README.md
    trunk/Master/texmf-dist/doc/latex/babel/babel.pdf
    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/locale.zip
    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/hyphen.cfg
    trunk/Master/texmf-dist/tex/generic/babel/locale/tr/babel-turkish.tex
    trunk/Master/texmf-dist/tex/generic/babel/luababel.def
    trunk/Master/texmf-dist/tex/generic/babel/nil.ldf
    trunk/Master/texmf-dist/tex/generic/babel/switch.def
    trunk/Master/texmf-dist/tex/generic/babel/xebabel.def

Modified: trunk/Master/texmf-dist/doc/latex/babel/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/babel/README.md	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/doc/latex/babel/README.md	2019-09-27 21:26:38 UTC (rev 52194)
@@ -1,4 +1,4 @@
-## Babel 3.33
+## Babel 3.34
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages.  Many
@@ -51,6 +51,11 @@
 ### Latest changes
 
 ```
+3.34   2019-09-27
+       - Improved compatibility for \babelfont vs \setmainfont.
+       - Fix - active ' entered in an infinite loop with lua.
+       - Fix - main in \babelprovide was not set until begin document.
+       
 3.33   2019-07-19
        - \prehyphenchar set to 0 in languages requiring it: kannada,
          marathi, tamil, etc. (lua).
@@ -57,6 +62,7 @@
        - \AddBabelHook can be set for specific languages.
        - Fix - !\grq in T1 behaved like the ligature !`.
        - Minimal preliminary support for the experimental harftex.
+       
 3.32   2019-06-03
        - CJK line breaking is now disabled in verbatim (lua).
        - New - \babelcharproperty, to change the direction, mirroring
@@ -119,30 +125,6 @@
        - Set the \thepage bidi bahavior in foots/heads.
        - Fix - Undefined \bbl at stripslash in Plain.
 
-3.22   2018-06-05
-       - Fix - Error with \chapter if empty in ini
-       - Prelimimary support for Sanskrit
-       - Unknown languages in aux files do not raise an error
-         any more (only show a warning).
-
-3.21   2018-05-10
-       - Fix - equation numbers raised an error.
-       - Two minor changes: if no language is requested load nil 
-         instead of raising an error, and the message 'babel <x.x>...'
-         is not printed to the log any more.
-
-3.20   2018-05-02
-       - ini files with the field digits.native define
-         \<language>digits and \<language>counters. \arabic can be
-         redefined to use native digits.
-       - Fix - mapfont in bidi=basic didn't take into account combining
-         marks (eg, Arabic vowels).
-       - Fix - A bug introduced in 3.19, which sometimes reversed text 
-         in \hbox'es.
-       - Fix for luatex 1.07 - An internal change in luatex broke
-         bidi at 'automatic' hyphens.
-       - Fix for latest latex - babel.ins raised an error.
-
 ```
 
 Javier Bezos

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

Modified: trunk/Master/texmf-dist/source/latex/babel/babel.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/babel.dtx	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/source/latex/babel/babel.dtx	2019-09-27 21:26:38 UTC (rev 52194)
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2019/07/19 v3.33 The Babel package]
+\ProvidesFile{babel.dtx}[2019/09/27 v3.34 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -267,7 +267,7 @@
 \subsection{Monolingual documents}
 
 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
+\LaTeX{} is to load the package using its standard mechanism for this
 purpose, namely, passing that language as an optional argument. In
 addition, you may want to set the font and input encodings.
 
@@ -282,7 +282,7 @@
 \documentclass{article}
 
 \usepackage[T1]{fontenc}
-\usepackage[utf8]{inputenc}
+% \usepackage[utf8]{inputenc} % Uncomment if LaTeX < 2018-04-01
 
 _\usepackage[french]{babel}_
 
@@ -349,9 +349,10 @@
 
 \subsection{Multilingual documents}
 
-In multilingual documents, just use several options. The last one is
-considered the main language, activated by default. Sometimes, the
-main language changes the document layout (eg, |spanish| and |french|).
+In multilingual documents, just use a list of the required languages as
+package or class options. The last language is considered the main one,
+activated by default. Sometimes, the main language changes the document
+layout (eg, |spanish| and |french|).
 
 \begin{example}
   In \LaTeX, the preamble of the document:
@@ -364,12 +365,15 @@
   language in use, and the main one.
 \end{example}
 
-You can also set the main language explicitly:
+You can also set the main language explicitly, but it is discouraged
+except if there a real reason to do so:
 \begin{verbatim}
 \documentclass{article}
 \usepackage[_main=english_,dutch]{babel}
 \end{verbatim}
 
+Examples of cases where |main| is useful are the following.
+
 \begin{note}
 Some classes load \babel{} with a hardcoded language option. Sometimes,
 the main language could be overridden with something like that before
@@ -432,7 +436,7 @@
 loading \babel{} by means of \textit{modifiers}. They are set after
 the language name, and are prefixed with a dot (only when the language
 is set as package option -- neither global options nor the |main| key
-accept them). An example is (spaces are not significant and they can
+accepts them). An example is (spaces are not significant and they can
 be added or removed):\footnote{No predefined ``axis'' for modifiers
 are provided because languages and their scripts have quite different
 needs.}
@@ -442,7 +446,7 @@
 
 Attributes (described below) are considered modifiers, ie, you can
 set an attribute by including it in the list of modifiers. However,
-modifiers is a more general mechanism.
+modifiers are a more general mechanism.
 
 \subsection{\textsf{xelatex} and \textsf{lualatex}}
 
@@ -607,7 +611,7 @@
 \Describe{\begin\menv{otherlanguage}}{\marg{language}\Eenv{otherlanguage}}
 
 The environment \Lenv{otherlanguage} does basically the same as
-|\selectlanguage|, except the language change is (mostly) local to
+|\selectlanguage|, except that language change is (mostly) local to
 the environment.
 
 Actually, there might be some non-local changes, as this environment
@@ -659,7 +663,7 @@
 \Describe{\babeltags}{\char`\{\m{tag1} \texttt{=} \m{language1}, \m{tag2}
 \texttt{=} \m{language2}, \dots\char`\}}
 
-\New{3.9i} In multilingual documents with many language switches the
+\New{3.9i} In multilingual documents with many language-switches the
 commands above can be cumbersome. With this tool shorter names can be
 defined. It adds nothing really new -- it is just syntactical sugar.
 
@@ -740,7 +744,7 @@
 A \textit{shorthand} is a sequence of one or two characters that
 expands to arbitrary \TeX{} code.
 
-Shorthands can be used for different kinds of things, as for example:
+Shorthands can be used for different kinds of things, for example:
 (1) in some languages shorthands such as |"a| are defined to be able
 to hyphenate the word if the encoding is |OT1|; (2) in some languages
 shorthands such as |!| are used to insert the right amount of white
@@ -747,7 +751,7 @@
 space; (3) several kinds of discretionaries and breaks can be inserted
 easily with |"-|, |"=|, etc.
 
-The package \textsf{inputenc} as well as \xetex{} an \luatex{} have
+The package \textsf{inputenc} as well as \xetex{} and \luatex{} have
 alleviated entering non-ASCII characters, but minority languages and
 some kinds of text can still require characters not directly available
 on the keyboards (and sometimes not even as separated or precomposed
@@ -860,7 +864,7 @@
 \defineshorthand{"*}{\babelhyphen{soft}}
 \defineshorthand{"-}{\babelhyphen{hard}}
 \end{verbatim}
-  However, behavior of hyphens is language dependent. For example, in
+  However, the behavior of hyphens is language-dependent. For example, in
   languages like Polish and Portuguese, a hard hyphen inside compound
   words are repeated at the beginning of the next line. You could then
   set:
@@ -870,7 +874,7 @@
   Here, options with |*| set a language-dependent user shorthand,
   which means the generic one above only applies for the rest of
   languages; without |*| they would (re)define the language shorthands
-  instead, which are overriden by user ones.
+  instead, which are overridden by user ones.
 
   Now, you have a single unified shorthand (|"-|), with a
   content-based meaning (`compound word hyphen') whose visual behavior
@@ -924,7 +928,7 @@
 with, for example, |\useshorthands| or |\useshorthands*|.)
 
 Very often, this is a more convenient way to deactivate shorthands
-than |\shorthandoff|, as for example if you want to define a macro
+than |\shorthandoff|, for example if you want to define a macro
 to easy typing phonetic characters with \textsf{tipa}:
 \begin{verbatim}
 \newcommand{\myipa}[1]{{\languageshorthands{none}\tipaencoding#1}}
@@ -937,7 +941,7 @@
 off with |\shorthandoff| or (3) deactivated with the internal
 |\bbl at deactivate|; for example, \verb|\babelshorthand{"u}| or
 \verb|\babelshorthand{:}|.  (You can conveniently define your own
-macros, or even you own user shorthands provided they do not ovelap.)
+macros, or even your own user shorthands provided they do not overlap.)
 
 For your records, here is a list of shorthands, but you must double
 check them, as they may change:\footnote{Thanks to Enrico Gregorio}
@@ -1029,7 +1033,7 @@
 Shorthands are mainly intended for text, not for math. By setting this
 option with the value |normal| they are deactivated in math mode
 (default is |active|) and things like |${a'}$| (a closing brace after
-a shorthand) are not a source of trouble any more.
+a shorthand) are not a source of trouble anymore.
 
 \Describe{config=}{\meta{file}} Load \meta{file}\texttt{.cfg} instead
 of the default config file |bblopts.cfg| (the file is loaded even
@@ -1041,8 +1045,8 @@
 languages.
 
 \Describe{headfoot=}{\meta{language}} By default, headlines and
-footlines are not touched (only marks), and if they contain language
-dependent macros (which is not usual) there may be unexpected
+footlines are not touched (only marks), and if they contain
+language-dependent macros (which is not usual) there may be unexpected
 results. With this option you may set the language in heads and foots.
 
 \Describe{noconfigs}{} Global and language default config files are
@@ -1100,7 +1104,7 @@
   options have been stated. The option |first| can be regarded as an
   optimized version of \texttt{other*} for monolingual
   documents.\footnote{Providing |foreign| is pointless, because the
-  case mapping applied is that at the end of paragraph, but if either
+  case mapping applied is that at the end of the paragraph, but if either
   \xetex{} or \luatex{} change this behavior it might be added. On
   the other hand, |other| is provided even if I [JBL] think it isn't
   really useful, but who knows.}
@@ -1122,11 +1126,11 @@
 
 With this package option \babel{} just loads some basic macros (those
 in |switch.def|), defines |\AfterBabelLanguage| and exits. It also
-selects the hyphenations patterns for the last language passed as
+selects the hyphenation patterns for the last language passed as
 option (by its name in |language.dat|). There are two main uses:
 classes and packages, and as a last resort in case there are, for some
 reason, incompatible languages. It can be used if you just want to
-select the hyphenations patterns of a single language, too.
+select the hyphenation patterns of a single language, too.
 % TODO: example
 
 \Describe\AfterBabelLanguage{\marg{option-name}\marg{code}}
@@ -1945,8 +1949,8 @@
   This makes sure the OpenType script for Devanagari is |deva| and not
   |dev2| (\luatex{} does not detect automatically the correct 
   script\footnote{And even with the correct code some fonts could be 
-  rendered incorrectly by \textsf{fontspec}, so double check the 
-  results. \xetex{} fares better, but some font are still
+  rendered incorrectly by \textsf{fontspec}, so double-check the 
+  results. \xetex{} fares better, but some fonts are still
   problematic.}). You may also pass some options to \textsf{fontspec}:
   with |silent|, the warnings about unavailable scripts or languages
   are not shown (they are only really useful when the document format
@@ -1966,10 +1970,10 @@
   |\fontspec| is not touched at all, only the preset font families
   (|rm|, |sf|, |tt|, and the like). If a language is switched when an
   \textit{ad hoc} font is active, or you select the font with this
-  command, neither the script nor the language are passed. You must
+  command, neither the script nor the language is passed. You must
   add them by hand. This is by design, for several reasons (for
   example, each font has its own set of features and a generic setting
-  for several of them could be problematic, and also a “lower level”
+  for several of them could be problematic, and also a “lower-level”
   font selection is useful).
 \end{note}
 
@@ -1993,7 +1997,9 @@
   no-op). Of course, both methods are incompatible, and if you use
   |\set|\textit{xxxx}|font|, font switching with |\babelfont| just
   does \textit{not} work (nor the standard |\|\textit{xx}|default|,
-  for that matter).
+  for that matter). As of \New{3.34} there is an attempt to make them
+  compatible, but the language system will not be set by \babel and
+  should be set with |fontspec| if necessary.
 \end{warning}
 
 \begin{troubleshooting}
@@ -2038,6 +2044,14 @@
 unselected: |\noextras|\m{lang}.
 \end{itemize}
 
+\begin{note} Do \textit{not} redefine a caption in the following way:
+\begin{verbatim}
+\AtBeginDocument{\renewcommand\contentsname{Foo}}
+\end{verbatim}
+The changes may be discarded with a language selector, and the original
+value restored.
+\end{note}
+
 \begin{note}
   These macros (|\captions|\m{lang}, |\extras|\m{lang}) may be
   redefined, but \textit{must not} be used as such -- they just pass
@@ -2064,11 +2078,14 @@
 
 \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 alerts like that in the |log| file:
+If the language |\marg{language-name}| has not been defined and there
+are no options, it creates an “empty” one in the following way: 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, some options allow to fill the language, and \babel{}
+warns you about what to do if there is a missing string. Very likely
+you will find alerts like that in the |log| file:
 \begin{verbatim}
 Package babel Warning: \mylangchaptername not set. Please, define
 (babel)                it in the preamble with something like:
@@ -2187,7 +2204,7 @@
 “provided” language, then change its font to that set for this
 language’. There are 3 directions, following the bidi Unicode
 algorithm, namely, Arabic-like, Hebrew-like and left to
-right.\footnote{In future releases an new value (\texttt{script}) will
+right.\footnote{In future releases a new value (\texttt{script}) will
 be added.} So, there should be at most 3 directives of this kind.
 
 \Describe{intraspace=}{\meta{base} \meta{shrink} \meta{stretch}}
@@ -2295,13 +2312,13 @@
 in the word. This is the desired behavior very often, but not always,
 and therefore many languages provide shorthands for these
 cases. Unfortunately, this has not been done consistently: for
-example, \verb|"-| in Dutch, Portugese, Catalan or Danish is a hard
+example, \verb|"-| in Dutch, Portuguese, Catalan or Danish is a hard
 hyphen, while in German, Spanish, Norwegian, Slovak or Russian is a
 soft hyphen. Furthermore, some of them even redefine |\-|, so that you
 cannot insert a soft hyphen without breaking opportunities in the rest
 of the word.
 
-Therefore, some macros are provide with a set of basic ``hyphens''
+Therefore, some macros are provided with a set of basic ``hyphens''
 which can be used by themselves, to define a user shorthand, or even
 in language files.
 \begin{itemize}
@@ -2309,16 +2326,16 @@
   explanatory.
 \item |\babelhyphen{repeat}| inserts a hard hyphen which is repeated
   at the beginning of the next line, as done in languages like
-  Polish, Portugese and Spanish.
+  Polish, Portuguese and Spanish.
 \item |\babelhyphen{nobreak}| inserts a hard hyphen without a break
   after it (even if a space follows).
-\item |\babelhyphen{empty}| inserts a break oportunity without
+\item |\babelhyphen{empty}| inserts a break opportunity without
   a hyphen at all.
 \item |\babelhyphen|\marg{text} is a hard ``hyphen'' using \m{text}
   instead. A typical case is |\babelhyphen{/}|.
 \end{itemize}
-With all of them hyphenation in the rest of the word is enabled. If
-you don't want enabling it, there is a starred counterpart:
+With all of them, hyphenation in the rest of the word is enabled. If
+you don't want to enable it, there is a starred counterpart:
 |\babelhyphen*{soft}| (which in most cases is equivalent to the
 original |\-|), |\babelhyphen*{hard}|, etc.
 
@@ -2345,7 +2362,7 @@
 
 It can be used only in the preamble, and exceptions are set when the
 language is first selected, thus taking into account changes of
-|\lccodes|'s done in |\extras|\m{lang} as well as the language specific
+|\lccodes|'s done in |\extras|\m{lang} as well as the language-specific
 encoding (not set in the preamble by default). Multiple
 |\babelhyphenation|'s are allowed. For example:
 \begin{verbatim}
@@ -2359,7 +2376,7 @@
 \begin{note}
   Using |\babelhyphenation| with Southeast Asian scripts is mostly
   pointless. But with |\babelpatterns| (below) you may fine-tune line
-  breaking (only \luatex). Even if there are no pattern for the
+  breaking (only \luatex). Even if there are no patterns for the
   language, you can add at least some typical cases.
 \end{note}
 
@@ -2376,7 +2393,7 @@
 
 It can be used only in the preamble, and patterns are added when the
 language is first selected, thus taking into account changes of
-|\lccodes|'s done in |\extras|\m{lang} as well as the language specific
+|\lccodes|'s done in |\extras|\m{lang} as well as the language-specific
 encoding (not set in the preamble by default). Multiple
 |\babelpatterns|'s are allowed.
 
@@ -2402,7 +2419,7 @@
 
 Currently \babel{} provides no standard interface to select
 scripts, because they are best selected with either |\fontencoding|
-(low level) or a language name (high level). Even the Latin script may
+(low-level) or a language name (high-level). Even the Latin script may
 require different encodings (ie, sets of glyphs) depending on the
 language, and therefore such a switch would be in a sense
 incomplete.\footnote{The so-called Unicode fonts do not improve the
@@ -2440,7 +2457,7 @@
 in some special cases when no Latin encoding is explicitly set).
 
 The foregoing rules (which are applied ``at begin document'') cover
-most of cases. No assumption is made on characters above
+most of the cases. No assumption is made on characters above
 127, which may not follow the LICR conventions -- the goal is just
 to ensure most of the ASCII letters and symbols are the right ones.
 
@@ -2456,7 +2473,7 @@
 
 \begin{warning}
   The current code for \textbf{text} in \luatex{} should be considered
-  essentially stable, but, of course, it is not bug free and there
+  essentially stable, but, of course, it is not bug-free and there
   could be improvements in the future, because setting bidi text has
   many subtleties (see for example <https://www.w3.org/TR/html-bidi/>).
   A basic stable version for other engines must wait. This applies to
@@ -2463,7 +2480,7 @@
   text; there is a basic support for \textbf{graphical} elements,
   including the |picture| environment (with \textsf{pict2e}) and
   \textsf{pfg/tikz}. Also, indexes and the like are under study, as
-  well as math (there are progresses in the latter, too, but for
+  well as math (there is progress in the latter, too, but for
   example |cases| may fail).
 
   An effort is being made to avoid incompatibilities in the future
@@ -2480,7 +2497,7 @@
 
 \New{3.14} Selects the bidi algorithm to be used. With |default| the
 bidi mechanism is just activated (by default it is not), but every
-change must by marked up. In \xetex{} and \pdftex{} this is the only
+change must be marked up. In \xetex{} and \pdftex{} this is the only
 option.
 
 In \luatex, |basic-r| provides a simple and fast method for R text,
@@ -2580,7 +2597,7 @@
 \end{example}
 
 \begin{note}
-  Boxes are “black boxes”. Numbers inside an |\hbox| (as for example
+  Boxes are “black boxes”. Numbers inside an |\hbox| (for example
   in a |\ref|) do not know anything about the surrounding chars. So,
   |\ref{A}-\ref{B}| are not rendered in the visual order A-B, but in the
   wrong one B-A (because the hyphen does not “see” the digits inside the
@@ -2591,7 +2608,7 @@
 \newcommand\refrange[2]{\babelsublr{\texthe{\ref{#1}}-\texthe{\ref{#2}}}}
 \end{verbatim}
 
-  In a future a more complete method, reading recursively boxed text, may
+  In the future a more complete method, reading recursively boxed text, may
   be added.
 \end{note}
 
@@ -2654,7 +2671,7 @@
   toc entries are R by default if the main language is R.
 
 \item[columns] required in \xetex{} and \pdftex{} to reverse the
-  column order (currently only the standard two column mode); in
+  column order (currently only the standard two-column mode); in
   \luatex{} they are R by default if the main language is R (including
   \textsf{multicol}).
 
@@ -2661,7 +2678,7 @@
 \item[footnotes] not required in monolingual documents, but it may be
   useful in bidirectional documents (with both R and L paragraphs) in all
   engines; you may use alternatively |\BabelFootnote| described below
-  (what this options does exactly is also explained there).
+  (what this option does exactly is also explained there).
 
 \item[captions] is similar to |sectioning|, but for |\caption|; not
   required in monolingual documents with \luatex{}, but may be
@@ -2803,8 +2820,8 @@
 and disabled for all defined events with |\EnableBabelHook|\marg{name},
 |\DisableBabelHook|\marg{name}. Names containing the string |babel| are
 reserved (they are used, for example, by |\useshortands*| to add a hook
-for the event |afterextras|). \New{3.33} They may be also applied to an
-specific language with the optional argument; language specific
+for the event |afterextras|). \New{3.33} They may be also applied to a
+specific language with the optional argument; language-specific
 settings are executed after global ones.
 
 Current events are the following; in some of them you can use one to
@@ -2826,7 +2843,7 @@
 \item[encodedcommands] (input, font encodings) Used (locally) in
   |\StartBabelCommands|. Both \xetex{} and \luatex{} make sure the
   encoded text is read correctly.
-\item[stopcommands] Used to reset the the above, if necessary.
+\item[stopcommands] Used to reset the above, if necessary.
 \item[write] This event comes just after the switching commands are
   written to the |aux| file.
 \item[beforeextras] Just before executing |\extras|\m{language}. This
@@ -2852,6 +2869,13 @@
 \item[afterreset] \New{3.9i} Executed when selecting a language just after
   |\originalTeX| is run and reset to its base value, before executing
   |\captions|\m{language} and |\date|\m{language}.
+% STILL UNDER STUDY:
+% \item[beforestart] \New{3.34} Executed either at the beginning of the
+%   |aux| file (when read at the start of the document), or else at begin
+%   document. In other words, it makes sure the code is executed always
+%   and executed once. But be aware it is a somewhat dangerous, because
+%   the scope in the first case is local, while in the second case is
+%   global, so be careful with assignments.
 \end{description}
 
 Four events are used in \file{hyphen.cfg}, which are handled in a
@@ -2864,7 +2888,7 @@
 \item[everylanguage] (language) Executed before every language patterns
   are loaded.
 \item[loadkernel] (file) By default loads |switch.def|. It can be used
-  to load a different version of this files or to load nothing.
+  to load a different version of this file or to load nothing.
 \item[loadpatterns] (patterns file) Loads the patterns file. Used by
   \file{luababel.def}.
 \item[loadexceptions] (exceptions file) Loads the exceptions
@@ -2959,7 +2983,8 @@
 script-specific features based on some properties. Currently, they are
 3, namely, direction (ie, bidi class), mirroring glyphs, and line
 breaking for CJK scripts. These properties are stored in \textsf{lua}
-tables, which you can modify with the following macro.
+tables, which you can modify with the following macro (for example,
+to set them for glyphs in the PUA).
 
 \Describe{\babelcharproperty}{\marg{char-code}\oarg{to-char-code}%
           \marg{propertry}\marg{value}}
@@ -2979,7 +3004,7 @@
 This command is allowed only in vertical mode (the preamble or between
 paragraphs).
 
-\subsection{Tips, workarounds, know issues and notes}
+\subsection{Tips, workarounds, known issues and notes}
 
 \begin{itemize}
 \item If you use the document class \cls{book} \emph{and} you use
@@ -3066,7 +3091,7 @@
 
 \subsection{Current and future work}
 
-Current work is focused on the so-called complex scripts in \luatex{}.
+The current work is focused on the so-called complex scripts in \luatex{}.
 In 8-bit engines, \babel{} provided a basic support for bidi text as
 part of the style for Hebrew, but it is somewhat unsatisfactory and
 internally replaces some hardwired commands by other hardwired commands
@@ -3074,7 +3099,7 @@
 
 Useful additions would be, for example, time, currency, addresses and
 personal names.\footnote{See for example POSIX, ISO 14652 and the
-Unicode Common Locale Data Repository (CLDR). Those system, however,
+Unicode Common Locale Data Repository (CLDR). Those systems, however,
 have limited application to \TeX\ because their aim is just to display
 information and not fine typesetting.}. But that is the easy
 part, because they don't require modifying the \LaTeX{} internals.
@@ -3177,7 +3202,7 @@
 
 You may also set the font encoding the patterns are intended for by
 following the language name by a colon and the encoding
-code.\footnote{This in not a new feature, but in former versions it
+code.\footnote{This is not a new feature, but in former versions it
 didn't work correctly.} For example:
 \begin{verbatim}
 german:T1 hyphenT1.ger
@@ -3251,19 +3276,19 @@
   ancient language). Note however |=|, |<|, |>|, |:| and the like
   can be dangerous, because they may be used as part of the syntax
   of some elements (numeric expressions, key/value pairs, etc.).
-\item Captions should not contain shorthands or encoding dependent
+\item Captions should not contain shorthands or encoding-dependent
   commands (the latter is not always possible, but should be clearly
   documented). They should be defined using the LICR. You may
   also use the new tools for encoded strings, described below.
 \item Avoid adding things to |\noextras|\m{lang} except for umlauthigh
   and friends, |\bbl at deactivate|, |\bbl@(non)frenchspacing|, and
-  language specific macros. Use always, if possible, |\bbl at save| and
+  language-specific macros. Use always, if possible, |\bbl at save| and
   |\bbl at savevariable| (except if you still want to have access to the
   previous value). Do not reset a macro or a setting to a hardcoded
   value. Never. Instead save its value in |\extras|\m{lang}.
 \item Do not switch scripts. If you want to make sure a set of glyphs
-  is used, switch either the font encoding (low level) or the language
-  (high level, which in turn may switch the font encoding). Usage of things
+  is used, switch either the font encoding (low-level) or the language
+  (high-level, which in turn may switch the font encoding). Usage of things
   like |\latintext| is deprecated.\footnote{But not removed, for backward
   compatibility.}
 \item Please, for ``private'' internal macros do not use the |\bbl@|
@@ -3307,7 +3332,7 @@
 The following page provides a starting point:
 \texttt{http://www.texnia.com/incubator.html}.
 
-If your need further assistance and technical advice in the
+If you need further assistance and technical advice in the
 development of language styles, I am willing to help you.  And of
 course, you can make any suggestion you like.
 
@@ -3429,7 +3454,7 @@
 
 Here is the basic structure of an |ldf| file, with a language, a
 dialect and an attribute. Strings are best defined using the method
-explained in in sec. \ref{s:strings} (\babel{} 3.9 and later).
+explained in sec. \ref{s:strings} (\babel{} 3.9 and later).
 
 \begin{verbatim}
 \ProvidesLanguage{<language>}
@@ -3651,7 +3676,7 @@
 |encoded|).
 
 If a string is set several times (because several blocks are read),
-the first one take precedence (ie, it works much like
+the first one takes precedence (ie, it works much like
 |\providecommand|).
 
 Encoding info is |charset=| followed by a charset, which if given sets
@@ -3784,7 +3809,7 @@
 
 \Describe\SetCase{\oarg{map-list}\marg{toupper-code}\marg{tolower-code}}
 Sets globally code to be executed at |\MakeUppercase| and
-|\MakeLowercase|. The code would be typically things like |\let\BB\bb|
+|\MakeLowercase|. The code would typically be things like |\let\BB\bb|
 and |\uccode| or |\lccode| (although for the reasons explained above,
 changes in lc/uc codes may not work). A \meta{map-list} is a series of
 macros using the internal format of |\@uclclist| (eg,
@@ -3856,7 +3881,7 @@
 
 \subsection{Changes in \babel\ version 3.9}
 
-Most of changes in version 3.9 were related to bugs, either to fix them
+Most of the changes in version 3.9 were related to bugs, either to fix them
 (there were lots), or to provide some alternatives. Even new features
 like |\babelhyphen| are intended to solve a certain problem (in this
 case, the lacking of a uniform syntax and behavior for shorthands
@@ -4046,8 +4071,8 @@
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.33>>
-%<<date=2019/07/19>>
+%<<version=3.34>>
+%<<date=2019/09/27>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -4134,6 +4159,25 @@
 %  \end{macro}
 %  \end{macro}
 %
+% \begin{macro}{\bbl at exp}
+%
+%   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
+%   name (the latter does not define the macro if undefined to
+%   |\relax|, because it is created locally). The result may be
+%   followed by extra arguments, if necessary.
+%
+%    \begin{macrocode}
+\def\bbl at exp#1{%
+  \begingroup
+    \let\\\noexpand
+    \def\<##1>{\expandafter\noexpand\csname##1\endcsname}%
+    \edef\bbl at exp@aux{\endgroup#1}%
+  \bbl at exp@aux}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\bbl at trim}
 %   The following piece of code is stolen (with some changes) from
 %   \textsf{keyval}, by David Carlisle. It defines two macros:
@@ -4257,12 +4301,20 @@
 % |ho|, then |\relax| becomes |\rho|). No checking is done at all,
 % because it is not a general purpose macro, and it is used by \babel{}
 % only when it works (an example where it does \textit{not} work is in
-% |\bbl at TG@@date|). It may change! (to add new features).
-%
+% |\bbl at TG@@date|, and also fails if there are macros with spaces,
+% because they retokenized). It may change! (or even merged with
+% |\bbl at replace|; I'm not sure ckecking the replacement is really
+% necessary or just paranoia).
+% 
+% \changes{babel~3.34}{2019/07/23}{Take into account prefixes like
+%   \cs{long} and macros with trailing spaces. Don't touch original if
+%   not necessary.}
+% 
 %    \begin{macrocode}
-\expandafter\def\expandafter\bbl at parsedef\detokenize{macro:}#1->#2\relax{%
+\bbl at exp{\def\\\bbl at parsedef##1\detokenize{macro:}}#2->#3\relax{%
   \def\bbl at tempa{#1}%
-  \def\bbl at tempb{#2}}
+  \def\bbl at tempb{#2}%
+  \def\bbl at tempe{#3}}
 \def\bbl at sreplace#1#2#3{%
   \begingroup
     \expandafter\bbl at parsedef\meaning#1\relax
@@ -4270,34 +4322,23 @@
     \edef\bbl at tempc{\expandafter\strip at prefix\meaning\bbl at tempc}%
     \def\bbl at tempd{#3}%
     \edef\bbl at tempd{\expandafter\strip at prefix\meaning\bbl at tempd}%
-    \bbl at exp{\\\bbl at replace\\\bbl at tempb{\bbl at tempc}{\bbl at tempd}}%
-    \bbl at exp{%
+    \bbl at xin@{\bbl at tempc}{\bbl at tempe}% If not in macro, do nothing
+    \ifin@
+      \bbl at exp{\\\bbl at replace\\\bbl at tempe{\bbl at tempc}{\bbl at tempd}}%
+      \def\bbl at tempc{%     Expanded an executed below as 'uplevel'
+         \\\makeatletter % "internal" macros with @ are assumed
+         \\\scantokens{%
+           \bbl at tempa\\\@namedef{\bbl at stripslash#1}\bbl at tempb{\bbl at tempe}}%
+         \catcode64=\the\catcode64\relax}%  Restore @
+    \else
+      \let\bbl at tempc\@empty  % Not \relax
+    \fi
+    \bbl at exp{%      For the 'uplevel' assignments
   \endgroup
-  \\\makeatletter % "internal" macros with @ are assumed
-  \\\scantokens{\def\\#1\bbl at tempa{\bbl at tempb}}%
-  \catcode64=\the\catcode64\relax}} % Restore @
+    \bbl at tempc}}  % empty or expand to set #1 with changes 
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\bbl at exp}
-%
-%   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
-%   name (the latter does not define the macro if undefined to
-%   |\relax|, because it is created locally). The result may be
-%   followed by extra arguments, if necessary.
-%
-%    \begin{macrocode}
-\def\bbl at exp#1{%
-  \begingroup
-    \let\\\noexpand
-    \def\<##1>{\expandafter\noexpand\csname##1\endcsname}%
-    \edef\bbl at exp@aux{\endgroup#1}%
-  \bbl at exp@aux}
-%    \end{macrocode}
-% \end{macro}
-%
 % Two further tools.  |\bbl at samestring| first expand its arguments and
 % then compare their expansion (sanitized, so that the catcodes do not
 % matter). |\bbl at engine| takes the following values: 0 is pdf\TeX, 1
@@ -4688,6 +4729,9 @@
 \DeclareOption{silent}{}
 \DeclareOption{mono}{}
 \DeclareOption{shorthands=off}{\bbl at tempa shorthands=\bbl at tempa}
+% Don't use. Experimental:
+\newif\ifbbl at single
+\DeclareOption{selectors=off}{\bbl at singletrue}
 <@More package options@>
 %    \end{macrocode}
 %
@@ -4964,7 +5008,7 @@
 %    defined explicitly. So, package options not yet taken into
 %    account and stored in |bbl at language@opts| are assumed to be
 %    languages (note this list also contains the language given with
-%    |main|). If not declared above, the name of the option and the
+%    |main|). If not declared above, the names of the option and the
 %    file are the same.
 %
 %    \begin{macrocode}
@@ -5056,7 +5100,7 @@
     {Too late for \string\AfterBabelLanguage}%
     {Languages have been loaded, so I can do nothing}}
 %    \end{macrocode}
-%
+%      
 %    In order to catch the case where the user forgot to specify a
 %    language we check whether |\bbl at main@language|, has become
 %    defined. If not, no language has been loaded and an error
@@ -5083,7 +5127,7 @@
 % The kernel of the \babel\ system is stored in either
 % \file{hyphen.cfg} or \file{switch.def} and \file{babel.def}.  The
 % file \file{babel.def} contains most of the code, while
-% \file{switch.def} defines the language switching commands; both can
+% \file{switch.def} defines the language-switching commands; both can
 % be read at run time. The file \file{hyphen.cfg} is a file that can
 % be loaded into the format, which is necessary when you want to be
 % able to switch hyphenation patterns (by default, it also inputs
@@ -5162,6 +5206,7 @@
   \def\bbl at opt@safe{BR}
   \ifx\@uclclist\@undefined\let\@uclclist\@empty\fi
   \ifx\bbl at trace\@undefined\def\bbl at trace#1{}\fi
+  \expandafter\newif\csname ifbbl at single\endcsname
 \fi
 %    \end{macrocode}
 %
@@ -5358,7 +5403,8 @@
   everylanguage=1,loadkernel=1,loadpatterns=1,loadexceptions=1,%
   adddialect=2,patterns=2,defaultcommands=0,encodedcommands=2,write=0,%
   beforeextras=0,afterextras=0,stopcommands=0,stringprocess=0,%
-  hyphenation=2,initiateactive=3,afterreset=0,foreign=0,foreign*=0}
+  hyphenation=2,initiateactive=3,afterreset=0,foreign=0,foreign*=0,%
+  beforestart=0}
 %    \end{macrocode}
 %
 % \begin{macro}{\babelensure}
@@ -5602,12 +5648,28 @@
 %    \end{macrocode}
 %
 %    We also have to make sure that some code gets executed at the
-%    beginning of the document. Languages does not set |\pagedir|, so
+%    beginning of the document. Languages do not set |\pagedir|, so
 %    we set here for the whole document to the main |\bodydir|.
 %
+% \changes{babel~3.34}{2019/09/20}{New hook beforestart.}
+%
 %    \begin{macrocode}
+\def\bbl at beforestart{%
+  \bbl at usehooks{beforestart}{}%
+  \global\let\bbl at beforestart\relax}
 \AtBeginDocument{%
+  \bbl at beforestart
+  \if at filesw
+    \immediate\write\@mainaux{%
+    %  \let\string\bbl at nostdfont\string\@gobble 
+      \string\bbl at beforestart}%
+  \fi
   \expandafter\selectlanguage\expandafter{\bbl at main@language}%
+  \ifbbl at single  % must go after the line above
+    \renewcommand\selectlanguage[1]{}%
+    \renewcommand\foreignlanguage[2]{#2}%
+    \global\let\babel at aux\@gobbletwo  % Also as flag
+  \fi
   \ifcase\bbl at engine\or\pagedir\bodydir\fi}  % TODO - a better place
 %    \end{macrocode}
 %
@@ -5641,7 +5703,7 @@
 %    the original catcode. It does not hurt, but should be fixed. It's
 %    already done with |\nfss at catcodes|, added in 3.10.
 %
-% \changes{3.10}{2017/05/14}{Refactored. Add to \cs{nfss at catcodes} too.}
+% \changes{babel~3.10}{2017/05/14}{Refactored. Add to \cs{nfss at catcodes} too.}
 %
 %    \begin{macrocode}
 \bbl at trace{Shorhands}
@@ -5767,6 +5829,8 @@
 % too}
 % \changes{babel~3.9a}{2012/12/27}{Take into account mathematically
 %   active chars, to avoid infinite loops}
+% \changes{babel~3.34}{2019/09/23}{Math active in lua has a different
+%   value}
 %
 %   The very first thing to do is saving the original catcode and the
 %   original definition, even if not active, which is possible
@@ -5800,7 +5864,7 @@
     \expandafter\let\csname normal at char#2\endcsname#3%
   \else
     \bbl at info{Making #2 an active character}%
-    \ifnum\mathcode`#2="8000
+    \ifnum\mathcode`#2=\ifodd\bbl at engine"1000000 \else"8000 \fi
       \@namedef{normal at char#2}{%
         \textormath{#3}{\csname bbl at oridef@@#2\endcsname}}%
     \else
@@ -6931,11 +6995,11 @@
 %    The following two commands are used to wrap the ``hyphen'' and
 %    set the behavior of the rest of the word -- the version with a
 %    single |@| is used when further hyphenation is allowed, while
-%    that with |@@| if no more hyphen are allowed. In both cases, if
+%    that with |@@| if no more hyphens are allowed. In both cases, if
 %    the hyphen is preceded by a positive space, breaking after the
 %    hyphen is disallowed.
 %
-%    There should not be a discretionaty after a hyphen at the
+%    There should not be a discretionary after a hyphen at the
 %    beginning of a word, so it is prevented if preceded by a
 %    skip. Unfortunately, this does handle cases like ``(-suffix)''.
 %    |\nobreak| is always preceded by |\leavevmode|, in case the
@@ -7622,7 +7686,7 @@
 %    \texttt{OT1} encoding by default.
 %
 %    Some code to construct these glyphs for the \texttt{OT1} encoding
-%    was made available to me by Stipcevic Mario,
+%    was made available to me by Stipčević Mario,
 %    (\texttt{stipcevic at olimp.irb.hr}).
 %
 %    \begin{macrocode}
@@ -7678,7 +7742,7 @@
 %    marks, which make them usable both outside and inside mathmode.
 %    They are defined with |\ProvideTextCommandDefault|, but this is
 %    very likely not required because their definitions are based on
-%    encoding dependent macros.
+%    encoding-dependent macros.
 %
 % \changes{babel~3.16}{2018/01/02}{Adapted to TU and refactored -
 %  redundant code.}
@@ -7952,11 +8016,11 @@
 % requested, an |ini| file. It may be used in conjunction to previouly
 % loaded |ldf| files.
 %
-% \changes{3.10}{2017/05/19}{Added \cs{babelprovide}}
-% \changes{3.13}{2017/08/30}{Added \cs{import}, which also reads
+% \changes{babel~3.10}{2017/05/19}{Added \cs{babelprovide}}
+% \changes{babel~3.13}{2017/08/30}{Added \cs{import}, which also reads
 % dates. Some refactoring in the ini reader.}
-% \changes{3.15}{2017/10/30}{New keys script, language}
-% \changes{3.16}{2018/01/02}{Make sure ensuring works even before
+% \changes{babel~3.15}{2017/10/30}{New keys script, language}
+% \changes{babel~3.16}{2018/01/02}{Make sure ensuring works even before
 %   the language is selected}
 % \changes{babel~3.19}{2018/04/23}{New option - mapfont. Currently
 %   only with direction}
@@ -7965,13 +8029,15 @@
 % \changes{babel~3.23}{2018/09/01}{Valueless import}
 % \changes{babel~3.26}{2018/10/16}{Quick fix for xetex - test the 
 %   script for intraspace}
-% \changes{3.30}{2019/04/22}{Read some basic parameters from ini
+% \changes{babel~3.30}{2019/04/22}{Read some basic parameters from ini
 %   even without import.}
-% \changes{3.30}{2019/04/22}{Native digits (lua level).}
-% \changes{3.30}{2019/04/22}{New attribute in luatex for `locale'. Also
+% \changes{babel~3.30}{2019/04/22}{Native digits (lua level).}
+% \changes{babel~3.30}{2019/04/22}{New attribute in luatex for `locale'. Also
 %   \cs{localeid}}
-% \changes{3.32}{2019/05/30}{Activate CJK line breaking  with an explicit
+% \changes{babel~3.32}{2019/05/30}{Activate CJK line breaking  with an explicit
 %   intraspace.}
+% \changes{babel~3.34}{2019/09/20}{Fix - with main the language must not
+%   be restored.}
 %
 %    \begin{macrocode}
 \bbl at trace{Creating languages and reading ini files}
@@ -8199,8 +8265,10 @@
        \catcode`\@=\atcatcode
        \let\atcatcode\relax
      \fi}%
-  \let\languagename\bbl at savelangname
-  \chardef\localeid\bbl at savelocaleid\relax}
+  \ifx\bbl at KVP@main\@nil  % Restore only if not 'main'
+    \let\languagename\bbl at savelangname
+    \chardef\localeid\bbl at savelocaleid\relax
+  \fi}
 %    \end{macrocode}
 %
 % A tool to define the macros for native digits from the list provided 
@@ -8242,7 +8310,7 @@
 %
 % Depending on whether or not the language exists, we define two macros.
 %
-% \changes{3.22}{2018/06/05}{Fix - Error with \cs{chapter} if empty in ini.}-
+% \changes{babel~3.22}{2018/06/05}{Fix - Error with \cs{chapter} if empty in ini.}-
 %
 %    \begin{macrocode}
 \def\bbl at provide@new#1{%
@@ -8300,7 +8368,7 @@
 %
 % The |hyphenrules| option is handled with an auxiliary macro.
 %
-% \changes{3.14}{2017/10/03}{Take into account ini settings for
+% \changes{babel~3.14}{2017/10/03}{Take into account ini settings for
 % hyphenrules if `import'.}
 %
 %    \begin{macrocode}
@@ -8359,6 +8427,15 @@
     \let\bbl at savestrings\@empty
     \let\bbl at savetoday\@empty
     \let\bbl at savedate\@empty
+    \def\bbl at inipreread##1=##2\@@{%
+      \bbl at trim@def\bbl at tempa{##1}% Redundant below !!
+      % Move trims here ??
+      \bbl at ifunset{bbl at KVP@\bbl at section/\bbl at tempa}%
+        {\expandafter\bbl at inireader\bbl at tempa=##2\@@}%
+        {\def\bbl at tempc{\expandafter\bbl at inireader\bbl at tempa=}%
+         \expandafter\expandafter\expandafter
+         \bbl at tempc\csname bbl at KVP@\bbl at section/\bbl at tempa\endcsname\@@}%
+         \global\bbl at csarg\let{KVP@\bbl at section/\bbl at tempa}\relax}%
     \let\bbl at inireader\bbl at iniskip
     \bbl at info{Importing data from babel-#1.ini for \languagename}%
     \loop
@@ -8372,7 +8449,7 @@
     \repeat
   \fi}
 \def\bbl at iniline#1\bbl at iniline{%
-  \@ifnextchar[\bbl at inisec{\@ifnextchar;\bbl at iniskip\bbl at inireader}#1\@@}% ]
+  \@ifnextchar[\bbl at inisec{\@ifnextchar;\bbl at iniskip\bbl at inipreread}#1\@@}% ]
 %    \end{macrocode}
 %
 % The special cases for comment lines and sections are handled by the
@@ -8494,8 +8571,8 @@
 %
 % TODO. Remove copypaste pattern.
 %
-% \changes{3.16}{2018/01/02}{Fix - dates were severely broken.}
-% \changes{3.28}{2019/04/01}{Start work on calendars.}
+% \changes{babel~3.16}{2018/01/02}{Fix - dates were severely broken.}
+% \changes{babel~3.28}{2019/04/01}{Start work on calendars.}
 %
 %    \begin{macrocode}
 \bbl at csarg\def{inikv at date.gregorian}#1=#2\@@{%       for defaults
@@ -8607,10 +8684,12 @@
 % when the language is first selected) to know which script/language
 % must be enabled. This means we must make sure a few characters are
 % not active. The |ini| is not read directly, but with a proxy |tex|
-% file named as the language.
+% file named as the language (which means any code in it must be
+% skipped, too.
 %
-% \changes{3.16}{2018/01/02}{Load ids inside a box, to prevent extra
+% \changes{babel~3.16}{2018/01/02}{Load ids inside a box, to prevent extra
 % spaces.}
+% \changes{babel~3.34}{2019/08/05}{Added \cs{endinput}.}
 %
 %    \begin{macrocode}
 \def\bbl at ini@ids#1{%
@@ -8618,7 +8697,8 @@
     \begingroup
       \bbl at add\bbl at secpost@identification{\closein1 }%
       \catcode`\[=12 \catcode`\]=12 \catcode`\==12 %
-      \bbl at read@ini{##1}%
+      \bbl at read@ini{##1}%   
+      \endinput
     \endgroup}%           boxed, to avoid extra spaces:
   {\setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}}}
 %    \end{macrocode}
@@ -8847,8 +8927,8 @@
 %    that definition (it would result in parameter stack overflow
 %    because of a circular definition).
 %
-%   (Recent versions of natbib change dynamically |\@citex|, so PR4087
-%    doesn't seem fixable in a simple way. Just load natbib before.)
+%   (Recent versions of \pkg{natbib} change dynamically |\@citex|, so PR4087
+%    doesn't seem fixable in a simple way. Just load \pkg{natbib} before.)
 %
 %    \begin{macrocode}
     \def\@citex[#1][#2]#3{%
@@ -8998,13 +9078,14 @@
        \edef\thepage{%
          \noexpand\babelsublr{\unexpanded\expandafter{\thepage}}}}%
    \fi}
-  {\bbl at redefine\markright#1{%
-     \bbl at ifblank{#1}%
-       {\org at markright{}}%
-       {\toks@{#1}%
-        \bbl at exp{%
-          \\\org at markright{\\\protect\\\foreignlanguage{\languagename}%
-            {\\\protect\\\bbl at restore@actives\the\toks@}}}}}%
+  {\ifbbl at single\else
+     \bbl at redefine\markright#1{%
+       \bbl at ifblank{#1}%
+         {\org at markright{}}%
+         {\toks@{#1}%
+          \bbl at exp{%
+            \\\org at markright{\\\protect\\\foreignlanguage{\languagename}%
+              {\\\protect\\\bbl at restore@actives\the\toks@}}}}}%
 %    \end{macrocode}
 %
 %  \end{macro}
@@ -9020,33 +9101,34 @@
 %    with the new definition of |\markboth|.
 %
 %    \begin{macrocode}
-   \ifx\@mkboth\markboth
-     \def\bbl at tempc{\let\@mkboth\markboth}
-   \else
-     \def\bbl at tempc{}
-   \fi
+     \ifx\@mkboth\markboth
+       \def\bbl at tempc{\let\@mkboth\markboth}
+     \else
+       \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{%
-       \protect\foreignlanguage
-       {\languagename}{\protect\bbl at restore@actives##1}}%
-     \bbl at ifblank{#1}%
-       {\toks@{}}%
-       {\toks@\expandafter{\bbl at tempb{#1}}}%
-     \bbl at ifblank{#2}%
-       {\@temptokena{}}%
-       {\@temptokena\expandafter{\bbl at tempb{#2}}}%
-     \bbl at exp{\\\org at markboth{\the\toks@}{\the\@temptokena}}}
+     \bbl at redefine\markboth#1#2{%
+       \protected at edef\bbl at tempb##1{%
+         \protect\foreignlanguage
+         {\languagename}{\protect\bbl at restore@actives##1}}%
+       \bbl at ifblank{#1}%
+         {\toks@{}}%
+         {\toks@\expandafter{\bbl at tempb{#1}}}%
+       \bbl at ifblank{#2}%
+         {\@temptokena{}}%
+         {\@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 \IfBabelLayout
+       \bbl at tempc
+     \fi}  % end ifbbl at single, end \IfBabelLayout
 %    \end{macrocode}
 %
 %  \end{macro}
@@ -9157,11 +9239,11 @@
 %
 %    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
+%    order to be able to do that it needs to access the expandable form
 %    of |\ref|. So we employ a little trick here. We redefine the
 %    (internal) command \verb*|\Ref | to call |\org at ref| instead of
-%    |\ref|. The disadvantgage of this solution is that whenever the
-%    derfinition of |\Ref| changes, this definition needs to be updated
+%    |\ref|. The disadvantage of this solution is that whenever the
+%    definition of |\Ref| changes, this definition needs to be updated
 %    as well.
 %
 %    \begin{macrocode}
@@ -9436,7 +9518,7 @@
 % Youssef Jabri), which is compatible with \babel{}.
 %
 % There are two ways of modifying macros to make them “bidi”, namely,
-% by patching the internal low level macros (which is what I have done
+% by patching the internal low-level macros (which is what I have done
 % with lists, columns, counters, tocs, much like |rlbabel| did), and
 % by introducing a “middle layer” just below the user interface
 % (sectioning, footnotes).
@@ -9453,7 +9535,7 @@
 %      and so on, but bidi text does not work out of the box and some
 %      development is necessary. It also provides tools to properly
 %      set left-to-right and right-to-left page layouts. As Lua\TeX-ja
-%      shows, vertical typesetting is posible, too. Its main drawback
+%      shows, vertical typesetting is possible, too. Its main drawback
 %      is font handling is often considered to be less mature than
 %      \xetex{}, mainly in Indic scripts (but there are steps to make
 %      HarfBuzz, the \xetex{} font engine, available in \luatex{}; see
@@ -9460,10 +9542,10 @@
 %      <https://github.com/tatzetwerk/luatex-harfbuzz>).
 %    \end{itemize}
 %
-% \changes{3.15}{2017/10/30}{Use an attribute instead of tex language
+% \changes{babel~3.15}{2017/10/30}{Use an attribute instead of tex language
 %    (reserved for hyphenation).}
-% \changes{3.15}{2017/10/30}{Store direction in @wdir@<lang>.}
-% \changes{3.28}{2019/04/01}{Dir in boxes within math and other
+% \changes{babel~3.15}{2017/10/30}{Store direction in @wdir@<lang>.}
+% \changes{babel~3.28}{2019/04/01}{Dir in boxes within math and other
 %    contexts (passim).}
 %
 %    \begin{macrocode}
@@ -9599,7 +9681,7 @@
 % properly handle the par direction. Note text and par dirs are
 % decoupled to some extent (although not completely).
 %
-% \changes{3.16}{2018/01/02}{Fix - the direction prevented the removal
+% \changes{babel~3.16}{2018/01/02}{Fix - the direction prevented the removal
 %   of the indent to be re-placed}
 %
 %    \begin{macrocode}
@@ -9634,7 +9716,7 @@
 % A tool for weak L (mainly digits). We also disable warnings with
 % \textsf{hyperref}.
 %
-% \changes{3.16}{2018/01/02}{New macro \cs{babelsublr}}
+% \changes{babel~3.16}{2018/01/02}{New macro \cs{babelsublr}}
 %
 %    \begin{macrocode}
 \DeclareRobustCommand\babelsublr[1]{\leavevmode{\bbl at textdir\z@#1}}
@@ -9998,7 +10080,9 @@
   % write to auxs
   \expandafter\ifx\csname date\languagename\endcsname\relax\else
     \if at filesw
-      \protected at write\@auxout{}{\string\babel at aux{\languagename}{}}%
+      \ifx\babel at aux\@gobbletwo\else % Set if single in the first, redundant
+        \protected at write\@auxout{}{\string\babel at aux{\languagename}{}}%
+      \fi
       \bbl at usehooks{write}{}%
     \fi
   \fi}
@@ -10093,7 +10177,7 @@
 % \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}
-% \changes{3.15}{2017/10/30}{Remove spaces inside captions and date.}
+% \changes{babel~3.15}{2017/10/30}{Remove spaces inside captions and date.}
 %
 %    \begin{macrocode}
 \newif\ifbbl at usedategroup
@@ -10390,8 +10474,8 @@
 %    |\lccode|'s and font encodings are not set at all, so in most
 %    cases you should use |otherlanguage*|.
 %
-% \changes{3.15}{2017/10/30}{Don't set language name. Use temp macro.}
-% \changes{3.15}{2018/02/14}{Fix - didn't work with polyglossia}
+% \changes{babel~3.15}{2017/10/30}{Don't set language name. Use temp macro.}
+% \changes{babel~3.15}{2018/02/14}{Fix - didn't work with polyglossia}
 %
 %    \begin{macrocode}
 \def\hyphenrules#1{%
@@ -10819,7 +10903,7 @@
 % \changes{babel~3.9f}{2013/05/16}{Restored code to set default
 %    hyphenmins, which was deleted mistakenly}
 %
-%    \cs{bbl at languages} saves a snapshot of the loaded languagues in the
+%    \cs{bbl at languages} saves a snapshot of the loaded languages in the
 %    form  \cs{bbl at elt}\marg{language-name}\marg{number}%
 %    \marg{patterns-file}\marg{exceptions-file}. Note the last 2
 %    arguments are empty in `dialects' defined in |language.dat| with
@@ -10884,7 +10968,7 @@
 %  \end{macro}
 %
 %    Now, hooks are defined. For efficiency reasons, they are dealt
-%    here in a special way. Besides \luatex, format specific
+%    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}
@@ -11054,7 +11138,7 @@
 %
 % \section{Font handling with fontspec}
 %
-% \changes{3.15}{2017/10/30}{New way to select fonts, with \cs{babelfont}}
+% \changes{babel~3.15}{2017/10/30}{New way to select fonts, with \cs{babelfont}}
 %
 % Add the bidi handler just before luaoftload, which is loaded by default
 % by LaTeX. Just in case, consider the possibility it has not been
@@ -11127,7 +11211,12 @@
 %
 % With explicit languages, we could define the font at once, but we
 % don't. Just wait and see if the language is actually activated.
+% |bbl at font| replaces hardcoded font names inside |\..family| by the
+% corresponding macro |\..default|.
 %
+% \changes{babel~3.34}{2019/08/29}{Better checks for fonts, and improved
+%   compatibility with fontspec.}
+%
 %    \begin{macrocode}
 %<<*Font selection>>
 \bbl at trace{Font handling with fontspec}
@@ -11134,14 +11223,18 @@
 \@onlypreamble\babelfont
 \newcommand\babelfont[2][]{%  1=langs/scripts 2=fam
   \edef\bbl at tempa{#1}%
-  \def\bbl at tempb{#2}%
+  \def\bbl at tempb{#2}%  Used by \bbl at bblfont
   \ifx\fontspec\@undefined
     \usepackage{fontspec}%
   \fi
   \EnableBabelHook{babel-fontspec}% Just calls \bbl at switchfont
   \bbl at bblfont}
-\newcommand\bbl at bblfont[2][]{% 1=features 2=fontname
-  \bbl at ifunset{\bbl at tempb family}{\bbl at providefam{\bbl at tempb}}{}%
+\newcommand\bbl at bblfont[2][]{% 1=features 2=fontname, @font=rm|sf|tt
+  \bbl at ifunset{\bbl at tempb family}%
+    {\bbl at providefam{\bbl at tempb}}%
+    {\bbl at exp{%
+      \\\bbl at sreplace\<\bbl at tempb family >%
+        {\@nameuse{\bbl at tempb default}}{\<\bbl at tempb default>}}}%
   % For the default font, just in case:
   \bbl at ifunset{bbl at lsys@\languagename}{\bbl at provide@lsys{\languagename}}{}%
   \expandafter\bbl at ifblank\expandafter{\bbl at tempa}%
@@ -11169,10 +11262,22 @@
 %    \end{macrocode}
 %
 % The following macro is activated when the hook |babel-fontspec| is
-% enabled.
+% enabled. But before we define a macro for a warning, which sets a
+% flag to avoid duplicate them.
 %
 %    \begin{macrocode}
-\def\bbl at switchfont{%
+\def\bbl at nostdfont#1{%
+  \bbl at ifunset{bbl at WFF@\f at family}%
+    {\bbl at csarg\gdef{WFF@\f at family}{}%  Flag, to avoid dupl warns
+     \bbl at warning{The current font is not a babel standard family:\\%
+       #1%
+       \fontname\font\\%
+       There is nothing intrinsically wrong with it, but\\%
+       'babel' will no set Script and Language. Consider\\%
+       defining a new family with \string\babelfont.\\%
+       Reported}}
+   {}}%
+\gdef\bbl at switchfont{%
   \bbl at ifunset{bbl at lsys@\languagename}{\bbl at provide@lsys{\languagename}}{}%
   \bbl at exp{%  eg Arabic -> arabic
     \lowercase{\edef\\\bbl at tempa{\bbl at cs{sname@\languagename}}}}%
@@ -11188,12 +11293,7 @@
             \global\let\<bbl@##1dflt@\languagename>%
                        \<bbl@##1dflt@*\bbl at tempa>}}}%
       {}}%                               1=T - language, already defined
-  \def\bbl at tempa{%
-    \bbl at warning{The current font is not a standard family:\\%
-      \fontname\font\\%
-      Script and Language are not applied. Consider\\%
-      defining a new family with \string\babelfont.\\%
-      Reported}}%
+  \def\bbl at tempa{\bbl at nostdfont{}}%
   \bbl at foreach\bbl at font@fams{%     don't gather with prev for
     \bbl at ifunset{bbl@##1dflt@\languagename}%
       {\bbl at cs{famrst@##1}%
@@ -11207,6 +11307,40 @@
   \bbl at ifrestoring{}{\bbl at tempa}}%
 %    \end{macrocode}
 %
+% The following is executed at the beginning of the aux file or the
+% document to warn about fonts not defined with |\babelfont|.
+%
+%    \begin{macrocode}
+\ifx\f at family\@undefined\else   % if latex
+  \ifcase\bbl at engine            % if pdftex
+    \let\bbl at ckeckstdfonts\relax
+  \else
+    \def\bbl at ckeckstdfonts{%
+      \begingroup
+        \global\let\bbl at ckeckstdfonts\relax
+        \let\bbl at tempa\@empty
+        \bbl at foreach\bbl at font@fams{%
+          \bbl at ifunset{bbl@##1dflt@}%
+            {\@nameuse{##1family}%
+             \bbl at csarg\gdef{WFF@\f at family}{}% Flag
+             \bbl at exp{\\\bbl at add\\\bbl at tempa{* \<##1family> / \f at family\\\\%
+                \space\space\fontname\font\\\\}}%
+             \bbl at csarg\xdef{##1dflt@}{\f at family}%
+             \expandafter\xdef\csname ##1default\endcsname{\f at family}}%
+            {}}%
+        \ifx\bbl at tempa\@empty\else
+          \bbl at warning{The following fonts are not babel standard families:\\%
+            \bbl at tempa
+            There is nothing intrinsically wrong with it, but\\%
+            'babel' will no set Script and Language. Consider\\%
+            defining a new family with \string\babelfont.\\%
+            Reported}%
+        \fi
+      \endgroup}
+  \fi
+\fi
+%    \end{macrocode}
+%
 % Now the macros defining the font with \textsf{fontspec}.
 %
 % When there are repeated keys in \textsf{fontspec}, the last value
@@ -11215,7 +11349,7 @@
 % |\bbl at mapselect| because |\selectfont| is called internally when a
 % font is defined.
 %
-% \changes{3.28}{2019/04/01}{\cs{babelfont} now based on
+% \changes{babel~3.28}{2019/04/01}{\cs{babelfont} now based on
 %   \cs{newfontfamily}.}
 %
 %    \begin{macrocode}
@@ -11453,6 +11587,7 @@
 <@Restore Unicode catcodes before loading patterns@>}
 \ifx\DisableBabelHook\@undefined\endinput\fi
 \AddBabelHook{babel-fontspec}{afterextras}{\bbl at switchfont}
+\AddBabelHook{babel-fontspec}{beforestart}{\bbl at ckeckstdfonts}
 \DisableBabelHook{babel-fontspec}
 <@Font selection@>
 \input txtbabel.def
@@ -11478,7 +11613,7 @@
 % Consider |txtbabel| as a shorthand for \textit{tex--xet babel},
 % which is the bidi model in both \pdftex{} and \xetex{}.
 %
-% \changes{3.33}{2019/05/04}{\cs{@tabular}, \cs{list}, etc., are
+% \changes{babel~3.32}{2019/05/04}{\cs{@tabular}, \cs{list}, etc., are
 %   patched, instead of redefined.}
 %
 %    \begin{macrocode}
@@ -11590,7 +11725,7 @@
 % latter. If there are new synonymous, the are added, but note if the
 % language patterns have not been preloaded they won't at run time.
 %
-% Other preloaded languages could be read twice, if they has been
+% Other preloaded languages could be read twice, if they have been
 % preloaded into the format. This is not optimal, but it shouldn't
 % happen very often -- with \luatex{} patterns are best loaded when
 % the document is typeset, and the ``0th'' language is preloaded just
@@ -12111,7 +12246,7 @@
 % (fullwidth \textit{vs.} halfwidth), not yet used. There is a separate
 % file, defined below.
 %
-% \changes{3.31}{2019/05/04}{Simple CJK line breaking.}
+% \changes{babel~3.31}{2019/05/04}{Simple CJK line breaking.}
 % 
 % \textit{Work in progress.} 
 %
@@ -12122,6 +12257,7 @@
 <@Restore Unicode catcodes before loading patterns@>}
 \ifx\DisableBabelHook\@undefined\endinput\fi
 \AddBabelHook{babel-fontspec}{afterextras}{\bbl at switchfont}
+\AddBabelHook{babel-fontspec}{beforestart}{\bbl at ckeckstdfonts}
 \DisableBabelHook{babel-fontspec}
 <@Font selection@>
 %    \end{macrocode}
@@ -12153,7 +12289,7 @@
 \AtBeginDocument{\bbl at luafixboxdir}
 %    \end{macrocode}
 %
-% \changes{3.32}{2019/05/23}{New - \cs{babelcharproperty}.}
+% \changes{babel~3.32}{2019/05/23}{New - \cs{babelcharproperty}.}
 %
 % The code for |\babelcharproperty| is straightforward. Just note the
 % modified lua table can be different.
@@ -12225,12 +12361,12 @@
 % \textsf{hhline}, \textsf{colortbl}, \textsf{longtable},
 % \textsf{booktabs}, etc. However, \textsf{dcolumn} still fails.
 %
-% \changes{3.18}{2018/02/14}{\cs{bbl at nextfake}, similar to the old
+% \changes{babel~3.18}{2018/02/14}{\cs{bbl at nextfake}, similar to the old
 %   \cs{nextfakemath} in Omega}
-% \changes{3.19}{2018/04/23}{Patch \cs{@eqnnum}, somewhat ad hoc. To be
+% \changes{babel~3.19}{2018/04/23}{Patch \cs{@eqnnum}, somewhat ad hoc. To be
 %   improved.}
-% \changes{3.21}{2018/05/09}{The ad hoc \cs{@eqnnum} was buggy. Fixed.}
-% \changes{3.31}{2019/05/04}{\cs{@tabular} and \cs{list} are patched,
+% \changes{babel~3.21}{2018/05/09}{The ad hoc \cs{@eqnnum} was buggy. Fixed.}
+% \changes{babel~3.31}{2019/05/04}{\cs{@tabular} and \cs{list} are patched,
 %   instead of redefined.}
 %
 %    \begin{macrocode}
@@ -12271,7 +12407,8 @@
     \noindent\box\@tempboxa}
 \fi
 \IfBabelLayout{tabular}
-  {\bbl at replace\@tabular{$}{\bbl at nextfake$}%
+  {\let\bbl at OL@@tabular\@tabular
+   \bbl at replace\@tabular{$}{\bbl at nextfake$}%
    \let\bbl at tabular\@tabular
    \AtBeginDocument{%
      \ifx\bbl at tabular\@tabular\else
@@ -12279,7 +12416,8 @@
      \fi}}
    {}
 \IfBabelLayout{lists}
-  {\bbl at sreplace\list{\parshape}{\bbl at listparshape}%
+  {\let\bbl at OL@list\list
+   \bbl at sreplace\list{\parshape}{\bbl at listparshape}%
    \def\bbl at listparshape#1#2#3{%
      \parshape #1 #2 #3 %
      \ifnum\bbl at getluadir{page}=\bbl at getluadir{par}\else
@@ -12295,6 +12433,8 @@
        \textdir TLT\relax
        \def\bbl at pictresetdir{\textdir TRT\relax}%
      \fi}%
+   \let\bbl at OL@@picture\@picture
+   \let\bbl at OL@put\put
    \bbl at sreplace\@picture{\hskip-}{\bbl at pictsetdir\hskip-}%
    \def\put(#1,#2)#3{%  Not easy to patch. Better redefine.
      \@killglue
@@ -12302,6 +12442,7 @@
      \hb at xt@\z@{\kern#1\unitlength{\bbl at pictresetdir#3}\hss}}%
    \AtBeginDocument
      {\ifx\tikz at atbegin@node\@undefined\else
+        \let\bbl at OL@pgfpicture\pgfpicture
         \bbl at sreplace\pgfpicture{\pgfpicturetrue}{\bbl at pictsetdir\pgfpicturetrue}%
         \bbl at add\pgfsys at beginpicture{\bbl at pictsetdir}%
         \bbl at add\tikz at atbegin@node{\bbl at pictresetdir}%
@@ -12316,19 +12457,26 @@
 %
 %    \begin{macrocode}
 \IfBabelLayout{counters}%
-  {\bbl at sreplace\@textsuperscript{\m at th}{\m at th\mathdir\pagedir}%
+  {\let\bbl at OL@@textsuperscript\@textsuperscript
+   \bbl at sreplace\@textsuperscript{\m at th}{\m at th\mathdir\pagedir}%
    \let\bbl at latinarabic=\@arabic
+   \let\bbl at OL@@arabic\@arabic
    \def\@arabic#1{\babelsublr{\bbl at latinarabic#1}}%
    \@ifpackagewith{babel}{bidi=default}%
      {\let\bbl at asciiroman=\@roman
+      \let\bbl at OL@@roman\@roman
       \def\@roman#1{\babelsublr{\ensureascii{\bbl at asciiroman#1}}}%
       \let\bbl at asciiRoman=\@Roman
+      \let\bbl at OL@@roman\@Roman
       \def\@Roman#1{\babelsublr{\ensureascii{\bbl at asciiRoman#1}}}%
+      \let\bbl at OL@labelenumii\labelenumii
       \def\labelenumii{)\theenumii(}%
+      \let\bbl at OL@p at enumiii\p at enumiii
       \def\p at enumiii{\p at enumii)\theenumii(}}{}}{}
 <@Footnote changes@>
 \IfBabelLayout{footnotes}%
-  {\BabelFootnote\footnote\languagename{}{}%
+  {\let\bbl at OL@footnote\footnote
+   \BabelFootnote\footnote\languagename{}{}%
    \BabelFootnote\localfootnote\languagename{}{}%
    \BabelFootnote\mainfootnote{}{}{}}
   {}
@@ -12338,11 +12486,13 @@
 % formatting. They have very little in common and are grouped here, as
 % a single option.
 %
-% \changes{3.19}{2018/04/23}{New option extras for layout}
+% \changes{babel~3.19}{2018/04/23}{New option extras for layout}
 %
 %    \begin{macrocode}
 \IfBabelLayout{extras}%
-  {\bbl at sreplace\underline{$\@@underline}{\bbl at nextfake$\@@underline}%
+  {\let\bbl at OL@underline\underline
+   \bbl at sreplace\underline{$\@@underline}{\bbl at nextfake$\@@underline}%
+   \let\bbl at OL@LaTeX2e\LaTeX2e
    \DeclareRobustCommand{\LaTeXe}{\mbox{\m at th
      \if b\expandafter\@car\f at series\@nil\boldmath\fi
      \babelsublr{%
@@ -12353,7 +12503,7 @@
 %
 % \subsection{Auto bidi with \texttt{basic} and \texttt{basic-r}}
 %
-% \changes{3.14}{2017/09/30}{LuaTeX - support for R/AL texts - basic-r}
+% \changes{babel~3.14}{2017/09/30}{LuaTeX - support for R/AL texts - basic-r}
 %
 % The file \textsf{babel-data-bidi.lua} currently only contains data. It is
 % a large and boring file and it's not shown here. See the generated

Modified: trunk/Master/texmf-dist/source/latex/babel/babel.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/babel.ins	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/source/latex/babel/babel.ins	2019-09-27 21:26:38 UTC (rev 52194)
@@ -26,7 +26,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %%
-\def\filedate{2019/07/19}
+\def\filedate{2019/09/27}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 

Modified: trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx	2019-09-27 21:26:38 UTC (rev 52194)
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2019/07/19 v3.33]
+\ProvidesFile{bbcompat.dtx}[2019/09/27 v3.34]
 %</dtx>
 %
 %% File 'bbcompat.dtx'

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

Modified: trunk/Master/texmf-dist/tex/generic/babel/babel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/babel.def	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/tex/generic/babel/babel.def	2019-09-27 21:26:38 UTC (rev 52194)
@@ -41,7 +41,7 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{babel.def}[2019/07/19 3.33 Babel common definitions]
+\ProvidesFile{babel.def}[2019/09/27 3.34 Babel common definitions]
 \ifx\AtBeginDocument\@undefined
   \input plain.def\relax
 \fi
@@ -65,6 +65,7 @@
   \def\bbl at opt@safe{BR}
   \ifx\@uclclist\@undefined\let\@uclclist\@empty\fi
   \ifx\bbl at trace\@undefined\def\bbl at trace#1{}\fi
+  \expandafter\newif\csname ifbbl at single\endcsname
 \fi
 \ifx\bbl at switchflag\@undefined % Prevent double input
   \let\bbl at switchflag\relax
@@ -121,6 +122,12 @@
     #2}}
 \long\def\bbl at afterelse#1\else#2\fi{\fi#1}
 \long\def\bbl at afterfi#1\fi{\fi#1}
+\def\bbl at exp#1{%
+  \begingroup
+    \let\\\noexpand
+    \def\<##1>{\expandafter\noexpand\csname##1\endcsname}%
+    \edef\bbl at exp@aux{\endgroup#1}%
+  \bbl at exp@aux}
 \def\bbl at tempa#1{%
   \long\def\bbl at trim##1##2{%
     \futurelet\bbl at trim@a\bbl at trim@c##2\@nil\@nil#1\@nil\relax{##1}}%
@@ -187,9 +194,10 @@
     \fi}%
   \expandafter\bbl at replace@aux#1#2\bbl at nil#2%
   \edef#1{\the\toks@}}
-\expandafter\def\expandafter\bbl at parsedef\detokenize{macro:}#1->#2\relax{%
+\bbl at exp{\def\\\bbl at parsedef##1\detokenize{macro:}}#2->#3\relax{%
   \def\bbl at tempa{#1}%
-  \def\bbl at tempb{#2}}
+  \def\bbl at tempb{#2}%
+  \def\bbl at tempe{#3}}
 \def\bbl at sreplace#1#2#3{%
   \begingroup
     \expandafter\bbl at parsedef\meaning#1\relax
@@ -197,18 +205,20 @@
     \edef\bbl at tempc{\expandafter\strip at prefix\meaning\bbl at tempc}%
     \def\bbl at tempd{#3}%
     \edef\bbl at tempd{\expandafter\strip at prefix\meaning\bbl at tempd}%
-    \bbl at exp{\\\bbl at replace\\\bbl at tempb{\bbl at tempc}{\bbl at tempd}}%
-    \bbl at exp{%
+    \bbl at xin@{\bbl at tempc}{\bbl at tempe}% If not in macro, do nothing
+    \ifin@
+      \bbl at exp{\\\bbl at replace\\\bbl at tempe{\bbl at tempc}{\bbl at tempd}}%
+      \def\bbl at tempc{%     Expanded an executed below as 'uplevel'
+         \\\makeatletter % "internal" macros with @ are assumed
+         \\\scantokens{%
+           \bbl at tempa\\\@namedef{\bbl at stripslash#1}\bbl at tempb{\bbl at tempe}}%
+         \catcode64=\the\catcode64\relax}%  Restore @
+    \else
+      \let\bbl at tempc\@empty  % Not \relax
+    \fi
+    \bbl at exp{%      For the 'uplevel' assignments
   \endgroup
-  \\\makeatletter % "internal" macros with @ are assumed
-  \\\scantokens{\def\\#1\bbl at tempa{\bbl at tempb}}%
-  \catcode64=\the\catcode64\relax}} % Restore @
-\def\bbl at exp#1{%
-  \begingroup
-    \let\\\noexpand
-    \def\<##1>{\expandafter\noexpand\csname##1\endcsname}%
-    \edef\bbl at exp@aux{\endgroup#1}%
-  \bbl at exp@aux}
+    \bbl at tempc}}  % empty or expand to set #1 with changes
 \def\bbl at ifsamestring#1#2{%
   \begingroup
     \protected at edef\bbl at tempb{#1}%
@@ -288,7 +298,8 @@
   everylanguage=1,loadkernel=1,loadpatterns=1,loadexceptions=1,%
   adddialect=2,patterns=2,defaultcommands=0,encodedcommands=2,write=0,%
   beforeextras=0,afterextras=0,stopcommands=0,stringprocess=0,%
-  hyphenation=2,initiateactive=3,afterreset=0,foreign=0,foreign*=0}
+  hyphenation=2,initiateactive=3,afterreset=0,foreign=0,foreign*=0,%
+  beforestart=0}
 \bbl at trace{Defining babelensure}
 \newcommand\babelensure[2][]{%  TODO - revise test files
   \AddBabelHook{babel-ensure}{afterextras}{%
@@ -405,8 +416,22 @@
   \bbl at id@assign
   \chardef\localeid\@nameuse{bbl at id@@\languagename}%
   \bbl at patterns{\languagename}}
+\def\bbl at beforestart{%
+  \bbl at usehooks{beforestart}{}%
+  \global\let\bbl at beforestart\relax}
 \AtBeginDocument{%
+  \bbl at beforestart
+  \if at filesw
+    \immediate\write\@mainaux{%
+    %  \let\string\bbl at nostdfont\string\@gobble
+      \string\bbl at beforestart}%
+  \fi
   \expandafter\selectlanguage\expandafter{\bbl at main@language}%
+  \ifbbl at single  % must go after the line above
+    \renewcommand\selectlanguage[1]{}%
+    \renewcommand\foreignlanguage[2]{#2}%
+    \global\let\babel at aux\@gobbletwo  % Also as flag
+  \fi
   \ifcase\bbl at engine\or\pagedir\bodydir\fi}  % TODO - a better place
 \def\select at language@x#1{%
   \ifcase\bbl at select@type
@@ -473,7 +498,7 @@
     \expandafter\let\csname normal at char#2\endcsname#3%
   \else
     \bbl at info{Making #2 an active character}%
-    \ifnum\mathcode`#2="8000
+    \ifnum\mathcode`#2=\ifodd\bbl at engine"1000000 \else"8000 \fi
       \@namedef{normal at char#2}{%
         \textormath{#3}{\csname bbl at oridef@@#2\endcsname}}%
     \else
@@ -1551,8 +1576,10 @@
        \catcode`\@=\atcatcode
        \let\atcatcode\relax
      \fi}%
-  \let\languagename\bbl at savelangname
-  \chardef\localeid\bbl at savelocaleid\relax}
+  \ifx\bbl at KVP@main\@nil  % Restore only if not 'main'
+    \let\languagename\bbl at savelangname
+    \chardef\localeid\bbl at savelocaleid\relax
+  \fi}
 \def\bbl at setdigits#1#2#3#4#5{%
   \bbl at exp{%
     \def\<\languagename digits>####1{%       ie, \langdigits
@@ -1682,6 +1709,15 @@
     \let\bbl at savestrings\@empty
     \let\bbl at savetoday\@empty
     \let\bbl at savedate\@empty
+    \def\bbl at inipreread##1=##2\@@{%
+      \bbl at trim@def\bbl at tempa{##1}% Redundant below !!
+      % Move trims here ??
+      \bbl at ifunset{bbl at KVP@\bbl at section/\bbl at tempa}%
+        {\expandafter\bbl at inireader\bbl at tempa=##2\@@}%
+        {\def\bbl at tempc{\expandafter\bbl at inireader\bbl at tempa=}%
+         \expandafter\expandafter\expandafter
+         \bbl at tempc\csname bbl at KVP@\bbl at section/\bbl at tempa\endcsname\@@}%
+         \global\bbl at csarg\let{KVP@\bbl at section/\bbl at tempa}\relax}%
     \let\bbl at inireader\bbl at iniskip
     \bbl at info{Importing data from babel-#1.ini for \languagename}%
     \loop
@@ -1695,7 +1731,7 @@
     \repeat
   \fi}
 \def\bbl at iniline#1\bbl at iniline{%
-  \@ifnextchar[\bbl at inisec{\@ifnextchar;\bbl at iniskip\bbl at inireader}#1\@@}% ]
+  \@ifnextchar[\bbl at inisec{\@ifnextchar;\bbl at iniskip\bbl at inipreread}#1\@@}% ]
 \def\bbl at iniskip#1\@@{}%      if starts with ;
 \def\bbl at inisec[#1]#2\@@{%    if starts with opening bracket
   \@nameuse{bbl at secpost@\bbl at section}%  ends previous section
@@ -1860,6 +1896,7 @@
       \bbl at add\bbl at secpost@identification{\closein1 }%
       \catcode`\[=12 \catcode`\]=12 \catcode`\==12 %
       \bbl at read@ini{##1}%
+      \endinput
     \endgroup}%           boxed, to avoid extra spaces:
   {\setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}}}
 {\def\format{lplain}
@@ -1959,30 +1996,32 @@
        \edef\thepage{%
          \noexpand\babelsublr{\unexpanded\expandafter{\thepage}}}}%
    \fi}
-  {\bbl at redefine\markright#1{%
-     \bbl at ifblank{#1}%
-       {\org at markright{}}%
-       {\toks@{#1}%
-        \bbl at exp{%
-          \\\org at markright{\\\protect\\\foreignlanguage{\languagename}%
-            {\\\protect\\\bbl at restore@actives\the\toks@}}}}}%
-   \ifx\@mkboth\markboth
-     \def\bbl at tempc{\let\@mkboth\markboth}
-   \else
-     \def\bbl at tempc{}
-   \fi
-   \bbl at redefine\markboth#1#2{%
-     \protected at edef\bbl at tempb##1{%
-       \protect\foreignlanguage
-       {\languagename}{\protect\bbl at restore@actives##1}}%
-     \bbl at ifblank{#1}%
-       {\toks@{}}%
-       {\toks@\expandafter{\bbl at tempb{#1}}}%
-     \bbl at ifblank{#2}%
-       {\@temptokena{}}%
-       {\@temptokena\expandafter{\bbl at tempb{#2}}}%
-     \bbl at exp{\\\org at markboth{\the\toks@}{\the\@temptokena}}}
-   \bbl at tempc}  % end \IfBabelLayout
+  {\ifbbl at single\else
+     \bbl at redefine\markright#1{%
+       \bbl at ifblank{#1}%
+         {\org at markright{}}%
+         {\toks@{#1}%
+          \bbl at exp{%
+            \\\org at markright{\\\protect\\\foreignlanguage{\languagename}%
+              {\\\protect\\\bbl at restore@actives\the\toks@}}}}}%
+     \ifx\@mkboth\markboth
+       \def\bbl at tempc{\let\@mkboth\markboth}
+     \else
+       \def\bbl at tempc{}
+     \fi
+     \bbl at redefine\markboth#1#2{%
+       \protected at edef\bbl at tempb##1{%
+         \protect\foreignlanguage
+         {\languagename}{\protect\bbl at restore@actives##1}}%
+       \bbl at ifblank{#1}%
+         {\toks@{}}%
+         {\toks@\expandafter{\bbl at tempb{#1}}}%
+       \bbl at ifblank{#2}%
+         {\@temptokena{}}%
+         {\@temptokena\expandafter{\bbl at tempb{#2}}}%
+       \bbl at exp{\\\org at markboth{\the\toks@}{\the\@temptokena}}}
+       \bbl at tempc
+     \fi}  % end ifbbl at single, end \IfBabelLayout
 \bbl at trace{Preventing clashes with other packages}
 \bbl at xin@{R}\bbl at opt@safe
 \ifin@

Modified: trunk/Master/texmf-dist/tex/generic/babel/babel.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/babel.sty	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/tex/generic/babel/babel.sty	2019-09-27 21:26:38 UTC (rev 52194)
@@ -33,7 +33,7 @@
 %%
 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\ProvidesPackage{babel}[2019/07/19 3.33 The Babel package]
+\ProvidesPackage{babel}[2019/09/27 3.34 The Babel package]
 \@ifpackagewith{babel}{debug}
   {\providecommand\bbl at trace[1]{\message{^^J[ #1 ]}}%
    \let\bbl at debug\@firstofone}
@@ -72,6 +72,12 @@
     #2}}
 \long\def\bbl at afterelse#1\else#2\fi{\fi#1}
 \long\def\bbl at afterfi#1\fi{\fi#1}
+\def\bbl at exp#1{%
+  \begingroup
+    \let\\\noexpand
+    \def\<##1>{\expandafter\noexpand\csname##1\endcsname}%
+    \edef\bbl at exp@aux{\endgroup#1}%
+  \bbl at exp@aux}
 \def\bbl at tempa#1{%
   \long\def\bbl at trim##1##2{%
     \futurelet\bbl at trim@a\bbl at trim@c##2\@nil\@nil#1\@nil\relax{##1}}%
@@ -138,9 +144,10 @@
     \fi}%
   \expandafter\bbl at replace@aux#1#2\bbl at nil#2%
   \edef#1{\the\toks@}}
-\expandafter\def\expandafter\bbl at parsedef\detokenize{macro:}#1->#2\relax{%
+\bbl at exp{\def\\\bbl at parsedef##1\detokenize{macro:}}#2->#3\relax{%
   \def\bbl at tempa{#1}%
-  \def\bbl at tempb{#2}}
+  \def\bbl at tempb{#2}%
+  \def\bbl at tempe{#3}}
 \def\bbl at sreplace#1#2#3{%
   \begingroup
     \expandafter\bbl at parsedef\meaning#1\relax
@@ -148,18 +155,20 @@
     \edef\bbl at tempc{\expandafter\strip at prefix\meaning\bbl at tempc}%
     \def\bbl at tempd{#3}%
     \edef\bbl at tempd{\expandafter\strip at prefix\meaning\bbl at tempd}%
-    \bbl at exp{\\\bbl at replace\\\bbl at tempb{\bbl at tempc}{\bbl at tempd}}%
-    \bbl at exp{%
+    \bbl at xin@{\bbl at tempc}{\bbl at tempe}% If not in macro, do nothing
+    \ifin@
+      \bbl at exp{\\\bbl at replace\\\bbl at tempe{\bbl at tempc}{\bbl at tempd}}%
+      \def\bbl at tempc{%     Expanded an executed below as 'uplevel'
+         \\\makeatletter % "internal" macros with @ are assumed
+         \\\scantokens{%
+           \bbl at tempa\\\@namedef{\bbl at stripslash#1}\bbl at tempb{\bbl at tempe}}%
+         \catcode64=\the\catcode64\relax}%  Restore @
+    \else
+      \let\bbl at tempc\@empty  % Not \relax
+    \fi
+    \bbl at exp{%      For the 'uplevel' assignments
   \endgroup
-  \\\makeatletter % "internal" macros with @ are assumed
-  \\\scantokens{\def\\#1\bbl at tempa{\bbl at tempb}}%
-  \catcode64=\the\catcode64\relax}} % Restore @
-\def\bbl at exp#1{%
-  \begingroup
-    \let\\\noexpand
-    \def\<##1>{\expandafter\noexpand\csname##1\endcsname}%
-    \edef\bbl at exp@aux{\endgroup#1}%
-  \bbl at exp@aux}
+    \bbl at tempc}}  % empty or expand to set #1 with changes
 \def\bbl at ifsamestring#1#2{%
   \begingroup
     \protected at edef\bbl at tempb{#1}%
@@ -313,6 +322,8 @@
 \DeclareOption{silent}{}
 \DeclareOption{mono}{}
 \DeclareOption{shorthands=off}{\bbl at tempa shorthands=\bbl at tempa}
+\newif\ifbbl at single
+\DeclareOption{selectors=off}{\bbl at singletrue}
 \DeclareOption{math=active}{}
 \DeclareOption{math=normal}{\def\bbl at mathnormal{\noexpand\textormath}}
 \DeclareOption{nocase}{}

Modified: trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg	2019-09-27 21:26:38 UTC (rev 52194)
@@ -37,7 +37,7 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{hyphen.cfg}[2019/07/19 3.33 Babel hyphens]
+\ProvidesFile{hyphen.cfg}[2019/09/27 3.34 Babel hyphens]
 \xdef\bbl at format{\jobname}
 \ifx\AtBeginDocument\@undefined
   \def\@empty{}

Modified: trunk/Master/texmf-dist/tex/generic/babel/locale/tr/babel-turkish.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/locale/tr/babel-turkish.tex	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/tex/generic/babel/locale/tr/babel-turkish.tex	2019-09-27 21:26:38 UTC (rev 52194)
@@ -10,7 +10,7 @@
 \BabelBeforeIni{tr}{%
 }
 
-\StartBabelCommands*{turkish}{}
+\StartBabelCommands{turkish}{}
   \SetCase
     {\uccode`i=`İ\relax
      \uccode`ı=`I\relax}

Modified: trunk/Master/texmf-dist/tex/generic/babel/luababel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/luababel.def	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/tex/generic/babel/luababel.def	2019-09-27 21:26:38 UTC (rev 52194)
@@ -490,19 +490,24 @@
   \input #1\relax}
 \ifx\DisableBabelHook\@undefined\endinput\fi
 \AddBabelHook{babel-fontspec}{afterextras}{\bbl at switchfont}
+\AddBabelHook{babel-fontspec}{beforestart}{\bbl at ckeckstdfonts}
 \DisableBabelHook{babel-fontspec}
 \bbl at trace{Font handling with fontspec}
 \@onlypreamble\babelfont
 \newcommand\babelfont[2][]{%  1=langs/scripts 2=fam
   \edef\bbl at tempa{#1}%
-  \def\bbl at tempb{#2}%
+  \def\bbl at tempb{#2}%  Used by \bbl at bblfont
   \ifx\fontspec\@undefined
     \usepackage{fontspec}%
   \fi
   \EnableBabelHook{babel-fontspec}% Just calls \bbl at switchfont
   \bbl at bblfont}
-\newcommand\bbl at bblfont[2][]{% 1=features 2=fontname
-  \bbl at ifunset{\bbl at tempb family}{\bbl at providefam{\bbl at tempb}}{}%
+\newcommand\bbl at bblfont[2][]{% 1=features 2=fontname, @font=rm|sf|tt
+  \bbl at ifunset{\bbl at tempb family}%
+    {\bbl at providefam{\bbl at tempb}}%
+    {\bbl at exp{%
+      \\\bbl at sreplace\<\bbl at tempb family >%
+        {\@nameuse{\bbl at tempb default}}{\<\bbl at tempb default>}}}%
   % For the default font, just in case:
   \bbl at ifunset{bbl at lsys@\languagename}{\bbl at provide@lsys{\languagename}}{}%
   \expandafter\bbl at ifblank\expandafter{\bbl at tempa}%
@@ -521,7 +526,18 @@
       \\\not at math@alphabet\<#1family>\relax
       \\\fontfamily\<#1default>\\\selectfont}%
     \\\DeclareTextFontCommand{\<text#1>}{\<#1family>}}}
-\def\bbl at switchfont{%
+\def\bbl at nostdfont#1{%
+  \bbl at ifunset{bbl at WFF@\f at family}%
+    {\bbl at csarg\gdef{WFF@\f at family}{}%  Flag, to avoid dupl warns
+     \bbl at warning{The current font is not a babel standard family:\\%
+       #1%
+       \fontname\font\\%
+       There is nothing intrinsically wrong with it, but\\%
+       'babel' will no set Script and Language. Consider\\%
+       defining a new family with \string\babelfont.\\%
+       Reported}}
+   {}}%
+\gdef\bbl at switchfont{%
   \bbl at ifunset{bbl at lsys@\languagename}{\bbl at provide@lsys{\languagename}}{}%
   \bbl at exp{%  eg Arabic -> arabic
     \lowercase{\edef\\\bbl at tempa{\bbl at cs{sname@\languagename}}}}%
@@ -537,12 +553,7 @@
             \global\let\<bbl@##1dflt@\languagename>%
                        \<bbl@##1dflt@*\bbl at tempa>}}}%
       {}}%                               1=T - language, already defined
-  \def\bbl at tempa{%
-    \bbl at warning{The current font is not a standard family:\\%
-      \fontname\font\\%
-      Script and Language are not applied. Consider\\%
-      defining a new family with \string\babelfont.\\%
-      Reported}}%
+  \def\bbl at tempa{\bbl at nostdfont{}}%
   \bbl at foreach\bbl at font@fams{%     don't gather with prev for
     \bbl at ifunset{bbl@##1dflt@\languagename}%
       {\bbl at cs{famrst@##1}%
@@ -554,6 +565,34 @@
          \\\bbl at font@set\<bbl@##1dflt@\languagename>% the main part!
                         \<##1default>\<##1family>}}}%
   \bbl at ifrestoring{}{\bbl at tempa}}%
+\ifx\f at family\@undefined\else   % if latex
+  \ifcase\bbl at engine            % if pdftex
+    \let\bbl at ckeckstdfonts\relax
+  \else
+    \def\bbl at ckeckstdfonts{%
+      \begingroup
+        \global\let\bbl at ckeckstdfonts\relax
+        \let\bbl at tempa\@empty
+        \bbl at foreach\bbl at font@fams{%
+          \bbl at ifunset{bbl@##1dflt@}%
+            {\@nameuse{##1family}%
+             \bbl at csarg\gdef{WFF@\f at family}{}% Flag
+             \bbl at exp{\\\bbl at add\\\bbl at tempa{* \<##1family> / \f at family\\\\%
+                \space\space\fontname\font\\\\}}%
+             \bbl at csarg\xdef{##1dflt@}{\f at family}%
+             \expandafter\xdef\csname ##1default\endcsname{\f at family}}%
+            {}}%
+        \ifx\bbl at tempa\@empty\else
+          \bbl at warning{The following fonts are not babel standard families:\\%
+            \bbl at tempa
+            There is nothing intrinsically wrong with it, but\\%
+            'babel' will no set Script and Language. Consider\\%
+            defining a new family with \string\babelfont.\\%
+            Reported}%
+        \fi
+      \endgroup}
+  \fi
+\fi
 \def\bbl at font@set#1#2#3{% eg \bbl at rmdflt@lang \rmdefault \rmfamily
   \bbl at xin@{<>}{#1}%
   \ifin@
@@ -724,7 +763,8 @@
     \noindent\box\@tempboxa}
 \fi
 \IfBabelLayout{tabular}
-  {\bbl at replace\@tabular{$}{\bbl at nextfake$}%
+  {\let\bbl at OL@@tabular\@tabular
+   \bbl at replace\@tabular{$}{\bbl at nextfake$}%
    \let\bbl at tabular\@tabular
    \AtBeginDocument{%
      \ifx\bbl at tabular\@tabular\else
@@ -732,7 +772,8 @@
      \fi}}
    {}
 \IfBabelLayout{lists}
-  {\bbl at sreplace\list{\parshape}{\bbl at listparshape}%
+  {\let\bbl at OL@list\list
+   \bbl at sreplace\list{\parshape}{\bbl at listparshape}%
    \def\bbl at listparshape#1#2#3{%
      \parshape #1 #2 #3 %
      \ifnum\bbl at getluadir{page}=\bbl at getluadir{par}\else
@@ -748,6 +789,8 @@
        \textdir TLT\relax
        \def\bbl at pictresetdir{\textdir TRT\relax}%
      \fi}%
+   \let\bbl at OL@@picture\@picture
+   \let\bbl at OL@put\put
    \bbl at sreplace\@picture{\hskip-}{\bbl at pictsetdir\hskip-}%
    \def\put(#1,#2)#3{%  Not easy to patch. Better redefine.
      \@killglue
@@ -755,6 +798,7 @@
      \hb at xt@\z@{\kern#1\unitlength{\bbl at pictresetdir#3}\hss}}%
    \AtBeginDocument
      {\ifx\tikz at atbegin@node\@undefined\else
+        \let\bbl at OL@pgfpicture\pgfpicture
         \bbl at sreplace\pgfpicture{\pgfpicturetrue}{\bbl at pictsetdir\pgfpicturetrue}%
         \bbl at add\pgfsys at beginpicture{\bbl at pictsetdir}%
         \bbl at add\tikz at atbegin@node{\bbl at pictresetdir}%
@@ -761,15 +805,21 @@
       \fi}}
   {}
 \IfBabelLayout{counters}%
-  {\bbl at sreplace\@textsuperscript{\m at th}{\m at th\mathdir\pagedir}%
+  {\let\bbl at OL@@textsuperscript\@textsuperscript
+   \bbl at sreplace\@textsuperscript{\m at th}{\m at th\mathdir\pagedir}%
    \let\bbl at latinarabic=\@arabic
+   \let\bbl at OL@@arabic\@arabic
    \def\@arabic#1{\babelsublr{\bbl at latinarabic#1}}%
    \@ifpackagewith{babel}{bidi=default}%
      {\let\bbl at asciiroman=\@roman
+      \let\bbl at OL@@roman\@roman
       \def\@roman#1{\babelsublr{\ensureascii{\bbl at asciiroman#1}}}%
       \let\bbl at asciiRoman=\@Roman
+      \let\bbl at OL@@roman\@Roman
       \def\@Roman#1{\babelsublr{\ensureascii{\bbl at asciiRoman#1}}}%
+      \let\bbl at OL@labelenumii\labelenumii
       \def\labelenumii{)\theenumii(}%
+      \let\bbl at OL@p at enumiii\p at enumiii
       \def\p at enumiii{\p at enumii)\theenumii(}}{}}{}
 \bbl at trace{Bidi footnotes}
 \ifx\bbl at beforeforeign\leavevmode
@@ -817,12 +867,15 @@
          {\bbl at exp{\\\bbl at footnotetext{\\\foreignlanguage{#2}}}{#3}{#4}}}}
 \fi
 \IfBabelLayout{footnotes}%
-  {\BabelFootnote\footnote\languagename{}{}%
+  {\let\bbl at OL@footnote\footnote
+   \BabelFootnote\footnote\languagename{}{}%
    \BabelFootnote\localfootnote\languagename{}{}%
    \BabelFootnote\mainfootnote{}{}{}}
   {}
 \IfBabelLayout{extras}%
-  {\bbl at sreplace\underline{$\@@underline}{\bbl at nextfake$\@@underline}%
+  {\let\bbl at OL@underline\underline
+   \bbl at sreplace\underline{$\@@underline}{\bbl at nextfake$\@@underline}%
+   \let\bbl at OL@LaTeX2e\LaTeX2e
    \DeclareRobustCommand{\LaTeXe}{\mbox{\m at th
      \if b\expandafter\@car\f at series\@nil\boldmath\fi
      \babelsublr{%

Modified: trunk/Master/texmf-dist/tex/generic/babel/nil.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/nil.ldf	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/tex/generic/babel/nil.ldf	2019-09-27 21:26:38 UTC (rev 52194)
@@ -32,7 +32,7 @@
 %% extension |.ins|) which are part of the distribution.
 %%
 
-\ProvidesLanguage{nil}[2019/07/19 3.33 Nil language]
+\ProvidesLanguage{nil}[2019/09/27 3.34 Nil language]
 \LdfInit{nil}{datenil}
 \ifx\l at nil\@undefined
   \newlanguage\l at nil

Modified: trunk/Master/texmf-dist/tex/generic/babel/switch.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/switch.def	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/tex/generic/babel/switch.def	2019-09-27 21:26:38 UTC (rev 52194)
@@ -37,7 +37,7 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{switch.def}[2019/07/19 3.33 Babel switching mechanism]
+\ProvidesFile{switch.def}[2019/09/27 3.34 Babel switching mechanism]
 \ifx\AtBeginDocument\@undefined
   \input plain.def\relax
 \fi
@@ -58,8 +58,8 @@
   \countdef\last at language=19
   \def\addlanguage{\alloc at 9\language\chardef\@cclvi}
 \fi
-\def\bbl at version{3.33}
-\def\bbl at date{2019/07/19}
+\def\bbl at version{3.34}
+\def\bbl at date{2019/09/27}
 \def\adddialect#1#2{%
   \global\chardef#1#2\relax
   \bbl at usehooks{adddialect}{{#1}{#2}}%
@@ -139,7 +139,9 @@
   % write to auxs
   \expandafter\ifx\csname date\languagename\endcsname\relax\else
     \if at filesw
-      \protected at write\@auxout{}{\string\babel at aux{\languagename}{}}%
+      \ifx\babel at aux\@gobbletwo\else % Set if single in the first, redundant
+        \protected at write\@auxout{}{\string\babel at aux{\languagename}{}}%
+      \fi
       \bbl at usehooks{write}{}%
     \fi
   \fi}

Modified: trunk/Master/texmf-dist/tex/generic/babel/xebabel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/xebabel.def	2019-09-27 21:25:12 UTC (rev 52193)
+++ trunk/Master/texmf-dist/tex/generic/babel/xebabel.def	2019-09-27 21:26:38 UTC (rev 52194)
@@ -82,19 +82,24 @@
   \input #1\relax}
 \ifx\DisableBabelHook\@undefined\endinput\fi
 \AddBabelHook{babel-fontspec}{afterextras}{\bbl at switchfont}
+\AddBabelHook{babel-fontspec}{beforestart}{\bbl at ckeckstdfonts}
 \DisableBabelHook{babel-fontspec}
 \bbl at trace{Font handling with fontspec}
 \@onlypreamble\babelfont
 \newcommand\babelfont[2][]{%  1=langs/scripts 2=fam
   \edef\bbl at tempa{#1}%
-  \def\bbl at tempb{#2}%
+  \def\bbl at tempb{#2}%  Used by \bbl at bblfont
   \ifx\fontspec\@undefined
     \usepackage{fontspec}%
   \fi
   \EnableBabelHook{babel-fontspec}% Just calls \bbl at switchfont
   \bbl at bblfont}
-\newcommand\bbl at bblfont[2][]{% 1=features 2=fontname
-  \bbl at ifunset{\bbl at tempb family}{\bbl at providefam{\bbl at tempb}}{}%
+\newcommand\bbl at bblfont[2][]{% 1=features 2=fontname, @font=rm|sf|tt
+  \bbl at ifunset{\bbl at tempb family}%
+    {\bbl at providefam{\bbl at tempb}}%
+    {\bbl at exp{%
+      \\\bbl at sreplace\<\bbl at tempb family >%
+        {\@nameuse{\bbl at tempb default}}{\<\bbl at tempb default>}}}%
   % For the default font, just in case:
   \bbl at ifunset{bbl at lsys@\languagename}{\bbl at provide@lsys{\languagename}}{}%
   \expandafter\bbl at ifblank\expandafter{\bbl at tempa}%
@@ -113,7 +118,18 @@
       \\\not at math@alphabet\<#1family>\relax
       \\\fontfamily\<#1default>\\\selectfont}%
     \\\DeclareTextFontCommand{\<text#1>}{\<#1family>}}}
-\def\bbl at switchfont{%
+\def\bbl at nostdfont#1{%
+  \bbl at ifunset{bbl at WFF@\f at family}%
+    {\bbl at csarg\gdef{WFF@\f at family}{}%  Flag, to avoid dupl warns
+     \bbl at warning{The current font is not a babel standard family:\\%
+       #1%
+       \fontname\font\\%
+       There is nothing intrinsically wrong with it, but\\%
+       'babel' will no set Script and Language. Consider\\%
+       defining a new family with \string\babelfont.\\%
+       Reported}}
+   {}}%
+\gdef\bbl at switchfont{%
   \bbl at ifunset{bbl at lsys@\languagename}{\bbl at provide@lsys{\languagename}}{}%
   \bbl at exp{%  eg Arabic -> arabic
     \lowercase{\edef\\\bbl at tempa{\bbl at cs{sname@\languagename}}}}%
@@ -129,12 +145,7 @@
             \global\let\<bbl@##1dflt@\languagename>%
                        \<bbl@##1dflt@*\bbl at tempa>}}}%
       {}}%                               1=T - language, already defined
-  \def\bbl at tempa{%
-    \bbl at warning{The current font is not a standard family:\\%
-      \fontname\font\\%
-      Script and Language are not applied. Consider\\%
-      defining a new family with \string\babelfont.\\%
-      Reported}}%
+  \def\bbl at tempa{\bbl at nostdfont{}}%
   \bbl at foreach\bbl at font@fams{%     don't gather with prev for
     \bbl at ifunset{bbl@##1dflt@\languagename}%
       {\bbl at cs{famrst@##1}%
@@ -146,6 +157,34 @@
          \\\bbl at font@set\<bbl@##1dflt@\languagename>% the main part!
                         \<##1default>\<##1family>}}}%
   \bbl at ifrestoring{}{\bbl at tempa}}%
+\ifx\f at family\@undefined\else   % if latex
+  \ifcase\bbl at engine            % if pdftex
+    \let\bbl at ckeckstdfonts\relax
+  \else
+    \def\bbl at ckeckstdfonts{%
+      \begingroup
+        \global\let\bbl at ckeckstdfonts\relax
+        \let\bbl at tempa\@empty
+        \bbl at foreach\bbl at font@fams{%
+          \bbl at ifunset{bbl@##1dflt@}%
+            {\@nameuse{##1family}%
+             \bbl at csarg\gdef{WFF@\f at family}{}% Flag
+             \bbl at exp{\\\bbl at add\\\bbl at tempa{* \<##1family> / \f at family\\\\%
+                \space\space\fontname\font\\\\}}%
+             \bbl at csarg\xdef{##1dflt@}{\f at family}%
+             \expandafter\xdef\csname ##1default\endcsname{\f at family}}%
+            {}}%
+        \ifx\bbl at tempa\@empty\else
+          \bbl at warning{The following fonts are not babel standard families:\\%
+            \bbl at tempa
+            There is nothing intrinsically wrong with it, but\\%
+            'babel' will no set Script and Language. Consider\\%
+            defining a new family with \string\babelfont.\\%
+            Reported}%
+        \fi
+      \endgroup}
+  \fi
+\fi
 \def\bbl at font@set#1#2#3{% eg \bbl at rmdflt@lang \rmdefault \rmfamily
   \bbl at xin@{<>}{#1}%
   \ifin@



More information about the tex-live-commits mailing list