summaryrefslogtreecommitdiff
path: root/macros/latex/required/babel/base/babel.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/required/babel/base/babel.dtx')
-rw-r--r--macros/latex/required/babel/base/babel.dtx130
1 files changed, 91 insertions, 39 deletions
diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx
index 47e8df74c5..a9b4ad69f9 100644
--- a/macros/latex/required/babel/base/babel.dtx
+++ b/macros/latex/required/babel/base/babel.dtx
@@ -1,7 +1,7 @@
% \iffalse
% This document requires lualatex
%%
-%% Copyright (C) 2012-2021 Javier Bezos and Johannes L. Braams.
+%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams.
%% Copyright (C) 1989-2012 Johannes L. Braams and
%% any individual authors listed elsewhere in this file.
%% All rights reserved.
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2021/12/30 v3.69 The Babel package]
+\ProvidesFile{babel.dtx}[2022/01/26 v3.70 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -3150,11 +3150,14 @@ Spanish}{hyphen.repeat}{Explicit hyphens behave like
\trans{Czech, Polish, Slovak}{oneletter.nobreak}{Converts a space after
a non-syllabic preposition or conjunction into a non-breaking space.}
+\trans{Finnish}{prehyphen.nobreak}{Line breaks just after hyphens
+prepended to words are prevented, like in “pakastekaapit ja -arkut”.}
+
\trans{Greek}{diaeresis.hyphen}{Removes the diaeresis above iota and
upsilon if hyphenated just before. It works with the three variants.}
-\trans{Greek}{transliteration.omega}{Although he provided combinations
-are not exactly the same, this transform follows the syntax of Omega:
+\trans{Greek}{transliteration.omega}{Although the provided combinations
+are not the full set, this transform follows the syntax of Omega:
|=| for the circumflex, |v| for digamma, and so on. For better
compatibility with Levy’s system, \texttt{\string~} (as ‘string’) is an
alternative to |=|. |'| is tonos in Monotonic Greek, but oxia in
@@ -5119,8 +5122,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.69>>
-%<<date=2021/12/30>>
+%<<version=3.70>>
+%<<date=2022/01/26>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -14301,8 +14304,8 @@ end
else
rep = rep:gsub( '(no)%s*=%s*([^%s,]*)', Babel.capture_func)
rep = rep:gsub( '(pre)%s*=%s*([^%s,]*)', Babel.capture_func)
- rep = rep:gsub( '(post)%s*=%s*([^%s,]*)', Babel.capture_func)
- end
+ rep = rep:gsub( '(post)%s*=%s*([^%s,]*)', Babel.capture_func)
+ end
tex.print([[\string\babeltempa{{]] .. rep .. [[}}]])
}}}&%
\let\bbl@kv@attribute\relax
@@ -14516,39 +14519,85 @@ end
% \begin{macrocode}
\bbl@trace{Redefinitions for bidi layout}
\ifnum\bbl@bidimode>\z@
- \AtBeginDocument{% amsmath
- \ifx\place@tag\@undefined\else
- \bbl@sreplace\place@tag{\llap}{\bbl@truellap}%
- \bbl@sreplace\place@tag@gather{\llap}{\bbl@truellap}%
- \bbl@sreplace\place@tag{\rlap}{\bbl@truerlap}%
- \bbl@sreplace\place@tag@gather{\rlap}{\bbl@truerlap}%
- \fi}
- \ifx\AddToHook\@undefined\else
- \AddToHook{env/equation/before}{\pardir TLT }{}
- \fi
- \ifx\@eqnnum\@undefined\else
- \ifx\bbl@attr@dir\@undefined\else
+ \let\bbl@eqnodir\relax
+ \AtBeginDocument{%
+ \ifx\maketag@@@\@undefined % Normal equation, eqnarray
+ \AddToHook{env/eqnarray/begin}{%
+ \ifnum\bbl@thetextdir>\z@
+ \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}%
+ \chardef\bbl@thetextdir\z@
+ \bbl@add\normalfont{\bbl@eqnodir}%
+ \fi}%
+ \AddToHook{env/equation/begin}{%
+ \ifnum\bbl@thetextdir>\z@
+ \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}%
+ \chardef\bbl@thetextdir\z@
+ \bbl@add\normalfont{\bbl@eqnodir}%
+ \pardir TLT % dir for \eqno is \pardir!
+ \fi}%
\bbl@xin@{,leqno,}{,\@classoptionslist,}%
\ifin@
- \bbl@sreplace\@eqnnum{\rlap}{\bbl@leqno@aux}
- \def\bbl@leqno@aux#1{%
- \bbl@truerlap{%
- \ifcase\bbl@attr@dir
- #1%
- \else
- \bbl@textdir\@ne
- #1%
- \hskip-\displaywidth
- \fi}}
- \else
- \bbl@exp{%
- \def\\\@eqnnum{{%
- \<ifcase>\\\bbl@attr@dir\<else>\\\bbl@textdir\@ne\<fi>%
- \\\bbl@ifsamestring{\\\@currenvir}{equation}%
- {}{\\\bbl@truellap}{\[@eqnnum]}}}}
+ \def\@eqnnum{%
+ \setbox\z@\hbox{\normalfont\normalcolor(\theequation)}%
+ \hbox to0.01pt{\hss\hbox to\displaywidth{\box\z@\hss}}}%
\fi
- \fi
- \fi
+ \else % amstex
+ \bbl@sreplace\intertext@{\normalbaselines}%
+ {\normalbaselines
+ \ifx\bbl@eqnodir\relax\else\bbl@pardir\@ne\bbl@textdir\@ne\fi}
+ \def\bbl@ams@tagbox#1#2{#1{\bbl@eqnodir#2}}% #1=\hbox|ams@lap
+ \def\bbl@ams@eqtagbox#1{%
+ \setbox\z@\hbox{\bbl@eqnodir#1}%
+ \hbox to\wd\z@{%
+ \ifx\bbl@ams@lap\hbox
+ \hss\hbox to\displaywidth{\box\z@\hss}%
+ \else
+ \hbox to\displaywidth{\hss\box\z@}\hss
+ \fi}}
+ \def\bbl@ams@preset#1{%
+ \ifnum\bbl@thetextdir>\z@
+ \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}%
+ \chardef\bbl@thetextdir\z@
+ \bbl@sreplace\textdef@{\hbox}{\bbl@ams@tagbox\hbox}%
+ \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@tagbox#1}%
+ \fi}
+ \@ifpackagewith{amsmath}{leqno}%
+ {\let\bbl@ams@lap\hbox}% = leqno
+ {\let\bbl@ams@lap\llap}% = default
+ % Not required?: split, alignat
+ \AddToHook{env/cases/begin}{\bbl@ams@preset\bbl@ams@lap}%
+ \AddToHook{env/multline/begin}{\bbl@ams@preset\hbox}%
+ \AddToHook{env/gather/begin}{\bbl@ams@preset\bbl@ams@lap}%
+ \AddToHook{env/gather*/begin}{\bbl@ams@preset\bbl@ams@lap}%
+ \AddToHook{env/align/begin}{\bbl@ams@preset\bbl@ams@lap}%
+ \AddToHook{env/align*/begin}{\bbl@ams@preset\bbl@ams@lap}%
+ % Hackish, for proper alignment-don’t ask me why it works! :-)
+ \bbl@exp{%
+ \\\AddToHook{env/align*/end}{\<iftag@>\<else>\\\tag*{}\<fi>}}%
+ \AddToHook{env/flalign/begin}{\bbl@ams@preset\hbox}%
+ \AddToHook{env/split/before}{%
+ \def\bbl@tempa{equation}%
+ \ifx\@currenvir\bbl@tempa
+ \def\bbl@ams@eqtagbox#1{%
+ \setbox\z@\hbox{\bbl@eqnodir#1}%
+ \hbox to\wd\z@{\box\z@}}%
+ \fi}
+ \AddToHook{env/equation/begin}{%
+ \bbl@add\ignorespacesafterend{\hrule\@height\z@}%
+ \ifnum\bbl@thetextdir>\z@
+ \ifx\bbl@ams@lap\llap\hrule\@height\z@\fi
+ \def\bbl@eqnodir{\bbl@textdir\@ne}%
+ \bbl@textdir\z@
+ \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}%
+ \fi}%
+ \AddToHook{env/equation*/begin}{%
+ \bbl@add\ignorespacesafterend{\hrule\@height\z@}%
+ \ifnum\bbl@thetextdir>\z@
+ \def\bbl@eqnodir{\bbl@textdir\@ne}%
+ \bbl@textdir\z@
+ \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}%
+ \fi}%
+ \fi}
\fi
\ifx\bbl@opt@layout\@nnil\endinput\fi % if no layout
\ifnum\bbl@bidimode>\z@
@@ -21986,7 +22035,10 @@ function Babel.bidi(head, ispar, hdir)
item = nodes[r][1] -- MIRRORING
if Babel.mirroring_enabled and item.id == GLYPH
and temp == 'r' and characters[item.char] then
- local font_mode = font.fonts[item.font].properties.mode
+ local font_mode = ''
+ if font.fonts[item.font].properties then
+ font_mode = font.fonts[item.font].properties.mode
+ end
if font_mode ~= 'harf' and font_mode ~= 'plug' then
item.char = characters[item.char].m or item.char
end