ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Arabic/Hindi numerals in layout structures (headers, page numbers, etc.)
@ 2015-08-02 23:32 talazem
  2015-08-03  1:53 ` talazem
  2015-08-03  2:04 ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 2 replies; 5+ messages in thread
From: talazem @ 2015-08-02 23:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
=====
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Arabic/Hindi numerals in layout structures (headers, page numbers, etc.)
  2015-08-02 23:32 Arabic/Hindi numerals in layout structures (headers, page numbers, etc.) talazem
@ 2015-08-03  1:53 ` talazem
  2015-08-03  2:04 ` Idris Samawi Hamid ادريس سماوي حامد
  1 sibling, 0 replies; 5+ messages in thread
From: talazem @ 2015-08-03  1:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2357 bytes --]

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@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
> =====


[-- Attachment #1.2: Type: text/html, Size: 3646 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Arabic/Hindi numerals in layout structures (headers, page numbers, etc.)
  2015-08-02 23:32 Arabic/Hindi numerals in layout structures (headers, page numbers, etc.) talazem
  2015-08-03  1:53 ` talazem
@ 2015-08-03  2:04 ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-03  2:24   ` talazem
  1 sibling, 1 reply; 5+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-03  2:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Salaam, Talal,
See below:

On Sun, 02 Aug 2015 17:32:44 -0600, talazem@fastmail.fm  
<talazem@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.

I'm on the move, but try these keys in the appropriate structure commands:

numberconversion=arabicnumerals
numberconversion=abjadnumerals

Failing that, a workaround is to use the m-translate module, and define a  
translation for each the ten digits. But numberconversion=arabicnumerals  
is supposed to work.

Wassalaam
Idris

PS \start-stopsection is now standard (\section is still there, but...)

>
> 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
> =====
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry  
> to the Wiki!
>
> maillist : ntg-context@ntg.nl /  
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Arabic/Hindi numerals in layout structures (headers, page numbers, etc.)
  2015-08-03  2:04 ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-08-03  2:24   ` talazem
  2015-08-03 12:02     ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 1 reply; 5+ messages in thread
From: talazem @ 2015-08-03  2:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 4603 bytes --]

Thank you for that, Idris. I had tried those earlier, but both of them gave me not digits but the Arabic equivalents of roman numerals — letters, used in the Arabic language, to denote enumeration (as you know). In fact, I have now settled on using those for my front matter in the Arabic critical edition. In fact, now that you mention them both, it seems to me that they produce the same out put: ا ب ج د ه و ز … which I would expect from abjadnumerals but not from arabicnumerals. Perhaps there is a bug?

But, in any case, the solution of Wolfgang solves my immediate problem. It would, of course, be nice not to have had to type out many lines of numbers (the Arabic edition has more than 250 sections, i.e. entries), and to have this automated when declaring the main language to be Arabic, for example. But it is a small price to pay for the flexible functionality. 

All the best, and salam,
Talal

> On 3 Aug 2015, at 03:04, Idris Samawi Hamid ادريس سماوي حامد <Idris.Hamid@colostate.edu> wrote:
> 
> Salaam, Talal,
> See below:
> 
> On Sun, 02 Aug 2015 17:32:44 -0600, talazem@fastmail.fm <mailto:talazem@fastmail.fm> <talazem@fastmail.fm <mailto:talazem@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.
> 
> I'm on the move, but try these keys in the appropriate structure commands:
> 
> numberconversion=arabicnumerals
> numberconversion=abjadnumerals
> 
> Failing that, a workaround is to use the m-translate module, and define a translation for each the ten digits. But numberconversion=arabicnumerals is supposed to work.
> 
> Wassalaam
> Idris
> 
> PS \start-stopsection is now standard (\section is still there, but...)
> 
>> 
>> 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
>> =====
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to the Wiki!
>> 
>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context <http://www.ntg.nl/mailman/listinfo/ntg-context>
>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / http://tex.aanhet.net <http://tex.aanhet.net/>
>> archive  : http://foundry.supelec.fr/projects/contextrev/ <http://foundry.supelec.fr/projects/contextrev/>
>> wiki     : http://contextgarden.net <http://contextgarden.net/>
>> ___________________________________________________________________________________
> 
> 
> -- 
> Idris Samawi Hamid
> Professor of Philosophy
> Colorado State University
> Fort Collins, CO 80523
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / http://tex.aanhet.net <http://tex.aanhet.net/>
> archive  : http://foundry.supelec.fr/projects/contextrev/ <http://foundry.supelec.fr/projects/contextrev/>
> wiki     : http://contextgarden.net <http://contextgarden.net/>
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 28899 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Arabic/Hindi numerals in layout structures (headers, page numbers, etc.)
  2015-08-03  2:24   ` talazem
@ 2015-08-03 12:02     ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 0 replies; 5+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-03 12:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 02 Aug 2015 20:24:50 -0600, talazem@fastmail.fm  
<talazem@fastmail.fm> wrote:

> But, in any case, the solution of Wolfgang solves my immediate problem.  
> It would, of course, be nice not to have had to type out many lines of  
> numbers (the Arabic edition has more than 250 sections, i.e. entries),  
> and to have this automated when declaring the main language to be  
> Arabic, for example.

Ultimately this workaround is overkill. conversion=arabicnumerals needs to  
be fixed. It's a matter of glyph mapping exactly ten digits, should be  
trivial...

Wassalaam
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-03 12:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-02 23:32 Arabic/Hindi numerals in layout structures (headers, page numbers, etc.) talazem
2015-08-03  1:53 ` talazem
2015-08-03  2:04 ` Idris Samawi Hamid ادريس سماوي حامد
2015-08-03  2:24   ` talazem
2015-08-03 12:02     ` Idris Samawi Hamid ادريس سماوي حامد

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).