From 09ab3a5d73d4bd916aa1fdfd114753087c851fe4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 9 Oct 2011 23:43:27 +0000 Subject: bidi (9oct11) git-svn-id: svn://tug.org/texlive/trunk@24248 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/bidi/bidi.dtx | 582 ++++++++++++++++++++++++--- Master/texmf-dist/source/latex/bidi/bidi.ins | 1 + 2 files changed, 523 insertions(+), 60 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/bidi/bidi.dtx b/Master/texmf-dist/source/latex/bidi/bidi.dtx index 48a056d02aa..410e292f51b 100644 --- a/Master/texmf-dist/source/latex/bidi/bidi.dtx +++ b/Master/texmf-dist/source/latex/bidi/bidi.dtx @@ -5,7 +5,7 @@ %<*readme> ___________________ The bidi package -v1.3.5 +v1.3.8 This package provides a convenient interface for typesetting bidirectional texts in Plain TeX and LaTeX. @@ -69,6 +69,7 @@ by Vafa Khalighi. \generate{\file{bidicode.sty}{\from{\jobname.dtx}{bidicode.sty}}} \generate{\file{bidiftnxtra.sty}{\from{\jobname.dtx}{bidiftnxtra.sty}}} \generate{\file{bidimoderncv.cls}{\from{\jobname.dtx}{bidimoderncv.cls}}} +\generate{\file{biditools.sty}{\from{\jobname.dtx}{biditools.sty}}} \generate{\file{bidituftefloat.sty}{\from{\jobname.dtx}{bidituftefloat.sty}}} \generate{\file{bidituftesidenote.sty}{\from{\jobname.dtx}{bidituftesidenote.sty}}} \generate{\file{bidituftetoc.sty}{\from{\jobname.dtx}{bidituftetoc.sty}}} @@ -230,7 +231,7 @@ by Vafa Khalighi. % Support for bidirectional typesetting in plain \TeX{} and \LaTeXe} % \author{Vafa Khalighi\\ % \url{vafaklg@gmail.com}} -% \date{\today\qquad Version 1.3.5} +% \date{\today\qquad Version 1.3.8} % \maketitle % \tableofcontents %\section*{Introduction} @@ -245,7 +246,7 @@ by Vafa Khalighi. %in plain TeX and LaTeX. The package includes adaptations for use %with many other commonly-used packages. %Copyright (c) 2009-2012 Vafa Khalighi -%v1.3.5, 2012/01/01 +%v1.3.8, 2012/01/01 %License: LaTeX Project Public License, version 1.3c or higher (your choice) %Location on CTAN: /macros/latex/contrib/bidi %\end{lstlisting} @@ -2519,7 +2520,7 @@ by Vafa Khalighi. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \def\bididate{2012/01/01} -\def\bidiversion{v1.3.5} +\def\bidiversion{v1.3.8} \ProvidesPackage{bidi}[\bididate\space \bidiversion\space Bidirectional typesetting in plain TeX and LaTeX] \edef\bidiinfo{% @@ -2535,48 +2536,7 @@ Location on CTAN: /macros/latex/contrib/bidi} \edef\bidi@everyjob{\the\everyjob} \everyjob{\bidi@everyjob\typeout{\bidiinfo}} \RequirePackage{iftex} -\def\@tagsextension{clo} -\def\@definitionfileextension{def} -\def\@iftagsloaded{\@ifl@aded\@tagsextension} -\def\@ifdefinitionfileloaded{\@ifl@aded\@definitionfileextension} -\def\eqnewif#1#2{% - \count@\escapechar \escapechar\m@ne - \let#1\iffalse - \let#2\iffalse - \eq@if#1#2\iftrue - \eq@if#1#2\iffalse - \escapechar\count@} -\def\eq@if#1#2#3{% - \expandafter\def\csname\expandafter\@gobbletwo\string#1% - \expandafter\@gobbletwo\string#3\endcsname - {\let#1#3% - \let#2#3}% - \expandafter\def\csname\expandafter\@gobbletwo\string#2% - \expandafter\@gobbletwo\string#3\endcsname - {\let#2#3% - \let#1#3}} -\newcommand*{\if@bidi@csdef}[1]{% - \ifcsname#1\endcsname - \expandafter\@firstoftwo - \else - \expandafter\@secondoftwo - \fi} -\newcommand{\if@bidi@def}[1]{% - \ifdefined#1% - \expandafter\@firstoftwo - \else - \expandafter\@secondoftwo - \fi} -\newcommand{\bidi@namelongdef}[1]{% - \long\expandafter\def\csname #1\endcsname} -\def\bidi@ensure@newcommand{\@star@or@long\bidi@ensure@new@command} -\def\bidi@ensure@new@command#1{% - \begingroup \escapechar\m@ne\xdef\@gtempa{{\string#1}}\endgroup - \expandafter\if@bidi@csdef\@gtempa - {\relax% - \let\@ifdefinable\@rc@ifdefinable% - \new@command#1}{\new@command#1}} -\def\bidi@ensure@newlength#1{\if@bidi@def#1{}{\newskip#1}} +\RequirePackage{biditools} \eqnewif{\if@RTLmain}{\if@rlmain} \eqnewif{\if@RTL}{\if@rl} \newif\if@RTLmaths @@ -3284,6 +3244,507 @@ Location on CTAN: /macros/latex/contrib/bidi} % \end{macrocode} % \iffalse % +%<*biditools.sty> +%\fi +% \subsection{\textsf{biditools.sty}} +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{biditools}[2012/01/01 v0.1 Programming tools for bidi package] +\def\@tagsextension{clo} +\def\@definitionfileextension{def} +\def\@iftagsloaded{\@ifl@aded\@tagsextension} +\def\@ifdefinitionfileloaded{\@ifl@aded\@definitionfileextension} +\def\eqnewif#1#2{% + \count@\escapechar \escapechar\m@ne + \let#1\iffalse + \let#2\iffalse + \eq@if#1#2\iftrue + \eq@if#1#2\iffalse + \escapechar\count@} +\def\eq@if#1#2#3{% + \expandafter\def\csname\expandafter\@gobbletwo\string#1% + \expandafter\@gobbletwo\string#3\endcsname + {\let#1#3% + \let#2#3}% + \expandafter\def\csname\expandafter\@gobbletwo\string#2% + \expandafter\@gobbletwo\string#3\endcsname + {\let#2#3% + \let#1#3}} +\newcommand*{\if@bidi@csdef}[1]{% + \ifcsname#1\endcsname + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} +\newcommand*{\if@bidi@csundef}[1]{% + \ifcsname#1\endcsname + \expandafter\ifx\csname#1\endcsname\relax + \expandafter\expandafter + \expandafter\@firstoftwo + \else + \expandafter\expandafter + \expandafter\@secondoftwo + \fi + \else + \expandafter\@firstoftwo + \fi} +\newcommand{\if@bidi@def}[1]{% + \ifdefined#1% + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} +\newcommand{\if@bidi@undef}[1]{% + \ifdefined#1% + \ifx#1\relax + \expandafter\expandafter + \expandafter\@firstoftwo + \else + \expandafter\expandafter + \expandafter\@secondoftwo + \fi + \else + \expandafter\@firstoftwo + \fi} +\newcommand{\if@bidi@blank}[1]{% from url.sty + \bidi@ifblank@i#1&&\@secondoftwo\@firstoftwo:} +\long\def\bidi@ifblank@i#1#2#4#5:{#4} +\newcommand{\bidi@notblank}[1]{% + \bidi@ifblank@i#1&&\@firstoftwo\@secondoftwo:} +\newcommand{\if@bidi@defmacro}{} +\long\edef\if@bidi@defmacro#1{% + \noexpand\expandafter\noexpand\bidi@ifdefmacro + \noexpand\meaning#1\detokenize{macro}:&} +\edef\bidi@ifdefmacro{% + \def\noexpand\bidi@ifdefmacro##1\detokenize{macro}:##2&} +\bidi@ifdefmacro{\bidi@notblank{#2}} +\newcommand*{\if@bidi@csmacro}[1]{% + \if@bidi@csdef{#1} + {\expandafter\if@bidi@defmacro\csname#1\endcsname} + {\@secondoftwo}} +\newcommand{\if@bidi@defprimitive}[1]{% + \ifprimitive#1% + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} +\newcommand{\if@bidi@csprimitive}[1]{% + \expandafter\ifprimitive\csname#1\endcsname% + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} +\newcommand*{\bidi@csdefcs}[2]{% +\expandafter\@ifdefinable \csname#1\endcsname{% +\expandafter\def\csname#1\expandafter\endcsname{\csname#2\endcsname}}} +\newcommand*{\bidi@csletcs}[2]{% +\expandafter\@ifdefinable \csname#1\endcsname{% +\expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname}} +\newcommand*{\bidi@cslet}[2]{% +\expandafter\@ifdefinable \csname#1\endcsname{% +\expandafter\let\csname#1\endcsname#2}} +\newcommand{\bidi@namelongdef}[1]{% + \long\expandafter\def\csname #1\endcsname} +\def\bidi@ensure@newcommand{\@star@or@long\bidi@ensure@new@command} +\def\bidi@ensure@new@command#1{% + \begingroup \escapechar\m@ne\xdef\@gtempa{{\string#1}}\endgroup + \expandafter\if@bidi@csundef\@gtempa + {\new@command#1}{\relax% + \let\@ifdefinable\@rc@ifdefinable% + \new@command#1}} +\def\bidi@ensure@newlength#1{\if@bidi@undef#1{\newskip#1}{}} + +\protected\def\bidi@error{\PackageError{bidi}} +\protected\def\bidi@warning{\PackageWarning{bidi}} +\protected\def\bidi@info{\PackageInfo{bidi}} + +\newcommand*{\bidi@newrobustcmd}{} +\protected\def\bidi@newrobustcmd{\@star@or@long\bidi@new@command} + +\def\bidi@new@command#1{\@testopt{\bidi@newcommand#1}0} + +\def\bidi@newcommand#1[#2]{% + \@ifnextchar[%] + {\bidi@xargdef#1[#2]} + {\ifx\l@ngrel@x\relax + \let\l@ngrel@x\protected + \else + \protected\def\l@ngrel@x{\protected\long}% + \fi + \@argdef#1[#2]}} + +\long\def\bidi@xargdef#1[#2][#3]#4{% + \@ifdefinable#1{% + \expandafter\protected + \expandafter\def + \expandafter#1% + \expandafter{% + \expandafter\@testopt + \csname\string#1\endcsname{#3}}% + \expandafter\@yargdef\csname\string#1\endcsname\tw@{#2}{#4}}} + +\bidi@newrobustcmd*{\bidi@renewrobustcmd}{\@star@or@long\bidi@renew@command} + +\def\bidi@renew@command#1{% + \if@bidi@undef{#1} + {\bidi@error{\string#1 undefined}\@ehc} + {}% + \let\@ifdefinable\@rc@ifdefinable + \bidi@new@command#1} + + + +\bidi@newrobustcmd*{\bidi@providerobustcmd}{\@star@or@long\bidi@provide@command} + +\def\bidi@provide@command#1{% + \if@bidi@undef{#1} + {\def\reserved@a{\bidi@new@command#1}} + {\def\reserved@a{\bidi@renew@command\reserved@a}}% + \reserved@a} + +\newcommand*{\bidi@csuse}[1]{% + \ifcsname#1\endcsname + \csname#1\expandafter\endcsname + \fi} + +\newcommand{\bidi@expandonce}[1]{% + \unexpanded\expandafter{#1}} + +\def\bidi@protected{% + \let\@@protect\protect + \let\protect\@unexpandable@protect + \afterassignment\restore@protect} + +\bidi@newrobustcmd{\bidi@appto}[2]{% + \if@bidi@undef{#1} + {\edef#1{\unexpanded{#2}}} + {\edef#1{\bidi@expandonce#1\unexpanded{#2}}}} +\bidi@newrobustcmd{\bidi@eappto}[2]{% + \if@bidi@undef{#1} + {\edef#1{#2}} + {\edef#1{\bidi@expandonce#1#2}}} +\bidi@newrobustcmd{\bidi@gappto}[2]{% + \if@bidi@undef{#1} + {\xdef#1{\unexpanded{#2}}} + {\xdef#1{\bidi@expandonce#1\unexpanded{#2}}}} +\bidi@newrobustcmd{\bidi@xappto}[2]{% + \if@bidi@undef{#1} + {\xdef#1{#2}} + {\xdef#1{\bidi@expandonce#1#2}}} + +\bidi@newrobustcmd*{\bidi@protected@eappto}{\bidi@protected\bidi@eappto} +\bidi@newrobustcmd*{\bidi@protected@xappto}{\bidi@protected\bidi@xappto} + + + +\bidi@newrobustcmd{\bidi@preto}[2]{% + \if@bidi@undef{#1} + {\edef#1{\unexpanded{#2}}} + {\edef#1{\unexpanded{#2}\bidi@expandonce#1}}} +\bidi@newrobustcmd{\bidi@epreto}[2]{% + \if@bidi@undef{#1} + {\edef#1{#2}} + {\edef#1{#2\bidi@expandonce#1}}} +\bidi@newrobustcmd{\bidi@gpreto}[2]{% + \if@bidi@undef{#1} + {\xdef#1{\unexpanded{#2}}} + {\xdef#1{\unexpanded{#2}\bidi@expandonce#1}}} +\bidi@newrobustcmd{\bidi@xpreto}[2]{% + \if@bidi@undef{#1} + {\xdef#1{#2}} + {\xdef#1{#2\bidi@expandonce#1}}} + +\bidi@newrobustcmd*{\bidi@protected@epreto}{\bidi@protected\bidi@epreto} +\bidi@newrobustcmd*{\bidi@protected@xpreto}{\bidi@protected\bidi@xpreto} + + + +\bidi@newrobustcmd*{\bidi@csappto}[1]{\expandafter\bidi@appto\csname#1\endcsname} +\bidi@newrobustcmd*{\bidi@cseappto}[1]{\expandafter\bidi@eappto\csname#1\endcsname} +\bidi@newrobustcmd*{\bidi@csgappto}[1]{\expandafter\bidi@gappto\csname#1\endcsname} +\bidi@newrobustcmd*{\bidi@csxappto}[1]{\expandafter\bidi@xappto\csname#1\endcsname} +\bidi@newrobustcmd*{\bidi@protected@cseappto}{\bidi@protected\bidi@cseappto} +\bidi@newrobustcmd*{\bidi@protected@csxappto}{\bidi@protected\bidi@csxappto} + + + +\bidi@newrobustcmd*{\bidi@cspreto}[1]{\expandafter\bidi@preto\csname#1\endcsname} +\bidi@newrobustcmd*{\bidi@csepreto}[1]{\expandafter\bidi@epreto\csname#1\endcsname} +\bidi@newrobustcmd*{\bidi@csgpreto}[1]{\expandafter\bidi@gpreto\csname#1\endcsname} +\bidi@newrobustcmd*{\bidi@csxpreto}[1]{\expandafter\bidi@xpreto\csname#1\endcsname} +\bidi@newrobustcmd*{\bidi@protected@csepreto}{\bidi@protected\bidi@csepreto} +\bidi@newrobustcmd*{\bidi@protected@csxpreto}{\bidi@protected\bidi@csxpreto} + + + +\bidi@newrobustcmd{\if@bidi@patchable}{% + \bidi@dbg@trce\if@bidi@patchable + \begingroup + \@makeother\#% + \@ifstar\bidi@ifpatchable@i\bidi@ifpatchable} + +\long\def\bidi@ifpatchable#1#2{% + \endgroup + \bidi@dbg@init#1% + \if@bidi@undef{#1} + {\bidi@dbg@fail{def}\@secondoftwo} + {\bidi@dbg@info{def}% + \if@bidi@defmacro{#1} + {\bidi@dbg@info{mac}% + \bidi@ifscanable{#1} + {\bidi@ifhashcheck{#2} + {\bidi@dbg@info{tok}% + \bidi@ifpattern#1{#2} + {\bidi@dbg@info{pat}% + \bidi@dbg@info{pos}\@firstoftwo} + {\bidi@dbg@fail{pat}\@secondoftwo}} + {\bidi@dbg@fail{hsh}\@secondoftwo}} + {\bidi@dbg@fail{tok}\@secondoftwo}} + {\bidi@dbg@fail{mac}\@secondoftwo}}} + +\long\def\bidi@ifpatchable@i#1{% + \endgroup + \bidi@dbg@init#1% + \if@bidi@undef{#1} + {\bidi@dbg@fail{def}\@secondoftwo} + {\bidi@dbg@info{def}% + \if@bidi@defmacro{#1} + {\bidi@dbg@info{mac}% + \if@bidi@defparam{#1} + {\bidi@dbg@info{prm}% + \bidi@ifscanable{#1} + {\bidi@dbg@info{tok}% + \bidi@dbg@info{pos}\@firstoftwo} + {\bidi@dbg@fail{tok}\@secondoftwo}} + {\bidi@dbg@info{prl}% + \if@bidi@defprotected{#1} + {\bidi@dbg@info{pro}} + {}% + \bidi@dbg@info{pos}\@firstoftwo}} + {\bidi@dbg@fail{mac}\@secondoftwo}}} + +\bidi@newrobustcmd*{\bidi@patchcmd}{% + \bidi@dbg@trce\bidi@patchcmd + \begingroup + \@makeother\#% + \bidi@@patchcmd} + +\newcommand{\bidi@@patchcmd}[4][########1]{% + \bidi@ifpatchable#2{#3} + {\bidi@dbg@succ{ret}% + \begingroup + \edef\bidi@resrvda{% + \def\noexpand\bidi@resrvda####1\detokenize{macro:}####2->####3&{% + #1\def\string\bidi@resrvda\space####2{\noexpand\bidi@resrvdb####3&}}% + \def\noexpand\bidi@resrvdb####1\detokenize{#3}####2&{% + ####1\detokenize{#4}####2}% + \edef\noexpand\bidi@resrvda{% + \noexpand\bidi@resrvda\meaning#2&}}% + \bidi@resrvda + \bidi@patchcmd@scantoks\bidi@resrvda + \let#2\bidi@resrvda + \bidi@undef\bidi@resrvda + \@firstoftwo} + {\@secondoftwo}} + +\def\bidi@patchcmd@scantoks#1{% + \edef\bidi@resrvda{\endgroup + \unexpanded{\makeatletter\scantokens}{#1}% + \catcode\number`\@=\the\catcode`\@\relax}% + \bidi@resrvda} + +\newcommand\bidi@isloaded[2][]{ + \expandafter\ifx\csname if@bidi@#2loaded@\endcsname\relax + \expandafter\newif\csname if@bidi@#2loaded@\endcsname + \fi + \@ifpackageloaded{#2} + {\csname @bidi@#2loaded@true\endcsname #1} + {\csname @bidi@#2loaded@false\endcsname}} + +\protected\def\bidi@ifscanable#1{% + \begingroup + \edef\bidi@resrvda{% + \def\noexpand\bidi@resrvda####1\detokenize{macro}:####2->####3&{% + ####1\def\string\bidi@resrvda####2{####3}}% + \edef\noexpand\bidi@resrvda{\noexpand\bidi@resrvda\meaning#1&}}% + \bidi@resrvda + \makeatletter + \scantokens\expandafter{\bidi@resrvda}% + \expandafter\endgroup\ifx#1\bidi@resrvda + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} + + +\protected\long\def\bidi@ifhashcheck#1{% + \begingroup + \edef\bidi@resrvda{\detokenize{#1}}% + \expandafter\endgroup + \expandafter\bidi@ifhashcheck@i\meaning\bidi@resrvda&} + +\edef\bidi@ifhashcheck@i#1&{% + \noexpand\expandafter + \noexpand\bidi@ifhashcheck@ii + \noexpand\strip@prefix#1\string#\string#&} + +\edef\bidi@ifhashcheck@ii{% + \def\noexpand\bidi@ifhashcheck@ii##1\string#\string###2&} +\bidi@ifhashcheck@ii{\if@bidi@blank{#2}} + + +\protected\long\def\bidi@ifpattern#1#2{% + \begingroup + \edef\bidi@resrvda{% + \def\noexpand\bidi@resrvda####1\detokenize{#2}####2&{% + \endgroup\noexpand\noexpand\noexpand\if@bidi@blank{####2}}% + \edef\noexpand\bidi@resrvda{\noexpand\bidi@resrvda + \expandafter\strip@prefix\meaning#1\detokenize{#2}&}% + \noexpand\bidi@resrvda} + \bidi@resrvda\@secondoftwo\@firstoftwo} + + +\newcommand{\if@bidi@defparam}{} +\long\edef\if@bidi@defparam#1{% + \noexpand\expandafter\noexpand\bidi@ifdefparam + \noexpand\meaning#1\detokenize{macro}:->&} +\edef\bidi@ifdefparam{% + \def\noexpand\bidi@ifdefparam##1\detokenize{macro}:##2->##3&} +\bidi@ifdefparam{\bidi@notblank{#2}} + + +\newcommand{\if@bidi@defprotected}{} +\long\edef\if@bidi@defprotected#1{% + \noexpand\expandafter\noexpand\bidi@ifdefprotected + \noexpand\meaning#1\string\protected&} +\edef\bidi@ifdefprotected{% + \def\noexpand\bidi@ifdefprotected##1\string\protected##2&} +\bidi@ifdefprotected{\bidi@notblank{#2}} + + +\bidi@newrobustcmd{\bidi@undef}[1]{\let#1\bidi@undefined} + +\let\bidi@dbg@trce\@gobble +\let\bidi@dbg@init\@gobble +\let\bidi@dbg@info\@gobble +\let\bidi@dbg@succ\@gobble +\let\bidi@dbg@fail\@gobble + + + +\bidi@newrobustcmd*{\bidi@apptocmd}{% + \bidi@dbg@trce\bidi@apptocmd + \begingroup + \@makeother\#% + \bidi@hooktocmd\bidi@append} + + + +\bidi@newrobustcmd*{\bidi@pretocmd}{% + \bidi@dbg@trce\bidi@pretocmd + \begingroup + \@makeother\#% + \bidi@hooktocmd\bidi@prepend} + +\long\def\bidi@hooktocmd#1#2#3{% + \endgroup + \bidi@dbg@init#2% + \if@bidi@undef{#2} + {\bidi@dbg@fail{def}\@secondoftwo} + {\bidi@dbg@info{def}% + \if@bidi@defmacro{#2} + {\bidi@dbg@info{mac}% + \if@bidi@defparam{#2} + {\bidi@dbg@info{prm}% + \bidi@ifscanable{#2} + {\bidi@ifhashcheck{#3} + {\bidi@dbg@info{tok}% + \bidi@dbg@succ{ret}% + \bidi@hooktocmd@i#1#2{#3}% + \@firstoftwo} + {\bidi@dbg@fail{hsh}\@secondoftwo}} + {\bidi@dbg@fail{tok}\@secondoftwo}} + {\bidi@dbg@info{prl}% + \if@bidi@defprotected{#2} + {\bidi@dbg@info{pro}% + \bidi@dbg@succ{red}% + \protected} + {\bidi@dbg@succ{red}}% + \edef#2{#1{\bidi@expandonce#2}{\unexpanded{#3}}}% + \@firstoftwo}} + {\bidi@dbg@fail{mac}\@secondoftwo}}} + +\long\def\bidi@hooktocmd@i#1#2#3{% + \begingroup + \edef\bidi@resrvda{% + \def\noexpand\bidi@resrvda####1\detokenize{macro}:####2->####3&{% + ####1\def\string\bidi@resrvda\space####2{#1{####3}{\detokenize{#3}}}}% + \edef\noexpand\bidi@resrvda{% + \noexpand\bidi@resrvda\meaning#2&}}% + \bidi@resrvda + \bidi@patchcmd@scantoks\bidi@resrvda + \let#2\bidi@resrvda + \bidi@undef\bidi@resrvda} + +\long\def\bidi@append#1#2{#1#2} +\long\def\bidi@prepend#1#2{#2#1} + + + +\bidi@newrobustcmd{\bidi@AtBeginEnvironment}[1]{% + \bidi@csgappto{@begin@#1@hook}} + +\bidi@patchcmd\begin + {\csname #1\endcsname} + {\bidi@csuse{@begin@#1@hook}% + \csname #1\endcsname} + {} + {\bidi@warning{% + Patching '\string\begin' failed!\MessageBreak + '\string\bidi@AtBeginEnvironment' will not work\@gobble}} + + + +\bidi@newrobustcmd{\bidi@AtEndEnvironment}[1]{% + \bidi@csgappto{@end@#1@hook}} + +\bidi@patchcmd\end + {\csname end#1\endcsname} + {\bidi@csuse{@end@#1@hook}% + \csname end#1\endcsname} + {} + {\bidi@warning{% + Patching '\string\end' failed!\MessageBreak + '\string\bidi@AtEndEnvironment' will not work\@gobble}} + + + +\bidi@newrobustcmd{\bidi@BeforeBeginEnvironment}[1]{% + \bidi@csgappto{@beforebegin@#1@hook}} + +\bidi@pretocmd\begin + {\bidi@csuse{@beforebegin@#1@hook}} + {} + {\bidi@warning{% + Patching '\string\begin' failed!\MessageBreak + '\string\bidi@BeforeBeginEnvironment' will not work\@gobble}} + + + +\bidi@newrobustcmd{\bidi@AfterEndEnvironment}[1]{% + \bidi@csgappto{@afterend@#1@hook}} + +\bidi@patchcmd\end + {\if@ignore} + {\bidi@csuse{@afterend@#1@hook}% + \if@ignore} + {} + {\bidi@warning{% + Patching '\string\end' failed!\MessageBreak + '\string\bidi@AfterEndEnvironment' will not work\@gobble}} +% \end{macrocode} +% \iffalse +% %<*bidituftefloat.sty> %\fi % \subsection{\textsf{bidituftefloat.sty}} @@ -10129,7 +10590,7 @@ bidi implementation of tufte title] %\fi % \subsection{\textsf{hyperref-xetex-bidi.def}} % \begin{macrocode} -\ProvidesFile{hyperref-xetex-bidi.def}[2010/07/25 v0.4 bidi adaptations for hyperref package for XeTeX engine] +\ProvidesFile{hyperref-xetex-bidi.def}[2012/01/01 v0.5 bidi adaptations for hyperref package for XeTeX engine] \AtBeginDocument{% \def\contentsline#1#2#3#4{% \ifx\\#4\\% @@ -10340,10 +10801,7 @@ bidi implementation of tufte title] \def\hyper@link#1#2#3{% \beginL\hyper@linkstart{#1}{#2}\if@RTL\beginR\fi#3\if@RTL\endR\fi\hyper@linkend\endL } -\let\origin@href=\href -\renewcommand\href[2]{\beginL\origin@href{#1}{\if@RTL\beginR\fi#2\if@RTL\endR\fi}\endL} -\let\origin@url=\url -\renewcommand\url[1]{\beginL\origin@url{#1}\endL}% +\def\url@#1{\beginL\hyper@linkurl{\Hurl{#1}}{#1}\endL} \def\hyper@natlinkstart#1{% \Hy@backout{#1}% \beginL\hyper@linkstart{cite}{cite.#1}\if@RTL\beginR\fi% @@ -10356,6 +10814,15 @@ bidi implementation of tufte title] \if@RTL\endR\fi\hyper@linkend\endL#1\beginL\hyper@linkstart{cite}{cite.#2}\if@RTL\beginR\fi% }% } +\begingroup + \catcode`\$=6 % + \catcode`\#=12 % + \gdef\href@$1{\expandafter\href@split$1##\\}% + \gdef\href@split$1#$2#$3\\$4{% + \beginL\hyper@@link{$1}{$2}{\if@RTL\beginR\fi$4\if@RTL\endR\fi}\endL% + \endgroup + }% +\endgroup % \end{macrocode} % \iffalse % @@ -10518,14 +10985,7 @@ bidi implementation of tufte title] %\fi % \subsection{\textsf{loadingorder-bidi.def}} % \begin{macrocode} -\ProvidesFile{loadingorder-bidi.def}[2011/09/16 v0.7 making sure that bidi is the last package loaded] -\newcommand\bidi@isloaded[2][]{ - \expandafter\ifx\csname if@bidi@#2loaded@\endcsname\relax - \expandafter\newif\csname if@bidi@#2loaded@\endcsname - \fi - \@ifpackageloaded{#2} - {\csname @bidi@#2loaded@true\endcsname #1} - {\csname @bidi@#2loaded@false\endcsname}} +\ProvidesFile{loadingorder-bidi.def}[2012/01/01 v0.8 making sure that bidi is the last package loaded] \bidi@isloaded{amsmath} \bidi@isloaded{amsthm} \bidi@isloaded{breqn} @@ -15145,7 +15605,7 @@ bidi implementation of tufte title] %\fi % \subsection{\textsf{xetex-bidi.def}} % \begin{macrocode} -\ProvidesFile{xetex-bidi.def}[2011/07/25 v0.9 bidi adaptations for XeTeX engine] +\ProvidesFile{xetex-bidi.def}[2012/01/01 v1.0.0 bidi adaptations for XeTeX engine] \newcommand{\TeXXeTOn}{\TeXXeTstate=1 } \newcommand{\TeXXeTOff}{\TeXXeTstate=0 } \TeXXeTOn @@ -15230,6 +15690,8 @@ bidi implementation of tufte title] \let\unsetRL=\setLTR \@ifpackageloaded{mathtools}{\RequirePackage{graphicx}}{} \@ifpackageloaded{sidecap}{\RequirePackage{ragged2e}}{} +\bidi@BeforeBeginEnvironment{picture}{\ifmmode\else\LTR\beginL\fi} +\bidi@AfterEndEnvironment{picture}{\ifmmode\else\endL\endLTR\fi} \DeclareOption{RTLdocument}{\@RTLtrue\@RTL@footnotetrue\g@addto@macro\document{\autofootnoterule}} \DeclareOption{rldocument}{\@RTLtrue\@RTL@footnotetrue\g@addto@macro\document{\autofootnoterule}} \def\RTLcases#1{\left.\vcenter{\normalbaselines\m@th diff --git a/Master/texmf-dist/source/latex/bidi/bidi.ins b/Master/texmf-dist/source/latex/bidi/bidi.ins index ee20a245f21..9ee20d62cf0 100644 --- a/Master/texmf-dist/source/latex/bidi/bidi.ins +++ b/Master/texmf-dist/source/latex/bidi/bidi.ins @@ -51,6 +51,7 @@ by Vafa Khalighi. \generate{\file{bidicode.sty}{\from{\jobname.dtx}{bidicode.sty}}} \generate{\file{bidiftnxtra.sty}{\from{\jobname.dtx}{bidiftnxtra.sty}}} \generate{\file{bidimoderncv.cls}{\from{\jobname.dtx}{bidimoderncv.cls}}} +\generate{\file{biditools.sty}{\from{\jobname.dtx}{biditools.sty}}} \generate{\file{bidituftefloat.sty}{\from{\jobname.dtx}{bidituftefloat.sty}}} \generate{\file{bidituftesidenote.sty}{\from{\jobname.dtx}{bidituftesidenote.sty}}} \generate{\file{bidituftetoc.sty}{\from{\jobname.dtx}{bidituftetoc.sty}}} -- cgit v1.2.3