Hi, In the process of extending math export I decided to finish and integrate an old experiment with units. Details can change as can configuration. \usemodule[dimensions] \setupbackend[export=yes] \starttext \startlines $10\su{km/h}$ $\su{10 km/h}$ \su{10 km/h} 10\su{km/h} 10 \su{km/h} $10 \su{km/h}$ 10 \su{KiloMeter/Hour} 10 \su{kilometer/hour} 10 \su{km/h} 10 \su{kilometer per hour} 10 \su{km / h} 10 \su{ km / h } 10 \su{km/ms2} 10 \su{meter per second} 10 \su{cubic meter} 10 \su{cubic meter per second} 10 \su{cubic meter / second} $10 \su{cubic meter / second}$ 30 \su{kilo pascal } 30 \su{kilo pascal square meter / second} 30 \su{kilo pascal square meter / kelvin second} \su{30 kilo pascal square meter / kelvin second} $30 \su{kilo pascal square meter / kelvin second }$ 30 \su{crap} 30 \su{AC} $ \frac{10 \su{m/s}}{20 \su{m/s}} $ {\ss 30 \su{kilo pascal square meter / second kelvin}} \stoplines \stoptext I might decide to push it in the core. The su is an abbreviation for scientific unit as we already have \unit (which I like more) and \dim is also taken. Of course \u would be even nicer but that's a accent placement (ok, we could drop all those as we have utf). Using two character names is not handy as they look like language switches. 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 -----------------------------------------------------------------
Am 11.06.2011 um 16:54 schrieb Hans Hagen:
Hi,
In the process of extending math export I decided to finish and integrate an old experiment with units. Details can change as can configuration.
[...]
I might decide to push it in the core. The su is an abbreviation for scientific unit as we already have \unit (which I like more) and \dim is also taken. Of course \u would be even nicer but that's a accent placement (ok, we could drop all those as we have utf). Using two character names is not handy as they look like language switches.
Nice but i suggest to use \si as name for the command. What’s still missing is a reimplementation of the \digits macro where you have more control about the decimal and thousand separator and a few more options. Wolfgang
2011/6/11 Wolfgang Schuster
Nice but i suggest to use \si as name for the command.
+1
What’s still missing is a reimplementation of the \digits macro where you have more control about the decimal and thousand separator and a few more options.
Also +1, it would be cool to have something similar to siunitx[1] in terms of functionality. Vedran [1] http://mirror.ctan.org/macros/latex/contrib/siunitx/siunitx.pdf
On 11-6-2011 5:23, Vedran Miletić wrote:
Also +1, it would be cool to have something similar to siunitx[1] in terms of functionality.
I don't know that one but I seldom model from something else anyway (no fun and no time to follow all that is around) .. I'd rather improve what we have (and the units module has a rather long history in context). Also, I want to stay away from too much tex hackery as in mkiv we follow a different approach. One thing that I need to add is cultural elements (present in the units module and needed for educational texts etc). 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 -----------------------------------------------------------------
On 11-6-2011 5:12, Wolfgang Schuster wrote:
Am 11.06.2011 um 16:54 schrieb Hans Hagen:
Hi,
In the process of extending math export I decided to finish and integrate an old experiment with units. Details can change as can configuration.
[...]
I might decide to push it in the core. The su is an abbreviation for scientific unit as we already have \unit (which I like more) and \dim is also taken. Of course \u would be even nicer but that's a accent placement (ok, we could drop all those as we have utf). Using two character names is not handy as they look like language switches.
Nice but i suggest to use \si as name for the command.
I don't like that one ... we're not exclusively dealing with si units and it's also a language tag.
What’s still missing is a reimplementation of the \digits macro where you have more control about the decimal and thousand separator and a few more options.
I have a scanner for that as well (needs to be integrated) 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 -----------------------------------------------------------------
Am 12.06.2011 um 12:57 schrieb Hans Hagen:
On 11-6-2011 5:12, Wolfgang Schuster wrote:
Nice but i suggest to use \si as name for the command.
I don't like that one ... we're not exclusively dealing with si units
What a lame excuse, “si” is easier to remember than “su” and even though the code isn’t limited to si units this isn’t a good reason to avoid the name.
and it's also a language tag.
Not for ConTeXt: \starttext \show\si \stoptext
\si=undefined.
Collision between language tags a context commands do exist since a long time, e.g. \sl or \it.
What’s still missing is a reimplementation of the \digits macro where you have more control about the decimal and thousand separator and a few more options.
I have a scanner for that as well (needs to be integrated)
Yes i know you have it also commented in the source but the input is too strict and expect something where you can write 10000.00 and depending on the setup you can get - 10.000,00 - 10\,000.00 - 10\,000,00 - ... as output. Wolfgang
On 12-6-2011 9:15, Wolfgang Schuster wrote:
What a lame excuse, “si” is easier to remember than “su” and even though the code isn’t limited to si units this isn’t a good reason to avoid the name.
I don't like \su either but I needed something that related to \unit (which is what I prefer) but the problem is that one then cannot us the m-units module at the same time. Well, I could save \unit when loading it, and one can wonder if they will be used mixed anyway so we might end up with \unit. We have a \m (inline math) macro and I'd like a one character one for units and digits and these could be \u and \d if we can assume that everyone uses utf (we could make them accent commands while dealing with bibtex).
and it's also a language tag.
Not for ConTeXt:
\starttext \show\si \stoptext
\si=undefined.
anyway, afaik si is relates to slovenian
Collision between language tags a context commands do exist since a long time, e.g. \sl or \it.
which is bad enough (I wonder if we'd have \it as font switch if italian had been needed in an earlier stage -)
Yes i know you have it also commented in the source but the input is too strict and expect something where you can write
not that code, it's specific digits code not yet in the distribution
10000.00
and depending on the setup you can get
- 10.000,00 - 10\,000.00 - 10\,000,00 - ...
currently the units code just uses the predefined number scanner (I needed a quick hack) but it will get the digits scanner 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 -----------------------------------------------------------------
\si=undefined.
anyway, afaik si is relates to slovenian
No, only to Sinhalese. SI is just the country code of Slovenia and doesn't interfere at all.
Collision between language tags a context commands do exist since a long time, e.g.
\sl or \it.
which is bad enough (I wonder if we'd have \it as font switch if italian had been needed in an earlier stage -)
\it for italic is needed by way more people than two-letter code for switching to Italian. I prefer to be able to use \sl for slanted than as a switch to slovenian. I need it approximately two hundred times more often than I need a language switch. Why would it be any different for Italians and what is wrong with \language[sl]/\language[it]? Mojca
On 13-6-2011 12:28, Mojca Miklavec wrote:
On Mon, Jun 13, 2011 at 00:27, Mojca Miklavec
wrote: \si=undefined.
anyway, afaik si is relates to slovenian
No, only to Sinhalese.
not always .... http://en.wikipedia.org/wiki/Country_codes:_S#.C2.A0Slovenia
Oh, btw. \su stands for Sundanese, so I strongly suggest not to use it for units ;)
Mojca ___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On Mon, Jun 13, 2011 at 22:24, Hans Hagen
On 13-6-2011 12:28, Mojca Miklavec wrote:
\si=undefined.
anyway, afaik si is relates to slovenian
No, only to Sinhalese.
not always ....
http://en.wikipedia.org/wiki/Country_codes:_S#.C2.A0Slovenia
No. Always. This is exactly like saying that "be" should refer to Dutch language, that "ch" and "si" should refer to Italian and "it" should refer to German language. I suggest to switch the language code for Dutch into "be" and call the format cont-be :) Mojca
On Tue, Jun 14, 2011 at 12:06 AM, Mojca Miklavec
On Mon, Jun 13, 2011 at 22:24, Hans Hagen
wrote: On 13-6-2011 12:28, Mojca Miklavec wrote:
> \si=undefined.
anyway, afaik si is relates to slovenian
No, only to Sinhalese.
not always ....
http://en.wikipedia.org/wiki/Country_codes:_S#.C2.A0Slovenia
No. Always.
This is exactly like saying that "be" should refer to Dutch language, that "ch" and "si" should refer to Italian and "it" should refer to German language.
I suggest to switch the language code for Dutch into "be" and call the format cont-be :) why not iso 639-3 ? http://www.sil.org/iso639-3/iso-639-3_20110525.ta
-- luigi
On Tue, Jun 14, 2011 at 12:36 AM, luigi scarso
On Tue, Jun 14, 2011 at 12:06 AM, Mojca Miklavec
wrote: On Mon, Jun 13, 2011 at 22:24, Hans Hagen
wrote: On 13-6-2011 12:28, Mojca Miklavec wrote:
>> \si=undefined.
anyway, afaik si is relates to slovenian
No, only to Sinhalese.
not always ....
http://en.wikipedia.org/wiki/Country_codes:_S#.C2.A0Slovenia
No. Always.
This is exactly like saying that "be" should refer to Dutch language, that "ch" and "si" should refer to Italian and "it" should refer to German language.
I suggest to switch the language code for Dutch into "be" and call the format cont-be :) why not iso 639-3 ? http://www.sil.org/iso639-3/iso-639-3_20110525.ta http://www.sil.org/iso639-3/iso-639-3_20110525.tab
-- luigi
On 14-6-2011 12:06, Mojca Miklavec wrote:
This is exactly like saying that "be" should refer to Dutch language,
you mean flemish (as belgium also has french) .. actually belgians always win the language contest so maybe we should switch to be indeed -) (which makes me wonder, as animation movies can come with dutch and flemisch voice over, there must be such significant differences that we might consider flemisch pattern files so it might backfire to you) 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 -----------------------------------------------------------------
On Tue, Jun 14, 2011 at 00:54, Hans Hagen
On 14-6-2011 12:06, Mojca Miklavec wrote:
This is exactly like saying that "be" should refer to Dutch language,
you mean flemish (as belgium also has french) .. actually belgians always win the language contest so maybe we should switch to be indeed -)
<OFFTOPIC> Stop to speak about belgium/flemish/french! It's a too sensitive subject for us here :) </OFFTOPIC>
Am 2011-06-14 um 11:52 schrieb Vnpenguin:
This is exactly like saying that "be" should refer to Dutch language,
you mean flemish (as belgium also has french) .. actually belgians always win the language contest so maybe we should switch to be indeed -)
<OFFTOPIC> Stop to speak about belgium/flemish/french! It's a too sensitive subject for us here :) </OFFTOPIC>
In my saturday newspaper there was an article about the botanical garden in Brussels - seems like they started to define plants and seeds to be either flemish or french. Crazy nationalists! Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
Back on topic... In starting out we often want to write out the units in full - that is the words, not the abbreviations. any chance of implementing these? At the moment I have (crudely, I suspect) a large number of definitions of the kind \define\metre{\;{\tf m}} \define\metrew{\;{\tf metre}} \define\kilometre{\;{\tf km}} \define\kilometrew{\;{\tf kilometre}} \define\millimetre{\;{\tf mm}} \define\millimetrew{\;{\tf millimetre}} \define\centimetre{\;{\tf cm}} \define\centimetrew{\;{\tf centimetre}} Which is *my way* of getting what I wanted - prior to this upgrade... Ian
On 8-7-2011 5:27, Ian Lawrence wrote:
Back on topic...
In starting out we often want to write out the units in full - that is the words, not the abbreviations.
any chance of implementing these? At the moment I have (crudely, I suspect) a large number of definitions of the kind
\define\metre{\;{\tf m}} \define\metrew{\;{\tf metre}} \define\kilometre{\;{\tf km}} \define\kilometrew{\;{\tf kilometre}} \define\millimetre{\;{\tf mm}} \define\millimetrew{\;{\tf millimetre}} \define\centimetre{\;{\tf cm}} \define\centimetrew{\;{\tf centimetre}}
Which is *my way* of getting what I wanted - prior to this upgrade...
we do have \unit {10 km} and \unit {10 kilo meter} etc but currently they expand to km it's no big deal to have the expandable form (slight variation of the old units mechanism) but in mkiv it would be \defineunit[fullunit][...=yes] and then \fullunit{10 km} would that work out ok? 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 -----------------------------------------------------------------
On 13-6-2011 12:27, Mojca Miklavec wrote:
what is wrong with \language[sl]/\language[it]?
Or \language[italian] etc. I think it depends on how often one switches language. I seldom switch fonts mid-document (using \it etc) as normally it is done in an environment. 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 -----------------------------------------------------------------
On 12 juin 2011, at 23:47, Hans Hagen wrote:
On 12-6-2011 9:15, Wolfgang Schuster wrote:
What a lame excuse, “si” is easier to remember than “su” and even though the code isn’t limited to si units this isn’t a good reason to avoid the name.
I don't like \su either but I needed something that related to \unit (which is what I prefer) but the problem is that one then cannot us the m-units module at the same time. Well, I could save \unit when loading it, and one can wonder if they will be used mixed anyway so we might end up with \unit. We have a \m (inline math) macro and I'd like a one character one for units and digits and these could be \u and \d if we can assume that everyone uses utf (we could make them accent commands while dealing with bibtex).
…so why not \SIunit or \siunit?
On 13-6-2011 7:20, Otared Kavian wrote:
…so why not \SIunit or \siunit?
for the moment I'll go for just \unit (maybe with \un as abbreviation) when I'm in the mood I'll make a \siunit : \siunit{1in} will then typeset 0.0254 m or so 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 -----------------------------------------------------------------
Hi Hans, Just out of curioisity I tested your example, but mkiv stopped with the error: ! Undefined control sequence. system > tex > error on line 14 in file units-math-export.tex: Undefined control sequence ... l.14 $10\su {km/h}$ Probably I am being somewhat dumb… since the module « dimenesions » is not present in the minimals. Has one to define \su somewhere? I am reporting this upon using ConTeXt ver: 2011.06.09 12:49 MKIV. Best regards: OK On 11 juin 2011, at 16:54, Hans Hagen wrote:
Hi,
In the process of extending math export I decided to finish and integrate an old experiment with units. Details can change as can configuration.
\usemodule[dimensions] \setupbackend[export=yes]
\starttext
\startlines $10\su{km/h}$ $\su{10 km/h}$ \su{10 km/h} 10\su{km/h} 10 \su{km/h} $10 \su{km/h}$ 10 \su{KiloMeter/Hour} 10 \su{kilometer/hour} 10 \su{km/h} 10 \su{kilometer per hour} 10 \su{km / h} 10 \su{ km / h } 10 \su{km/ms2} 10 \su{meter per second} 10 \su{cubic meter} 10 \su{cubic meter per second} 10 \su{cubic meter / second} $10 \su{cubic meter / second}$ 30 \su{kilo pascal } 30 \su{kilo pascal square meter / second} 30 \su{kilo pascal square meter / kelvin second} \su{30 kilo pascal square meter / kelvin second} $30 \su{kilo pascal square meter / kelvin second }$ 30 \su{crap} 30 \su{AC} $ \frac{10 \su{m/s}}{20 \su{m/s}} $ {\ss 30 \su{kilo pascal square meter / second kelvin}} \stoplines
\stoptext
I might decide to push it in the core. The su is an abbreviation for scientific unit as we already have \unit (which I like more) and \dim is also taken. Of course \u would be even nicer but that's a accent placement (ok, we could drop all those as we have utf). Using two character names is not handy as they look like language switches.
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 ___________________________________________________________________________________
%%%%%%%%%%%%%%%%%% Otared Kavian Département de Mathématiques Université de Versailles Saint-Quentin Bâtiment Fermat 45 avenue des Etats Unis 78035 Versailles cedex Téléphone: +33 1 39 25 46 42 Secrétariat: +33 1 39 25 46 44 Secrétariat: +33 1 39 25 46 46 e-mail: Otared.Kavian@math.uvsq.fr
On 2011-06-12 Otared Kavian
Probably I am being somewhat dumb… since the module « dimenesions » is not present in the minimals. Has one to define \su somewhere? I am reporting this upon using ConTeXt ver: 2011.06.09 12:49 MKIV.
Read the subject ;) And give it a shot with 2011.06.11 16:45 Marco
On 12 juin 2011, at 09:52, Marco wrote:
On 2011-06-12 Otared Kavian
wrote: Probably I am being somewhat dumb… since the module « dimenesions » is not present in the minimals. Has one to define \su somewhere? I am reporting this upon using ConTeXt ver: 2011.06.09 12:49 MKIV.
Read the subject ;)
And give it a shot with 2011.06.11 16:45
Marco
Thanks… I didn't notice the new beta yesterday. Indeed it works as expected, and it's great! Best regards: OK
participants (10)
-
Hans Hagen
-
Henning Hraban Ramm
-
Ian Lawrence
-
luigi scarso
-
Marco
-
Mojca Miklavec
-
Otared Kavian
-
Vedran Miletić
-
Vnpenguin
-
Wolfgang Schuster