[NTG-context] Arabic/Hindi numerals in layout structures (headers, page numbers, etc.)

talazem at fastmail.fm talazem at fastmail.fm
Mon Aug 3 03:53:03 CEST 2015


Never mind. After more word combinations when searching the archives, I came across Wolfgang’s answer here: gmane.comp.tex.context/85673 <http://article.gmane.org/gmane.comp.tex.context/85673>, in which he says to use the \defineconversion command. E.g.:

\defineconversion
  [myconversion]
  [۱,۲,۳,۴,۵,۶,۷,۸,۹,۱۰,
   ۱۱,۱۲,۱۳,۱۴,۱۵,۱۶,۱۷,۱۸,۱۹,۲۰,
   ۲۱,۲۲,۲۳,۲۴,۲۵,۲۶,۲۷,۲۸,۲۹,۳۰]

\setuppagenumber[numberconversion=myconversion]

Of course, one can add the same to setups for the other matters as well:

\setuphead[chapter,title,section,subject][conversion=myconversion]
\setuplinenumbering[conversion=myconversion]
\setupnotations[footnote][numberconversion=myconversion]
\setupnotations[linenote][numberconversion=myconversion]
etc.

This actually provides lots of flexibility, as you can fine-tune various footnote streams by assigning different scripts, etc.

Talal


> On 3 Aug 2015, at 00:32, talazem at fastmail.fm wrote:
> 
> Dear all,
> 
> When typesetting in Arabic (or, for that matter, other non-Latin scripts), how does one get numerals to appear ‘natively’ in layout structures such as headers, page numbers, line-numbering, and footnote numbers? In the case of Arabic, this means using the so-called “mashriqi”, or “Arabic-Indic”/“Arabic-Hindi” numerals. Is there some option when defining the font family? (I would have thought that using “\mainlanguage[arabic]” would have done it.) Of course, I am using a font that contains the numbers of that script.
> 
> Mind you, if I manually type such numbers into the body of my text, they appear correctly. MWE below.
> 
> Best wishes,
> Talal
> 
> =====
> \setuppapersize[A6]
> \mainlanguage[arabic]
> \definefontfamily[mainface][serif][ALMFixed][features=arabic,range=arabic,]
> \setupbodyfont [mainface,10pt]
> 
> \starttext \showframe
> \righttoleft
> 
> %\setupdirections[bidi=global,method=two]
> 
> \section{section one}
> \startlinenumbering
> \input ward 
> \stoplinenumbering
> \footnote{I would like the footnote number — like the page number, section number, and linenumbers — to be in the so-called Arabic-Indic script.}
> 
> \section{section two}
> مرحباً بالعالم. ١٢٣٤٥٦٧٨٩٠ مرحباً بالعالم.
> \stoptext
> =====

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20150803/d7bbbf44/attachment.html>


More information about the ntg-context mailing list