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.sty54
1 files changed, 52 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/biditools.sty b/Master/texmf-dist/tex/xelatex/bidi/biditools.sty
index de54590f353..eebd3eb90df 100644
--- a/Master/texmf-dist/tex/xelatex/bidi/biditools.sty
+++ b/Master/texmf-dist/tex/xelatex/bidi/biditools.sty
@@ -17,7 +17,7 @@
%% by Vafa Khalighi.
%%
%%
-%% \CheckSum{44630}
+%% \CheckSum{44780}
%% \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 +35,7 @@
%% Right brace \} Tilde \~}
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{biditools}[2015/06/29 v0.5 Programming tools for bidi package]
+\ProvidesPackage{biditools}[2015/10/03 v0.6 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%
@@ -48,6 +48,56 @@
\fi
\fi
\endgroup}
+\newtoks\@bidi@envbody
+\newtoks\@bidi@emptytoks
+\def\bidi@addto@envbody#1{\global\@bidi@envbody\expandafter{\the\@bidi@envbody#1}}
+\def\bidi@collect@body#1{%
+ \@bidi@envbody{\expandafter#1\expandafter{\the\@bidi@envbody}}%
+ \edef\bidi@process@envbody{\the\@bidi@envbody\noexpand\end{\@currenvir}}%
+ \@bidi@envbody\@bidi@emptytoks \def\begin@bidi@stack{b}%
+ \begingroup
+ \expandafter\let\csname\@currenvir\endcsname\bidi@collect@@body
+ \edef\bidi@process@envbody{\expandafter\noexpand\csname\@currenvir\endcsname}%
+ \bidi@process@envbody
+}
+\def\bidi@push@begins#1\begin#2{%
+ \ifx\end#2\else b\expandafter\bidi@push@begins\fi
+}
+\def\bidi@collect@@body#1\end#2{%
+ \edef\begin@bidi@stack{\bidi@push@begins#1\begin\end \expandafter\@gobble\begin@bidi@stack}%
+ \ifx\@empty\begin@bidi@stack
+ \endgroup
+ \@checkend{#2}%
+ \bidi@addto@envbody{#1}%
+ \else
+ \bidi@addto@envbody{#1\end{#2}}%
+ \fi
+ \bidi@process@envbody % A little tricky! Note the grouping
+}
+\long\def\bidi@addto@long@envbody#1{\global\@bidi@envbody\expandafter{\the\@bidi@envbody#1}}
+\long\def\bidi@collect@long@body#1{%
+ \@bidi@envbody{\expandafter#1\expandafter{\the\@bidi@envbody}}%
+ \edef\bidi@process@envbody{\the\@bidi@envbody\noexpand\end{\@currenvir}}%
+ \@bidi@envbody\@bidi@emptytoks \def\begin@bidi@stack{b}%
+ \begingroup
+ \expandafter\let\csname\@currenvir\endcsname\bidi@collect@long@@body
+ \edef\bidi@process@envbody{\expandafter\noexpand\csname\@currenvir\endcsname}%
+ \bidi@process@envbody
+}
+\long\def\bidi@push@long@begins#1\begin#2{%
+ \ifx\end#2\else b\expandafter\bidi@push@long@begins\fi
+}
+\long\def\bidi@collect@long@@body#1\end#2{%
+ \edef\begin@bidi@stack{\bidi@push@long@begins#1\begin\end \expandafter\@gobble\begin@bidi@stack}%
+ \ifx\@empty\begin@bidi@stack
+ \endgroup
+ \@checkend{#2}%
+ \bidi@addto@long@envbody{#1}%
+ \else
+ \bidi@addto@long@envbody{#1\end{#2}}%
+ \fi
+ \bidi@process@envbody % A little tricky! Note the grouping
+}
\def\@tagsextension{clo}
\def\@definitionfileextension{def}
\def\@iftagsloaded{\@ifl@aded\@tagsextension}