[latex3-commits] [git/latex2e] master: Bump version to 3.16 (f36feaf)

Javier javier at dante.de
Wed Jan 3 18:10:27 CET 2018


Repository : https://github.com/latex3/latex2e
On branch  : master
Link       : https://github.com/latex3/latex2e/commit/f36feafb4020c21c09a95010b5c00fea5061be16

>---------------------------------------------------------------

commit f36feafb4020c21c09a95010b5c00fea5061be16
Author: Javier <javier at localhost>
Date:   Wed Jan 3 18:10:27 2018 +0100

    Bump version to 3.16


>---------------------------------------------------------------

f36feafb4020c21c09a95010b5c00fea5061be16
 required/babel/babel.dtx              |  478 +++++++++++++++++++--------------
 required/babel/babel.ins              |    2 +-
 required/babel/babel.pdf              |  Bin 624467 -> 628320 bytes
 required/babel/bbcompat.dtx           |    2 +-
 required/babel/samples/lua-arabic.pdf |  Bin 68044 -> 74071 bytes
 required/babel/samples/lua-arabic.tex |   54 +++-
 required/babel/samples/lua-se-he.pdf  |  Bin 0 -> 4007 bytes
 required/babel/samples/lua-se-he.tex  |   13 +
 8 files changed, 335 insertions(+), 214 deletions(-)

diff --git a/required/babel/babel.dtx b/required/babel/babel.dtx
index a3b311d..8165602 100644
--- a/required/babel/babel.dtx
+++ b/required/babel/babel.dtx
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2017/11/03 v3.15 The Babel package]
+\ProvidesFile{babel.dtx}[2018/01/04 v3.16 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -224,18 +224,23 @@ Javier Bezos
 
 \part{User guide}
 
-This user guide focuses on \LaTeX. There are also some notes on its
-use with Plain \TeX.
+\begin{itemize}
+\item This user guide focuses on \LaTeX. There are also some notes on
+  its use with Plain \TeX.
+
+\item  Changes and new features with relation to version 3.8 are
+  highlighted with \New{X.XX}\hspace{-.5em}. The most recent features
+  could be still unstable. Please, report any issues you find.
 
-If you are interested in the \TeX{} multilingual support, please join
-the \textsf{kadingira} list on
-\texttt{http://tug.org/mailman/listinfo/kadingira}.  You can follow
-the development of \babel{} on
-\texttt{https://github.com/latex3/latex2e/tree/master/required/babel}.
+\item If you are interested in the \TeX{} multilingual support, please
+  join the \textsf{kadingira} list on
+  \texttt{http://tug.org/mailman/listinfo/kadingira}.  You can follow
+  the development of \babel{} on
+  \texttt{https://github.com/latex3/latex2e/tree/master/required/babel}
+  (which provides some sample files, too).
 
-Changes and new features with relation to version 3.8 are highlighted with
-\New{X.XX}\hspace{-.5em}. The most recent features could be still
-unstable. Please, report any issues you find.
+\item  See section \ref{contribute} for contributing a language.
+\end{itemize}
 
 \section{The user interface}\label{U-I}
 
@@ -389,7 +394,8 @@ With them you can use \babel{} to localize the documents.
 The Latin script is covered by default in current \LaTeX{} (provided
 the document encoding is UTF-8), because the font loader is preloaded
 and the font is switched to |lmroman|. Other scripts require loading
-\textsf{fontspec}.
+\textsf{fontspec}. You may want to set the font attributes with
+\textsf{fontspec}, too.
 
 \begin{example}
   The following bilingual, single script document in UTF-8 encoding
@@ -1050,7 +1056,7 @@ can take the following values:
 
 \Describe{layout=}{}
 
-\New{3.16} Selects with layout elements are adapted in bidi
+\New{3.16} Selects which layout elements are adapted in bidi
 documents. See sec.~\ref{bidi}.
 
 \subsection{The \texttt{base} option}
@@ -1389,7 +1395,7 @@ captions):
 \hrule
 \bigskip
 
-In some context (currently |\babelfont|) an \textsc{ini} file may be
+In some contexts (currently |\babelfont|) an \texttt{ini} file may be
 loaded by its name. Here is the list of the names currently
 supported. With these languages, |\babelfont| loads (if not done
 before) the language and script names (even if the language is defined
@@ -1714,9 +1720,10 @@ zulu
 
 \subsection{Selecting fonts}
 
-\New{3.15} Babel provides a high level interface on top of |fontspec| to select
-fonts. There is no need to load \textsf{fontspec} explicitly --
-\babel{} does it for you with the first |\babelfont|.
+\New{3.15} Babel provides a high level interface on top of |fontspec|
+to select fonts. There is no need to load \textsf{fontspec} explicitly
+-- \babel{} does it for you with the first |\babelfont|.\footnote{See
+also the package \textsf{combofont} for a complementary approach.}
 
 \Describe\babelfont{\oarg{language-list}\marg{font-family}%
   \oarg{font-options}\marg{font-name}}
@@ -2016,90 +2023,6 @@ respectively.
   \textsf{iflang} instead of |\iflanguage| if possible.
 \end{warning}
 
-\subsection{Hooks}
-
-\New{3.9a} A hook is a piece of code to be executed at certain
-events. Some hooks are predefined when \luatex{} and \xetex{} are
-used.
-
-\Describe\AddBabelHook{\marg{name}\marg{event}\marg{code}}
-
-The same name can be applied to several events.  Hooks may be enabled
-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|).
-
-Current events are the following; in some of them you can use one to
-three \TeX{} parameters (|#1|, |#2|, |#3|), with the meaning given:
-\begin{description}
-\renewcommand\makelabel[1]{%
-  \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
-\itemsep=-\parskip
-\item[adddialect] (language name, dialect name) Used by
-  \file{luababel.def} to load the patterns if not preloaded.
-\item[patterns] (language name, language with encoding) Executed just
-  after the |\language| has been set. The second argument has the
-  patterns name actually selected (in the form of either |lang:ENC| or
-  |lang|).
-\item[hyphenation] (language name, language with encoding) Executed
-  locally just before exceptions given in |\babelhyphenation| are
-  actually set.
-\item[defaultcommands] Used (locally) in |\StartBabelCommands|.
-\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[write] This event comes just after the switching commands are
-  written to the |aux| file.
-\item[beforeextras] Just before executing |\extras|\m{language}. This
-  event and the next one should not contain language-dependent code
-  (for that, add it to |\extras|\m{language}).
-\item[afterextras] Just after executing |\extras|\m{language}. For
-  example, the following deactivates shorthands in all languages:
-\begin{verbatim}
-\AddBabelHook{noshort}{afterextras}{\languageshorthands{none}}
-\end{verbatim}
-\item[stringprocess] Instead of a parameter, you can manipulate the
-  macro |\BabelString| containing the string to be defined with
-  |\SetString|. For example, to use an expanded version of the string
-  in the definition, write:
-\begin{verbatim}
-\AddBabelHook{myhook}{stringprocess}{%
-  \protected at edef\BabelString{\BabelString}}
-\end{verbatim}
-\item[initiateactive] (char as active, char as other, original char)
-  \New{3.9i} Executed just after a shorthand has been `initiated'. The three
-  parameters are the same character with different catcodes: active,
-  other (|\string|'ed) and the original one.
-\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}.
-\end{description}
-
-Four events are used in \file{hyphen.cfg}, which are handled in a
-quite different way for efficiency reasons -- unlike the precedent
-ones, they only have a single hook and replace a default definition. 
-\begin{description}
-\renewcommand\makelabel[1]{%
-  \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
-\itemsep=-\parskip
-\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.
-\item[loadpatterns] (patterns file) Loads the patterns file. Used by
-  \file{luababel.def}.
-\item[loadexceptions] (exceptions file) Loads the exceptions
-  file. Used by \file{luababel.def}.
-\end{description}
-
-\Describe\BabelContentsFiles{}
-\New{3.9a} This macro contains a list of ``toc'' types 
-requiring a command to switch the language. Its default value is
-|toc,lof,lot|, but you may redefine it with |\renewcommand| (it's up
-to you to make sure no toc type is duplicated).
-
 \subsection{Hyphenation tools}
 
 \Describe\babelhyphen{%
@@ -2118,14 +2041,14 @@ with a breaking oportunity after it. A further type is a
 oportunity.
 
 In \TeX, \verb|-| and \verb|\-| forbid further breaking oportunities
-in the word. This is the desired behaviour very often, but not
-always, and therefore many languages provide shorthands for these
+in the word. This is the desired behaviour very often, but not always,
+and therefore many languages provide shorthands for these
 cases. Unfortunately, this has not been done consistently: for
-example, in Dutch, Portugese, Catalan or Danish, \verb|"-| is a hard
-hyphen, while in German, Spanish, Norwegian, Slovak or Russian, it
-is a soft hyphen. Furthermore, some of them even redefine |\-|, so
-that you cannot insert a soft hyphen without breaking oportunities
-in the rest of the word.
+example, \verb|"-| in Dutch, Portugese, 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 oportunities in the rest
+of the word.
 
 Therefore, some macros are provide with a set of basic ``hyphens''
 which can be used by themselves, to define a user shorthand, or even
@@ -2214,8 +2137,7 @@ incomplete.\footnote{The so-called Unicode fonts do not improve the
 situation either. So, a font suited for Vietnamese is not necessarily
 suited for, say, the romanization of Indic languages, and the fact it
 contains glyphs for Modern Greek does not mean it includes them for
-Classic Greek. As to directionality, it poses special challenges
-because it also affects individual characters and layout elements.}
+Classic Greek.}
 
 Some languages sharing the same script define macros to switch it (eg,
 |\textcyrillic|), but be aware they may also set the language to a
@@ -2279,10 +2201,14 @@ option. In \luatex, |basic-r| provides a simple and fast method for R
 text, which handles numbers and unmarked L text within an R context.
 
 \begin{example}
-The following text comes from the Arabic Wikipedia (article about
-Arabia). Copy-pasting some text from the Wikipedia is a good way to
-test this feature, which will be improved in the future. Remember
-|basic-r| is available in \luatex{} only.
+  The following text comes from the Arabic Wikipedia (article about
+  Arabia). Copy-pasting some text from the Wikipedia is a good way to
+  test this feature, which will be improved in the future. Remember
+  |basic-r| is available in \luatex{} only.\footnote{At the time of
+  this writing some Arabic fonts are not rendered correctly by the
+  default \luatex{} font loader, with misplaced kerns inside some
+  words, so double check the resulting text. It seems a fix is on the
+  way.}
   \begingroup
 % If you are looking at the code to see how it has been written, you
 % will be disappointed :-). The following example is built ad hoc to
@@ -2318,9 +2244,10 @@ _\babelprovide[import=ar, main]{arabic}_
                    \texttt{contents}  $\string|$
                    \texttt{columns}}
 
-\New{3.16} Selects with layout elements are adapted in bidi
-documents. This list will be expanded in future releases. \textit{To
-be expanded}.
+\New{3.16} Selects which layout elements are adapted in bidi
+documents. This list will be expanded in future releases (footnotes,
+tables, etc.). \textit{To be expanded}. Note some options are not
+required in \luatex{}.
 
 \begin{description}
 \renewcommand\makelabel[1]{%
@@ -2331,37 +2258,41 @@ be expanded}.
   below for further details);
 \item[counters] required in all engines to reorder correctly section
   numbers and the like (eg, \m{subsection}.\m{section}); required in
-  \xetex{} and pdftex for counters in general, as well as in \luatex{}
+  \xetex{} and \pdftex{} for counters in general, as well as in \luatex{}
   with |bidi=default|;
 \item[lists]  required in \xetex{} and \pdftex{}, but only in
   multilingual documents in \luatex{};
-\item[contents] required in \xetex{} and \pdftex{}, but only in
-  multilingual documents in \luatex{};
+\item[contents] required in \xetex{} and \pdftex{}; in \luatex{} 
+  toc entries are R by default;
 \item[columns] required in \xetex{} and \pdftex{} to reverse the
-  column order (standard two column mode).
+  column order (currently only the standard two column mode); in
+  \luatex{} they are R by default (including \textsf{multicol}).
 \end{description}
 
 \Describe{\babelsublr}{\marg{lr-text}}
 
-However, digits in \pdftex{} must be marked up explicitly
-(unlike \luatex{} with |bidi=basic-r| and, usually, \xetex{}). Mainly
-for it (although available in all engines, because it can be
-useful), this command is provided to set \marg{lr-text} in L
-mode. It's mainly intended for what Unicode calls weak characters,
-because words are best set with the corresponding language. For this
-reason, there is not a |rl| counterpart.
+However, digits in \pdftex{} must be marked up explicitly (unlike
+\luatex{} with |bidi=basic-r| and, usually, \xetex{}). Mainly for it
+(although available in all engines, because it can be useful), this
+command is provided to set \marg{lr-text} in L mode. It's mainly
+intended for what Unicode calls weak characters, because words are
+best set with the corresponding language. For this reason, there is
+no |rl| counterpart.
 
 \Describe{\BabelPatchSection}{\marg{section-name}}
 
-\textit{At work} -- Mainly for bidi text, but it could be useful in other
+Mainly for bidi text, but it could be useful in other
 cases. |\BabelPatchSection| and the corresponding option
 |layout=sectioning| takes a more logical approach (at least in many
-cases) because it applies the global language to the section format,
-while the section text is still the current language. The latter is
-passed to tocs and marks, too. It can be set individually or to all
-standard sectioning commands. TODO: In the latter case, |\markboth|
-and |markright| are not redefined, because the text passed includes
-already the language selector. TODO: layout=nomarks ? %%%%%
+cases) because it applies the global language to the section format
+(including the |\chaptername| in |\chapter|), while the section text
+is still the current language. The latter is passed to tocs and marks,
+too, and with |sectioning| in |layout| they both reset the “global”
+language to the main one, while the text uses the “local”
+language. With |layout=sectioning| all the standard sectioning
+commands are redefined, but with this command you can set them
+individually if necessary (but note then tocs and marks are not
+touched).
 
 \subsection{Language attributes}
 
@@ -2383,6 +2314,90 @@ options. For example, \textsf{french} uses |\frenchsetup|,
 |spanish| have no attribute counterparts. Macros settting
 options are also used (eg, |\ProsodicMarksOn| in \textsf{latin}).
 
+\subsection{Hooks}
+
+\New{3.9a} A hook is a piece of code to be executed at certain
+events. Some hooks are predefined when \luatex{} and \xetex{} are
+used.
+
+\Describe\AddBabelHook{\marg{name}\marg{event}\marg{code}}
+
+The same name can be applied to several events.  Hooks may be enabled
+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|).
+
+Current events are the following; in some of them you can use one to
+three \TeX{} parameters (|#1|, |#2|, |#3|), with the meaning given:
+\begin{description}
+\renewcommand\makelabel[1]{%
+  \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
+\itemsep=-\parskip
+\item[adddialect] (language name, dialect name) Used by
+  \file{luababel.def} to load the patterns if not preloaded.
+\item[patterns] (language name, language with encoding) Executed just
+  after the |\language| has been set. The second argument has the
+  patterns name actually selected (in the form of either |lang:ENC| or
+  |lang|).
+\item[hyphenation] (language name, language with encoding) Executed
+  locally just before exceptions given in |\babelhyphenation| are
+  actually set.
+\item[defaultcommands] Used (locally) in |\StartBabelCommands|.
+\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[write] This event comes just after the switching commands are
+  written to the |aux| file.
+\item[beforeextras] Just before executing |\extras|\m{language}. This
+  event and the next one should not contain language-dependent code
+  (for that, add it to |\extras|\m{language}).
+\item[afterextras] Just after executing |\extras|\m{language}. For
+  example, the following deactivates shorthands in all languages:
+\begin{verbatim}
+\AddBabelHook{noshort}{afterextras}{\languageshorthands{none}}
+\end{verbatim}
+\item[stringprocess] Instead of a parameter, you can manipulate the
+  macro |\BabelString| containing the string to be defined with
+  |\SetString|. For example, to use an expanded version of the string
+  in the definition, write:
+\begin{verbatim}
+\AddBabelHook{myhook}{stringprocess}{%
+  \protected at edef\BabelString{\BabelString}}
+\end{verbatim}
+\item[initiateactive] (char as active, char as other, original char)
+  \New{3.9i} Executed just after a shorthand has been `initiated'. The three
+  parameters are the same character with different catcodes: active,
+  other (|\string|'ed) and the original one.
+\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}.
+\end{description}
+
+Four events are used in \file{hyphen.cfg}, which are handled in a
+quite different way for efficiency reasons -- unlike the precedent
+ones, they only have a single hook and replace a default definition. 
+\begin{description}
+\renewcommand\makelabel[1]{%
+  \hspace\labelsep\normalfont\ttfamily\color{thered}#1}
+\itemsep=-\parskip
+\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.
+\item[loadpatterns] (patterns file) Loads the patterns file. Used by
+  \file{luababel.def}.
+\item[loadexceptions] (exceptions file) Loads the exceptions
+  file. Used by \file{luababel.def}.
+\end{description}
+
+\Describe\BabelContentsFiles{}
+\New{3.9a} This macro contains a list of ``toc'' types 
+requiring a command to switch the language. Its default value is
+|toc,lof,lot|, but you may redefine it with |\renewcommand| (it's up
+to you to make sure no toc type is duplicated).
+
 \subsection{Languages supported by \babel}
 
 In the following table most of the languages supported by \babel\ are
@@ -2807,6 +2822,40 @@ provide a standalone document suited for your needs, as well as other
 files you think can be useful. A PDF and a ``readme'' are strongly
 recommended.
 
+\subsection{Guidelines for contributed languages}
+\label{contribute}
+
+Now language files are “outsourced” and are located in a separate
+directory (\texttt{/macros/latex/contrib/babel-contrib}), so that they
+are contributed directly to CTAN (please, do not send to me language
+styles just to upload them to CTAN).
+
+Of course, placing your style files in this directory is not mandatory,
+but if you want to do it, here are a few guidelines.
+
+\begin{itemize}
+\item Do not hesitate stating on the file heads you are the author and the
+  maintainer, if you actually are. There is no need to state the babel
+  maintainer(s) as authors if they have not contributed significantly
+  to your language files. 
+\item Fonts are not strictly part of a language, so they are best placed
+  in the corresponding TeX tree. This includes not only \texttt{tfm}, \texttt{vf}, \texttt{ps1},
+  \texttt{otf}, \texttt{mf} files and the like, but also \texttt{fd} ones.
+\item Font and input encodings are usually best placed in the
+  corresponding tree, too, but sometimes they belong more naturally to
+  the babel style.  Note you may also need to define a LICR.
+\item \Babel{} ldf files may just interface a framework, as it happens often
+  with Oriental languages/scripts. This framework is best placed in its
+  own directory.
+\end{itemize}
+
+The following page provides a starting point:
+\texttt{http://www.texnia.com/incubator.html}.
+
+If your 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.
+
 \subsection{Basic macros}
 
 In the core of the \babel{} system, several macros are defined for use
@@ -3518,8 +3567,8 @@ help from Bernd Raichle, for which I am grateful.
 %    little bit of literate programming.
 %
 %    \begin{macrocode}
-%<<version=3.15>>
-%<<date=2017/11/03>>
+%<<version=3.16>>
+%<<date=2018/01/04>>
 %    \end{macrocode}
 %
 % \section{Tools}
@@ -4103,7 +4152,7 @@ help from Bernd Raichle, for which I am grateful.
       Bad option `#1=#2'. Either you have misspelled the\\%
       key or there is a previous setting of `#1'}{%
       Valid keys are `shorthands', `config', `strings', `main',\\%
-      `headfoot', `safe', `math'}
+      `headfoot', `safe', `math', among others.}
   \fi}
 %    \end{macrocode}
 %
@@ -4225,6 +4274,9 @@ help from Bernd Raichle, for which I am grateful.
 % For |layout| an auxiliary macro is provided, available for packages
 % and language styles.
 %
+% \changes{babel~3.16}{2018/01/02}{Added the basic layout stuff and the
+%  macro \cs{IfBabelLayout}}
+%
 %    \begin{macrocode}
 \ifx\bbl at opt@layout\@nnil
   \newcommand\IfBabelLayout[3]{#3}%
@@ -4935,7 +4987,8 @@ help from Bernd Raichle, for which I am grateful.
 %    \end{macrocode}
 %
 %    We also have to make sure that some code gets executed at the
-%    beginning of the document.
+%    beginning of the document. Languages does not set |\pagedir|, so
+%    we set here for the whole document to the main |\bodydir|. 
 %
 %    \begin{macrocode}
 \AtBeginDocument{%
@@ -7003,6 +7056,9 @@ help from Bernd Raichle, for which I am grateful.
 %    very likely not required because their definitions are based on
 %    encoding dependent macros.
 %
+% \changes{babel~3.16}{2018/01/02}{Adapted to TU and refactored -
+%  redundant code.}
+%
 %  \begin{macro}{\glq}
 %  \begin{macro}{\grq}
 %
@@ -7238,17 +7294,18 @@ help from Bernd Raichle, for which I am grateful.
       \@ifstar{\bbl at presec@s{#1}}%
               {\@dblarg{\bbl at presec@x{#1}}}}}}
 \def\bbl at presec@x#1[#2]#3{%
-  \let\bbl at savetemplang\languagename
-  \select at language@x\bbl at main@language
-  \@nameuse{bbl at ss@#1}%
-    [\foreignlanguage{\bbl at savetemplang}{#2}]%
-    {\foreignlanguage{\bbl at savetemplang}{#3}}%
-  \select at language@x\bbl at savetemplang}
+  \bbl at exp{%
+    \\\select at language@x{\bbl at main@language}%
+    \\\@nameuse{bbl at ss@#1}%
+      [\\\foreignlanguage{\languagename}{\unexpanded{#2}}]%
+      {\\\foreignlanguage{\languagename}{\unexpanded{#3}}}%
+    \\\select at language@x{\languagename}}}
 \def\bbl at presec@s#1#2{%
-  \let\bbl at savetemplang\languagename
-  \select at language@x\bbl at main@language
-  \@nameuse{bbl at ss@#1}*{\foreignlanguage{\languagename}{#2}}%
-  \select at language@x\bbl at savetemplang}
+  \bbl at exp{%
+    \\\select at language@x{\bbl at main@language}%
+    \\\@nameuse{bbl at ss@#1}*%
+      {\\\foreignlanguage{\languagename}{\unexpanded{#2}}}%
+    \\\select at language@x{\languagename}}}
 \IfBabelLayout{sectioning}%   at begin document ???
   {\BabelPatchSection{part}%
    \BabelPatchSection{chapter}%
@@ -7256,7 +7313,9 @@ help from Bernd Raichle, for which I am grateful.
    \BabelPatchSection{subsection}%
    \BabelPatchSection{subsubsection}%
    \BabelPatchSection{paragraph}%
-   \BabelPatchSection{subparagraph}}{}
+   \BabelPatchSection{subparagraph}%
+   \def\babel at toc#1{%
+     \select at language@x{\bbl at main@language}}}{}
 %    \end{macrocode}
 %
 %    Now we load definition files for engines.
@@ -7310,6 +7369,8 @@ help from Bernd Raichle, for which I am grateful.
 % \changes{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
+%  the language is selected}
 %
 %
 %    \begin{macrocode}
@@ -7465,10 +7526,10 @@ help from Bernd Raichle, for which I am grateful.
     \let\bbl at inireader\bbl at iniskip
     \bbl at info{Importing data from babel-#1.ini for \languagename}%
     \loop
+    \if T\ifeof1F\fi T\relax % Trick, because inside \loop
       \endlinechar\m at ne
       \read1 to \bbl at line
       \endlinechar`\^^M
-    \if T\ifeof1F\fi T\relax % Trick, because inside \loop
       \ifx\bbl at line\@empty\else
         \expandafter\bbl at iniline\bbl at line\bbl at iniline
       \fi
@@ -7583,8 +7644,9 @@ help from Bernd Raichle, for which I am grateful.
 % But dates are more complex. The full date format is stores in
 % |date.gregorian|, so we must read it in non-Unicode engines, too.
 %
+% \changes{3.16}{2018/01/02}{Fix - dates were severely broken.}
+%      
 %    \begin{macrocode}
-\newif\ifbbl at usedategroup
 \bbl at csarg\def{secpre at date.gregorian.licr}{%
   \ifcase\bbl at engine\let\bbl at savedate\@empty\fi}
 \def\bbl at ini@dategreg#1.#2.#3.#4\relax#5{% TODO - ignore with 'captions'
@@ -7685,16 +7747,18 @@ help from Bernd Raichle, for which I am grateful.
 % not active. The |ini| is not read directly, but with a proxy |tex|
 % file named as the language.
 %
+% \changes{3.16}{2018/01/02}{Load ids inside a box, to prevent extra
+% spaces.}
+%
 %    \begin{macrocode}
 \def\bbl at ini@ids#1{%
   \def\BabelBeforeIni##1##2{%
     \begingroup
-      \bbl at add\bbl at secpost@identification{%
-        \def\bbl at iniline########1\bbl at iniline{}}%
+      \bbl at add\bbl at secpost@identification{\closein1 }%
       \catcode`\[=12 \catcode`\]=12 \catcode`\==12 
       \bbl at read@ini{##1}%
     \endgroup}%           boxed, to avoid extra spaces:
-  \setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}}
+  {\setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}}}
 %    \end{macrocode}
 %
 % \subsection{Cross referencing macros}
@@ -8052,13 +8116,20 @@ help from Bernd Raichle, for which I am grateful.
 %    \cs{@safe at activestrue} is in effect.
 %
 %    \begin{macrocode}
-\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@}}}}}
+\IfBabelLayout{sectioning}
+  {\ifx\bbl at opt@headfoot\@nnil
+     \g at addto@macro\@resetactivechars{%
+       \set at typeset@protect                  
+       \expandafter\select at language@x\expandafter{\bbl at main@language}%
+       \let\protect\noexpand}%
+   \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@}}}}}
 %    \end{macrocode}
 %
 %  \end{macro}
@@ -8083,32 +8154,32 @@ help from Bernd Raichle, for which I am grateful.
 %    3826)} 
 %
 %    \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
+   \bbl at tempc}  % end \IfBabelLayout
 %    \end{macrocode}
 %
 %  \end{macro}
@@ -8633,6 +8704,9 @@ help from Bernd Raichle, for which I am grateful.
 % 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
+%   of the indent to be re-placed}
+%
 %    \begin{macrocode}
   \def\bbl at xebidipar{%
     \let\bbl at xebidipar\relax 
@@ -8652,6 +8726,8 @@ help from Bernd Raichle, for which I am grateful.
 %  
 % A tool for weak L (mainly digits).
 %
+% \changes{3.16}{2018/01/02}{New macro \cs{babelsublr}}
+%
 %    \begin{macrocode}
 \DeclareRobustCommand\babelsublr[1]{\leavevmode{\bbl at textdir\z@#1}}
 %    \end{macrocode}
@@ -8964,6 +9040,8 @@ help from Bernd Raichle, for which I am grateful.
 % \changes{babel~3.9a}{2013/03/08}{Don't write to aux if language is
 %    unknown}
 % \changes{babel~3.9h}{2013/11/20}{Error with a more helpful text }
+% \changes{babel~3.16}{2018/01/02}{New mechanism to pass the language
+% to aux, toc, etc.}
 %
 %    \begin{macrocode}
 \def\BabelContentsFiles{toc,lof,lot}
@@ -8997,9 +9075,9 @@ help from Bernd Raichle, for which I am grateful.
 \def\babel at aux#1#2{%
   \select at language{#1}%
   \bbl at foreach\BabelContentsFiles{%
-    \@writefile{##1}{\babel at toc{#1}{#2}}}} %% TODO - ok in plain? \string?
+    \@writefile{##1}{\babel at toc{#1}{#2}}}} %% TODO - ok in plain?
 \def\babel at toc#1#2{%
-  \select at language{#1}{#2}}
+  \select at language{#1}}
 %    \end{macrocode}
 %    
 % A bit of optimization. Select in heads/foots the language only if
@@ -9059,6 +9137,7 @@ help from Bernd Raichle, for which I am grateful.
 % \changes{3.15}{2017/10/30}{Remove spaces inside captions and date.}
 %
 %    \begin{macrocode}
+\newif\ifbbl at usedategroup
 \def\bbl at switch#1{%
   \originalTeX
   \expandafter\def\expandafter\originalTeX\expandafter{%
@@ -10292,13 +10371,16 @@ help from Bernd Raichle, for which I am grateful.
 %
 % \subsection{Layout}
 %
+% \changes{babel~3.16}{2018/01/02}{Option layout - first available options:
+% sectioning, counters, lists, columns, contents}
+%
 % In progress.
 %
 % Unfortunately, for proper support for \xetex{} lots of macros and
 % packages must be patched somehow. At least at this stage, \babel{}
 % will not do it and therefore a package similar to \textsf{bidi} will
 % be required. Any help in making \babel{} and \textsf{bidi}
-% collaborate will be wlecome. Note as well, elements like headlines
+% collaborate will be welcome. Note as well, elements like headlines
 % and margins can be modified easily with packages like
 % \textsf{fancyhdr}, \textsf{typearea} or \textsf{titleps}, and
 % \textsf{geometry}.
@@ -10308,7 +10390,8 @@ help from Bernd Raichle, for which I am grateful.
 % constructs are valid: |\adim\bbl at startskip|,
 % |\advance\bbl at startskip\adim|, |\bbl at startskip\adim|.
 %
-% Consider |txtbabel| as a shorthand for \textit{tex--xet babel}.
+% Consider |txtbabel| as a shorthand for \textit{tex--xet babel},
+% which the bidi model in both \pdftex{} and \xetex{}. 
 %
 %    \begin{macrocode}
 %<*texxet>
@@ -10381,15 +10464,7 @@ help from Bernd Raichle, for which I am grateful.
           \hfill\nobreak
           \hb at xt@\@pnumwidth{\hfil\normalfont\normalcolor#5}%
           \par}%
-     \fi}%
-   \def\babel at toc#1{%
-     \select at language{#1}%
-     \bbl at ifunset{bbl at wdir@\bbl at main@language}%
-       {\bbl at provide@dirs{\bbl at main@language}}%
-       {}%
-     \bbl at exp{%
-       \\\bbl at pardir\bbl at cs{wdir@\bbl at main@language}%
-       \\\bbl at textdir\bbl at cs{wdir@\bbl at main@language}}}}
+     \fi}}
   {}
 \IfBabelLayout{columns}
   {\def\@outputdblcol{%
@@ -10880,21 +10955,12 @@ help from Bernd Raichle, for which I am grateful.
      \fi
      \ignorespaces}}
   {}
-\IfBabelLayout{contents}
-  {\def\babel at toc#1{%
-     \select at language{#1}%
-     \bbl at ifunset{bbl at wdir@\bbl at main@language}%
-       {\bbl at provide@dirs{\bbl at main@language}}%
-       {}%
-     \bbl at exp{%
-       \\\bbl at pardir\bbl at cs{wdir@\bbl at main@language}%
-       \\\bbl at textdir\bbl at cs{wdir@\bbl at main@language}}}}
-  {}
 %    \end{macrocode}
 %
 %      Implicitly reverses sectioning labels in bidi=basic-r, because
 %      the full stop is not in contact with L numbers any more. I
-%      think there must be a better way. Assumes bidi=basic-r.
+%      think there must be a better way. Assumes |bidi=basic-r|, but
+%      there are some additional readjustments for |bidi=default|.
 %
 %    \begin{macrocode}
 \IfBabelLayout{counters}%  Global or language dependent? At begin doc?
@@ -10904,10 +10970,9 @@ help from Bernd Raichle, for which I am grateful.
      {\let\bbl at asciiroman=\@roman
       \def\@roman#1{\babelsublr{\ensureascii{\bbl at asciiroman#1}}}%
       \let\bbl at asciiRoman=\@Roman
-      \def\@Roman#1{\babelsublr{\ensureascii{\bbl at asciiRoman#1}}}}}{}
-% only if bidi=default %%%%%%%%%%%%%%%% :
-% \def\labelenumii{)\theenumii(}  % luas, pdf, no xe, luar
-% \def\p at enumiii{\p at enumii)\theenumii(} % luas, pdf, no xe, luar
+      \def\@Roman#1{\babelsublr{\ensureascii{\bbl at asciiRoman#1}}}%
+      \def\labelenumii{)\theenumii(}%
+      \def\p at enumiii{\p at enumii)\theenumii(}}}{}
 %</luatex>
 %    \end{macrocode}
 %
@@ -17136,6 +17201,7 @@ function Babel.pre_otfload(head)
         outer = strong_lr
         new_dir = false
       end
+
       if dir == 'nsm' then dir = strong end             -- W1
 %    \end{macrocode}
 %
diff --git a/required/babel/babel.ins b/required/babel/babel.ins
index 23e4c6b..024b1b8 100644
--- a/required/babel/babel.ins
+++ b/required/babel/babel.ins
@@ -26,7 +26,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %%
-\def\filedate{2017/11/03}
+\def\filedate{2018/01/04}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/required/babel/babel.pdf b/required/babel/babel.pdf
index cb96c98..fd09151 100644
Binary files a/required/babel/babel.pdf and b/required/babel/babel.pdf differ
diff --git a/required/babel/bbcompat.dtx b/required/babel/bbcompat.dtx
index 0a3c730..f568989 100644
--- a/required/babel/bbcompat.dtx
+++ b/required/babel/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2017/11/03 v3.15]
+\ProvidesFile{bbcompat.dtx}[2018/01/04 v3.16]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/required/babel/samples/lua-arabic.pdf b/required/babel/samples/lua-arabic.pdf
index df889fe..63c81e4 100644
Binary files a/required/babel/samples/lua-arabic.pdf and b/required/babel/samples/lua-arabic.pdf differ
diff --git a/required/babel/samples/lua-arabic.tex b/required/babel/samples/lua-arabic.tex
index a6b8ff2..e53fba5 100644
--- a/required/babel/samples/lua-arabic.tex
+++ b/required/babel/samples/lua-arabic.tex
@@ -1,7 +1,7 @@
 %$LuaLaTeX -*- coding: utf-8 ; mode: latex; TeX-engine: luatex; -*-
 \documentclass[a4paper]{book}
 
-\usepackage[english, bidi=basic-r]{babel}
+\usepackage[english, bidi=basic-r, layout=counters]{babel}
 
 \babelprovide[import=ar, main]{arabic}
 
@@ -12,6 +12,8 @@
 \usepackage{microtype}
 \usepackage{graphicx}
 \usepackage{color}
+\usepackage{hyperref}
+\usepackage{multicol}
 
 \title{كهرباء} \author{From Wikipedia}
 
@@ -90,11 +92,9 @@ luatexbase.add_to_callback("pre_linebreak_filter", fixkerns, "fixkerns", where)
 
 \bigskip
 
-\foreignlanguage*{english}{Things to do: section numbers are reversed
-(“correct” in the Unicode sense, but here the full stop has a special
-meaning). In red, a couple of word incorrectly rendered by default. It
-seems a bug in the font loader, and a workaround is used in
-this document (see the source).}
+\foreignlanguage*{english}{In red, a couple of words incorrectly
+rendered by default in the corrent font. It seems a bug in the font
+loader, and a workaround is used in this document (see the source).}
 
 \mainmatter
 
@@ -171,4 +171,46 @@ Pseudodoxia Epidemica) الذي صدر عام 1646.
 تقوم من خلاله الخلايا العصبية بنقل \textcolor{red}{الإشارات} إلى
 العضلات.
 
+\subsection{التيار الكهربائي}
+
+\begin{multicols}{3}
+  تُعرف حركة الشحنة الكهربائية باسم التيار الكهربائي الذي تقاس شدته
+  عادةً بوحدة الأمبير. ويتكون التيار الكهربائي من أية جسيمات مشحونة
+  ومتحركة. وتعد الإلكترونات الأكثر شيوعًا بين هذه الجسيمات، ولكن أي
+  شحنة متحركة يمكنها أن تكون تيارًا. ووفقًا لما هو متعارف عليه، فإن
+  التيار الموجب يُعَرّف بأنه التيار المتدفق في الاتجاه نفسه الذي تتدفق
+  فيه أية شحنة موجبة يحملها؛ أو أنه التيار المتدفق من أقصى طرف موجب في
+  الدائرة الكهربائية إلى أقصى طرف سالب. ويُطلق على هذا النوع من
+  التيارات اسم التيار الاصطلاحي. وبالتالي، تعد حركة الإلكترونات
+  السالبة حول الدائرة الكهربائية ـ وهي أحد أشهر أشكال التيار الكهربائي
+  ـ موجبة في الاتجاه المقابل لاتجاه الإلكترونات.[22] ومع ذلك، فإنه
+  وفقًا للظروف المحيطة يمكن أن يتكون التيار الكهربائي من تدفق الجسيمات
+  المشحونة (الجسيم المشحون) في أيٍّ من الاتجاهين أو حتى في كلا الاتجاهين
+  في وقت واحد. ويشيع استخدام المصطلحين السالب والموجب لتبسيط هذه
+  الحالة.
+
+  علاوةً على ذلك، يُطلق على العملية التي يمر فيها التيار الكهربائي خلال
+  أحد المواد "التوصيل الكهربائي". وتختلف طبيعة التوصيل الكهربائي عن
+  طبيعة الجسيمات المشحونة والمادة التي يمر من خلالها. ومن أمثلة
+  التيارات الكهربائية: التوصيل الفلزي الذي تتدفق فيه الإلكترونات خلال
+  موصل مثل الفلز. بالإضافة إلى ذلك، هناك التحليل الكهربائي الذي تتدفق
+  فيه الأيونات (وهي عبارة عن ذرات مشحونة) خلال السوائل. في حين تتحرك
+  الجسيمات نفسها ببطء تام، ليصل متوسط سرعة الانسياق أحيانًا إلى أجزاء
+  من المليمتر في الثانية،[21] فإن المجال الكهربائي الذي تتدفق فيه هذه
+  الجسيمات ينتشر في حد ذاته بسرعة مقاربة لسرعة الضوء، مما يسمح
+  للإشارات الكهربائية بالمرور بسرعة خلال الأسلاك.[23] يؤدي التيار
+  الكهربائي إلى حدوث عدة تأثيرات ملحوظة ـ كانت تعتبر في الماضي الوسيلة
+  التي يدرك بها الأفراد وجود تيار كهربائي. وقد اكتشف ويليام نيكلسون
+  وأنطوني كارلايل عام 1800 أن بإمكان التيار الكهربائي تحليل الماء من
+  بطارية فولتية، وتُعرف هذه العملية الآن باسم التحليل الكهربائي. وقام
+  مايكل فاراداي بعمل دراسات موسعة في اكتشاف نيكلسون وكارلايل بشكل كبير
+  عام 1833.[24] ويسبب التيار المار من خلال مقاومة نوعًا من التدفئة في
+  المكان المحيط، وهو تأثير كان جيمس بريسكوت قد بحثه حسابيًا عام
+  1840. ومن أهم الاكتشافات الخاصة بالتيار الكهربائي كان ما توصل إليه
+  هانز كريستيان أورستد بمحض الصدفة عام 1820 عندما كان يحضر إحدى
+  محاضراته. حيث وجد أن التيار الكهربائي في أحد الأسلاك يشوش حركة إبرة
+  البوصلة المغناطيسية،[25] كما اكتشف الكهرومغناطيسية، وهي عبارة عن
+  تفاعل أساسي يحدث بين الكهرباء والمغناطيسات.
+\end{multicols}
+
 \end{document}
diff --git a/required/babel/samples/lua-se-he.pdf b/required/babel/samples/lua-se-he.pdf
new file mode 100644
index 0000000..a105cac
Binary files /dev/null and b/required/babel/samples/lua-se-he.pdf differ
diff --git a/required/babel/samples/lua-se-he.tex b/required/babel/samples/lua-se-he.tex
new file mode 100644
index 0000000..3541a7a
--- /dev/null
+++ b/required/babel/samples/lua-se-he.tex
@@ -0,0 +1,13 @@
+\documentclass{article}
+
+\usepackage[swedish, bidi=default]{babel}
+
+\babelprovide[import=he]{hebrew}
+
+\babelfont{rm}{FreeSerif}
+
+\begin{document}
+
+Svenska \foreignlanguage{hebrew}{עִבְרִית} svenska.
+
+\end{document}
\ No newline at end of file





More information about the latex3-commits mailing list