[XeTeX] Images in LTR text

Jonathan Kew jonathan_kew at sil.org
Sat Nov 5 14:49:06 CET 2005

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...)

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

> 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

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.)

JK