diff options
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/footnote-bidi.def')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/bidi/footnote-bidi.def | 90 |
1 files changed, 58 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/footnote-bidi.def b/Master/texmf-dist/tex/xelatex/bidi/footnote-bidi.def index 25d2a504f1b..9ce5054aeeb 100644 --- a/Master/texmf-dist/tex/xelatex/bidi/footnote-bidi.def +++ b/Master/texmf-dist/tex/xelatex/bidi/footnote-bidi.def @@ -1,17 +1,14 @@ %% %% This is file `footnote-bidi.def', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% bidi.dtx (with options: `footnote-bidi.def') + %% %% __________________________________ -%% Copyright © 2009 Vafa Khalighi +%% Copyright © 2009-2010 Vafa Khalighi %% %% License information appended. %% %% +\ProvidesFile{footnote-bidi.def}[2010/03/01 v0.4 footnote macros for bidi package] \if@RTLmain\@RTL@footnotetrue\else\@RTL@footnotefalse\fi \def\bidi@footnote@output{{% \dimen0=\ht\footins @@ -86,15 +83,15 @@ \DeclareRobustCommand\EInLTR{\endinsertLTR} \DeclareRobustCommand\InRTL{\insertRTL} \DeclareRobustCommand\EInRTL{\endinsertRTL} -\def\parse@lsent#1#2\EInLTR#3#4#5\parse@end{\@sentdirfalse +\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} -\def\parse@rsent#1#2\EInRTL#3#4#5\parse@end{\@sentdirfalse +\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} -\def\iflsentence#1{\parse@lsent#1\EInLTR123\parse@end\if@sentdir} -\def\ifrsentence#1{\parse@rsent#1\EInRTL123\parse@end\if@sentdir} -\def\bidi@footnotetext@dir#1{% +\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 @@ -122,7 +119,7 @@ \hsize\columnwidth \@parboxrestore \bidi@footnotetext@dir{#1}% \protected@edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext - {\rule{\z@}{\footnotesep}\ignorespaces\if@RTL@footnote#1\else\rmfamily#1\fi\strut}}% + {\rule{\z@}{\footnotesep}\ignorespaces#1\strut}}% \bidi@footnotetext@after \insert\footins{\unvbox\footins}% \endgroup} @@ -150,51 +147,51 @@ \hsize\columnwidth \@parboxrestore \bidi@footnotetext@dir{#1}% \protected@edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext - {\rule{\z@}{\footnotesep}\ignorespaces\rmfamily #1\strut}}% + {\rule{\z@}{\footnotesep}\ignorespaces#1\strut}}% \bidi@footnotetext@after \insert\footins{\unvbox\footins}% \endgroup} -\long\def\@mpRTLfootnotetext#1{ - \global\setbox\@mpfootins\vbox{\@RTLtrue +\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} + {\csname p@mpfootnote\endcsname\@thefnmark}% \color@begingroup \bidi@footnotetext@dir{#1} - \if@RTL\global\let\bidi@footnoterule\right@footnote\else\global\let\bidi@footnoterule\left@footnote\fi - \@makefntext{ - \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox} + \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 +\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} + {\csname p@mpfootnote\endcsname\@thefnmark}% \color@begingroup \bidi@footnotetext@dir{#1} - \if@RTL\global\let\bidi@footnoterule\right@footnote\else\global\let\bidi@footnoterule\left@footnote\fi - \@makefntext{ - \rule\z@\footnotesep\ignorespaces\rmfamily#1\@finalstrut\strutbox} + \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 +\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} + {\csname p@mpfootnote\endcsname\@thefnmark}% \color@begingroup \bidi@footnotetext@dir{#1} - \if@RTL\global\let\bidi@footnoterule\right@footnote\else\global\let\bidi@footnoterule\left@footnote\fi - \@makefntext{ - \rule\z@\footnotesep\ignorespaces\if@RTL@footnote#1\else\rmfamily#1\fi\@finalstrut\strutbox} + \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 @@ -213,8 +210,37 @@ \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} %% -%% Copyright © 2009 by Vafa Khalighi <vafa@users.berlios.de> +%% Copyright © 2009-2010 by Vafa Khalighi <vafa@users.berlios.de> %% %% Distributable under the LaTeX Project Public License, %% version 1.3c or higher (your choice). The latest version of |