%% %% This is file `footnote-xetex-bidi.def', %% generated with the docstrip utility. %% %% The original source files were: %% %% bidi.dtx (with options: `footnote-xetex-bidi.def') %% %% ______________________________________ %% Copyright © 2009–2010 Vafa Khalighi %% %% License information appended. %% %% \ProvidesFile{footnote-xetex-bidi.def}[2010/07/25 v0.5 bidi footnote macros for XeTeX engine] \if@RTLmain\@RTL@footnotetrue\else\@RTL@footnotefalse\fi \def\bidi@footnote@output{{% \dimen0=\ht\footins \advance\dimen0 by\dp\footins \def\@elt##1##2{% \ifx\bidi@footnoterule\relax\global\let\bidi@footnoterule##2\fi \advance\dimen0 by -##1\relax \ifdim\dimen0<\z@ {% \let\@elt\relax\let\right@footnote\relax\let\left@footnote\relax \dimen0=-\dimen0% \xdef\new@bidi@footnote@list{\new@bidi@footnote@list\noexpand\@elt{\the\dimen0}{##2}}% }% \fi \ifdim\dimen0>\z@\else \let\right@footnote\relax\let\left@footnote\relax \def\@elt####1####2{% {\let\@elt\relax \xdef\new@bidi@footnote@list{\new@bidi@footnote@list\noexpand\@elt{####1}{####2}}}% }% \fi }% \def\new@bidi@footnote@list{}% \bidi@footnote@list \global\let\bidi@footnote@list\new@bidi@footnote@list }} \def\right@footnote{% \hbox to \columnwidth {\beginR \vbox{\kern -3\p@ \hrule width .4\columnwidth \kern2.6\p@}\hfil\endR}} \def\left@footnote{% \hrule width .4\columnwidth\kern 2.6\p@} \def\textwidth@footnote{\kern-3\p@ \hrule \@width \textwidth \kern 2.6\p@} \def\right@footnoterule{\bidi@footnote@output\right@footnote\global\let\bidi@footnoterule\relax} \def\left@footnoterule{\bidi@footnote@output\left@footnote\global\let\bidi@footnoterule\relax} \def\textwidth@footnoterule{\bidi@footnote@output\textwidth@footnote\global\let\bidi@footnoterule\relax} \def\auto@footnoterule{\bidi@footnote@output \ifx\bidi@footnoterule\relax\if@RTL\right@footnote\else\left@footnote\fi\else\bidi@footnoterule\fi \global\let\bidi@footnoterule\relax} \def\leftfootnoterule{\def\footnoterule{\left@footnoterule}} \let\LRfootnoterule=\leftfootnoterule \def\rightfootnoterule{\def\footnoterule{\right@footnoterule}} \def\textwidthfootnoterule{\def\footnoterule{\textwidth@footnoterule}} \def\autofootnoterule{\def\footnoterule{\auto@footnoterule}} \def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}} \def\bidi@footnote@list{} \let\bidi@footnoterule\relax \def\RTLfootnote{\@ifnextchar[\@xRTLfootnote{\stepcounter\@mpfn \protected@xdef\@thefnmark{\thempfn}% \@footnotemark\@RTLfootnotetext}} \def\@xRTLfootnote[#1]{% \begingroup \csname c@\@mpfn\endcsname #1\relax \unrestored@protected@xdef\@thefnmark{\thempfn}% \endgroup \@footnotemark\@RTLfootnotetext} \def\LTRfootnote{\@ifnextchar[\@xLTRfootnote{\stepcounter\@mpfn \protected@xdef\@thefnmark{\thempfn}% \@footnotemark\@LTRfootnotetext}} \def\@xLTRfootnote[#1]{% \begingroup \csname c@\@mpfn\endcsname #1\relax \unrestored@protected@xdef\@thefnmark{\thempfn}% \endgroup \@footnotemark\@LTRfootnotetext} \def\insertRTL{\bgroup\beginR\@RTLtrue} \def\endinsertRTL{\endR\egroup} \def\insertLTR{\bgroup\beginL\@RTLfalse} \def\endinsertLTR{\endL\egroup} \DeclareRobustCommand\InLTR{\insertLTR} \DeclareRobustCommand\EInLTR{\endinsertLTR} \DeclareRobustCommand\InRTL{\insertRTL} \DeclareRobustCommand\EInRTL{\endinsertRTL} \long\def\parse@lsent#1#2\EInLTR#3#4#5\parse@end{\@sentdirfalse \def\@tempa{\InLTR}\def\@tempb{\EInLTR}\def\@tempc{#1}\def\@tempd{#4}% \ifx\@tempa\@tempc\ifx\@tempb\@tempd\@sentdirtrue\fi\fi} \long\def\parse@rsent#1#2\EInRTL#3#4#5\parse@end{\@sentdirfalse \def\@tempa{\InRTL}\def\@tempb{\EInRTL}\def\@tempc{#1}\def\@tempd{#4}% \ifx\@tempa\@tempc\ifx\@tempb\@tempd\@sentdirtrue\fi\fi} \long\def\iflsentence#1{\parse@lsent#1\EInLTR123\parse@end\if@sentdir} \long\def\ifrsentence#1{\parse@rsent#1\EInRTL123\parse@end\if@sentdir} \long\def\bidi@footnotetext@dir#1{% \@tempswatrue \ifrsentence{#1}\rtl\@tempswafalse\fi \iflsentence{#1}\ltr\@tempswafalse\fi \if@tempswa\if@RTL\rtl\else\ltr\fi\fi \xdef\bidi@this@footnote{\if@RTL\noexpand\right@footnote\else\noexpand\left@footnote\fi}% } \def\bidi@footnotetext@after{% {% \let\@elt\relax\let\right@footnote\relax\let\left@footnote\relax \dimen0=\ht\footins \advance\dimen0 by\dp\footins \xdef\bidi@footnote@list{\bidi@footnote@list\@elt{\the\dimen0}{\bidi@this@footnote}}% }% } \def\setfootnoteRL{\@RTL@footnotetrue} \def\unsetfootnoteRL{\@RTL@footnotefalse} \def\setfootnoteLR{\unsetfootnoteRL} \long\def\@footnotetext#1{% \begingroup \setbox\footins \vbox{\if@RTL@footnote\@RTLtrue\else\@RTLfalse\fi\reset@font\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty \@MM \hsize\columnwidth \@parboxrestore \bidi@footnotetext@dir{#1}% \protected@edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext {\rule{\z@}{\footnotesep}\ignorespaces#1\strut}}% \bidi@footnotetext@after \insert\footins{\unvbox\footins}% \endgroup} \long\def\@RTLfootnotetext#1{% \begingroup \setbox\footins \vbox{\@RTLtrue\reset@font\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty \@MM \hsize\columnwidth \@parboxrestore \bidi@footnotetext@dir{#1}% \protected@edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext {\rule{\z@}{\footnotesep}\ignorespaces #1\strut}}% \bidi@footnotetext@after \insert\footins{\unvbox\footins}% \endgroup} \long\def\@LTRfootnotetext#1{% \begingroup \setbox\footins \vbox{\@RTLfalse\reset@font\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty \@MM \hsize\columnwidth \@parboxrestore \bidi@footnotetext@dir{#1}% \protected@edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext {\rule{\z@}{\footnotesep}\ignorespaces#1\strut}}% \bidi@footnotetext@after \insert\footins{\unvbox\footins}% \endgroup} \long\def\@mpRTLfootnotetext#1{% \global\setbox\@mpfootins\vbox{\@RTLtrue% \unvbox\@mpfootins \reset@font\footnotesize \hsize\columnwidth \@parboxrestore \protected@edef\@currentlabel {\csname p@mpfootnote\endcsname\@thefnmark}% \color@begingroup \bidi@footnotetext@dir{#1} \ifnum\c@mpfootnote=1\if@RTL\global\let\bidi@footnoterule\right@footnote\else\global\let\bidi@footnoterule\left@footnote\fi\fi \@makefntext{% \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% \color@endgroup}} \long\def\@mpLTRfootnotetext#1{% \global\setbox\@mpfootins\vbox{\@RTLfalse% \unvbox\@mpfootins \reset@font\footnotesize \hsize\columnwidth \@parboxrestore \protected@edef\@currentlabel {\csname p@mpfootnote\endcsname\@thefnmark}% \color@begingroup \bidi@footnotetext@dir{#1} \ifnum\c@mpfootnote=1\if@RTL\global\let\bidi@footnoterule\right@footnote\else\global\let\bidi@footnoterule\left@footnote\fi\fi \@makefntext{% \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% \color@endgroup}} \long\def\@mpfootnotetext#1{% \global\setbox\@mpfootins\vbox{\if@RTL@footnote\@RTLtrue\else\@RTLfalse\fi% \unvbox\@mpfootins \reset@font\footnotesize \hsize\columnwidth \@parboxrestore \protected@edef\@currentlabel {\csname p@mpfootnote\endcsname\@thefnmark}% \color@begingroup \bidi@footnotetext@dir{#1} \ifnum\c@mpfootnote=1\if@RTL\global\let\bidi@footnoterule\right@footnote\else\global\let\bidi@footnoterule\left@footnote\fi\fi \@makefntext{% \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% \color@endgroup}} \def\@iiiminipage#1#2[#3]#4{% \leavevmode \@pboxswfalse \setlength\@tempdima{#4}% \def\@mpargs{{#1}{#2}[#3]{#4}}% \setbox\@tempboxa\vbox\bgroup\hbox\bgroup\if@RTL\beginL\fi\vbox\bgroup \color@begingroup \hsize\@tempdima \textwidth\hsize \columnwidth\hsize \@parboxrestore \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ \let\@footnotetext\@mpfootnotetext \let\@LTRfootnotetext\@mpLTRfootnotetext \let\@RTLfootnotetext\@mpRTLfootnotetext \let\@listdepth\@mplistdepth \@mplistdepth\z@ \@minipagerestore \@setminipage} \def\LTRthanks#1{\footnotemark \protected@xdef\@thanks{\@thanks \protect\LTRfootnotetext[\the\c@footnote]{#1}}% } \def\LTRfootnotetext{% \@ifnextchar [\@xLTRfootnotenext {\protected@xdef\@thefnmark{\thempfn}% \@LTRfootnotetext}} \def\@xLTRfootnotenext[#1]{% \begingroup \csname c@\@mpfn\endcsname #1\relax \unrestored@protected@xdef\@thefnmark{\thempfn}% \endgroup \@LTRfootnotetext} \def\RTLthanks#1{\footnotemark \protected@xdef\@thanks{\@thanks \protect\RTLfootnotetext[\the\c@footnote]{#1}}% } \let\@thanks\@empty \def\RTLfootnotetext{% \@ifnextchar [\@xRTLfootnotenext {\protected@xdef\@thefnmark{\thempfn}% \@RTLfootnotetext}} \def\@xRTLfootnotenext[#1]{% \begingroup \csname c@\@mpfn\endcsname #1\relax \unrestored@protected@xdef\@thefnmark{\thempfn}% \endgroup \@RTLfootnotetext} \leftfootnoterule %% %% Copyright © 2009–2010 Vafa Khalighi %% %% 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 Vafa Khalighi. %% %% In addition to the terms of LPPL any distributed version %% (unchanged or modified) of bidi has to keep the statement %% about the moral obligation for using bidi. In case of major %% changes where this would not be appropriate the author of the %% changed version should contact the copyright holder. %% %% %% %% Moral obligation for using bidi: %% ____________________________________ %% %% Users of bidi who wish to include or use bidi or a modified %% version in a proprietary and commercially market product are asked %% under certain conditions (see below) for the payment of a license %% fee. The size of this fee is to be determined, in each instance, %% by the commercial user, depending on his/her judgment of the value of %% bidi for his/her product. %% %% %% The conditions for this are as follows: %% %% The producer of a proprietary and commercially market product %% that involves typesetting using bidi is asked to determine %% the value of a license fee for using bidi if %% %% - the product is a document and the producer has decided to %% include bidi to typeset (parts of) the document or has %% directed the author of the document to include bidi (for %% example, by providing a class file to be used by the author) %% %% - the product is a LaTeX class or package that includes bidi %% %% %% There is no moral obligation in case %% %% - the product is a document but producer has not directed %% the author to include bidi (in that case the moral obligation %% lies with the author of the document) %% %% - the product does not involve typesetting, e.g., consists, for %% example, of distributing bidi and its documentation. %% %% - the product is not proprietary, i.e., is made available as free %% software itself (which doesn't prohibit its commercial marketing) %% %% - bidi is used for non-commercial purposes %% %% %% Determinating a license fee might result in a license fee of zero %% (i.e., no payment) in case a producer has determined that the use %% of bidi has no enhancing effect on the product. This is a %% plausible scenario, i.e., in the above two cases the producer is %% only asked to evaluate the value of bidi for the product %% not for the payment of a license fee per se (which might or might %% not follow from this evaluation). %% %% The license fee, if any, can be payed to the author of %% the program who can be contacted at %% %% vafakhlgh@gmail.com %% %% %% %% %% End of file `footnote-xetex-bidi.def'.