summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/supp-num.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/supp-num.tex')
-rw-r--r--Master/texmf-dist/tex/context/base/supp-num.tex38
1 files changed, 26 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/context/base/supp-num.tex b/Master/texmf-dist/tex/context/base/supp-num.tex
index 73b28e3de20..130fd393844 100644
--- a/Master/texmf-dist/tex/context/base/supp-num.tex
+++ b/Master/texmf-dist/tex/context/base/supp-num.tex
@@ -2,7 +2,7 @@
%D [ file=supp-num,
%D version=1998.05.15,
%D title=\CONTEXT\ Support Macros,
-%D subtitle=Number (Digit) Handling,
+%D subtitle=Numbers,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\writestatus{loading}{Context Support Macros / Number (Digit) Handling}
+\writestatus{loading}{ConTeXt Support Macros / Numbers}
\unprotect
@@ -96,14 +96,12 @@
\ifx\mbox\undefined \let\mbox\normalhbox \fi
% \unexpanded\def\digits
-% {\bgroup\let~@\doifnextcharelse\bgroup\dodigits\grabdigit}
+% {\bgroup\let~@\doifnextbgroupelse\dodigits\grabdigit}
\unexpanded\def\digits
{\bgroup
\let~@%
- \doifnextcharelse\bgroup
- \dodigits
- {\doifnextcharelse\normalmathshift\domathdigits\grabdigit}}
+ \doifnextbgroupelse\dodigits{\doifnextcharelse\normalmathshift\domathdigits\grabdigit}}
\def\dodigits#1%
{\grabdigit#1\relax}
@@ -197,10 +195,23 @@
%D Although we could do with one pass, a second pass for
%D handling the stored sequence is more readable.
-\def\dohandledigits
- {\mathcode`\,="013B \mathcode`\.="013A % pretty hard coded
- \expandafter\handletokens\collecteddigits\with\scandigits
- \ifcase\powerdigits\else\digitpowerseparator^{\savedpowerdigits}\fi}
+\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
\def\doscandigit#1%
{\ifcase\skipdigit\@EA\hbox\else\@EA\hphantom\fi\bgroup
@@ -403,8 +414,11 @@
%D
%D The separator is defined as:
-\def\digitpowerseparator%
- {\cdot10} % {\times10}
+% \def\digitpowerseparator%
+% {\cdot10} % {\times10}
+
+\def\digitpowerseparator
+ {\ifx\collecteddigits\empty\else\cdot\fi10}
%D \macros
%D {digittemplate}