[XeTeX] bidi and hyperref and color in XeTeX

Vafa Khalighi vafa at users.berlios.de
Fri Aug 7 05:50:19 CEST 2009


Sorry for repeating this again but I think it is forgotten. This is the
answer to the questions that Jonathan asked about the \beginspecial and
\endspecial primitives with the attached patch which shows the main changes
needed for implementing these and \semihalign primitive.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The primitives \beginspecial and \endspecial are defined because when
\special's range is more than a line in a paragraph and end of it, is in the
middle of another line (e.g. when 1.5 lines of a paragraph is coloured), the
coloured range in RTL will not be what we expect and  this is because of the
paragraph scan towards the lines which are adjusted from left. With these
two primitives (\beginspecial and \endspecial) paragraph scan algorithm can
colour the range of each line that was intended to be coloured and as a
consequent the problem will disappear.

\beginspecial has two arguments, one of the argument is about the start of
special and the other argument is about the end of special \endspecial does
not have any arguments and its argument is the second argument of
\beginspecial. So in your example \beginspecial and \endspecial would be
used in the following way:


preceding text \b‌e‌g‌i‌n‌s‌p‌e‌c‌i‌a‌l{c‌o‌l‌o‌r p‌u‌s‌h r‌g‌b 1 0
0}{c‌o‌l‌o‌r p‌o‌p} r‌e‌d a‌n‌d m‌o‌r‌e  r‌e‌d  \e‌n‌d‌s‌p‌e‌c‌i‌a‌l
‌fo‌l‌l‌o‌w‌i‌n‌g t‌e‌x‌t w‌o‌u‌l‌d w‌o‌r‌k l‌i‌k‌e y‌o‌u‌r example


Therefore in the lines scan algorithm, in the end of each line, the argument
of \endspecial (second argument of \beginspecial) and in the  beginning of
next line, the argument of \beginspecial (first argument) will be added.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Could you please tell me that what you think about this? I just want to see
if you really can not fix it, then I have to modify TeX line breaking
algorithm. But I should be very careful with modifying TeX line breaking
algorithm because *pierre **mackay told me that *"This was just what he
looked into in his first attempts at a bidi TeX, but DEK looked at it and
decided that it broke too many other aspects of TeX. That was what inspired
him to produce his own solution, which became TeX-Xet. "


*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20090807/7bae51fa/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spcalign.zip
Type: application/zip
Size: 2508 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20090807/7bae51fa/attachment-0001.zip>


More information about the XeTeX mailing list