[XeTeX] bidi and hyperref and color in XeTeX

Vafa Khalighi vafa at users.berlios.de
Sat Aug 8 07:48:39 CEST 2009


This is the fix, I wrote today which fixes color isuue automatically in RTL
mode. But it does not support color texts spanning multiple lines because
then I would need to have \beginspecial and \endspecial primitives. I have
explinaed where and how these two primitives should be used. This fix
perfectly works with color and xcolor packages and no more macro programming
is required.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\long\def\color at b@x#1#2#3{%
 \leavevmode\beginL
 \setbox\z@\hbox{\kern\fboxsep{\set at color{\beginL#3\endL}}\kern\fboxsep}%
 \dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@
 \dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@
 {#1{#2\color at block{\wd\z@}{\ht\z@}{\dp\z@}%
      \box\z@}}\endL}
\def\before at color{\if at RTL \beginL \aftergroup \endR \set at color@stack \beginR
\aftergroup\endL \else \set at normalcolor\fi}% when \beginspecial and
\endspecial are implemented, then replace \set at color@stack with
"\set at colorspecial"
%\def\set at colorspecial{\beginspecial{color push \current at color}{color pop}%
%    \aftergroup \endspecial} % needs to be implemented when primitives
\beginspecial and \endspecial are present
\AtBeginDocument{\let\set at normalcolor\set at color%
\def\set at color{\ifhmode\before at color\else\set at normalcolor\fi}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20090808/fa6d3bd9/attachment.html>


More information about the XeTeX mailing list