summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/bidi/bidi.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/bidi.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/bidi/bidi.sty341
1 files changed, 200 insertions, 141 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/bidi.sty b/Master/texmf-dist/tex/xelatex/bidi/bidi.sty
index 1110445d0f6..32eadcd2da7 100644
--- a/Master/texmf-dist/tex/xelatex/bidi/bidi.sty
+++ b/Master/texmf-dist/tex/xelatex/bidi/bidi.sty
@@ -20,7 +20,7 @@
%% by Vafa Khalighi.
%%
%%
-%% \CheckSum{58587}
+%% \CheckSum{58539}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -38,12 +38,142 @@
%% Right brace \} Tilde \~}
%%
\NeedsTeXFormat{LaTeX2e}
-\def\bididate{2024/12/10}
-\def\bidi@version{40.1}
-\def\bidi@releasename{John Torrence Tate, Jr.}
+\def\bididate{2024/12/14}
+\def\bidi@version{40.3}
+\def\bidi@releasename{John Willard Milnor}
\newcommand*{\bidireleasename}{\bidi@releasename}
\ProvidesPackage{bidi}[\bididate\space v\bidi@version\space (Release \bidi@releasename)\space
Bidirectional typesetting in plain TeX and LaTeX]
+\newif\if@bidi@banner
+\newif\if@bidi@pdfbanner
+\newif\iffootdir@debug
+\newif\if@extrafootnotefeatures
+\newif\if@nonlatin
+\newif\if@bidi@pdfm@mark
+\newif\if@bidi@perpage@footnote
+\ExplSyntaxOn
+\keys_define:nn { bidi }
+ {
+ banner .choice: ,
+ banner / on .code:n = \@bidi@bannertrue ,
+ banner / off .code:n = \@bidi@bannerfalse ,
+ banner .default:n = on
+ }
+\keys_define:nn { bidi }
+ {
+ PDFbanner .choice: ,
+ PDFbanner / on .code:n = \@bidi@pdfbannertrue ,
+ PDFbanner / off .code:n = \@bidi@pdfbannerfalse ,
+ PDFbanner .default:n = on
+ }
+\keys_define:nn { bidi }
+ {
+ RTLdocument .choice: ,
+ RTLdocument / on .code:n = \AtEndOfPackage{\@RTLtrue} ,
+ RTLdocument / off .code:n = \AtEndOfPackage{\@RTLfalse} ,
+ RTLdocument .default:n = on
+ }
+\keys_define:nn { bidi }
+ {
+ rldocument .choice: ,
+ rldocument / on .code:n = \AtEndOfPackage{\@RTLtrue} ,
+ rldocument / off .code:n = \AtEndOfPackage{\@RTLfalse} ,
+ rldocument .default:n = on
+ }
+\keys_define:nn { bidi }
+ {
+ documentdirection .choice: ,
+ documentdirection / righttoleft .code:n = \AtEndOfPackage{\@RTLtrue} ,
+ documentdirection / lefttoright .code:n = \AtEndOfPackage{\@RTLfalse}
+ }
+\keys_define:nn { bidi }
+ {
+ tabledirection .choice: ,
+ tabledirection / righttoleft .code:n = \AtEndOfPackage{\@RTLtabtrue} ,
+ tabledirection / lefttoright .code:n = \AtEndOfPackage{\@RTLtabfalse}
+ }
+\keys_define:nn { bidi }
+ {
+ footnotedirection .choice: ,
+ footnotedirection / righttoleft .code:n = \AtEndOfPackage{\@RTL@footnotetrue} ,
+ footnotedirection / lefttoright .code:n = \AtEndOfPackage{\@RTL@footnotefalse}
+ }
+\keys_define:nn { bidi }
+ {
+ debugfootnotedirection .choice: ,
+ debugfootnotedirection / on .code:n = \footdir@debugtrue ,
+ debugfootnotedirection / off .code:n = \footdir@debugfalse ,
+ debugfootnotedirection .default:n = on
+ }
+\keys_define:nn { bidi }
+ {
+ footnoterule .choice: ,
+ footnoterule / automatic .code:n = \AtEndOfPackage{\autofootnoterule} ,
+ footnoterule / left .code:n = \AtEndOfPackage{\leftfootnoterule} ,
+ footnoterule / right .code:n = \AtEndOfPackage{\rightfootnoterule} ,
+ footnoterule / split .code:n = \AtEndOfPackage{\SplitFootnoteRule} ,
+ footnoterule / textwidth .code:n = \AtEndOfPackage{\textwidthfootnoterule}
+ }
+\keys_define:nn { bidi }
+ {
+ extrafootnotefeatures .choice: ,
+ extrafootnotefeatures / on .code:n = \@extrafootnotefeaturestrue ,
+ extrafootnotefeatures / off .code:n = \@extrafootnotefeaturesfalse ,
+ extrafootnotefeatures .default:n = on
+ }
+\keys_define:nn { bidi }
+ {
+ script .choice: ,
+ script / latin .code:n = \@nonlatinfalse ,
+ script / nonlatin .code:n = \@nonlatintrue ,
+ script .default:n = latin
+ }
+\keys_define:nn { bidi }
+ {
+ DetectColumn .choice: ,
+ DetectColumn / on .code:n =
+ \def\bidi@firstcolumn@status@write{%
+ \protected@write\@auxout{}%
+ {\string\bidi@column@status
+ {1}}}
+ \def\bidi@lastcolumn@status@write{%
+ \protected@write\@auxout{}%
+ {\string\bidi@column@status{2}}} ,
+ DetectColumn / off .code:n =
+ \let\bidi@firstcolumn@status@write\relax
+ \let\bidi@lastcolumn@status@write\relax ,
+ DetectColumn .default:n = on
+ }
+\keys_define:nn { bidi }
+ {
+ logo .choice: ,
+ logo / on .code:n = \AtEndOfPackage{\AtBeginDocument{\@bidi@inslogo@}} ,
+ logo / off .code:n = \let\@bidi@logo@\@empty \let\@bidi@inslogo@\@empty ,
+ logo .default:n = on
+ }
+\keys_define:nn { bidi }
+ {
+ pdfinfo .choice: ,
+ pdfinfo / on .code:n = \@bidi@pdfm@marktrue ,
+ pdfinfo / off .code:n = \@bidi@pdfm@markfalse ,
+ pdfinfo .default:n = on
+ }
+\keys_define:nn { bidi }
+ {
+ perpagefootnote .choice: ,
+ perpagefootnote / on .code:n = \@bidi@perpage@footnotetrue ,
+ perpagefootnote / off .code:n = \@bidi@perpage@footnotefalse ,
+ perpagefootnote .default:n = on
+ }
+\keys_set:nn { bidi }
+ {
+ banner = on ,
+ PDFbanner = on ,
+ DetectColumn = off
+
+ }
+\ExplSyntaxOff
+\ProcessKeyOptions
\edef\@bidi@info{****************************************************^^J%
* ^^J%
* bidi package (Bidirectional typesetting in^^J%
@@ -71,9 +201,11 @@ Bidirectional typesetting in plain TeX and LaTeX]
* Primary author of bidi package: Vafa Khalighi.^^J%
* ^^J%
****************************************************}
-\typeout{\@bidi@info}
\edef\bidi@everyjob{\the\everyjob}
-\everyjob{\bidi@everyjob\typeout{\@bidi@info}}
+\if@bidi@banner
+ \typeout{\@bidi@info}
+ \everyjob{\bidi@everyjob\typeout{\@bidi@info}}
+\fi
\newcommand*{\bidiversion}{\ensuremath\bidi@version}
\newcommand*{\IfbidiPackageVersionLater}[1]{%
\ifdim\bidi@version pt > #1 pt %
@@ -99,11 +231,8 @@ Bidirectional typesetting in plain TeX and LaTeX]
\RequirePackage{zref-abspage}
\RequirePackage{auxhook}
\RequirePackage{ltxcmds}
-\RequirePackage{xkeyval}
\eqnewif{\if@RTLmain}{\if@rlmain}
\eqnewif{\if@RTL}{\if@rl}
-\newif\if@nonlatin
-\newif\if@bidi@perpage@footnote
\newcommand*{\setlatin}{\@nonlatinfalse}
\newcommand*{\setnonlatin}{\@nonlatintrue}
\eqnewif{\if@RTLtab}{\if@tab@rl}
@@ -111,12 +240,10 @@ Bidirectional typesetting in plain TeX and LaTeX]
\newif\if@bidi@pdfencrypt
\newcommand*{\setRTLtable}{\@RTLtabtrue}
\newcommand*{\setLTRtable}{\@RTLtabfalse}
-\newif\if@bidi@pdfm@mark
\newif\if@RTLmarginpar
\newif\if@LTRmarginpar
\newif\if@LTRbibitems
\newif\if@RTLbibitems
-\newif\if@extrafootnotefeatures
\eqnewif{\if@RTL@footnote}{\if@rl@footnote}
\newif\if@bidi@list@minipage@parbox
\newif\if@bidi@list@minipage@parbox@not@nob
@@ -128,7 +255,7 @@ Bidirectional typesetting in plain TeX and LaTeX]
}
\newcommand*{\@bidi@pdfcustomproperties}{%
This is the bidi package, Version \bidi@version\space (Release \bidi@releasename),
- Released December 10, 2024.
+ Released December 14, 2024.
}
\newcommand*{\bidi@beamer@ragged}{}
\@RTLmainfalse
@@ -186,124 +313,32 @@ Bidirectional typesetting in plain TeX and LaTeX]
\@bidi@logo@hb@xt@columnwidth
{\hss\LRE{\bfseries Typeset by the \textsf{bidi}
package\quad\@bidi@logo{bidi-logo.pdf}}}}
-\define@key{bidi@pdfencrypt}{userpassword}[]{%
- \def\bidi@pdfencrypt@userpassword{#1}%
-}
-\define@key{bidi@pdfencrypt}{ownerpassword}[]{%
- \def\bidi@pdfencrypt@ownerpassword{#1}%
-}
-\define@key{bidi@pdfencrypt}{keylength}[128]{%
- \def\bidi@pdfencrypt@keylength{#1}%
-}
-\define@key{bidi@pdfencrypt}{permissionflags}[2052]{%
- \def\bidi@pdfencrypt@permissionflags{#1}%
-}
-\newcommand*{\pdfencryptsetup}{\setkeys{bidi@pdfencrypt}}
+\ExplSyntaxOn
+\keys_define:nn { bidi / pdfencrypt }
+ {
+ userpassword .code:n = \def\bidi@pdfencrypt@userpassword{#1} ,
+ userpassword .default:n =
+ }
+\keys_define:nn { bidi / pdfencrypt }
+ {
+ ownerpassword .code:n = \def\bidi@pdfencrypt@ownerpassword{#1} ,
+ ownerpassword .default:n =
+ }
+\keys_define:nn { bidi / pdfencrypt }
+ {
+ keylength .code:n = \def\bidi@pdfencrypt@keylength{#1} ,
+ keylength .default:n = 128
+ }
+\keys_define:nn { bidi / pdfencrypt }
+ {
+ permissionflags .code:n = \def\bidi@pdfencrypt@permissionflags{#1} ,
+ permissionflags .default:n = 2052
+ }
+\NewDocumentCommand \pdfencryptsetup {m} { \keys_set:nn { bidi / pdfencrypt } {#1} }
+\ExplSyntaxOff
\@onlypreamble\pdfencryptsetup
\input{latex-xetex-bidi.def}
\input{loadingorder-xetex-bidi.def}
-\define@choicekey{bidi.sty}{RTLdocument}[\bidi@tempa\bidi@tempb]{on,off}[on]{%
- \ifcase\bidi@tempb\relax
- \@RTLtrue
- \or
- \@RTLfalse
- \fi}
-\define@choicekey{bidi.sty}{documentdirection}[\bidi@tempa\bidi@tempb]{righttoleft,lefttoright}{%
- \ifcase\bidi@tempb\relax
- \@RTLtrue
- \or
- \@RTLfalse
- \fi}
-\define@choicekey{bidi.sty}{tabledirection}[\bidi@tempa\bidi@tempb]{righttoleft,lefttoright}{%
- \ifcase\bidi@tempb\relax
- \@RTLtabtrue
- \or
- \@RTLtabfalse
- \fi}
-\define@choicekey{bidi.sty}{script}[\bidi@tempa\bidi@tempb]{latin,nonlatin}[latin]{%
- \ifcase\bidi@tempb\relax
- \@nonlatinfalse
- \or
- \@nonlatintrue
- \fi}
-\define@choicekey{bidi.sty}{rldocument}[\bidi@tempa\bidi@tempb]{on,off}[on]{%
- \ifcase\bidi@tempb\relax
- \@RTLtrue
- \or
- \@RTLfalse
- \fi}
-\define@choicekey{bidi.sty}{footnoterule}[\bidi@tempa\bidi@tempb]{automatic,left,right,split,textwidth}{%
- \ifcase\bidi@tempb\relax
- \autofootnoterule
- \or
- \leftfootnoterule
- \or
- \rightfootnoterule
- \or
- \SplitFootnoteRule
- \or
- \textwidthfootnoterule
- \fi}
-\define@choicekey{bidi.sty}{footnotedirection}[\bidi@tempa\bidi@tempb]{righttoleft,lefttoright}{%
- \ifcase\bidi@tempb\relax
- \@RTL@footnotetrue
- \or
- \@RTL@footnotefalse
- \fi}
-\define@choicekey{bidi.sty}{debugfootnotedirection}[\bidi@tempa\bidi@tempb]{on,off}[on]{%
- \ifcase\bidi@tempb\relax
- \footdir@debugtrue
- \or
- \footdir@debugfalse
- \fi}
-\define@choicekey{bidi.sty}{extrafootnotefeatures}[\bidi@tempa\bidi@tempb]{on,off}[on]{%
- \ifcase\bidi@tempb\relax
- \@extrafootnotefeaturestrue
- \or
- \@extrafootnotefeaturesfalse
- \fi}
-
-\define@choicekey{bidi.sty}{DetectColumn}[\bidi@tempa\bidi@tempb]{on,off}[on]{%
- \ifcase\bidi@tempb\relax
- \def\bidi@firstcolumn@status@write{%
- \protected@write\@auxout{}%
- {\string\bidi@column@status
- {1}}}%
- \def\bidi@lastcolumn@status@write{%
- \protected@write\@auxout{}%
- {\string\bidi@column@status{2}}}%
- \or
- \let\bidi@firstcolumn@status@write\relax
- \let\bidi@lastcolumn@status@write\relax
- \fi}
-
-\define@choicekey{bidi.sty}{logo}[\bidi@tempa\bidi@tempb]{on,off}[on]{%
- \ifcase\bidi@tempb\relax
- \AtBeginDocument{\@bidi@inslogo@}%
- \or
- \let\@bidi@logo@\@empty \let\@bidi@inslogo@\@empty
- \fi}
-
-\define@choicekey{bidi.sty}{pdfinfo}[\bidi@tempa\bidi@tempb]{on,off}[on]{%
- \ifcase\bidi@tempb\relax
- \@bidi@pdfm@marktrue
- \or
- \@bidi@pdfm@markfalse
- \fi}
-
-
-\define@choicekey{bidi.sty}{perpagefootnote}[\bidi@tempa\bidi@tempb]{on,off}[on]{%
- \ifcase\bidi@tempb\relax
- \@bidi@perpage@footnotetrue
- \or
- \@bidi@perpage@footnotefalse
- \fi}
-
-\ExecuteOptionsX{%
- DetectColumn=off%
-}
-
-\ProcessOptionsX
\pdfencryptsetup{%
userpassword,%
@@ -349,20 +384,44 @@ Bidirectional typesetting in plain TeX and LaTeX]
}%
\fi
}
-\AtEndDocument{%
- \special{pdf:%
- docinfo<<%
- \if@bidi@pdfm@mark
- /Creator(\@bidi@pdfcreator)%
- /Producer(\@bidi@pdfproducer)%
- \fi
- /BIDI.Fullbanner(\@bidi@pdfcustomproperties)%
- \if@bidi@csdef{@xepersian@pdfcustomproperties}{%
- /XEPERSIAN.Fullbanner(\@xepersian@pdfcustomproperties)%
- }{}%
- >>%
- }%
-}
+\if@bidi@pdfbanner
+ \if@bidi@pdfm@mark
+ \AtEndDocument{%
+ \special{pdf:%
+ docinfo<<%
+ /Creator(\@bidi@pdfcreator)%
+ /Producer(\@bidi@pdfproducer)%
+ /BIDI.Fullbanner(\@bidi@pdfcustomproperties)%
+ \if@bidi@csdef{@xepersian@pdfcustomproperties}{%
+ /XEPERSIAN.Fullbanner(\@xepersian@pdfcustomproperties)%
+ }{}%
+ >>%
+ }%
+ }
+ \else
+ \AtEndDocument{%
+ \special{pdf:%
+ docinfo<<%
+ /BIDI.Fullbanner(\@bidi@pdfcustomproperties)%
+ \if@bidi@csdef{@xepersian@pdfcustomproperties}{%
+ /XEPERSIAN.Fullbanner(\@xepersian@pdfcustomproperties)%
+ }{}%
+ >>%
+ }%
+ }
+ \fi
+\else
+ \if@bidi@pdfm@mark
+ \AtEndDocument{%
+ \special{pdf:%
+ docinfo<<%
+ /Creator(\@bidi@pdfcreator)%
+ /Producer(\@bidi@pdfproducer)%
+ >>%
+ }%
+ }
+ \fi
+\fi
\endinput
%%
%% End of file `bidi.sty'.