[XeTeX] XeTeX, Persian, Page Numbers, Footnote Numbers and other same issues
Otared Kavian
otared at gmail.com
Thu Nov 29 09:14:36 CET 2007
> On 27 Nov 2007, at 9:10 am, Ali Majdzadeh wrote:
>
>> Hello
>> Is it possible to produce page numbers in Persian? The same
>> question exists about footnote numbers, endnote numbers and heading
>> numbers.
>>
Hi Ali,
Actually, following Mojca's answer, using ConTeXt + XeTeX, that is the
format called XeConTeXt, using Persian numerals is quite easy: one has
only to specify how the nmbers are converted to such and such glyphs.
Below is a complete working example.
Note that there is still a problem with the alignment of sections
headers…
This also can be fixed but right now I don't remember how and I don't
have time to search in my archives :-)
Best reards: OK
%%%%%%%%%%
%!TEX TS-program = xecontext
% following Mojca M.'s suggestions:
\TeXXeTstate=1
\everypar={\setbox0=\lastbox \beginR \box0 }
\font\PersianA="B Zar" at 10pt
\font\PersianB="X Ferdosi" at 10pt
% persian page numbers:
\setuppagenumbering[conversion=persiannumerals,style=\PersianA]
% persian heading numbers:
\setuphead[section][conversion=persiannumerals,numberstyle=
\PersianA]
\setuphead[subsection][conversion=persiannumerals,numberstyle=
\PersianA]
% persian footnotes numbers:
\setupfootnotes[conversion=persiannumerals,style=\PersianA]
% persian item numbers
\setupitemize[conversion=persiannumerals,stopper=,left={(},style=
\PersianA]
\starttext
\PersianB
\beginR
\section{
\PersianB
گفتار یکم
}
\startitemize[n]
\dorecurse{5}{
\item
اين آزمايش نوشتن فارسى است بدون هيچ
آمادگى
۱۲۳۴۵۶۷۸۹۰
\item
.خانه دوست كجاست؟ در فلق بود كه پرسيد
سوار
۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ ۰
}
\stopitemize
\subsection{
\PersianB
بخش یکم
}
۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ ۰
\subsection{
\PersianB
بخش دوم
}
۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ ۰
\stoptext
%%%%%%%%%%
More information about the XeTeX
mailing list