[XeTeX] A Few Questions

Otared Kavian otared.kavian at math.uvsq.fr
Wed Feb 20 08:49:37 CET 2008


On 20 févr. 08, at 03:59, Petite Chez Scheme wrote:

> I am a TeXnician not a LaTeXnician.
>
> I am using plain XeTeX to produce persian typesetting, everything is  
> good.
> 1) I just want to know how do you make the page numbers Arabic/ 
> Persian, I tried very hard but could not do it.
>
>

Hi,

Some time ago there was a discussion on the issue and it seems that,  
XeTeX being an extend TeX, that it is possible to have page numbers as  
well as numbers in mathmode in Persian. Unfortunately I don't have the  
mail archives anymore on my computer, but you can search it on the  
website of the list.

However for my part I use ConTeXt together with XeTeX (thus obtaining  
something called XeConTeXt) and the code below does what I want to have.

Best regards: OK

%%% the first line is only for use with TeXShop on Mac OS X
%!TEX TS-program = xecontext

% following Mojca M.'s suggestions:

\TeXXeTstate=1
\everypar={\setbox0=\lastbox \beginR \box0 }

\font\PersianNumber="B Zar" at 10pt
\font\PersianHeadNumber="B Titr" at 10pt

\font\PersianB="X Ferdosi" at 10pt
\font\PersianHeadText="X Titre" at 10pt

\definefont[PersianBB]["X Ferdosi" at 10pt]

\definehead[PersianSection][section]
\setuphead[PersianSection][before=\beginR,align=left,style= 
\PersianHeadText]

\definehead[PersianSubsection][subsection]
\setuphead[PersianSubsection][before=\beginR,align=left,style= 
\PersianHeadText]


% persian page numbers:
    \setuppagenumbering[conversion=persiannumerals,style=\PersianNumber]

% persian heading numbers:
    \setuphead[PersianSection] 
[conversion=persiannumerals,stopper=,left={.},
    numberstyle=\PersianHeadNumber]
    \setuphead[PersianSubsection] 
[conversion=persiannumerals,stopper=,left={.},
    numberstyle=\PersianHeadNumber]

% persian footnotes numbers:
    \setupfootnotes[conversion=persiannumerals,style=\PersianNumber]

% persian item numbers
	\setupitemize[conversion=persiannumerals,stopper=,left={(},
	style=\PersianNumber]
	
\starttext

\PersianB
‍
\beginR

\PersianSection{
گفتار یکم
}


\startitemize[n]
\dorecurse{5}{
\item
  اين آزمايش نوشتن فارسى است بدون هيچ  
آمادگى.

$$ \sin(x)^{\mbox{\PersianNumber ۲}} + \cos(x)^{\mbox{\PersianNumber  
۲}} = {\mbox{\PersianNumber ۱}}$$
۱۲۳۴۵۶۷۸۹۰

\item
«خانه دوست كجاست؟» در فلق بود كه پرسيد  
سوار.

۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ ۰
}
\stopitemize

\PersianSubsection{
بخش یکم
}

۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ ۰


\PersianSubsection{
بخش دوم
}


۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ ۰

\stoptext


More information about the XeTeX mailing list