ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \digits
@ 2003-08-29 17:59 Patrick Gundlach
  2003-08-31 21:48 ` \digits Hans Hagen
  2003-08-31 21:56 ` \digits Hans Hagen
  0 siblings, 2 replies; 8+ messages in thread
From: Patrick Gundlach @ 2003-08-29 17:59 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: \digits
  2003-08-29 17:59 \digits Patrick Gundlach
@ 2003-08-31 21:48 ` Hans Hagen
  2003-08-31 21:56 ` \digits Hans Hagen
  1 sibling, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2003-08-31 21:48 UTC (permalink / raw)


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?


strange bug, some messing up i have to look into

hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       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
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: \digits
  2003-08-29 17:59 \digits Patrick Gundlach
  2003-08-31 21:48 ` \digits Hans Hagen
@ 2003-08-31 21:56 ` Hans Hagen
  2003-09-01 11:01   ` \digits Patrick Gundlach
  1 sibling, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2003-08-31 21:56 UTC (permalink / raw)


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
    \if#1@\digitnop \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 | pragma@wxs.nl
                       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
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: \digits
  2003-08-31 21:56 ` \digits Hans Hagen
@ 2003-09-01 11:01   ` Patrick Gundlach
  2003-09-04 19:42     ` \digits Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick Gundlach @ 2003-09-01 11:01 UTC (permalink / raw)


Hans Hagen <pragma@wxs.nl> writes:


> \def\scandigits#1%


[...]


> Not that tested -)

Looks fine.

Is there a way to increase the length of the dash in 

123,--

Now it looks like a simple "-", I'd like to be able to choose between
"-", "--" and perhaps "---".


Patrick

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: \digits
  2003-09-01 11:01   ` \digits Patrick Gundlach
@ 2003-09-04 19:42     ` Hans Hagen
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2003-09-04 19:42 UTC (permalink / raw)


At 13:01 01/09/2003 +0200, you wrote:
>Hans Hagen <pragma@wxs.nl> writes:
>
>
> > \def\scandigits#1%
>
>
>[...]
>
>
> > Not that tested -)
>
>Looks fine.
>
>Is there a way to increase the length of the dash in
>
>123,--
>
>Now it looks like a simple "-", I'd like to be able to choose between
>"-", "--" and perhaps "---".

you can tweak:

\def\zeroamount{-}
\def\positive  {+}
\def\negative  {-}
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       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
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: \digits
  2009-02-24 21:10 ` \digits Taco Hoekwater
@ 2009-02-24 22:33   ` Hans Hagen
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2009-02-24 22:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Taco Hoekwater wrote:
> Wolfgang Schuster wrote:
>> On Sun, Feb 15, 2009 at 5:04 PM, Wolfgang Schuster
>> <schuster.wolfgang@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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: \digits
  2009-02-24 20:06 \digits Wolfgang Schuster
@ 2009-02-24 21:10 ` Taco Hoekwater
  2009-02-24 22:33   ` \digits Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Taco Hoekwater @ 2009-02-24 21:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wolfgang Schuster wrote:
> On Sun, Feb 15, 2009 at 5:04 PM, Wolfgang Schuster
> <schuster.wolfgang@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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

* \digits
@ 2009-02-24 20:06 Wolfgang Schuster
  2009-02-24 21:10 ` \digits Taco Hoekwater
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2009-02-24 20:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, Feb 15, 2009 at 5:04 PM, Wolfgang Schuster
<schuster.wolfgang@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
> #1@\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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-02-24 22:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-29 17:59 \digits Patrick Gundlach
2003-08-31 21:48 ` \digits Hans Hagen
2003-08-31 21:56 ` \digits Hans Hagen
2003-09-01 11:01   ` \digits Patrick Gundlach
2003-09-04 19:42     ` \digits Hans Hagen
2009-02-24 20:06 \digits Wolfgang Schuster
2009-02-24 21:10 ` \digits Taco Hoekwater
2009-02-24 22:33   ` \digits Hans Hagen

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).