[XeTeX] XeTeX, arab and halign

Jonathan Kew jonathan_kew at sil.org
Tue Nov 20 23:50:14 CET 2007

On 20 Nov 2007, at 4:42 pm, seroul at math.u-strasbg.fr wrote:

> Hello,
> Mixing Latin and Arabic characters produces strange effetcs with  
> XeTeX.
> I want to put some arabic characters in a table :
> %-------------------------------------
> %!TeX TS-program=xetex
> %!TeX encoding=UTF-8 Unicode

(Not relevant to your current question, but I think you need spaces  
around the = signs here, otherwise TeXShop doesn't actually recognize  
these but simply uses your defaults.)

> \nonstopmode
> \TeXXeTstate=1
> \font \arabfont="Geeza Pro" at 12pt
> \def \tv {\vrule height 15pt depth 8pt width .4pt }
> \def\dochar #1{\hbox to 25mm{\hss{\arabfont #1}\hss }}
> $$\offinterlineskip
> \halign{\tv \dochar{#}\tv && \dochar{#}\tv \cr
> \cr {ت} {ث} {م} {س} {خ} {ر} {ج} {ت}
> \cr {ش} {ف} {ن} {ز} {ص} {ق} {ك} {و}
> }$$

If you're wanting each letter in a table cell, surely you need "&"  
characters between them?

> \bye
> %-------------------------------------
> 1) Look at the \cr at the end of the line !

As far as I can tell, the \cr is at the *beginning* of each table  
line. Editing with mixed directions can get confusing, though,  
depending how well the editor handles it. You might find it helpful  
to force left-to-right writing direction in TeXShop's editor (control- 
click in the window, and choose this from the Writing Direction  

> 2) Horizontal glue seems to be not recognised :
> \hbox to 25mm does not work.
> Is there some cure ?

I think you're getting the whole line in one cell, because of the  
lack of "&" alignment tab characters.

> 3) By the way, is it possible to augment (in the source file)
> the size of the arabic font without changing the Latin font ?

Not as far as I know. You could probably do this if you use something  
with stronger mixed-script capabilities such as Mellel, or maybe  
Nisus Writer, to edit your source.


More information about the XeTeX mailing list