[XeTeX] Please help me with \XeTeXinterchartoks

Ross Moore ross at ics.mq.edu.au
Mon Dec 1 20:57:26 CET 2008


Hi Vafa,

On 01/12/2008, at 11:14 PM, VAFA KHALIGHI wrote:

> I want to set \XeTeXinterchartoks for small English sentenses in a  
> Right to Left direction such that when I write an/Two English it  
> will be typeset in rmfamily and from Left to Write. This is what I  
> have done
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \XeTeXinterchartokenstate = 1
> \XeTeXcharclass `\Q 1
> \XeTeXcharclass `\q 2
> \XeTeXcharclass `\W 3
> ...

> \XeTeXcharclass `\n 50
> \XeTeXcharclass `\M 51
> \XeTeXcharclass `\m 52
> \XeTeXinterchartoks 255 1={\beginL\begin{rmfamily}}
> \XeTeXinterchartoks 1 255={\end{rmfamily}\endL}
> \XeTeXinterchartoks 255 2={\beginL\begin{rmfamily}}
> ...

> \XeTeXinterchartoks 51 255={\end{rmfamily}\endL}
> \XeTeXinterchartoks 255 52={\beginL\begin{rmfamily}}
> \XeTeXinterchartoks 52 255={\end{rmfamily}\endL}
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> but when I write "This is" in a Right to left direction, I see that  
> it is typeset in rmfamily but in the reverse order "is This", ...

Presumably this is because the 'space' (or 'end-of-word') has
XeTeXcharclass of 255, thus generating the \endL .
So letters in words come out L-R but the words themselves
are placed R-L.

> ... so can you please help me to get this done?

Sorry, I've not played around with this kind of thing.
Presumably there aren't many of us who have, yet.
Nevertheless, I'm very interested in what you manage to achieve.

>
>
> I am only asking for one example, please just show me how to do  
> this for  "This is".

Have you tried setting the \XeTeXcharclass for the space token?
Can this even be done?  Jonathan?


>
>
> Thanks


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the XeTeX mailing list