summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/babel/txtbabel.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/txtbabel.def')
-rw-r--r--Master/texmf-dist/tex/generic/babel/txtbabel.def49
1 files changed, 48 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/txtbabel.def b/Master/texmf-dist/tex/generic/babel/txtbabel.def
index b6a4aa89585..cb34d09338a 100644
--- a/Master/texmf-dist/tex/generic/babel/txtbabel.def
+++ b/Master/texmf-dist/tex/generic/babel/txtbabel.def
@@ -37,7 +37,7 @@
\bbl@trace{Redefinitions for bidi layout}
\def\bbl@sspre@caption{%
\bbl@exp{\everyhbox{\\\bbl@textdir\bbl@cs{wdir@\bbl@main@language}}}}
-\ifx\bbl@opt@layout\@nnil\endinput\fi % No layout
+\ifx\bbl@opt@layout\@nnil\else % if layout=..
\def\bbl@startskip{\ifcase\bbl@thepardir\leftskip\else\rightskip\fi}
\def\bbl@endskip{\ifcase\bbl@thepardir\rightskip\else\leftskip\fi}
\ifx\bbl@beforeforeign\leavevmode % A poor test for bidi=
@@ -144,6 +144,16 @@
\BabelFootnote\localfootnote\languagename{}{}%
\BabelFootnote\mainfootnote{}{}{}}
{}
+\IfBabelLayout{counters*}%
+ {\bbl@add\bbl@opt@layout{.counters.}%
+ \AddToHook{shipout/before}{%
+ \let\bbl@tempa\babelsublr
+ \let\babelsublr\@firstofone
+ \let\bbl@save@thepage\thepage
+ \protected@edef\thepage{\thepage}%
+ \let\babelsublr\bbl@tempa}%
+ \AddToHook{shipout/after}{%
+ \let\thepage\bbl@save@thepage}}{}
\IfBabelLayout{counters}%
{\let\bbl@latinarabic=\@arabic
\def\@arabic#1{\babelsublr{\bbl@latinarabic#1}}%
@@ -151,6 +161,43 @@
\def\@roman#1{\babelsublr{\ensureascii{\bbl@asciiroman#1}}}%
\let\bbl@asciiRoman=\@Roman
\def\@Roman#1{\babelsublr{\ensureascii{\bbl@asciiRoman#1}}}}{}
+\fi % end if layout
+\def\bbl@provide@extra#1{%
+ % == auto-select encoding ==
+ \ifx\bbl@encoding@select@off\@empty\else
+ \bbl@ifunset{bbl@encoding@#1}%
+ {\def\@elt##1{,##1,}%
+ \edef\bbl@tempe{\expandafter\@gobbletwo\@fontenc@load@list}%
+ \count@\z@
+ \bbl@foreach\bbl@tempe{%
+ \def\bbl@tempd{##1}% Save last declared
+ \advance\count@\@ne}%
+ \ifnum\count@>\@ne
+ \getlocaleproperty*\bbl@tempa{#1}{identification/encodings}%
+ \ifx\bbl@tempa\relax \let\bbl@tempa\@empty \fi
+ \bbl@replace\bbl@tempa{ }{,}%
+ \global\bbl@csarg\let{encoding@#1}\@empty
+ \bbl@xin@{,\bbl@tempd,}{,\bbl@tempa,}%
+ \ifin@\else % if main encoding included in ini, do nothing
+ \let\bbl@tempb\relax
+ \bbl@foreach\bbl@tempa{%
+ \ifx\bbl@tempb\relax
+ \bbl@xin@{,##1,}{,\bbl@tempe,}%
+ \ifin@\def\bbl@tempb{##1}\fi
+ \fi}%
+ \ifx\bbl@tempb\relax\else
+ \bbl@exp{%
+ \global\<bbl@add>\<bbl@preextras@#1>{\<bbl@encoding@#1>}%
+ \gdef\<bbl@encoding@#1>{%
+ \\\babel@save\\\f@encoding
+ \\\bbl@add\\\originalTeX{\\\selectfont}%
+ \\\fontencoding{\bbl@tempb}%
+ \\\selectfont}}%
+ \fi
+ \fi
+ \fi}%
+ {}%
+ \fi}
\endinput
%%
%% End of file `txtbabel.def'.