Re: [NTG-context] \digits get \times instead of \cdot before exponent

2013-05-22 Thread Hans Hagen

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 )


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \digits get \times instead of \cdot before exponent

2013-05-22 Thread Romain Diss
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
___


[NTG-context] \digits get \times instead of \cdot before exponent

2013-05-21 Thread Christian Prim
Hi,

is it possible to change the behaviour of \digits to have \cdot as in
http://www.pragma-ade.com/general/magazines/mag-0003.pdf page 2 (table at
the bottom) instead of \times as shown in the latest units-mkiv-document
http://www.pragma-ade.com/general/manuals/units-mkiv.pdf pages 67?

Thanks for your advise
Christian Prim

Example:

\unit{10.5e3 Newton} should produce 10.5\cdot 10^3 N and not  10.5\times
10^3 N

(also tested in the latest version at http://live.contextgarden.net/)
___
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
___

Re: [NTG-context] \digits get \times instead of \cdot before exponent

2013-05-21 Thread Romain Diss
Le lundi 20 mai 2013, Christian Prim a écrit :
 is it possible to change the behaviour of \digits to have \cdot as in
 http://www.pragma-ade.com/general/magazines/mag-0003.pdf page 2 (table at
 the bottom) instead of \times as shown in the latest units-mkiv-document
 http://www.pragma-ade.com/general/manuals/units-mkiv.pdf pages 67?
Seems to be hardcoded in phys-dim.mkiv for the moment:
l. 173-175

\unexpanded\def\digitspower   #1{\times10\phys_digits_raised{#1}}
\unexpanded\def\digitspowerplus   
#1{\times10\phys_digits_raised{\digitsplus#1}}
\unexpanded\def\digitspowerminus  
#1{\times10\phys_digits_raised{\digitsminus#1}}
ntextgarden.net/)



-- 
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
___

Re: [NTG-context] \digits get \times instead of \cdot before exponent

2013-05-21 Thread Hans Hagen

On 5/21/2013 11:44 AM, Romain Diss wrote:

Le lundi 20 mai 2013, Christian Prim a écrit :

is it possible to change the behaviour of \digits to have \cdot as in
http://www.pragma-ade.com/general/magazines/mag-0003.pdf page 2 (table at
the bottom) instead of \times as shown in the latest units-mkiv-document
http://www.pragma-ade.com/general/manuals/units-mkiv.pdf pages 67?

Seems to be hardcoded in phys-dim.mkiv for the moment:
l. 173-175

\unexpanded\def\digitspower   #1{\times10\phys_digits_raised{#1}}
\unexpanded\def\digitspowerplus
#1{\times10\phys_digits_raised{\digitsplus#1}}
\unexpanded\def\digitspowerminus
#1{\times10\phys_digits_raised{\digitsminus#1}}
ntextgarden.net/)


there are several ways we can deal with this:

% \def\digitstimessymbol{\symbol[units][times]}

% \definesymbol[units][times][\times]
% \definesymbol[units][times][\cdots]
% \definesymbol[units][times][\kern.2\emwidth\cdot\kern.2\emwidth]

\def\digitstimessymbol{\times}
\def\digitstimessymbol{\cdot}
\def\digitstimessymbol{\kern.2\emwidth\cdot\kern.2\emwidth}

\unprotect

\unexpanded\def\digitspower 
#1{\digitstimessymbol10\phys_digits_raised{#1}}
\unexpanded\def\digitspowerplus 
#1{\digitstimessymbol10\phys_digits_raised{\digitsplus#1}}
\unexpanded\def\digitspowerminus 
#1{\digitstimessymbol10\phys_digits_raised{\digitsminus#1}}


\protect

or maybe a key/value in setuptimes .. not sure yet

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \digits get \times instead of \cdot before exponent

2013-05-21 Thread Christian Prim
Thanks for the tip Hans,

but the kerning in
\def\digitstimessymbol{\kern.**2\emwidth\cdot\kern.2\emwidth}
should not take place in mathmode, only in textmode. Else the space is too
big. Don't know how to deal with that.

Christian


2013/5/21 Hans Hagen pra...@wxs.nl

 On 5/21/2013 11:44 AM, Romain Diss wrote:

 Le lundi 20 mai 2013, Christian Prim a écrit :

 is it possible to change the behaviour of \digits to have \cdot as in
 http://www.pragma-ade.com/**general/magazines/mag-0003.pdfhttp://www.pragma-ade.com/general/magazines/mag-0003.pdfpage
  2 (table at
 the bottom) instead of \times as shown in the latest units-mkiv-document
 http://www.pragma-ade.com/**general/manuals/units-mkiv.pdfhttp://www.pragma-ade.com/general/manuals/units-mkiv.pdfpages
  67?

 Seems to be hardcoded in phys-dim.mkiv for the moment:
 l. 173-175

 \unexpanded\def\digitspower   #1{\times10\phys_digits_**raised{#1}}
 \unexpanded\def\**digitspowerplus
 #1{\times10\phys_digits_**raised{\digitsplus#1}}
 \unexpanded\def\**digitspowerminus
 #1{\times10\phys_digits_**raised{\digitsminus#1}}
 ntextgarden.net/)


 there are several ways we can deal with this:

 % \def\digitstimessymbol{\**symbol[units][times]}

 % \definesymbol[units][times][\**times]
 % \definesymbol[units][times][\**cdots]
 % \definesymbol[units][times][\**kern.2\emwidth\cdot\kern.2\**emwidth]

 \def\digitstimessymbol{\times}
 \def\digitstimessymbol{\cdot}
 \def\digitstimessymbol{\kern.**2\emwidth\cdot\kern.2\emwidth}

 \unprotect

 \unexpanded\def\digitspower #1{\digitstimessymbol10\phys_**
 digits_raised{#1}}
 \unexpanded\def\**digitspowerplus #1{\digitstimessymbol10\phys_**
 digits_raised{\digitsplus#1}}
 \unexpanded\def\**digitspowerminus #1{\digitstimessymbol10\phys_**
 digits_raised{\digitsminus#1}}

 \protect

 or maybe a key/value in setuptimes .. not sure yet

 Hans


 --**--**-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 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 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/http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 __**__**
 ___

___
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
___

Re: [NTG-context] \digits get \times instead of \cdot before exponent

2013-05-21 Thread Hans Hagen

On 5/21/2013 5:15 PM, Christian Prim wrote:

Thanks for the tip Hans,

but the kerning in
\def\digitstimessymbol{\kern.__2\emwidth\cdot\kern.2\emwidth} should not
take place in mathmode, only in textmode. Else the space is too big.
Don't know how to deal with that.


\def\digitstimessymbol{\mathortext{\cdot}{\kern.2\emwidth\cdot\kern.2\emwidth}}

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \digits get \times instead of \cdot before exponent

2013-05-21 Thread Christian Prim
Now it's perfect! Will this be included in the next version of context?

Christian


2013/5/21 Hans Hagen pra...@wxs.nl

 On 5/21/2013 5:15 PM, Christian Prim wrote:

 Thanks for the tip Hans,

 but the kerning in
 \def\digitstimessymbol{\kern._**_2\emwidth\cdot\kern.2\**emwidth} should
 not

 take place in mathmode, only in textmode. Else the space is too big.
 Don't know how to deal with that.


 \def\digitstimessymbol{\**mathortext{\cdot}{\kern.2\**
 emwidth\cdot\kern.2\emwidth}}


 --**--**-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 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 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/http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 __**__**
 ___

___
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
___

Re: [NTG-context] \digits get \times instead of \cdot before exponent

2013-05-21 Thread Sietse Brouwer
Hi Hans,

Christian Prim wrote:

 is it possible to change the behaviour of \digits to have \cdot [...]
 instead of \times [...]?

Hans wrote:
 there are several ways we can deal with this: [...]
 or maybe a key/value in setuptimes .. not sure yet

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
]

Cheers,
Sietse

---

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?
___
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
___


Re: [NTG-context] \digits get \times instead of \cdot before exponent

2013-05-21 Thread Romain Diss
 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!

-- 
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
___


Re: [NTG-context] Digits-Module in tabulate does not work

2011-06-12 Thread yoraxe
Am 09.06.2011 23:16, schrieb Wolfgang Schuster:
 I guess the \pm has to be in $$. If I type

 \NN (30$\pm$3)e-3

 there's 'e-3' in the pdf-file again. The \NN somewhere between the digit
 only creates a big space (new column).

 Sorry for being so slow on the uptake.
 
 The \NN column expects a valid \digits argument but your code isn’t supported.
 You can now resort to math mode or write your own digits code.

Sad, that this isn't supported. I think this is a very popular notation.
I'm not that skilled until now to write my own code.
Woud be nice, if someone, who also uses this, could give an example how
to reach an easy success without typing something like $\cdot 10^{-3}$.

So far so good.

Yoraxe
___
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
___


[NTG-context] Digits-Module in tabulate does not work

2011-06-09 Thread yoraxe
Hi,

I'm using the digit-module and enjoy, that I get a nice output using the
following:

\starttext
\digits{30e-3}
\stoptext

instead of

\starttext
$30 \cdot 10^{-3}$ or $30 ⋅ 10^{-3}$
\stoptext

But now I'm wondering why this module does not work in the
tabulate-environment with:

\starttabulate[|l|l]
\HL
\NC first \NC second \AR
\HL
\NC \digits{30e-3}\NC \digits{30e+3} \AR
\HL
\stoptabulate

In the pdf-file now appears only 30e-3.

Thanks,

Yoraxe
___
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
___

Re: [NTG-context] Digits-Module in tabulate does not work

2011-06-09 Thread Wolfgang Schuster

Am 09.06.2011 um 22:24 schrieb yoraxe:

 Hi,
 
 I'm using the digit-module and enjoy, that I get a nice output using the
 following:
 
 \starttext
 \digits{30e-3}
 \stoptext
 
 instead of
 
 \starttext
 $30 \cdot 10^{-3}$ or $30 ⋅ 10^{-3}$
 \stoptext
 
 But now I'm wondering why this module does not work in the
 tabulate-environment with:
 
 \starttabulate[|l|l]
 \HL
 \NC first \NC second \AR
 \HL
 \NC \digits{30e-3}\NC \digits{30e+3} \AR
 \HL
 \stoptabulate
 
 In the pdf-file now appears only 30e-3.

\starttext

\starttabulate[|l|l|]
\HL
\NC first \NC second \NC\NR
\HL
\NN 30e-3 \NN 30e+3  \NC\NR
\HL
\stoptabulate

\stoptext

Wolfgang

___
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
___

Re: [NTG-context] Digits-Module in tabulate does not work

2011-06-09 Thread yoraxe
Am 09.06.2011 22:31, schrieb Wolfgang Schuster:
 Am 09.06.2011 um 22:24 schrieb yoraxe:

   
 Hi,

 I'm using the digit-module and enjoy, that I get a nice output using the
 following:

 \starttext
 \digits{30e-3}
 \stoptext

 instead of

 \starttext
 $30 \cdot 10^{-3}$ or $30 ⋅ 10^{-3}$
 \stoptext

 But now I'm wondering why this module does not work in the
 tabulate-environment with:

 \starttabulate[|l|l]
 \HL
 \NC first \NC second \AR
 \HL
 \NC \digits{30e-3}\NC \digits{30e+3} \AR
 \HL
 \stoptabulate

 In the pdf-file now appears only 30e-3.
 
 \starttext

 \starttabulate[|l|l|]
 \HL
 \NC first \NC second \NC\NR
 \HL
 \NN 30e-3 \NN 30e+3  \NC\NR
 \HL
 \stoptabulate

 \stoptext

 Wolfgang
   
Thanks. That was very easy. But where do I have to put the \NN when I
use something like

(30 \pm 3)e-3

?

I guess the \pm has to be in $$. If I type

\NN (30$\pm$3)e-3

there's 'e-3' in the pdf-file again. The \NN somewhere between the digit
only creates a big space (new column).

Sorry for being so slow on the uptake.

Yoraxe
___
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
___

Re: [NTG-context] Digits-Module in tabulate does not work

2011-06-09 Thread Wolfgang Schuster

Am 09.06.2011 um 23:00 schrieb yoraxe:

 Thanks. That was very easy. But where do I have to put the \NN when I use 
 something like
 
 (30 \pm 3)e-3
 
 ?

The \NN command is place of the \NC command and adding another one will only 
start a new column.

 I guess the \pm has to be in $$. If I type
 
 \NN (30$\pm$3)e-3
 
 there's 'e-3' in the pdf-file again. The \NN somewhere between the digit
 only creates a big space (new column).
 
 Sorry for being so slow on the uptake.

The \NN column expects a valid \digits argument but your code isn’t supported.
You can now resort to math mode or write your own digits code.

Wolfgang

___
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
___


[NTG-context] \digits

2009-02-24 Thread Wolfgang Schuster
On Sun, Feb 15, 2009 at 5:04 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:
 Hi,

 the \digits command cause a error message with the last beta in MkIV.


 % engine=luatex
 \starttext
 \digits{1.000}
 \stoptext


 ! \textfont 1 is undefined (character :).
 \mathematics #1-\relax \ifmmode #1\else $#1$
                                             \fi
 \doscandigit ...\digitoutputmode ,\else .\fi \fi }
                                                  \egroup
 \digitsep ...x \digitsepbox \hbox {\doscandigit #1
                                                  }\fi \chardef \skipdigit
 0...
 \scandigits #1-\if #1.\digitsep 1
                                  \else \if #1,\digitsep 2\else \if
 #...@\digi...
 \next *#1-\dododohandletokens {#1}
                                   \dohandletokens
 argument 1.
             000
 ...
 l.3 \digits{1.000}


 Best regards,
 Wolfgang
___
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
___


Re: [NTG-context] \digits

2009-02-24 Thread Taco Hoekwater

Wolfgang Schuster wrote:

On Sun, Feb 15, 2009 at 5:04 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

Hi,

the \digits command cause a error message with the last beta in MkIV.


This took much more longer than it should. In supp-num.tex, there is
this definition:

\def\dohandledigits
  {\mathcode`\,=013B \mathcode`\.=013A % pretty hard coded
   \expandafter\handletokens\collecteddigits\with\scandigits
   \ifcase\powerdigits\else\digitpowerseparator^{\savedpowerdigits}\fi}


which is causing the trouble. I assume this is just to move them out of
the way, so replacing the two ones with zeroes probably works (?).

Best wishes,
Taco
___
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
___


Re: [NTG-context] \digits

2009-02-24 Thread Hans Hagen

Taco Hoekwater wrote:

Wolfgang Schuster wrote:

On Sun, Feb 15, 2009 at 5:04 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

Hi,

the \digits command cause a error message with the last beta in MkIV.


This took much more longer than it should. In supp-num.tex, there is
this definition:

\def\dohandledigits
  {\mathcode`\,=013B \mathcode`\.=013A % pretty hard coded
   \expandafter\handletokens\collecteddigits\with\scandigits
   \ifcase\powerdigits\else\digitpowerseparator^{\savedpowerdigits}\fi}


which is causing the trouble. I assume this is just to move them out of
the way, so replacing the two ones with zeroes probably works (?).


ok, so we need

\startmode[mkiv]

\def\dohandledigits
  {\mathcode`\,=003B \mathcode`\.=003A % pretty hard coded
   \expandafter\handletokens\collecteddigits\with\scandigits
   \ifcase\powerdigits\else\digitpowerseparator^{\savedpowerdigits}\fi}

\stopmode

\startnotmode[mkiv]

\def\dohandledigits
  {\mathcode`\,=013B \mathcode`\.=013A % pretty hard coded
   \expandafter\handletokens\collecteddigits\with\scandigits
   \ifcase\powerdigits\else\digitpowerseparator^{\savedpowerdigits}\fi}

\stopnotmode

it is on my agenda to rewrite digits in lua (we use it at pragma so i 
have a motive)



-
  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
___


Re: [NTG-context] \digits

2003-09-01 Thread Hans Hagen
At 19:59 29/08/2003 +0200, you wrote:
Hello,

while browsing the source, I came across the very nice \digits
macro.
But I have some comments: In my opinion some characters don't look right

\starttext
\digits 123.222,=  % short, OK
\digits 123.222,== % should be em dash (?)
\digits +123.222,22% OK
\digits -123.222,33% too small
\stoptext
The + and - should be the same size.

Any comments?
\def\scandigits#1%
  {\if#1.\digitsep1\else
   \if#1,\digitsep2\else
   [EMAIL PROTECTED] \else
   \if#1_\digitnop \else
   \if#1/\digitsgn{\hphantom{+}}\chardef\skipdigit0\else
   \if#1-\ifcase\skipdigit\digitsgn-\else 
% \skipdigit instead of 
\digitsepbox
   \box\digitsepbox\digitzeroamount \fi\chardef\skipdigit0\else
   \if#1+\digitsgn+\chardef\skipdigit0\else
   \if#1=\box\digitsepbox\digitzeroamount \chardef\skipdigit0\else
   \if#1s\digitsgn{\hphantom{\positive}}\chardef\skipdigit0\else
   \if#1p\digitsgn\positive\chardef\skipdigit0\else
   \if#1m\digitsgn\negative\chardef\skipdigit0\else
   \if#1n\digitsgn\negative\chardef\skipdigit0\else
 \box\digitsepbox 
#1\chardef\skipdigit0\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}

Not that tested -)

Hans
-
  Hans Hagen | PRAGMA ADE | [EMAIL PROTECTED]
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-
   information: http://www.pragma-ade.com/roadmap.pdf
documentation: http://www.pragma-ade.com/showcase.pdf
-
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] \digits

2003-08-29 Thread Patrick Gundlach
Hello, 

while browsing the source, I came across the very nice \digits
macro. 

But I have some comments: In my opinion some characters don't look right

\starttext
\digits 123.222,=  % short, OK
\digits 123.222,== % should be em dash (?)
\digits +123.222,22% OK
\digits -123.222,33% too small
\stoptext

The + and - should be the same size. 

Any comments?

Patrick
-- 
Silent is the goldfish in its bowl
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context