Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I insert LTR script directly within RTL text without cumbersome markup? (consider a Language learning book. )

What is most clean method to write following texts?

Aa bb cc ااا ببب تتت dd ee ff.

or

ااا ببب ثثث aa bb cc تتت خخ.

If I do not use extera markup the output of One Two Three will be Three Two One in RTL document and output of یک دو سه will be سه دو یک‍‍ in LTR documents.

also see: LTR sequences within RTL text - alternative to cumbersome markup?

share|improve this question
    
The bidi package offers you this possibility through commands to typeset short LTR text inside RTL paragraphs and viceversa. –  Gonzalo Medina Jul 25 '12 at 4:49
    
@GonzaloMedina As mentioned above I want use no extra command, mixing up RTL and LTR text in all other environment is displayed corrctily without any markup (Notepad, HTML, ...) –  PHPst Jul 25 '12 at 5:12
    
Didn't you ask this question already? tex.stackexchange.com/questions/54320/…. What's wrong with the answer you got there? –  Ulrike Fischer Jul 25 '12 at 6:25
    
@UlrikeFischer That answer do not work (as mentioned in its comment) also this question is in general and that question was about XePersian –  PHPst Jul 25 '12 at 8:36
1  
Then you should add a link to the older question and explain what's wrong with it so that people don't start from scratch again. –  Ulrike Fischer Jul 25 '12 at 9:03
show 1 more comment

1 Answer

No, you can’t. XeTeX processes each word in isolation and does not apply the BiDi algorithm to the whole paragraph. It is possible to use interchar classes to do very primitive BiDi processing, but it is too limited to be reliable (because the nature of BiDi handling and the fact interchar classes were not meant for such use cases).

P.S. I have a Bidi algorithm implementation in Lua that I use with ConTeXt, but it is not very well tested beyond my personal documents and I stopped providing a LaTeX package for it.

share|improve this answer
    
Thanks. I thought nothing is impossible in TeX World ;) –  PHPst Jul 27 '12 at 6:39
    
That is not my experience, though. –  Khaled Hosny Jul 27 '12 at 7:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.