[XeTeX] Arabic XeLaTeX sample

Musa Furber musaf at runbox.com
Tue Jul 6 00:50:45 CEST 2004


Thanks for your recommendation. It does the job.

Musa


On 5 Jul 2004, at 23:39, Jonathan Kew wrote:

>
> On 5 Jul 2004, at 9:16 pm, Musa Furber wrote:
>
>> %%%%%%%%%%%%%%%%%%%%%%
>> %  for Arabic formatting
>> %%%%%%%%%%%%%%%%%%%%%%
>> % make paragraphs RTL instead of LTR
>> \let\myeverypar\everypar
>> \newtoks\everypar
>> \everypar\expandafter{\the\myeverypar}
>> \myeverypar{\the\everypar\beginR}
>>
>> % get rid of the paragraph indent, otherwise it will
>> % appear on the LEFT hand side of the page, instead
>> % of the right.
>> \parindent=0pt
>>
>
> If you want to be able to use the paragraph indent, you can enhance 
> the \everypar code slightly. What I typically use (in plain TeX, where 
> I'm not concerned about other packages using \everypar without my 
> knowledge) is:
> 	\everypar={\setbox0=\lastbox \beginR \box0 }
> This works because a paragraph indent is created by inserting a \box 
> at the start of the horizontal list for the paragraph, before 
> \everypar is called. We just need to move that box so that it follows 
> the \beginR, and all will be well.
>
> I guess the equivalent in your example would be to replace:
> 	\myeverypar{\the\everypar\beginR}
> with:
> 	\newbox\saveparindentbox
> 	\myeverypar{\setbox\saveparindentbox=\lastbox \the\everypar \beginR 
> \box\saveparindentbox}
> (better not just use \box0 in case \the\everypar includes something 
> that messes with it).
>
> Jonathan
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>



More information about the XeTeX mailing list