[latex3-commits] [git/LaTeX3-latex3-latex2e] master: (babel) 3.27. Preliminary support for the bidi package. (abf47e1)

Javier jbezos at dante.de
Tue Nov 13 08:15:41 CET 2018


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

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

commit abf47e1bd40299e46b000d9ca7fdafe830fe645b
Author: Javier <jbezos at localhost>
Date:   Tue Nov 13 08:15:41 2018 +0100

    (babel) 3.27. Preliminary support for the bidi package.
    
    With sample. And minor improvements in babel-vi.ini.


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

abf47e1bd40299e46b000d9ca7fdafe830fe645b
 required/babel/README.md              |    8 ++-
 required/babel/babel.dtx              |  108 +++++++++++++++++++++------------
 required/babel/babel.ins              |    3 +-
 required/babel/babel.pdf              |  Bin 652174 -> 660189 bytes
 required/babel/bbcompat.dtx           |    2 +-
 required/babel/locale/vi/babel-vi.ini |    9 +--
 required/babel/samples/xe-bidi.pdf    |  Bin 0 -> 20487 bytes
 required/babel/samples/xe-bidi.tex    |   25 ++++++++
 8 files changed, 108 insertions(+), 47 deletions(-)

diff --git a/required/babel/README.md b/required/babel/README.md
index d16d407..0e99ab6 100644
--- a/required/babel/README.md
+++ b/required/babel/README.md
@@ -1,4 +1,4 @@
-## Babel 3.26.1445
+## Babel 3.27
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages.  Many
@@ -51,6 +51,10 @@ respective authors.
 ### Latest changes
 
 ```
+3.27   - Preliminary support for bidi (by Vafa Khalighi) with xetex.
+       - Fix for 3.23 - \ensureascii was redefined even when not 
+         necessary.
+       - Minor improvements in babel-vi.ini.
 3.26   - Fix for 3.25 - \babelprovide raised an error with xetex. 
 3.25   - Fixes for 3.23 - mapfont=direction could raise an error.
          Language and Script were not always defined correctly.
@@ -115,5 +119,5 @@ respective authors.
 ```
 
 Javier Bezos
-2018/10/30
+2018/11/13
 
diff --git a/required/babel/babel.dtx b/required/babel/babel.dtx
index 5bfc9e3..73602cb 100644
--- a/required/babel/babel.dtx
+++ b/required/babel/babel.dtx
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2018/10/30 v3.26.1445 The Babel package]
+\ProvidesFile{babel.dtx}[2018/11/13 v3.27 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -2312,7 +2312,7 @@ loaded. For example, if you load |LY1,LGR|, then it is set to |LY1|,
 but if you load |LY1,T2A| it is set to |T2A|. The symbol encodings
 |TS1|, |T3|, and |TS3| are not taken into account, since they are not
 used for ``ordinary'' text (they are stored in |\BabelNonText|, used
-in some special cases when no latin encoding is explicitly set).
+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 asumption is made on characters above
@@ -2910,12 +2910,42 @@ chapters), in Hungarian ``from (1)'' is ``(1)-b\H{o}l'', but ``from
 
 \subsection{Tentative and experimental code}
 
+See the code section for |\foreignlanguage*| (a new starred
+version of |\foreignlanguage|).
+
+\medskip
 \textbf{Southeast Asian interword spacing}
 
-There is some preliminary interword spacing for Thai, Lao and Khemer
-in \luatex{} (provided there are hyphenation patters). It is activated
-automatically if a language with of one of these scripts are loaded
-with |\babelprovide|. See the sample on the \babel{} repository.
+There is some preliminary interword spacing for Thai, Lao and Khemer in
+\luatex{} (provided there are hyphenation patters) and \xetex. It is
+activated automatically if a language with one of those scripts are
+loaded with |\babelprovide|. See the sample on the \babel{} repository.
+With both engines, interword spacing is based on the ``current'' em
+unit (the size of the previous char in \luatex{} and the font size set
+by the last |\selectfont| in \xetex).
+
+\medskip
+\textbf{Bidi writing} in \luatex{} is still under development, but the
+basic implementation is finished. On the other hand, in \xetex{} it is
+taking its first steps. The latter engine poses quite different
+challenges. An option to manage document layout in \luatex{} (lists,
+footnotes, etc.) is almost finished, but \xetex{} required more work.
+
+Unfortunately, proper support for \xetex{} requires patching somehow
+lots of macros and packages (and some issues related to |\special|s
+remain, like color and hyperlinks). 
+
+\medskip
+\textbf{bidi=bidi}
+
+\New{3.27} This package option is a new experimental support for bidi
+writing with \xetex{} and the \textsf{bidi} package (by Vafa Khalighi).
+Currently, it just provides the basic direction switches with
+|\selectlanguage| and |\foreignlanguage|. Any help in making \babel{}
+and \textsf{bidi} collaborate will be welcome (although the underlying
+concepts in both packages seem very different).
+
+See the babel repository for a small example (|xe-bidi|).
 
 \medskip
 \textbf{Old stuff}
@@ -2940,19 +2970,6 @@ So, for example:
 \babelFSfeatures{turkish}{Language=Turkish}
 \end{verbatim}
 
-\medskip
-\textbf{Bidi writing} in \luatex{} is under development, but a basic
-implementation is almost finished. On the other hand, in \xetex{} it is
-taking its first steps. The latter engine poses quite different
-challenges. An option to manage document layout in \luatex{} (lists,
-footnotes, etc.) is almost finished, but \xetex{} required more work.
-
-See the code section for |\foreignlanguage*| (a new starred version of
-|\foreignlanguage|).
-
-\xetex{} relies on the font to properly handle these unmarked changes,
-so it is not under the control of \TeX.
-
 \section{Loading languages with \file{language.dat}}
 
 \TeX{} and most engines based on it (pdf\TeX, \xetex, $\epsilon$-\TeX,
@@ -3633,7 +3650,7 @@ set for Turkish:
 \end{verbatim}
 (Note the mapping for |OT1| is not complete.)
 
-\Describe\SetHyphenMap{\marg{to-lower-macros}}
+\Describe{\SetHyphenMap}{\marg{to-lower-macros}}
 \New{3.9g} Case mapping serves in \TeX{} for two unrelated purposes: case
 transforms (upper/lower) and hyphenation. |\SetCase| handles the
 former, while hyphenation is handled by |\SetHyphenMap| and controlled
@@ -3776,7 +3793,7 @@ help from Bernd Raichle, for which I am grateful.
 %  \global\let\check at percent\saved at check@percent
 %\endgroup
 %
-% \part{The code}
+% \part{Source code}
 %
 % \babel{} is being developed incrementally, which means parts of the
 % code are under development and therefore incomplete. Only documented
@@ -3857,8 +3874,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.26.1445>>
-%<<date=2018/10/30>>
+%<<version=3.27>>
+%<<date=2018/11/13>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -9284,6 +9301,18 @@ help from Bernd Raichle, for which I am grateful.
     \newtoks\everypar
     \everypar=\bbl at severypar
     \bbl at severypar{\bbl at xeeverypar\the\everypar}}
+  \@ifpackagewith{babel}{bidi=bidi}%
+    {\let\bbl at textdir@i\@gobbletwo
+     \let\bbl at xebidipar\@empty
+     \AddBabelHook{bidi}{foreign}{%
+       \def\bbl at tempa{\def\BabelText####1}%
+       \ifcase\bbl at thetextdir
+         \expandafter\bbl at tempa\expandafter{\BabelText{\LR{##1}}}%
+       \else
+         \expandafter\bbl at tempa\expandafter{\BabelText{\RL{##1}}}%
+       \fi}
+     \def\bbl at pardir#1{\ifcase#1\relax\setLR\else\setRL\fi}}
+    {}%
 \fi
 %    \end{macrocode}
 %
@@ -10214,7 +10243,7 @@ help from Bernd Raichle, for which I am grateful.
 \def\bbl at tentative{\protect\bbl at tentative@i}
 \def\bbl at tentative@i#1{%
   \bbl at warning{%
-    Some functions in '#1' are tentative.\\%
+    Some functions for '#1' are tentative.\\%
     They might not work as expected and their behavior\\%
     could change in the future.\\%
     Reported}}
@@ -10687,6 +10716,16 @@ help from Bernd Raichle, for which I am grateful.
     \AtEndOfPackage{%
       \EnableBabelHook{babel-bidi}%
       \bbl at xebidipar}}
+  \DeclareOption{bidi=bidi}%
+    {\bbl at tentative{bidi=bidi}%
+     \ifx\RTLfootnotetext\@undefined
+       \AtEndOfPackage{%
+         \EnableBabelHook{babel-bidi}%
+         \ifx\fontspec\@undefined
+           \usepackage{fontspec}% bidi needs fontspec 
+         \fi
+         \usepackage{bidi}}%
+     \fi}
 \fi
 \DeclareOption{bidi=default}%
   {\let\bbl at beforeforeign\leavevmode
@@ -11032,16 +11071,9 @@ help from Bernd Raichle, for which I am grateful.
 %
 % \textit{In progress.}
 %
-% Unfortunately, proper support for \xetex{} requires patching somehow
-% lots of macros and packages (and some issues related to |\special|s
-% remain, like color and hyperlinks). At least at this stage, \babel{}
-% will not do it and therefore a package like \textsf{bidi} (by Vafa
-% Khalighi) would be necessary to overcome the limitations of
-% \xetex. Any help in making \babel{} and \textsf{bidi} collaborate
-% will be welcome, although the underlying concepts in both packages
-% seem very different. Note also elements like headlines and margins
-% can be modified easily with packages like \textsf{fancyhdr},
-% \textsf{typearea} or \textsf{titleps}, and \textsf{geometry}.
+% Note elements like headlines and margins can be modified easily with
+% packages like \textsf{fancyhdr}, \textsf{typearea} or
+% \textsf{titleps}, and \textsf{geometry}.
 %
 % |\bbl at startskip| and |\bbl at endskip| are available to package
 % authors. Thanks to the \TeX{} expansion mechanism the following
@@ -11581,7 +11613,7 @@ help from Bernd Raichle, for which I am grateful.
 %    \end{macrocode}
 %  \end{macro}
 %
-% \section{Southeast Asian scripts}
+% \subsection{Southeast Asian scripts}
 %
 % \changes{babel~3.24}{2018/09/24}{Lua code for interword spacing
 %   in Southeast Asian scripts.}
@@ -11591,8 +11623,8 @@ help from Bernd Raichle, for which I am grateful.
 % sense, because the hyphen and the previous char go always together).
 % Other discretionaries are not touched.
 %
-% For the moment, only 3 SA languages are 
-% activated by default (see Unicode UAX 14).
+% For the moment, only 3 SA languages are activated by default (see
+% Unicode UAX 14).
 %
 %    \begin{macrocode}
 \def\bbl at intraspace#1 #2 #3\@@{%
@@ -11822,7 +11854,7 @@ help from Bernd Raichle, for which I am grateful.
 %</luatex>
 %    \end{macrocode}
 %
-% \subsection{Auto bidi with \texttt{basic-r}}
+% \subsection{Auto bidi with \texttt{basic} and \texttt{basic-r}}
 %
 % \changes{3.14}{2017/09/30}{LuaTeX - support for R/AL texts - basic-r}
 %
diff --git a/required/babel/babel.ins b/required/babel/babel.ins
index 3c3624d..21726ac 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{2018/10/30}
+\def\filedate{2018/11/13}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
@@ -196,7 +196,6 @@
          \compatfile{usorbian}
          \compatfile{bahasa}
          \compatfile{hebrew}
-         %\compatfile{sanskrit}
          \compatfile{basque}
          \compatfile{latin}
          \compatfile{icelandic}
diff --git a/required/babel/babel.pdf b/required/babel/babel.pdf
index 6bc21b2..bd66981 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 d77eef7..4744d1b 100644
--- a/required/babel/bbcompat.dtx
+++ b/required/babel/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2018/10/30 v3.26.1445]
+\ProvidesFile{bbcompat.dtx}[2018/11/13 v3.27]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/required/babel/locale/vi/babel-vi.ini b/required/babel/locale/vi/babel-vi.ini
index 21f6cbb..396a9c7 100644
--- a/required/babel/locale/vi/babel-vi.ini
+++ b/required/babel/locale/vi/babel-vi.ini
@@ -8,11 +8,12 @@
 ; * Common Locale Data Repository (license Unicode):
 ;   http://cldr.unicode.org/
 ;   http://unicode.org/copyright.html
+; With suggestions by Reinhard Kotucha
 
 [identification]
 charset = utf8
-version = 1.0
-date = 2017-09-01
+version = 1.1
+date = 2018-11-12
 name.local = Tiếng Việt
 name.english = Vietnamese
 name.babel = vietnamese
@@ -23,7 +24,7 @@ script.name = Latin
 script.tag.bcp47 = Latn
 script.tag.opentype = latn
 level = 1
-encodings = T1 OT1 LY1
+encodings = T5
 derivate = no
 
 [captions]
@@ -147,7 +148,7 @@ time.short = [HH]:[mm]
 
 [typography]
 frenchspacing = yes
-hyphenrules = vietnam
+hyphenrules = 
 lefthyphenmin = 2
 righthyphenmin = 3
 hyphenchar = 
diff --git a/required/babel/samples/xe-bidi.pdf b/required/babel/samples/xe-bidi.pdf
new file mode 100644
index 0000000..2880841
Binary files /dev/null and b/required/babel/samples/xe-bidi.pdf differ
diff --git a/required/babel/samples/xe-bidi.tex b/required/babel/samples/xe-bidi.tex
new file mode 100644
index 0000000..fe67f85
--- /dev/null
+++ b/required/babel/samples/xe-bidi.tex
@@ -0,0 +1,25 @@
+\documentclass{article}
+
+\usepackage[english, bidi=bidi]{babel}
+
+\babelprovide[import, maparabic]{arabic}
+
+\babelfont{rm}{FreeSerif}
+
+\begin{document}
+
+The date format must be fixed.
+
+One two \foreignlanguage{arabic}{ثلاثة أربعة} five six. 
+
+\selectlanguage{arabic}
+
+\section{العَرَبِيَّة‎}
+
+واحد اثنان \foreignlanguage{english}{three four} خمسة ستة
+
+\foreignlanguage{english}{A B \today{} C D}
+
+\foreignlanguage{english}{A B} \today{} \foreignlanguage{english}{C D}
+
+\end{document}





More information about the latex3-commits mailing list