I have a serious of auto-generated documents in various languages that include a mix of LTR and RTL languages. I am trying to come up with common markup that works across both directions. I've run into some trouble aligning images. When I wrap images at the start of a line, the LTR version properly wraps but the RTL version drops the image into the margin.

How do I correct the placement of the image so that both LTR and RTL variants will wrap the text around the image?

enter image description here

\setuppapersize [A5]
\starttypescript [sans] [notolatin]
    \definefontsynonym [Sans] [name:notosans]
    \definefontsynonym [SansBold] [name:notosansbold]
    \definefontsynonym [SansItalic] [name:notosansitalic]
    \definefontsynonym [SansBoldItalic] [name:notosansbolditalic]
\starttypescript [sans] [notoarabic]
    \definefontsynonym [Sans] [name:notonaskharabic] [range=persian,features=persian]
    \definefontsynonym [SansBold] [name:notonaskharabicbold]
    \definefontsynonym [SansItalic] [name:notonaskharabicitalic]
    \definefontsynonym [SansBoldItalic] [name:notonaskharabicbolditalic]
\definetypeface [notolatin] [ss] [sans] [notolatin]
\definetypeface [notoarabic] [ss] [sans] [notoarabic]
\define\EN{\setupbodyfont[notolatin,ss]\pardir TLT \textdir TLT}
\define\PE{\setupbodyfont[notoarabic,ss]\pardir TRT \textdir TRT}
\pagedir TRT
\bodydir TRT
هناك حقيقة مثبتة منذ زمن طويل وهي أن المحتوى المقروء لصفحة ما سيلهي القارئ عن التركيز على الشكل الخارجي للنص أو شكل توضع الفقرات في الصفحة التي يقرأها.

    {\PE \bf ۱.آفرینش}
    {\PE \em داستانی برگرفته از کتاب مقدّس: کتاب پیدایش، فصلهای ۱و۲}

\pagedir TLT
\bodydir TLT
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit.

    {\EN \bf Checking level 1}
    {\EN \em find out more at https://unfoldingword.org/quality}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.