[XeTeX] Problems with hyperref and bidi

Khaled Hosny khaledhosny at eglug.org
Sat Apr 26 21:58:31 CEST 2008


On Sat, Apr 26, 2008 at 11:19:24AM +1000, Ross Moore wrote:
> Hi Vafa, Khaled, and others.
> 
> 
> On 26/04/2008, at 12:42 AM, VAFA KHALIGHI wrote:
> > If you are producing a book or a report, then put these commands in  
> > your preamble: (You can vary the hyperref options to meet your  
> > needs or add anyother things)
> 
> > %%%%%%%%%%%%%%%%%%
> >
> > If you are producing an article, then put these commands in your  
> > preamble:
> 
> 
> > \makeatletter
> > \renewcommand*\l at section[2]{%
> > \ifnum \c at tocdepth >\m at ne
> > \addpenalty{-\@highpenalty}%
> > \vskip 1.0em \@plus\p@
> > \setlength\@tempdima{1.5em}%
> > \begingroup
> > \parindent \z@ \rightskip \@pnumwidth
> > \parfillskip -\@pnumwidth
> > \leavevmode \bfseries
> > \advance\leftskip\@tempdima
> > \hskip -\leftskip
> > #1\nobreak\hfil \nobreak\hb at xt@\@pnumwidth{\hss \textroman{#2}}\par
> 
> This is using the \textroman  command from  arabxetex.sty .
> 
> > \penalty\@highpenalty
> > \endgroup
> > \fi}
> > \makeatother
> > %%%%%%%%%%%%%%%%%%%%%%%%%%
> 
> If you don't use arabxetex.sty , or even if you do, then
> also include a coding line here:
> 
>     \providecommand{\textroman}[1]{{\LR{\rmfamily #1}}}
> 
> which will give you this command if your packages don't
> define it already.
> 
> 
> But even with this, there are still some 'minor' problems.
> 
> Using  xdvipdfmx  as the xdv processor, I get warnings:
> 
> rossmoor% xdvipdfmx-0997 test.xdv
> test.xdv -> test.pdf
> [1
> 
> ** WARNING ** End color with no corresponding begin color.]
> 
> ** WARNING ** Invalid CMap mapping entry. (ignored)
> 
> 
> Using  xdv2pdf  (MacOS X only)  the messages are:
> 
>    *** rule color stack underflow
> 
>    *** text color stack underflow
> 
> 
> Clearly there is an interaction with the color-stack mechanism
> that isn't yet adapted to getting the order of the push/pop
> correct within a  right-to-left setting.
> 
> To resolve this, it looks like the \LR cannot apply to just
> the text of the hyperlink, but must also include the internal
> color-commands that are placed by hyperref .
> But this cannot be done globally, as there may be a legitimate
> need for \RL text within the text of the anchor.
> 
> Surely someone has tackled this kind of difficulty already.
> 

Reading the bidi package documentation again
(http://www.ctan.org/tex-archive/macros/xetex/latex/bidi/bidi.pdf)
It is mentioned that the color commands doesn't work properly with RL,
though the package redefine \textcolor command, it doesn't work with
hyperref. This thread is related too
http://listserv.tau.ac.il/cgi-bin/wa?A2=ind0404&L=ivritex&D=0&T=0&P=268,
though non of the mentioned workarounds seem to affect hyperref.

Thanks,
 -Khaled

> 
> 
> 
> BTW,
> the only  /ToUnicode  CMap within the PDF
> is associated with the   Scheherezade  font:
> 
> <</Type/Font
> /Subtype/Type0
> /BaseFont/EDMOXA+Scheherazade
> /Encoding/Identity-H
> /DescendantFonts[7 0 R]
> /ToUnicode 34 0 R
>  >>
> 
> So there must be a problem in there somewhere.
> 
> While this doesn't affect the appearance of the font within the PDF,
> it can affect searching and copying the text from this document.
> 
> 
> Cheers,
> 
> 	Ross
> 
> ------------------------------------------------------------------------
> Ross Moore                                       ross at maths.mq.edu.au
> Mathematics Department                           office: E7A-419
> Macquarie University                             tel: +61 (0)2 9850 8955
> Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
> ------------------------------------------------------------------------
> 
> 
> 
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex

-- 
 Khaled Hosny
 Arabic localizer and member of Arabeyes.org team
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://tug.org/pipermail/xetex/attachments/20080426/6eb8f8f2/attachment.bin 


More information about the XeTeX mailing list