[latex3-commits] [git/LaTeX3-latex3-latex2e] master: Option layout=captions (experimental in pdf/xe). (d640683)

Javier javier at dante.de
Wed Jan 31 17:27:26 CET 2018


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

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

commit d640683283f9d0b53524f8cea7b8661e5402b873
Author: Javier <javier at localhost>
Date:   Wed Jan 31 17:26:31 2018 +0100

    Option layout=captions (experimental in pdf/xe).


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

d640683283f9d0b53524f8cea7b8661e5402b873
 required/babel/README.md              |    4 ++--
 required/babel/babel.dtx              |   36 ++++++++++++++++++++++++++-------
 required/babel/babel.ins              |    2 +-
 required/babel/babel.pdf              |  Bin 637952 -> 638337 bytes
 required/babel/bbcompat.dtx           |    2 +-
 required/babel/samples/lua-arabic.pdf |  Bin 85575 -> 85578 bytes
 required/babel/samples/lua-arabic.tex |   21 +++++++++++--------
 7 files changed, 46 insertions(+), 19 deletions(-)

diff --git a/required/babel/README.md b/required/babel/README.md
index 32dbe50..14911cc 100644
--- a/required/babel/README.md
+++ b/required/babel/README.md
@@ -1,4 +1,4 @@
-## Babel 3.17.1171
+## Babel 3.17.1173
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages.  Many
@@ -110,5 +110,5 @@ respective authors.
 ```
 
 Javier Bezos
-2018/01/29
+2018/01/31
 
diff --git a/required/babel/babel.dtx b/required/babel/babel.dtx
index bebb78c..7f2bed5 100644
--- a/required/babel/babel.dtx
+++ b/required/babel/babel.dtx
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2018/01/29 v3.17.1171 The Babel package]
+\ProvidesFile{babel.dtx}[2018/01/31 v3.17.1173 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -2246,6 +2246,7 @@ _\babelprovide[import=ar, main]{arabic}_
                    \texttt{lists}  $\string|$
                    \texttt{contents}  $\string|$
                    \texttt{footnotes}  $\string|$
+                   \texttt{captions}  $\string|$
                    \texttt{columns}}
 
 \New{3.16} \textit{To be expanded}.  Selects which layout elements are
@@ -2278,6 +2279,10 @@ etc.). Note not all options are required by all engines.
   useful in multilingual documents in all engines; you may use
   alternatively |\BabelFootnote| described below (what this options
   does exactly is also explained there).
+\item[captions] is similar to |sectioning|, but for |\caption|; not
+  required in monolingual documents with \luatex{}, but may be
+  required in \xetex{} and \pdftex{} in some styles (support for the
+  latter two engines is still experimental);
 \end{description}
 
 \Describe{\babelsublr}{\marg{lr-text}}
@@ -3615,8 +3620,8 @@ help from Bernd Raichle, for which I am grateful.
 %    little bit of literate programming.
 %
 %    \begin{macrocode}
-%<<version=3.17.1171>>
-%<<date=2018/01/29>>
+%<<version=3.17.1173>>
+%<<date=2018/01/31>>
 %    \end{macrocode}
 %
 % \section{Tools}
@@ -7401,6 +7406,7 @@ help from Bernd Raichle, for which I am grateful.
 \def\bbl at presec@x#1[#2]#3{%
   \bbl at exp{%
     \\\select at language@x{\bbl at main@language}%
+    \\\@nameuse{bbl at sspre@#1}%
     \\\@nameuse{bbl at ss@#1}%
       [\\\foreignlanguage{\languagename}{\unexpanded{#2}}]%
       {\\\foreignlanguage{\languagename}{\unexpanded{#3}}}%
@@ -7408,10 +7414,11 @@ help from Bernd Raichle, for which I am grateful.
 \def\bbl at presec@s#1#2{%
   \bbl at exp{%
     \\\select at language@x{\bbl at main@language}%
+    \\\@nameuse{bbl at sspre@#1}%
     \\\@nameuse{bbl at ss@#1}*%
       {\\\foreignlanguage{\languagename}{\unexpanded{#2}}}%
     \\\select at language@x{\languagename}}}
-\IfBabelLayout{sectioning}%   at begin document ???
+\IfBabelLayout{sectioning}%
   {\BabelPatchSection{part}%
    \BabelPatchSection{chapter}%
    \BabelPatchSection{section}%
@@ -7421,6 +7428,8 @@ help from Bernd Raichle, for which I am grateful.
    \BabelPatchSection{subparagraph}%
    \def\babel at toc#1{%
      \select at language@x{\bbl at main@language}}}{}
+\IfBabelLayout{captions}%
+  {\BabelPatchSection{caption}}{}
 %    \end{macrocode}
 %
 %    Now we load definition files for engines.
@@ -10584,6 +10593,8 @@ help from Bernd Raichle, for which I am grateful.
 %    \begin{macrocode}
 %<*texxet>
 \bbl at trace{Redefinitions for bidi layout}
+\def\bbl at sspre@caption{%
+  \bbl at exp{\everyhbox{\\\bbl at textdir\bbl at cs{wdir@\bbl at main@language}}}}
 \ifx\bbl at opt@layout\@nnil\endinput\fi  % No layout
 \def\bbl at startskip{\ifcase\bbl at thepardir\leftskip\else\rightskip\fi}
 \def\bbl at endskip{\ifcase\bbl at thepardir\rightskip\else\leftskip\fi}
@@ -11143,10 +11154,21 @@ help from Bernd Raichle, for which I am grateful.
 \ifx\bbl at opt@layout\@nnil\endinput\fi  % if no layout
 \ifx\bbl at beforeforeign\leavevmode % A poor test for bidi=
   \def\bbl at nextfake#1{%
+    \mathdir\bodydir  % non-local, use always inside a group!
     \bbl at exp{%
-      \mathdir\bodydir#1%
-      \everyvbox{\bodydir\the\bodydir\everyvbox{}}%
-      \everyhbox{\bodydir\the\bodydir\everyhbox{}}}}%
+      #1%
+      \everyvbox{%
+        \the\everyvbox
+        \bodydir\the\bodydir
+        \mathdir\the\mathdir
+        \everyhbox{\the\everyhbox}%
+        \everyvbox{\the\everyvbox}}%
+      \everyhbox{%
+        \the\everyhbox
+        \bodydir\the\bodydir
+        \mathdir\the\mathdir
+        \everyhbox{\the\everyhbox}%
+        \everyvbox{\the\everyvbox}}}}%
   \def\@hangfrom#1{%
     \setbox\@tempboxa\hbox{{#1}}%
     \hangindent\wd\@tempboxa
diff --git a/required/babel/babel.ins b/required/babel/babel.ins
index 38d1520..86f229f 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/01/29}
+\def\filedate{2018/01/31}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/required/babel/babel.pdf b/required/babel/babel.pdf
index e161ef1..edfae6c 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 73bf9dc..9592ae3 100644
--- a/required/babel/bbcompat.dtx
+++ b/required/babel/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2018/01/29 v3.17.1171]
+\ProvidesFile{bbcompat.dtx}[2018/01/31 v3.17.1173]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/required/babel/samples/lua-arabic.pdf b/required/babel/samples/lua-arabic.pdf
index 7c77630..21d108b 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 6f1dec3..7d7d1e7 100644
--- a/required/babel/samples/lua-arabic.tex
+++ b/required/babel/samples/lua-arabic.tex
@@ -1,7 +1,9 @@
 %$LuaLaTeX -*- coding: utf-8 ; mode: latex; TeX-engine: luatex; -*-
 \documentclass[a4paper]{book}
 
-\usepackage[english, bidi=basic-r, layout=counters.tabular]{babel}
+\usepackage[english, bidi=basic-r,
+            headfoot=arabic,  % an alternative is layout=sectioning
+            layout=counters.tabular]{babel}
 
 \babelprovide[import=ar, main]{arabic}
 
@@ -22,11 +24,13 @@
         Typeset with \textsf{babel}
         \addfontfeatures{Numbers=ArabicOff} \csname bbl at version\endcsname}
 
-% Fix some bad kerns inserted by the font loader. I don't know where
-% the bug is and why the following workaroud fixes it. It just forces
-% a dir node as the second node in the par. Note it doesn't take hboxes
-% into account, yet (no local_par = 9 node at the beginning). It seems
-% the font loader will be fixed soon.
+% ----
+% Fix some bad kerns inserted by the font loader. I don't know
+% where the bug is and why the following workaroud fixes it. It just
+% forces a dir node as the second node in the par. Note it doesn't
+% take hboxes into account, yet (no local_par = 9 node at the
+% beginning), but there is another workaround. But in tabular the
+% issue remains. It seems the font loader will be fixed soon.
 
 \directlua{
 
@@ -46,8 +50,9 @@ where = luatexbase.priority_in_callback('pre_linebreak_filter',
         'luaotfload.node_processor')
 
 luatexbase.add_to_callback("pre_linebreak_filter", fixkerns, "fixkerns", where)
-% luatexbase.add_to_callback("hpack_filter", fixkerns, "fixkerns", where)
 }
+\everyhbox{\bgroup\aftergroup\egroup\textdir\bodydir}
+% ----
 
 \begin{document}
 
@@ -238,7 +243,7 @@ actually “correct”).}
 1 & هيدروجين & 1\\
 2 & هيليوم & 2\\
 37 & روبيديوم & 2 & 8 & 18 & 8 & 1\\
-38 & سترانشيوم & 2 & 8 & 18 & 8 & 2\\
+38 & \color{red}{سترانشيوم} & 2 & 8 & 18 & 8 & 2\\
 39 & إيتيريوم & 2 & 8 & 18 & 9 & 2\\
 40 & زركونيوم & 2 & 8 & 18 & 10 & 2\\
 41 & نيوبيوم & 2 & 8 & 18 & 12 & 1\\





More information about the latex3-commits mailing list