Re: [NTG-context] Units fonts and spacing

2010-09-12 Thread Hans Hagen

On 11-9-2010 4:00, Wolfgang Schuster wrote:


Am 11.09.2010 um 11:33 schrieb Hans Hagen:


Will siunits module be used as a base for this or will this be
something completely new?


I don't know what you mean with siunits. Wolfgangs module?  We have unit 
support in context for along time (also as part of some mathml extensions). So, 
we're more talking of an upgrade of the current module (units and digits) and I 
will have a look at Wolfgangs code to see what additional support is in there 
and we can merge things if needed.


He’s talking about my module. The difference between our modules is that your 
use “10 \Meter \Per \Second” for the input while i use 
”\siunit{10\meter\per\second}”.


ah, so you explicitly tag the unit

one reason why I didn't do this is that it does not integrate well in 
math at that time (superscripts etc) and the mechanism was mainly meant 
for schoolbooks (and strongly related to mathml input as well)



There is nothing wrong about two modules with the same function as long as both 
do not cause a problem for the module (and i took care of this in my module).


sure


Parts like the number parsing can become part of the core and you provide a 
function which others can use to integrate it in their own macros.


indeed


The fundamentals of units are not going to change much, apart from the fact 
that we can now parse m/s if needed instead of using the verbose names).


I’m not a friend of the ”m/s” input because you can’t say where a units 
starts/ends without adding separators between them, here is a example from 
latex’s siunitx package which supports both methods but although the first is 
shorter we should rely on the tex method


hm, never seen that one (no time to look into it anyway)


- si{kg.m/s^2}
- si{\kilo\gram\metre\per\square\second}


we can provide the first one flagged as unit mode for dummies but it 
will never work out well with


$ a = 123 m/s^2$

so one would always hae to tag the unit then.


Keep in mind that the units module runs on top of synonyms so that one can ask 
for lists of used units and meanings of them.


Adding this function is no problem, synonyms can also be integrated in any 
other system.


yes

let's discuss it at the conference

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] Units fonts and spacing

2010-09-11 Thread Hans Hagen

On 11-9-2010 12:13, Vedran Miletić wrote:

2010/9/10 Hans Hagenpra...@wxs.nl:

Is the new module with the old syntax (10 \Meter etc.) or a new one.


first I'm redoing digits

with regards to the units themselves, we can do both: \Meter \Per \Second
and m/s) .. i'm still considering doing it at the node end .. typical dark
winternight work with a movie/talkshow on tv in the background

Hans


Will siunits module be used as a base for this or will this be
something completely new?


I don't know what you mean with siunits. Wolfgangs module?  We have unit 
support in context for along time (also as part of some mathml 
extensions). So, we're more talking of an upgrade of the current module 
(units and digits) and I will have a look at Wolfgangs code to see what 
additional support is in there and we can merge things if needed.


The fundamentals of units are not going to change much, apart from the 
fact that we can now parse m/s if needed instead of using the verbose 
names).


Keep in mind that the units module runs on top of synonyms so that one 
can ask for lists of used units and meanings of them.


Anyhow, Wolfgang and I will look into it when we have time (and energy) 
so eventually something upgraded will show up.


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] Units fonts and spacing

2010-09-11 Thread Wolfgang Schuster

Am 11.09.2010 um 00:40 schrieb Vedran Miletić:

 To add a bit to this thread: just checked the siunits module, it's
 awesome. Spacing is right, sans font units work out of the box, no
 need for \ after the units and syntax for adding new units is very
 simple.

You should notice the module is beta (i haven't done anything since 10 months)
and more a concept of a new module for units than a working solution.

 I have a couple of questions:
 1. How to change decimal separator and thousand separator?

decimal separator  : decimalpoint=...
thousand separator : thousandsseparator=...

 2. Should'nt \siunit[thousandgroup=4]{1} produce 1 instead of
 1. to be consistent with default thousandgroup=3?

dunno, i’m a least interested where it’s required to set thousandgroup to 4

 3. \ss $\siunit{\square\kilo\meter}$ will produce all roman, but
 square will be sans. Why?

The module is configured to produce roman text, the number can be a side effect 
of math mode

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] Units fonts and spacing

2010-09-11 Thread Wolfgang Schuster

Am 11.09.2010 um 11:33 schrieb Hans Hagen:

 Will siunits module be used as a base for this or will this be
 something completely new?
 
 I don't know what you mean with siunits. Wolfgangs module?  We have unit 
 support in context for along time (also as part of some mathml extensions). 
 So, we're more talking of an upgrade of the current module (units and digits) 
 and I will have a look at Wolfgangs code to see what additional support is in 
 there and we can merge things if needed.

He’s talking about my module. The difference between our modules is that your 
use “10 \Meter \Per \Second” for the input while i use 
”\siunit{10\meter\per\second}”.

There is nothing wrong about two modules with the same function as long as both 
do not cause a problem for the module (and i took care of this in my module).

Parts like the number parsing can become part of the core and you provide a 
function which others can use to integrate it in their own macros.

 The fundamentals of units are not going to change much, apart from the fact 
 that we can now parse m/s if needed instead of using the verbose names).

I’m not a friend of the ”m/s” input because you can’t say where a units 
starts/ends without adding separators between them, here is a example from 
latex’s siunitx package which supports both methods but although the first is 
shorter we should rely on the tex method

- si{kg.m/s^2}
- si{\kilo\gram\metre\per\square\second}

 Keep in mind that the units module runs on top of synonyms so that one can 
 ask for lists of used units and meanings of them.

Adding this function is no problem, synonyms can also be integrated in any 
other system.

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] Units fonts and spacing

2010-09-11 Thread Alan BRASLAU
On Saturday 11 September 2010 16:00:58 Wolfgang Schuster wrote:
 
 I’m not a friend of the ”m/s” input because you can’t say where a units
 starts/ends without adding separators between them, here is a example from
 latex’s siunitx package which supports both methods but although the first
 is shorter we should rely on the tex method
 
 - si{kg.m/s^2}
 - si{\kilo\gram\metre\per\square\second}
 

My two bits, for what it is worth...

I have never liked the \kilo\gram\meter\per\square\second
particularly as we now have utf8 input.

To be most readable, kg.m/s² is far superior.
(and to be digestable by non-TeX users, as yes,
I do often share my document source with collegues
who do not use TeX, and they even often edit
them using MS-Word, for example, as a text editor)

I should use some sort of units module,
as writing, as I do, 0{,}2\,nm$^2$ is pretty ugly!

Alan
___
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] Units fonts and spacing

2010-09-11 Thread Wolfgang Schuster

Am 11.09.2010 um 16:24 schrieb Alan BRASLAU:

 My two bits, for what it is worth...
 
 I have never liked the \kilo\gram\meter\per\square\second
 particularly as we now have utf8 input.
 
 To be most readable, kg.m/s² is far superior.
   (and to be digestable by non-TeX users, as yes,
   I do often share my document source with collegues
   who do not use TeX, and they even often edit
   them using MS-Word, for example, as a text editor)
 
 I should use some sort of units module,
 as writing, as I do, 0{,}2\,nm$^2$ is pretty ugly!

We can discuss this next week. It’s also interesting what’s
Hans opinion about different input methods/modules.

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] Units fonts and spacing

2010-09-10 Thread Vedran Miletić
2010/9/9 Wolfgang Schuster schuster.wolfg...@googlemail.com:
 \textdimensionstrue

Awesome. Are there any other useful switches?

-- 
Vedran Miletić
___
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] Units fonts and spacing

2010-09-10 Thread Wolfgang Schuster

Am 10.09.2010 um 10:03 schrieb Vedran Miletić:

 2010/9/9 Wolfgang Schuster schuster.wolfg...@googlemail.com:
 \textdimensionstrue
 
 Awesome. Are there any other useful switches?

Beside \textdimension(true|false) there is \spaceddimensions(true|false)
to add a small space between dimension.

The units module has unlike many other commands and environments in context
not many parameters to change the layout and it will make more sense
to write another module for units which has these options than modifying
the existing one.

With MkIV we have a powerful tool to do this because Lua make it so easy
to parse and format numbers and units, see here: 
http://bitbucket.org/wolfs/units/src/tip/files/

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] Units fonts and spacing

2010-09-10 Thread Hans Hagen

On 10-9-2010 4:58, Wolfgang Schuster wrote:


Am 10.09.2010 um 10:03 schrieb Vedran Miletić:


2010/9/9 Wolfgang Schusterschuster.wolfg...@googlemail.com:

\textdimensionstrue


Awesome. Are there any other useful switches?


Beside \textdimension(true|false) there is \spaceddimensions(true|false)
to add a small space between dimension.

The units module has unlike many other commands and environments in context
not many parameters to change the layout and it will make more sense
to write another module for units which has these options than modifying
the existing one.

With MkIV we have a powerful tool to do this because Lua make it so easy
to parse and format numbers and units, see here: 
http://bitbucket.org/wolfs/units/src/tip/files/


I actually have a mkiv variant somewhere and will pick up that thread soon.

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] Units fonts and spacing

2010-09-10 Thread Wolfgang Schuster

Am 10.09.2010 um 17:01 schrieb Hans Hagen:

 With MkIV we have a powerful tool to do this because Lua make it so easy
 to parse and format numbers and units, see here: 
 http://bitbucket.org/wolfs/units/src/tip/files/
 
 I actually have a mkiv variant somewhere and will pick up that thread soon.


Is the new module with the old syntax (10 \Meter etc.) or a new one.

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] Units fonts and spacing

2010-09-10 Thread Hans Hagen

On 10-9-2010 5:06, Wolfgang Schuster wrote:


Am 10.09.2010 um 17:01 schrieb Hans Hagen:


With MkIV we have a powerful tool to do this because Lua make it so easy
to parse and format numbers and units, see here: 
http://bitbucket.org/wolfs/units/src/tip/files/


I actually have a mkiv variant somewhere and will pick up that thread soon.



Is the new module with the old syntax (10 \Meter etc.) or a new one.


first I'm redoing digits

with regards to the units themselves, we can do both: \Meter \Per 
\Second and m/s) .. i'm still considering doing it at the node end .. 
typical dark winternight work with a movie/talkshow on tv in the 
background


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] Units fonts and spacing

2010-09-10 Thread Vedran Miletić
2010/9/10 Hans Hagen pra...@wxs.nl:
 Is the new module with the old syntax (10 \Meter etc.) or a new one.

 first I'm redoing digits

 with regards to the units themselves, we can do both: \Meter \Per \Second
 and m/s) .. i'm still considering doing it at the node end .. typical dark
 winternight work with a movie/talkshow on tv in the background

 Hans

Will siunits module be used as a base for this or will this be
something completely new?

-- 
Vedran Miletić
___
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] Units fonts and spacing

2010-09-10 Thread Vedran Miletić
To add a bit to this thread: just checked the siunits module, it's
awesome. Spacing is right, sans font units work out of the box, no
need for \ after the units and syntax for adding new units is very
simple.

I have a couple of questions:
1. How to change decimal separator and thousand separator?
2. Should'nt \siunit[thousandgroup=4]{1} produce 1 instead of
1. to be consistent with default thousandgroup=3?
3. \ss $\siunit{\square\kilo\meter}$ will produce all roman, but
square will be sans. Why?

-- 
Vedran Miletić
___
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] Units fonts and spacing

2010-09-09 Thread Vedran Miletić
Hello,

can m-units be made to adjust it's font style to local font?

For example

\usemodule[units]
\starttext
\ss 1 \Bit\Per\Second
\stoptext

will still use serif font for units.

Also, can m-units be set up to use spacing like 1\,\Bit\Per\Second
instead of normal spacing? I saw there are some definitions for that
in m-units.tex, but haven't found a way to activate them.

Thanks,

-- 
Vedran Miletić
___
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] Units fonts and spacing

2010-09-09 Thread Wolfgang Schuster

Am 09.09.2010 um 11:22 schrieb Vedran Miletić:

 Hello,
 
 can m-units be made to adjust it's font style to local font?
 
 For example
 
 \usemodule[units]
 \starttext
 \ss 1 \Bit\Per\Second
 \stoptext
 
 will still use serif font for units.


Add \textdimensionstrue to your preamble.

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
___