Re: [NTG-context] \unit problem with powers of ten.

2012-11-24 Thread Romain Diss
Le samedi 24 novembre 2012, Hans Hagen a écrit :
> On 11/24/2012 1:48 AM, Sietse Brouwer wrote:
> >>> The '^' and 'e' all print a '10 ×' at the begining. It's what is
> >>> expected for
> >>> 'e' but not for '^'. Did I miss something?
> >> 
> >> well, until now ^ and e were equivalent so if that has to change (say ^
> >> no 10) then there need to be agreement about this as it's an
> >> incompatible change
> > 
> > I, for one, would expect 2^3 to mean '2 cubed', not 2x10^3. So I'd be
> > in favour of this change. Then again, I have no code that depends on
> > the old meaning...
> 
> interesting so then we need a list of more ^2 ^3 ^4 ^5 ... and what
> about ^1.2
I don't know everyone's use of \units but for physicists I think that the only 
case where it should be usefull is for 10^something (like \unit{10^-12 second} 
;). Maybe the informaticians need 2^something… The other cases are probably 
marginals.

> then, what will be the escape for the texlike 2^3? maybe $2^3$, so $
> will leave scanning mode
That's already working and this should be the way when one need something 
unusual. Maybe a support for \m{} should be usefull for those who do not use 
$...$ anymore. For the moment nested curly brackets aren't supported inside a 
\m{} which himself is inside a \unit{}.

All the best.


-- 
Romain Diss

___
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] \unit problem with powers of ten.

2012-11-24 Thread Hans Hagen

On 11/24/2012 1:48 AM, Sietse Brouwer wrote:

The '^' and 'e' all print a '10 ×' at the begining. It's what is expected
for
'e' but not for '^'. Did I miss something?



well, until now ^ and e were equivalent so if that has to change (say ^ no
10) then there need to be agreement about this as it's an incompatible
change


I, for one, would expect 2^3 to mean '2 cubed', not 2x10^3. So I'd be
in favour of this change. Then again, I have no code that depends on
the old meaning...


interesting so then we need a list of more ^2 ^3 ^4 ^5 ... and what 
about ^1.2


then, what will be the escape for the texlike 2^3? maybe $2^3$, so $ 
will leave scanning mode


the 2^3 is probably not used that much


--Sietse

P.s. Isn't MkIV known to be unstable? I thought the official advice
was "If you want stability, use (a) MkII, or (b) a stable version of
MkIV, or (c) a dedicated standalone install that you do not update.


so you want instability to be a leading design principle ... i'll think 
about it


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] \unit problem with powers of ten.

2012-11-23 Thread Romain Diss
Le samedi 24 novembre 2012, Sietse Brouwer a écrit :
> > > The '^' and 'e' all print a '10 ×' at the begining. It's what is
> > > expected for
> > > 'e' but not for '^'. 
> >
> > well, until now ^ and e were equivalent so if that has to change (say ^
> > no 10) then there need to be agreement about this as it's an
> > incompatible change
> 
> I, for one, would expect 2^3 to mean '2 cubed', not 2x10^3. So I'd be
> in favour of this change. Then again, I have no code that depends on
> the old meaning...
Of course, I'm also in favour of 2^3 to mean '2 cubed'.

-- 
Romain Diss

___
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] \unit problem with powers of ten.

2012-11-23 Thread Sietse Brouwer
>> The '^' and 'e' all print a '10 ×' at the begining. It's what is expected
>> for
>> 'e' but not for '^'. Did I miss something?
>
>
> well, until now ^ and e were equivalent so if that has to change (say ^ no
> 10) then there need to be agreement about this as it's an incompatible
> change

I, for one, would expect 2^3 to mean '2 cubed', not 2x10^3. So I'd be
in favour of this change. Then again, I have no code that depends on
the old meaning...
--Sietse

P.s. Isn't MkIV known to be unstable? I thought the official advice
was "If you want stability, use (a) MkII, or (b) a stable version of
MkIV, or (c) a dedicated standalone install that you do not update.
___
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] \unit problem with powers of ten.

2012-11-23 Thread Hans Hagen

On 11/23/2012 8:25 PM, Romain Diss wrote:

Hi,

Le jeudi 22 novembre 2012, Hans Hagen a écrit :

On 11/19/2012 11:44 PM, Romain Diss wrote:

Hi all,

I got some problems to express powers of ten in the \unit command. See
the strange behaviour with these two minimal examples.

\starttext
\unit{10^2 meter}\\
\unit{10^{-12} second}
\stoptext
Is this a bug or are these expressions not supported?


not supported .. i've added it to the upcoming beta:

Thank you very much.


needs testing as usual (and wiki adaption as well)

I have upgraded my context version few minutes ago:
$ context --version
mtx-context | ConTeXt Process Management 0.60
mtx-context | current version: 2012.11.23 17:35

but your following code doesn't work completely:


\starttext

\startlines
\unit{10^12 meter}
\unit{10^{-12} second}
\unit{10^{12} second}
\unit{10e12 meter}
\unit{10e{-12} second}
\unit{10e{12} second}
\stoplines

\stoptext


The '^' and 'e' all print a '10 ×' at the begining. It's what is expected for
'e' but not for '^'. Did I miss something?


well, until now ^ and e were equivalent so if that has to change (say ^ 
no 10) then there need to be agreement about this as it's an 
incompatible change


i only added support for {..}

-
  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] \unit problem with powers of ten.

2012-11-23 Thread Romain Diss
Hi,

Le jeudi 22 novembre 2012, Hans Hagen a écrit :
> On 11/19/2012 11:44 PM, Romain Diss wrote:
> > Hi all,
> > 
> > I got some problems to express powers of ten in the \unit command. See
> > the strange behaviour with these two minimal examples.
> > 
> > \starttext
> > \unit{10^2 meter}\\
> > \unit{10^{-12} second}
> > \stoptext
> > Is this a bug or are these expressions not supported?
> 
> not supported .. i've added it to the upcoming beta:
Thank you very much.

> needs testing as usual (and wiki adaption as well)
I have upgraded my context version few minutes ago:
$ context --version
mtx-context | ConTeXt Process Management 0.60
mtx-context | current version: 2012.11.23 17:35

but your following code doesn't work completely:

> \starttext
> 
> \startlines
> \unit{10^12 meter}
> \unit{10^{-12} second}
> \unit{10^{12} second}
> \unit{10e12 meter}
> \unit{10e{-12} second}
> \unit{10e{12} second}
> \stoplines
> 
> \stoptext

The '^' and 'e' all print a '10 ×' at the begining. It's what is expected for 
'e' but not for '^'. Did I miss something?

-- 
Romain Diss

___
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] \unit problem with powers of ten.

2012-11-23 Thread Sietse Brouwer
> needs testing as usual (and wiki adaption as well)

http://wiki.contextgarden.net/Command/unit

Wiki: adapted. (Page created, actually, as there was none.) Using the
fancy-schmancy {{since|2012|text=nov 2012}} template, which (1) marks
this as a recent feature, and as such not in the stable yet, and
(2) sticks it in the hidden categories [Since] and [Since 2012], so
that we may review (and remove) those tags when the new stable comes
out next year.

--Sietse

On Thu, Nov 22, 2012 at 7:09 PM, Hans Hagen  wrote:
> On 11/19/2012 11:44 PM, Romain Diss wrote:
>>
>> Hi all,
>>
>> I got some problems to express powers of ten in the \unit command. See the
>> strange behaviour with these two minimal examples.
>>
>> \starttext
>> \unit{10^2 meter}\\
>> \unit{10^{-12} second}
>> \stoptext
>>
>> However, there is no problem with this one: \unit{1e-4 kilogram}.
>>
>> Is this a bug or are these expressions not supported?
>
>
> not supported .. i've added it to the upcoming beta:
>
> \starttext
>
> \startlines
> \unit{10^12 meter}
> \unit{10^{-12} second}
> \unit{10^{12} second}
> \unit{10e12 meter}
> \unit{10e{-12} second}
> \unit{10e{12} second}
> \stoplines
>
> \stoptext
>
> needs testing as usual (and wiki adaption as well)
>
> 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
> ___
___
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] \unit problem with powers of ten.

2012-11-22 Thread Hans Hagen

On 11/19/2012 11:44 PM, Romain Diss wrote:

Hi all,

I got some problems to express powers of ten in the \unit command. See the
strange behaviour with these two minimal examples.

\starttext
\unit{10^2 meter}\\
\unit{10^{-12} second}
\stoptext

However, there is no problem with this one: \unit{1e-4 kilogram}.

Is this a bug or are these expressions not supported?


not supported .. i've added it to the upcoming beta:

\starttext

\startlines
\unit{10^12 meter}
\unit{10^{-12} second}
\unit{10^{12} second}
\unit{10e12 meter}
\unit{10e{-12} second}
\unit{10e{12} second}
\stoplines

\stoptext

needs testing as usual (and wiki adaption as well)

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] \unit problem with powers of ten.

2012-11-22 Thread luigi scarso
At least me have seen your post and tried some solutions, but nothing
useful


On Thu, Nov 22, 2012 at 3:45 PM, Romain Diss  wrote:

> Hi all,
>
> Le mardi 20 novembre 2012, Romain Diss a écrit :
> > Le lundi 19 novembre 2012, Romain Diss a écrit :
> > > I got some problems to express powers of ten in the \unit command. See
> > > the strange behaviour with these two minimal examples.
> > >
> > > \starttext
> > > \unit{10^2 meter}\\
> > > \unit{10^{-12} second}
> > > \stoptext
> > > Is this a bug or are these expressions not supported?
> >
> > I'm not an expert neither in TeX nor Lua, but I quickly glance at the
> > source code (phys-dim.*) and here is what I understand:
> > — the brackets { } are not recognized (a comment in the lua code
> mentioned
> > it), so \unit{10^{-12} second} should be \unit{10^-12 second};
> > — the hat sign '^' is recognized as 'e' so it means "… times ten to the
> > power…" instead of "to the power…" as one should expect.
> >
> > So I come back to my problem. I want to write 10⁻¹² s (ten to the
> negative
> > twelfth power second). Actually, I'm typing \math{10^{-12} \unit{second}}
> > but I'd prefer to type \unit{10^-12 second} (for coherence). Is it
> > possible to modify phys-dim.lua in that way or is this to much work (I
> > have no idea if this is a matter of changing one line or a hundred lines
> > in phys-dim.lua. Maybe also this is a too specific request, I don't know…
>
> Nobody seems very enthusiastic concerning this thread so I tried to go
> further
> in the comprehension of the phys-dim.lua code. I now have found an
> approximate
> solution to my problem :
> \unit{$10^{-12}$ second}
> give the right result. It is not very satisfactory because I'm now used to
> use
> \m{} instead of $ $. In the phys-dim.lua code, the line 64 shows that \m{}
> can
> be used inside \unit{} but this doesn't work for:
> \unit{\m{10^{-12}} second}
> because the pattern doesn't handle nested curly braces.
>
> Is there any Lua expert to find a pattern to handle exponents?
>
> Thank you.
>
> --
> Romain Diss
> 
>
> ___
> 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
>
> ___
>



-- 
luigi
___
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] \unit problem with powers of ten.

2012-11-22 Thread Romain Diss
Hi all,

Le mardi 20 novembre 2012, Romain Diss a écrit :
> Le lundi 19 novembre 2012, Romain Diss a écrit :
> > I got some problems to express powers of ten in the \unit command. See
> > the strange behaviour with these two minimal examples.
> > 
> > \starttext
> > \unit{10^2 meter}\\
> > \unit{10^{-12} second}
> > \stoptext
> > Is this a bug or are these expressions not supported?
> 
> I'm not an expert neither in TeX nor Lua, but I quickly glance at the
> source code (phys-dim.*) and here is what I understand:
> — the brackets { } are not recognized (a comment in the lua code mentioned
> it), so \unit{10^{-12} second} should be \unit{10^-12 second};
> — the hat sign '^' is recognized as 'e' so it means "… times ten to the
> power…" instead of "to the power…" as one should expect.
> 
> So I come back to my problem. I want to write 10⁻¹² s (ten to the negative
> twelfth power second). Actually, I'm typing \math{10^{-12} \unit{second}}
> but I'd prefer to type \unit{10^-12 second} (for coherence). Is it
> possible to modify phys-dim.lua in that way or is this to much work (I
> have no idea if this is a matter of changing one line or a hundred lines
> in phys-dim.lua. Maybe also this is a too specific request, I don't know…

Nobody seems very enthusiastic concerning this thread so I tried to go further 
in the comprehension of the phys-dim.lua code. I now have found an approximate 
solution to my problem :
\unit{$10^{-12}$ second}
give the right result. It is not very satisfactory because I'm now used to use 
\m{} instead of $ $. In the phys-dim.lua code, the line 64 shows that \m{} can 
be used inside \unit{} but this doesn't work for:
\unit{\m{10^{-12}} second}
because the pattern doesn't handle nested curly braces.

Is there any Lua expert to find a pattern to handle exponents?

Thank you.

-- 
Romain Diss

___
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] \unit problem with powers of ten.

2012-11-20 Thread Romain Diss
Le lundi 19 novembre 2012, Romain Diss a écrit :
> I got some problems to express powers of ten in the \unit command. See the
> strange behaviour with these two minimal examples.
> 
> \starttext
> \unit{10^2 meter}\\
> \unit{10^{-12} second}
> \stoptext
> Is this a bug or are these expressions not supported?

I'm not an expert neither in TeX nor Lua, but I quickly glance at the source 
code (phys-dim.*) and here is what I understand:
— the brackets { } are not recognized (a comment in the lua code mentioned 
it), so \unit{10^{-12} second} should be \unit{10^-12 second};
— the hat sign '^' is recognized as 'e' so it means "… times ten to the 
power…" instead of "to the power…" as one should expect.

So I come back to my problem. I want to write 10⁻¹² s (ten to the negative 
twelfth power second). Actually, I'm typing \math{10^{-12} \unit{second}} but 
I'd prefer to type \unit{10^-12 second} (for coherence). Is it possible to 
modify phys-dim.lua in that way or is this to much work (I have no idea if 
this is a matter of changing one line or a hundred lines in phys-dim.lua. 
Maybe also this is a too specific request, I don't know…

Anyway, thank you in advance.

All the best.

-- 
Romain Diss

___
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] \unit problem with powers of ten.

2012-11-19 Thread Romain Diss
Hi all,

I got some problems to express powers of ten in the \unit command. See the 
strange behaviour with these two minimal examples.

\starttext
\unit{10^2 meter}\\
\unit{10^{-12} second}
\stoptext

However, there is no problem with this one: \unit{1e-4 kilogram}.

Is this a bug or are these expressions not supported?

Thanks.

-- 
Romain Diss

___
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] \unit problem

2011-11-03 Thread Romain Diss
Hello all,

It seems that some unit combinations don't work very well with the \unit 
macro. I have some problems with the m- (milli-) prefix but some tests reveal 
other strange errors.

Here is a not so minimal example. The first 33 entries come from "phys-
dim.mkiv" and work well. In the entries 100 to 115 which I added, the 102, 
107, 108, 109, 110, 111, 112 and 115 cause problem :

 \starttext
\startbuffer
01: $10\unit{km/h}$
02: $\unit{10  km/h}$
03: \unit{km/h}
04: \unit{10 km/h}
05: \unit{10 km/h}
06: \unit{~1 km/h}
07: 10\unit{km/h}
08: 10 \unit{km/h}
09: $10 \unit{km/h}$
10: 10 \unit{KiloMeter/Hour}
11: 10 \unit{kilometer/hour}
12: 10 \unit{km/h}
13: 10 \unit{kilometer per hour}
14: 10 \unit{km / h}
15: 10 \unit{ km / h }
16: 10 \unit{km/ms2}
17: 10 \unit{meter per second}
18: 10 \unit{cubic meter}
19: 10 \unit{cubic meter per second}
21: 10 \unit{cubic meter / second}
22: $10 \unit{cubic meter / second}$
23: 30 \unit{kilo pascal }
24: 30 \unit{kilo pascal square meter / second}
25: 30 \unit{kilo pascal square meter / kelvin second}
26: \unit{30 kilo pascal square meter / kelvin second}
27: $30 \unit{kilo pascal square meter / kelvin second }$
28: 30 \unit{crap}
29: 30 \unit{AC}
30: $\frac{10 \unit{m/s}}{20 \unit{m/s}} $
31: {\ss 30 \unit{kilo pascal square meter / second kelvin}}
32: \unit{123.22^-3 km/s}
33: \unit{123.22e-3 km/s}

100: \unit{10 mm}
101: \unit{10 km}
102: \unit{10,2 mA}
103: \unit{123 kA}
104: \unit{0,001 MA}
105: \unit{1 dal}
106: \unit{2.21 GW}
107: \unit{345 mW}
108: \unit{152.20 mHz}
109: \unit{55.5 mmol}
110: \unit{6.7 mol/l}
111: \unit{125 g/l}
112: \unit{125 g / l}
113: \unit{125 km/s}
114: \unit{125 m/s}
115: \unit{125 mA/s}
\stopbuffer

\typebuffer

Result: \startlines \getbuffer \stoplines
\stoptext


Thank you for your help.

-- 
Romain Diss

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