Le mercredi 22 mai 2013, Hans Hagen a écrit :
> On 5/21/2013 11:35 PM, Romain Diss wrote:
> >> We've already got \setdigitmode, \setdigitorder, and \setdigitspace;
> >> it might make sense to create a \setupdigits to consolidate these
> >> setups into one interface. Something like this:
> >> 
> >> \setupdigits
> >> 
> >>     [mode=4,               % -->\setdigitmode{4}
> >>     
> >>                            % (decimal period, thinspace between groups)
> >>      
> >>      inputdecimalmark={,}, % -->\setdigitorder{0}
> >>      signspace=yes,        % -->\setdigitsign{1}; '+ 1.4', not '+1.4'
> >>      times=\times,         % or times=\cdot
> >>      ]
> > 
> > +1
> > 
> >> P.s: I've been thinking I'd like to write more contexty interface that
> >> doesn't use predefined modes, but lets you setup the decimal mark,
> >> separator mark, the input decimal mark, etc. Something like this:
> >> 
> >> \setupdigits
> >> 
> >>     [inputdecimal={.},  % input  3.1415926535
> >>     
> >>      decimal={,}
> >>      separator=\space,
> >>      groupsize=4,       % output 3,1415 9265 45
> >>      signspace=,]       % +3.14159...
> >> 
> >> That could even tie into \setuplanguage to allow setting
> >> language-specific defaults. Would anyone be interested in this?
> > 
> > +1 again!
> 
> needs a bit of thinking as when we start this route we get lots of new
> keywords (with the danger of introducing inconsistencies) so first we
> need to collect all potential candidates for such keys (e.g. using
> separator might be too generic )

I don't know if it is possible and can not estimate how much work it 
represents but maybe one can consider to merge the digit part of the \digits 
and \unit code.
The \unit command would then use the same code as the \digit one to format the 
digit part. Then, the \unit code would use a specific code to format the unit 
part.
This would make it possible to configure the digit formatting with one unique 
command for both \unit and \digit and another command would be used to 
configure the formating of the unit part.

-- 
Romain Diss
<romain.d...@yahoo.fr>
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to