* \digits get \times instead of \cdot before exponent @ 2013-05-20 7:32 Christian Prim 2013-05-21 9:44 ` Romain Diss 0 siblings, 1 reply; 10+ messages in thread From: Christian Prim @ 2013-05-20 7:32 UTC (permalink / raw) To: ntg-context [-- Attachment #1.1: Type: text/plain, Size: 495 bytes --] 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 6&7? 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/) [-- Attachment #1.2: Type: text/html, Size: 922 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \digits get \times instead of \cdot before exponent 2013-05-20 7:32 \digits get \times instead of \cdot before exponent Christian Prim @ 2013-05-21 9:44 ` Romain Diss 2013-05-21 14:37 ` Hans Hagen 0 siblings, 1 reply; 10+ messages in thread From: Romain Diss @ 2013-05-21 9:44 UTC (permalink / raw) To: ntg-context 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 6&7? 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.diss@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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \digits get \times instead of \cdot before exponent 2013-05-21 9:44 ` Romain Diss @ 2013-05-21 14:37 ` Hans Hagen 2013-05-21 15:15 ` Christian Prim 2013-05-21 19:17 ` Sietse Brouwer 0 siblings, 2 replies; 10+ messages in thread From: Hans Hagen @ 2013-05-21 14:37 UTC (permalink / raw) To: ntg-context 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 6&7? > 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \digits get \times instead of \cdot before exponent 2013-05-21 14:37 ` Hans Hagen @ 2013-05-21 15:15 ` Christian Prim 2013-05-21 15:34 ` Hans Hagen 2013-05-21 19:17 ` Sietse Brouwer 1 sibling, 1 reply; 10+ messages in thread From: Christian Prim @ 2013-05-21 15:15 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 3045 bytes --] 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 <pragma@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.pdf<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<http://www.pragma-ade.com/general/manuals/units-mkiv.pdf>pages 6&7? >>> >> 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 > ______________________________**______________________________** > _______________________ > [-- Attachment #1.2: Type: text/html, Size: 4861 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \digits get \times instead of \cdot before exponent 2013-05-21 15:15 ` Christian Prim @ 2013-05-21 15:34 ` Hans Hagen 2013-05-21 15:40 ` Christian Prim 0 siblings, 1 reply; 10+ messages in thread From: Hans Hagen @ 2013-05-21 15:34 UTC (permalink / raw) To: ntg-context 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \digits get \times instead of \cdot before exponent 2013-05-21 15:34 ` Hans Hagen @ 2013-05-21 15:40 ` Christian Prim 0 siblings, 0 replies; 10+ messages in thread From: Christian Prim @ 2013-05-21 15:40 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 1555 bytes --] Now it's perfect! Will this be included in the next version of context? Christian 2013/5/21 Hans Hagen <pragma@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 > ______________________________**______________________________** > _______________________ > [-- Attachment #1.2: Type: text/html, Size: 2693 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \digits get \times instead of \cdot before exponent 2013-05-21 14:37 ` Hans Hagen 2013-05-21 15:15 ` Christian Prim @ 2013-05-21 19:17 ` Sietse Brouwer 2013-05-21 21:35 ` Romain Diss 1 sibling, 1 reply; 10+ messages in thread From: Sietse Brouwer @ 2013-05-21 19:17 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \digits get \times instead of \cdot before exponent 2013-05-21 19:17 ` Sietse Brouwer @ 2013-05-21 21:35 ` Romain Diss 2013-05-22 8:29 ` Hans Hagen 0 siblings, 1 reply; 10+ messages in thread From: Romain Diss @ 2013-05-21 21:35 UTC (permalink / raw) To: ntg-context > 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.diss@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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \digits get \times instead of \cdot before exponent 2013-05-21 21:35 ` Romain Diss @ 2013-05-22 8:29 ` Hans Hagen 2013-05-22 12:31 ` Romain Diss 0 siblings, 1 reply; 10+ messages in thread From: Hans Hagen @ 2013-05-22 8:29 UTC (permalink / raw) To: ntg-context 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \digits get \times instead of \cdot before exponent 2013-05-22 8:29 ` Hans Hagen @ 2013-05-22 12:31 ` Romain Diss 0 siblings, 0 replies; 10+ messages in thread From: Romain Diss @ 2013-05-22 12:31 UTC (permalink / raw) To: mailing list for ConTeXt users 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.diss@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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-05-22 12:31 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-05-20 7:32 \digits get \times instead of \cdot before exponent Christian Prim 2013-05-21 9:44 ` Romain Diss 2013-05-21 14:37 ` Hans Hagen 2013-05-21 15:15 ` Christian Prim 2013-05-21 15:34 ` Hans Hagen 2013-05-21 15:40 ` Christian Prim 2013-05-21 19:17 ` Sietse Brouwer 2013-05-21 21:35 ` Romain Diss 2013-05-22 8:29 ` Hans Hagen 2013-05-22 12:31 ` Romain Diss
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).