diff options
author | Karl Berry <karl@freefriends.org> | 2015-11-26 22:30:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-11-26 22:30:56 +0000 |
commit | 77f3c70030f7f916ddf1ccc01d9f83c307b9f8f0 (patch) | |
tree | 14c3cd81132aaf0a1a0c6fb900210f0bdf943db3 /Master/texmf-dist/tex/xelatex/bidi/hyperref-xetex-bidi.def | |
parent | 249e1802e166afcb824ea15688c6fff18f40ff80 (diff) |
bidi (26nov15)
git-svn-id: svn://tug.org/texlive/trunk@38953 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/hyperref-xetex-bidi.def')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/bidi/hyperref-xetex-bidi.def | 187 |
1 files changed, 150 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/hyperref-xetex-bidi.def b/Master/texmf-dist/tex/xelatex/bidi/hyperref-xetex-bidi.def index f1ddc804bfb..148d0fa0841 100644 --- a/Master/texmf-dist/tex/xelatex/bidi/hyperref-xetex-bidi.def +++ b/Master/texmf-dist/tex/xelatex/bidi/hyperref-xetex-bidi.def @@ -17,7 +17,7 @@ %% by Vafa Khalighi. %% %% -%% \CheckSum{45985} +%% \CheckSum{46083} %% \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 @@ -34,7 +34,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} %% -\ProvidesFile{hyperref-xetex-bidi.def}[2014/11/08 v0.8 bidi adaptations for hyperref package for XeTeX engine] +\ProvidesFile{hyperref-xetex-bidi.def}[2015/11/26 v0.9 bidi adaptations for hyperref package for XeTeX engine] \AtBeginDocument{% \def\contentsline#1#2#3#4{% \ifx\\#4\\% @@ -44,17 +44,17 @@ \csname l@#1\endcsname{#2}{#3}% \or % section \csname l@#1\endcsname{% - \beginL\hyper@linkstart{link}{#4}{\if@RTL\beginR\fi#2\if@RTL\endR\fi}\hyper@linkend\endL + \hyper@linkstart{link}{#4}{\if@RTL\beginR\fi#2\if@RTL\endR\fi}\hyper@linkend }{#3}% \or % page \csname l@#1\endcsname{{#2}}{% - \beginL\hyper@linkstart{link}{#4}{#3}\hyper@linkend\endL + \hyper@linkstart{link}{#4}{#3}\hyper@linkend }% \else % all \csname l@#1\endcsname{% - \beginL\hyper@linkstart{link}{#4}{\if@RTL\beginR\fi#2\if@RTL\endR\fi}\hyper@linkend\endL + \hyper@linkstart{link}{#4}{\if@RTL\beginR\fi#2\if@RTL\endR\fi}\hyper@linkend }{% - \beginL\hyper@linkstart{link}{#4}{#3}\hyper@linkend\endL + \hyper@linkstart{link}{#4}{#3}\hyper@linkend }% \fi \fi @@ -184,23 +184,6 @@ \fi }% }% - \def\@footnotemark{% - \leavevmode - \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi - \stepcounter{Hfootnote}% - \global\let\Hy@saved@currentHlabel\@currentHlabel - \global\let\Hy@saved@currentHref\@currentHref - \hyper@makecurrent{Hfootnote}% - \global\let\Hy@footnote@currentHlabel\@currentHlabel - \global\let\Hy@footnote@currentHref\@currentHref - \global\let\@currentHlabel\Hy@saved@currentHlabel - \global\let\@currentHref\Hy@saved@currentHref - \beginL\hyper@linkstart{link}{\Hy@footnote@currentHref}% - \@makefnmark - \hyper@linkend\endL - \ifhmode\spacefactor\@x@sf\fi - \relax - }% \@ifpackageloaded{tabularx}{% \let\HyOrg@TX@endtabularx\TX@endtabularx \def\Hy@tabularx@hook{% @@ -435,31 +418,161 @@ }% }% \fi +\def\Hy@BeginAnnot#1{% + \ifmmode\else\beginL\fi% + \stepcounter{Hy@AnnotLevel}% + \ifnum\value{Hy@AnnotLevel}=\@ne + #1% + \fi +} +\def\Hy@EndAnnot{% + \ifnum\value{Hy@AnnotLevel}=\@ne + \Hy@endcolorlink + \@pdfm@mark{eann}% + \fi + \addtocounter{Hy@AnnotLevel}\m@ne + \ifmmode\else\endL\fi% +} \def\hyper@link#1#2#3{% - \ifmmode\else\beginL\fi\hyper@linkstart{#1}{#2}\ifmmode\else\if@RTL\beginR\fi\fi#3\ifmmode\else\if@RTL\endR\fi\fi\hyper@linkend\ifmmode\else\endL\fi + \hyper@linkstart{#1}{#2}\ifmmode\else\if@RTL\beginR\fi\fi#3\ifmmode\else\if@RTL\endR\fi\fi\Hy@xspace@end\hyper@linkend +} +\def\hyper@linkfile#1#2#3{% + \leavevmode + \Hy@BeginAnnot{% + \def\Hy@pstringF{#2}% + \Hy@CleanupFile\Hy@pstringF + \Hy@pstringdef\Hy@pstringF\Hy@pstringF + \Hy@pstringdef\Hy@pstringD{#3}% + \Hy@MakeRemoteAction + \@pdfm@mark{% + bann<<% + /Type/Annot% + /Subtype/Link% + \ifHy@pdfa /F 4\fi + \Hy@setpdfborder + \ifx\@filebordercolor\relax + \else + /C[\@filebordercolor]% + \fi + /A<<% + /S/GoToR% + /F(\Hy@pstringF)% + /D% + \ifx\\#3\\% + [\Hy@href@page\@pdfremotestartview]% + \else + (\Hy@pstringD)% + \fi + \Hy@SetNewWindow + \Hy@href@nextactionraw + >>% + >>% + }% + \Hy@colorlink\@filecolor + }% + \ifmmode\else\if@RTL\beginR\fi\fi#1\ifmmode\else\if@RTL\endR\fi\fi\Hy@xspace@end + \Hy@EndAnnot +} +\def\@hyper@launch run:#1\\#2#3{% filename, anchor text linkname + \leavevmode + \Hy@BeginAnnot{% + \Hy@pstringdef\Hy@pstringF{#1}% + \Hy@pstringdef\Hy@pstringP{#3}% + \@pdfm@mark{% + bann<<% + /Type/Annot% + /Subtype/Link% + \ifHy@pdfa /F 4\fi + \Hy@setpdfborder + \ifx\@runbordercolor\relax + \else + /C[\@runbordercolor]% + \fi + /A<<% + /F(\Hy@pstringF)% + /S/Launch% + \Hy@SetNewWindow + \ifx\\#3\\% + \else + /Win<</P(\Hy@pstringP)/F(\Hy@pstringF)>>% + \fi + \Hy@href@nextactionraw + >>% + >>% + }% + \Hy@colorlink\@runcolor + }% + \ifmmode\else\if@RTL\beginR\fi\fi#2\ifmmode\else\if@RTL\endR\fi\fi\Hy@xspace@end + \Hy@EndAnnot +} +\def\hyper@linkurl#1#2{% + \leavevmode + \Hy@BeginAnnot{% + \Hy@pstringdef\Hy@pstringURI{#2}% + \@pdfm@mark{% + bann<<% + /Type/Annot% + /Subtype/Link% + \ifHy@pdfa /F 4\fi + \Hy@setpdfborder + \ifx\@urlbordercolor\relax + \else + /C[\@urlbordercolor]% + \fi + /A<<% + /S/URI% + /URI(\Hy@pstringURI)% + \ifHy@href@ismap + /IsMap true% + \fi + \Hy@href@nextactionraw + >>% + >>% + }% + \Hy@colorlink\@urlcolor + }% + \ifmmode\else\if@RTL\beginR\fi\fi#1\ifmmode\else\if@RTL\endR\fi\fi\Hy@xspace@end + \Hy@EndAnnot +} +\def\Acrobatmenu#1#2{% + \Hy@Acrobatmenu{#1}{#2}{% + \Hy@BeginAnnot{% + \EdefEscapeName\Hy@temp@menu{#1}% + \@pdfm@mark{% + bann<<% + /Type/Annot% + /Subtype/Link% + \ifHy@pdfa /F 4\fi + \Hy@setpdfborder + \ifx\@menubordercolor\relax + \else + /C[\@menubordercolor]% + \fi + /A<<% + /S/Named% + /N/\Hy@temp@menu + \Hy@href@nextactionraw + >>% + >>% + }% + \Hy@colorlink\@menucolor + }% + \ifmmode\else\if@RTL\beginR\fi\fi#2\ifmmode\else\if@RTL\endR\fi\fi\Hy@xspace@end + \Hy@EndAnnot + }% } -\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% + \hyper@linkstart{cite}{cite.#1}\if@RTL\beginR\fi% \def\hyper@nat@current{#1}% } \def\hyper@natlinkend{% - \if@RTL\endR\fi\hyper@linkend\endL + \if@RTL\endR\fi\hyper@linkend } \def\hyper@natlinkbreak#1#2{% - \if@RTL\endR\fi\hyper@linkend\endL#1\beginL\hyper@linkstart{cite}{cite.#2}\if@RTL\beginR\fi% + \if@RTL\endR\fi\hyper@linkend#1\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 \pdfstringdefDisableCommands{% \let\LRE\@firstofone \let\LR\@firstofone |