summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/bidi/biditools.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/biditools.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/bidi/biditools.sty220
1 files changed, 215 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/biditools.sty b/Master/texmf-dist/tex/xelatex/bidi/biditools.sty
index 7ecbc7745d3..6df4aa8254f 100644
--- a/Master/texmf-dist/tex/xelatex/bidi/biditools.sty
+++ b/Master/texmf-dist/tex/xelatex/bidi/biditools.sty
@@ -7,17 +7,18 @@
%% bidi.dtx (with options: `table,biditools.sty')
%%
%% __________________________________________________
-%% Copyright (c) 2009-2019 Vafa Khalighi
-%% 2018-2020 bidi-tex GitHub Organisation
+%% Copyright (c) 2007--2020 Vafa Khalighi
+%% Copyright (c) 2018--2020 bidi-tex GitHub Organization
%%
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%%
%% This work is “author-maintained” (as per LPPL maintenance status)
-%% by bidi-tex GitHub Organisation.
+%% by Vafa Khalighi.
%%
%%
+%% \CheckSum{50407}
%% \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
@@ -35,7 +36,7 @@
%% Right brace \} Tilde \~}
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{biditools}[2020-01-29 v1.10 Programming tools for bidi package]
+\ProvidesPackage{biditools}[2020/05/13 v2 Programming tools for bidi package]
\providecommand{\@bidi@saveprimitive}[2]{\begingroup\escapechar`\\\relax
\edef\@tempa{\string#1}\edef\@tempb{\meaning#1}%
\ifx\@tempa\@tempb \global\let#2#1%
@@ -328,6 +329,216 @@ ill-advised in the old versions of bidi package.%
\protected\def\bidi@warning{\PackageWarning{bidi}}
\protected\def\bidi@info{\PackageInfo{bidi}}
+\def\bidi@pos#1#2#3#4{\bidi@namegdef{bidi@#1pos@@#2@#3}{#4}}
+
+\newcount\bidi@poscount
+
+\newcommand*{\WriteStartXPostoaux}{%
+ \global\advance\bidi@poscount\@ne
+ \edef\@tempa{%
+ \write\@auxout{%
+ \string\bidi@pos{x}{start}{\number\bidi@poscount}{\noexpand\number\noexpand\pdflastxpos}%
+ }%
+ }%
+ \ifvmode
+ \leavevmode
+ \fi
+ \if@RTL
+ \if@filesw
+ \@tempa
+ \fi
+ \pdfsavepos
+ \else
+ \pdfsavepos
+ \if@filesw
+ \@tempa
+ \fi
+ \fi
+ \if@bidi@csundef{bidi@xpos@@start@\number\bidi@poscount}{%
+ \PackageWarningNoLine{biditools}{%
+ The start x position `\number\bidi@poscount' is not known yet.
+ Rerun to get this x position%
+ }%
+ }{}%
+}
+
+\newcommand*{\WriteEndXPostoaux}{%
+ \edef\@tempa{%
+ \write\@auxout{%
+ \string\bidi@pos{x}{end}{\number\bidi@poscount}{\noexpand\number\noexpand\pdflastxpos}%
+ }%
+ }%
+ \if@RTL
+ \if@filesw
+ \@tempa
+ \fi
+ \pdfsavepos
+ \else
+ \pdfsavepos
+ \if@filesw
+ \@tempa
+ \fi
+ \fi
+ \if@bidi@csundef{bidi@xpos@@end@\number\bidi@poscount}{%
+ \PackageWarningNoLine{biditools}{%
+ The end x position `\number\bidi@poscount' is not known yet.
+ Rerun to get this x position%
+ }%
+ }{}%
+}
+
+\newcommand*{\WriteStartYPostoaux}{%
+ \global\advance\bidi@poscount\@ne
+ \edef\@tempa{%
+ \write\@auxout{%
+ \string\bidi@pos{y}{start}{\number\bidi@poscount}{\noexpand\number\noexpand\pdflastypos}%
+ }%
+ }%
+ \ifvmode
+ \leavevmode
+ \fi
+ \if@RTL
+ \if@filesw
+ \@tempa
+ \fi
+ \pdfsavepos
+ \else
+ \pdfsavepos
+ \if@filesw
+ \@tempa
+ \fi
+ \fi
+ \if@bidi@csundef{bidi@ypos@@start@\number\bidi@poscount}{%
+ \PackageWarningNoLine{biditools}{%
+ The start y position `\number\bidi@poscount' is not known yet.
+ Rerun to get this y position%
+ }%
+ }{}%
+}
+
+\newcommand*{\WriteEndYPostoaux}{%
+ \edef\@tempa{%
+ \write\@auxout{%
+ \string\bidi@pos{y}{end}{\number\bidi@poscount}{\noexpand\number\noexpand\pdflastypos}%
+ }%
+ }%
+ \if@RTL
+ \if@filesw
+ \@tempa
+ \fi
+ \pdfsavepos
+ \else
+ \pdfsavepos
+ \if@filesw
+ \@tempa
+ \fi
+ \fi
+ \if@bidi@csundef{bidi@ypos@@end@\number\bidi@poscount}{%
+ \PackageWarningNoLine{biditools}{%
+ The end y position `\number\bidi@poscount' is not known yet.
+ Rerun to get this y position%
+ }%
+ }{}%
+}
+
+\newcommand*{\WriteStartXYPostoaux}{%
+ \global\advance\bidi@poscount\@ne
+ \edef\@tempa{%
+ \write\@auxout{%
+ \string\bidi@pos{x}{start}{\number\bidi@poscount}{\noexpand\number\noexpand\pdflastxpos}%
+ }%
+ \write\@auxout{%
+ \string\bidi@pos{y}{start}{\number\bidi@poscount}{\noexpand\number\noexpand\pdflastypos}%
+ }%
+ }%
+ \ifvmode
+ \leavevmode
+ \fi
+ \if@RTL
+ \if@filesw
+ \@tempa
+ \fi
+ \pdfsavepos
+ \else
+ \pdfsavepos
+ \if@filesw
+ \@tempa
+ \fi
+ \fi
+ \if@bidi@csundef{bidi@xpos@@start@\number\bidi@poscount}{%
+ \PackageWarningNoLine{biditools}{%
+ The start x position `\number\bidi@poscount' is not known yet.
+ Rerun to get this x position%
+ }%
+ }{}%
+ \if@bidi@csundef{bidi@ypos@@start@\number\bidi@poscount}{%
+ \PackageWarningNoLine{biditools}{%
+ The start y position `\number\bidi@poscount' is not known yet.
+ Rerun to get this y position%
+ }%
+ }{}%
+}
+
+\newcommand*{\WriteEndXYPostoaux}{%
+ \edef\@tempa{%
+ \write\@auxout{%
+ \string\bidi@pos{x}{end}{\number\bidi@poscount}{\noexpand\number\noexpand\pdflastxpos}%
+ }%
+ \write\@auxout{%
+ \string\bidi@pos{y}{end}{\number\bidi@poscount}{\noexpand\number\noexpand\pdflastypos}%
+ }%
+ }%
+ \if@RTL
+ \if@filesw
+ \@tempa
+ \fi
+ \pdfsavepos
+ \else
+ \pdfsavepos
+ \if@filesw
+ \@tempa
+ \fi
+ \fi
+ \if@bidi@csundef{bidi@xpos@@end@\number\bidi@poscount}{%
+ \PackageWarningNoLine{biditools}{%
+ The end x position `\number\bidi@poscount' is not known yet.
+ Rerun to get this x position%
+ }%
+ }{}%
+ \if@bidi@csundef{bidi@ypos@@end@\number\bidi@poscount}{%
+ \PackageWarningNoLine{biditools}{%
+ The end y position `\number\bidi@poscount' is not known yet.
+ Rerun to get this y position%
+ }%
+ }{}%
+}
+
+\newcommand*{\currentposxwidth}{%
+ \if@bidi@csundef{bidi@xpos@@end@\number\bidi@poscount}{\z@}
+ {%
+ \ifnum\csname bidi@xpos@@start@\number\bidi@poscount
+ \endcsname < \csname bidi@xpos@@end@\number\bidi@poscount
+ \endcsname
+ \dimexpr \csname bidi@xpos@@end@\number\bidi@poscount
+ \endcsname sp - \csname bidi@xpos@@start@\number\bidi@poscount
+ \endcsname sp\relax
+ \else
+ \dimexpr \csname bidi@xpos@@start@\number\bidi@poscount
+ \endcsname sp - \csname bidi@xpos@@end@\number\bidi@poscount
+ \endcsname sp\relax
+ \fi
+ }%
+}
+
+\newcommand*{\currentposyheight}{%
+ \if@bidi@csundef{bidi@ypos@@end@\number\bidi@poscount}{\z@}
+ {%
+ \dimexpr \csname bidi@ypos@@start@\number\bidi@poscount
+ \endcsname sp - \csname bidi@ypos@@end@\number\bidi@poscount
+ \endcsname sp\relax
+ }%
+}
+
\newcommand*{\setbaselineskip}[1]{%
\linespread{\strip@pt\dimexpr\numexpr\dimexpr#1\relax*65536/\dimexpr\baselineskip\relax\relax sp\relax}
\selectfont
@@ -739,7 +950,6 @@ ill-advised in the old versions of bidi package.%
\bidi@newrobustcmd{\bidi@AtBeginEnvironment}[1]{%
\bidi@csgappto{@bidi@begin@#1@hook}}
-
\expandafter\bidi@patchcmd\csname begin\ifcsname begin \endcsname\space\fi\endcsname
{\csname #1\endcsname}
{\bidi@csuse{@bidi@begin@#1@hook}%