Feature request: \digits command
Hi everyone, The \digits command is really great when it comes to typeset numbers in different languages. However, I miss one functionality from the numprint package in latex: when you type for example $e-5$, you get 10^{-5} (with no dot in front of it). Would it be possible to add an option to \digits to reproduce this? Best wishes, Morgan
On Thu, Jun 19, 2008 at 10:10 PM, Morgan Brassel
Hi everyone,
The \digits command is really great when it comes to typeset numbers in different languages. However, I miss one functionality from the numprint package in latex: when you type for example $e-5$, you get 10^{-5} (with no dot in front of it).
Would it be possible to add an option to \digits to reproduce this?
\starttext \def\digitpowerseparator{10} \digits{e-5} \stoptext http://pragma-ade.com/show-mag-4.htm Regards Wolfgang
Thank you, Wolfgang. I have already read the "This Way" on your link very carefully. In fact, I was looking for a solution to have \digits{e-5} printed as 10^5 \digits{2e-5} printed as 2 . 10^5 Is it possible to do that? to detect if there is a number before the 'e' in \digits? Regards, Morgan Wolfgang Schuster a écrit :
On Thu, Jun 19, 2008 at 10:10 PM, Morgan Brassel
wrote: Hi everyone,
The \digits command is really great when it comes to typeset numbers in different languages. However, I miss one functionality from the numprint package in latex: when you type for example $e-5$, you get 10^{-5} (with no dot in front of it).
Would it be possible to add an option to \digits to reproduce this?
\starttext \def\digitpowerseparator{10} \digits{e-5} \stoptext
http://pragma-ade.com/show-mag-4.htm
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
___________________________________________________________________________________
On Fri, Jun 20, 2008 at 4:10 PM, Morgan Brassel
Thank you, Wolfgang. I have already read the "This Way" on your link very carefully. In fact, I was looking for a solution to have \digits{e-5} printed as 10^5 \digits{2e-5} printed as 2 . 10^5 Is it possible to do that? to detect if there is a number before the 'e' in \digits?
\def\digitpowerseparator {\ifx\collecteddigits\empty 10 \else \cdot10 \fi} \starttext \digits{e-5} \digits{2e-5} \stoptext Regards, Wolfgang
Great, thank you! Maybe this should become the default for the \digits command? Or at least turned on via an option to \digits? I guess this is the wanted behavior for many users, so this should be made accessible easily... But maybe I'm wrong! Best regards, Morgan Wolfgang Schuster a écrit :
On Fri, Jun 20, 2008 at 4:10 PM, Morgan Brassel
wrote: Thank you, Wolfgang. I have already read the "This Way" on your link very carefully. In fact, I was looking for a solution to have \digits{e-5} printed as 10^5 \digits{2e-5} printed as 2 . 10^5 Is it possible to do that? to detect if there is a number before the 'e' in \digits?
\def\digitpowerseparator {\ifx\collecteddigits\empty 10 \else \cdot10 \fi}
\starttext
\digits{e-5}
\digits{2e-5}
\stoptext
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 ___________________________________________________________________________________
Wolfgang Schuster wrote:
On Fri, Jun 20, 2008 at 4:10 PM, Morgan Brassel
wrote: Thank you, Wolfgang. I have already read the "This Way" on your link very carefully. In fact, I was looking for a solution to have \digits{e-5} printed as 10^5 \digits{2e-5} printed as 2 . 10^5 Is it possible to do that? to detect if there is a number before the 'e' in \digits?
\def\digitpowerseparator {\ifx\collecteddigits\empty 10 \else \cdot10 \fi}
\starttext
\digits{e-5}
\digits{2e-5}
\stoptext
ok, patched: \def\digitpowerseparator {\ifx\collecteddigits\empty\else\cdot\fi10} Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Dear all, I allow me to use this message for a related topic on the digits command. I took a look at the "manual" on the digits command but did not found a way to cut a number by group of three digits like the numprint command, e.g. 1000000 becomes 1 000 000. With the digits option 3, dots become thinmuskips. I would like to do something similar but automatically for groups of three digits. For people who know the numprint package, this is default option with the french language. Best regards. Flavien.
On Wed, Jun 25 2008, Flavien Lambert wrote:
did not found a way to cut a number by group of three digits like the numprint command, e.g. 1000000 becomes 1 000 000. With the digits option 3, dots become thinmuskips. I would like to do something similar but automatically for groups of three digits.
Hi, Does this feature exist now in ConTeXt? TIA for any hints, -- Peter
participants (5)
-
Flavien Lambert
-
Hans Hagen
-
Morgan Brassel
-
Peter Münster
-
Wolfgang Schuster