[XeTeX] Images in LTR text

musa furber musaf at runbox.com
Sun Nov 6 15:26:16 CET 2005


On Nov 5, 2005, at 3:49 PM, Jonathan Kew wrote:

> On 5 Nov 2005, at 1:19 am, musa furber wrote:
>
>> When I use insert an image into a stream of LTR text,
>
> (I assume you meant RTL here...)

Correct.

> Are you inserting the image using \XeTeXpicfile, or are you using  
> some higher-level LaTeX construction?

I was using

\DeclareRobustCommand{\mftaradia}{\hspace{.5em}\raisebox{-1pt} 
{\XeTeXpdffile "radiya2_AGA-Arabesque.pdf" height .8\baselineskip} 
\hspace{-1em}\xspace}


>> the image is drawn from LTR (against the flow of the RTL text) so  
>> it ends up drawing over the previous characters.
>>
>> Is this how things are supposed to and should be? If so, can  
>> anyone recommend a solution?
>
> Hmm.... can't say I'd really considered it!
>
> In a quick test with \XeTeXpicfile in a line of Arabic text, I see  
> what you mean; not good. I should think about this.
>
> You should be able to avoid the issue by surrounding the image with  
> \beginL...\endL, so that XeTeX knows it is a left-to-right segment.  
> I tried:
>
>     \hbox{\beginL \XeTeXpicfile "mypic.jpg"\endL}
>
> within Arabic text, and this seems to work fine. (Without the \hbox  
> around the image, it seems to come out wrongly spaced.... this is  
> probably a bug that I should investigate. In practice, I always box  
> images, as I usually want to get their dimensions, etc.)

I replaced my macro with

\DeclareRobustCommand{\mftaradia}{\hspace{.5em}\raisebox{-1pt} 
{\beginR \XeTeXpdffile "radiya2_AGA-Arabesque.pdf" height .8 
\baselineskip \endR}
\hspace{-1em}\xspace
}

and things work just fine. Thanks. I would prefer not having to have  
to include \beginR...\endR since it means having to create two sets  
of macros for ligatures that are common in Islamic texts.

Regards,
Musa



More information about the XeTeX mailing list