ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Idris Samawi Hamid <ishamid@colostate.edu>
Subject: Re: Numerals in mkiv
Date: Sat, 18 Apr 2009 14:15:57 +0200	[thread overview]
Message-ID: <49E9C47D.9010501@wxs.nl> (raw)
In-Reply-To: <913904C4-2DE1-4E62-810E-76B344E13B93@gmail.com>

Otared Kavian wrote:
> Hi Hans,
> 
> It seems that Arabic or Persian numerals (for instance in section 
> numbers) in mkiv begin at 0, instead of 1… well it is true that in 
> Mathematics natural integers begin with 0, but not in books in those 
> languages :-)
> Here is a minimal example:
> 
> \setupdirections[bidi=global]
> \pagedir TRT
> \bodydir TRT
> \pardir TRT
> \textdir TRT
> 
> \starttypescript[serif][arabic]
> \usetypescript[serif][fallback]
> \definefontsynonym [Serif][name:SimpleNaskhi] [features=arabic]
> \stoptypescript
> 
> \starttypescript  [arabic]
>   \definetypeface [arabic][rm] [serif] [arabic]  [default]
> \stoptypescript
> 
> \usetypescript[arabic]
> \setupbodyfont[arabic,12pt]
> 
> %%%%%%%%%%%%%%%%%%
> % heading numbers:
>    \setuphead[section][conversion=persiannumerals] %,numberstyle={arabic}]
> %%%%%%%%%%%%%%%%%%%
> 
> \starttext
> \dorecurse{5}{%
> \section{بخش}\par
> آزمایش
> }
> \stoptext
> 
> Pardon me if I have been missing something already explained elsewhere.

it all depends how we define conversions

- numeric (1,2,3,4)
- alphabetic (a,b,c,d)

numeric is used in chapter numbering and alphabetic for instance in 
itemized (ok, all can be used everywhere but those are most common)

so, the question is ... how do we define the commands ... maybe we need:


\def\abjadnumerals     #1{\ctxlua{converters.abjadnumerals(\number#1)}}
\def\abjadnodotnumerals#1{\ctxlua{converters.abjadnodotnumerals(\number#1)}}
\def\abjadnaivenumerals#1{\ctxlua{converters.abjadnumerals(\number#1)}}

\defineconversion [arabicnumerals]    [\abjadnumerals]
\defineconversion [persiannumerals]   [\abjadnumerals]

Idris ... any ideas about this? We never finished this so it's about time

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2009-04-18 12:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17 21:08 Otared Kavian
2009-04-18 12:15 ` Hans Hagen [this message]
2009-04-18 14:06   ` Otared Kavian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49E9C47D.9010501@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ishamid@colostate.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).