[latex3-commits] [git/latex2e] master: Bidi footnotes. Bump version (babel 3.17) (e1e68b5)
Javier
javier at dante.de
Fri Jan 26 17:05:52 CET 2018
Repository : https://github.com/latex3/latex2e
On branch : master
Link : https://github.com/latex3/latex2e/commit/e1e68b51ad42f83481b84819b20e1701fd5ee122
>---------------------------------------------------------------
commit e1e68b51ad42f83481b84819b20e1701fd5ee122
Author: Javier <javier at localhost>
Date: Fri Jan 26 17:05:21 2018 +0100
Bidi footnotes. Bump version (babel 3.17)
>---------------------------------------------------------------
e1e68b51ad42f83481b84819b20e1701fd5ee122
required/babel/README.md | 7 +-
required/babel/babel.dtx | 183 +++++++++++++++++++++++++++++++++++--------
required/babel/babel.ins | 2 +-
required/babel/babel.pdf | Bin 629696 -> 635190 bytes
required/babel/bbcompat.dtx | 2 +-
5 files changed, 158 insertions(+), 36 deletions(-)
diff --git a/required/babel/README.md b/required/babel/README.md
index 7515fb2..add1ef5 100644
--- a/required/babel/README.md
+++ b/required/babel/README.md
@@ -1,4 +1,4 @@
-## Babel 3.16.1150
+## Babel 3.17
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -64,6 +64,9 @@ respective authors.
### New
```
+3.17 - A tool for bidi footnotes.
+ - Fix - \ragged... didn't work for bidi.
+
3.16 - New package option layout for bidi documents.
- Quotes in TU encoding
- Fix - \<language>date did not work correctly
@@ -107,5 +110,5 @@ respective authors.
```
Javier Bezos
-2018/01/08
+2018/01/24
diff --git a/required/babel/babel.dtx b/required/babel/babel.dtx
index a3ac04b..b846f29 100644
--- a/required/babel/babel.dtx
+++ b/required/babel/babel.dtx
@@ -31,7 +31,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2018/01/08 v3.16.1150 The Babel package]
+\ProvidesFile{babel.dtx}[2018/01/24 v3.17 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -2183,11 +2183,14 @@ differ in the way `weak' numeric characters are ordered (eg, Arabic
\begin{warning}
Setting bidi text has many subtleties (see for example
- <https://www.w3.org/TR/html-bidi/>). This means the \babel{} bidi
- code may take some time before it is truly stable. An effort is
- being made to avoid incompatibilities in the future (this one of the
- reason currently bidi must be explicitly requested as a package
- option, with a certain bidi model).
+ <https://www.w3.org/TR/html-bidi/>). \textit{This means the \babel{}
+ bidi code may take some time before it is truly stable.}\footnote{A
+ basic stable version for \luatex{} is planned before Summer
+ 2018. Other engines must wait very likely until Winter.} An effort
+ is being made to avoid incompatibilities in the future (this one of
+ the reason currently bidi must be explicitly requested as a package
+ option, with a certain bidi model, and also the |layout| options
+ described below).
\end{warning}
There are some package options controlling bidi writing.
@@ -2242,12 +2245,14 @@ _\babelprovide[import=ar, main]{arabic}_
\texttt{counters} $\string|$
\texttt{lists} $\string|$
\texttt{contents} $\string|$
+ \texttt{footnotes} $\string|$
\texttt{columns}}
-\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{}.
+\New{3.16} \textit{To be expanded}. Selects which layout elements are
+adapted in bidi documents. You may use several options with a
+comma-separated list (eg, |layout=counters.contents.sectioning|). This
+list will be expanded in future releases (tables, captions,
+etc.). Note not all options are required by all engines.
\begin{description}
\renewcommand\makelabel[1]{%
@@ -2255,29 +2260,34 @@ required in \luatex{}.
\itemsep=-\parskip
\item[sectioning] makes sure the sectioning macros are typeset in the
main language, but with the title text in the current language (see
- below for further details);
+ below |\BabelPatchSection| 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{}
- with |bidi=default|;
+ \xetex{} and \pdftex{} for counters in general, as well as in
+ \luatex{} with |bidi=default|; required in \luatex{} for numeric
+ footnote marks $>$9;
\item[lists] 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;
+ 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
- \luatex{} they are R by default (including \textsf{multicol}).
+ \luatex{} they are R by default if the main language is R (including
+ \textsf{multicol});
+\item[footnotes] not required in monolingual documents, but it may be
+ useful in multilingual documents in all engines; you may use
+ alternatively |\BabelFootnote| described below (what this options
+ does exactly is also explained there).
\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
-no |rl| counterpart.
+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 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}}
@@ -2289,11 +2299,49 @@ cases) because it applies the global language to the section format
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
+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).
+\Describe{\BabelFootnote}{\marg{cmd}\marg{local-language}%
+ \marg{before}\marg{after}}
+
+\New{3.17} Something like:
+\begin{verbatim}
+\BabelFootnote{\parsfootnote}{\languagename}{(}{)}
+\end{verbatim}
+defines |\parsfootnote| so that |\parsfootnote{note}| is equivalent to:
+\begin{verbatim}
+\footnote{(\foreignlanguage{\languagename}{note})}
+\end{verbatim}
+but the footnote itself is typeset in the main language (to unify its
+direction). In addition, |\parsfootnotetext| is defined. The option
+|footnotes| just does the following:
+\begin{verbatim}
+\BabelFootnote{\footnote}{\languagename}{}{}%
+\BabelFootnote{\localfootnote}{\languagename}{}{}%
+\BabelFootnote{\mainfootnote}{}{}{}
+\end{verbatim}
+(which also redefine |\footnotetext| and define |\localfootnotetext|
+and |\mainfootnotetext|). If the language argument is empty, then no
+language is selected inside the argument of the footnote. Note this
+command is available always in bidi documents, even without
+|layout=footnotes|.
+
+\begin{example}
+ If you want to preserve directionality in footnotes and there are
+ many footnotes entirely in English, you can define:
+\begin{verbatim}
+\BabelFootnote{\enfootnote}{english}{}{.}
+\end{verbatim}
+ It adds a period outside the English part, so that it is placed
+ at the left in the last line. This means the dot the end of the
+ footnote text should be omitted.
+\end{example}
+
\subsection{Language attributes}
\DescribeMacro{\languageattribute}
@@ -3567,8 +3615,8 @@ help from Bernd Raichle, for which I am grateful.
% little bit of literate programming.
%
% \begin{macrocode}
-%<<version=3.16.1150>>
-%<<date=2018/01/08>>
+%<<version=3.17>>
+%<<date=2018/01/24>>
% \end{macrocode}
%
% \section{Tools}
@@ -8569,7 +8617,8 @@ help from Bernd Raichle, for which I am grateful.
% \subsection{Basic bidi support}
%
% \textbf{Work in progress.} This code is currently placed here for
-% practical reasons.
+% practical reasons. It is loosely based on |rlbabel.def|, but most
+% of it has been developed from scratch.
%
% \begin{itemize}
% \item pdftex provides a minimal support for bidi text, and it
@@ -10342,6 +10391,59 @@ help from Bernd Raichle, for which I am grateful.
%<</Restore Unicode catcodes before loading patterns>>
% \end{macrocode}
%
+% Some more common code.
+%
+% \changes{babel 3.17}{2018/01/24}{Tools for bidi footnote}
+%
+% \begin{macrocode}
+%<<*Footnote changes>>
+\ifx\bbl at beforeforeign\leavevmode
+ \def\bbl at footnote#1#2#3{%
+ \@ifnextchar[%
+ {\bbl at footnote@o{#1}{#2}{#3}}%
+ {\bbl at footnote@x{#1}{#2}{#3}}}
+ \def\bbl at footnote@x#1#2#3#4{%
+ \bgroup
+ \select at language@x{\bbl at main@language}%
+ \bbl at fn@footnote{#2#1{\ignorespaces#4}#3}%
+ \egroup}
+ \def\bbl at footnote@o#1#2#3[#4]#5{%
+ \bgroup
+ \select at language@x{\bbl at main@language}%
+ \bbl at fn@footnote[#4]{#2#1{\ignorespaces#5}#3}%
+ \egroup}
+ \def\bbl at footnotetext#1#2#3{%
+ \@ifnextchar[%
+ {\bbl at footnotetext@o{#1}{#2}{#3}}%
+ {\bbl at footnotetext@x{#1}{#2}{#3}}}
+ \def\bbl at footnotetext@x#1#2#3#4{%
+ \bgroup
+ \select at language@x{\bbl at main@language}%
+ \bbl at fn@footnotetext{#2#1{\ignorespaces#4}#3}%
+ \egroup}
+ \def\bbl at footnotetext@o#1#2#3[#4]#5{%
+ \bgroup
+ \select at language@x{\bbl at main@language}%
+ \bbl at fn@footnotetext[#4]{#2#1{\ignorespaces#5}#3}%
+ \egroup}
+ \def\BabelFootnote#1#2#3#4{%
+ \ifx\bbl at fn@footnote\@undefined
+ \let\bbl at fn@footnote\footnote
+ \fi
+ \ifx\bbl at fn@footnotetext\@undefined
+ \let\bbl at fn@footnotetext\footnotetext
+ \fi
+ \bbl at ifblank{#2}%
+ {\def#1{\bbl at footnote{\@firstofone}{#3}{#4}}
+ \@namedef{\bbl at stripslash#1text}%
+ {\bbl at footnotetext{\@firstofone}{#3}{#4}}}%
+ {\def#1{\bbl at exp{\\\bbl at footnote{\\\foreignlanguage{#2}}}{#3}{#4}}%
+ \@namedef{\bbl at stripslash#1text}%
+ {\bbl at exp{\\\bbl at footnotetext{\\\foreignlanguage{#2}}}{#3}{#4}}}}
+\fi
+%<</Footnote changes>>
+% \end{macrocode}
+%
% Now, the code.
%
% \begin{macrocode}
@@ -10380,8 +10482,9 @@ help from Bernd Raichle, for which I am grateful.
% 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 welcome. Note as well, elements like headlines
-% and margins can be modified easily with packages like
+% collaborate will be welcome, although the underlying concepts in
+% both packages seem very different. 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}.
%
@@ -10535,6 +10638,12 @@ help from Bernd Raichle, for which I am grateful.
\endgroup
\fi}}%
{}
+<@Footnote changes@>
+\IfBabelLayout{footnotes}%
+ {\BabelFootnote\footnote\languagename{}{}%
+ \BabelFootnote\localfootnote\languagename{}{}%
+ \BabelFootnote\mainfootnote{}{}{}}
+ {}
% \end{macrocode}
%
% Implicitly reverses sectioning labels in |bidi=basic-r|, because
@@ -10988,16 +11097,26 @@ help from Bernd Raichle, for which I am grateful.
% there are some additional readjustments for |bidi=default|.
%
% \begin{macrocode}
-\IfBabelLayout{counters}% Global or language dependent? At begin doc?
- {\let\bbl at latinarabic=\@arabic
+\IfBabelLayout{counters}%
+ {\def\@textsuperscript#1{{% lua has separate settings for math
+ \m at th
+ \mathdir\pagedir % required with basic-r; ok with default, too
+ \ensuremath {^{\mbox {\fontsize \sf at size \z@ #1}}}}}%
+ \let\bbl at latinarabic=\@arabic
\def\@arabic#1{\babelsublr{\bbl at latinarabic#1}}%
- \@ifpackagewith{babel}{bidi=default}
+ \@ifpackagewith{babel}{bidi=default}%
{\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}}}%
\def\labelenumii{)\theenumii(}%
- \def\p at enumiii{\p at enumii)\theenumii(}}}{}
+ \def\p at enumiii{\p at enumii)\theenumii(}}{}}{}
+<@Footnote changes@>
+\IfBabelLayout{footnotes}%
+ {\BabelFootnote\footnote\languagename{}{}%
+ \BabelFootnote\localfootnote\languagename{}{}%
+ \BabelFootnote\mainfootnote{}{}{}}
+ {}
%</luatex>
% \end{macrocode}
%
diff --git a/required/babel/babel.ins b/required/babel/babel.ins
index dbad36b..69c3509 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/08}
+\def\filedate{2018/01/24}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/required/babel/babel.pdf b/required/babel/babel.pdf
index fc64b67..b8da57f 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 a1d3cee..66af9a5 100644
--- a/required/babel/bbcompat.dtx
+++ b/required/babel/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2018/01/08 v3.16.1150]
+\ProvidesFile{bbcompat.dtx}[2018/01/24 v3.17]
%</dtx>
%
%% File 'bbcompat.dtx'
More information about the latex3-commits
mailing list