[NTG-context] cont-de help for context with MK IV

Hans Hagen pragma at wxs.nl
Tue Sep 2 19:22:49 CEST 2008


Martin Scholz wrote:

...

> \unprotect
> \def\MPdivten[#1]%
> {\@EA\@EA\@EA\doMPdivten\@EA\@EA\@EA[\@EA#1]}
> 
> \def\doMPdivten[#1]%
> {\ifnum#1> 9999 \dodoMPdivtenB#1\else
> \ifnum#1> 999 \dodoMPdivtenC#1\else
> \ifnum#1> 99 \dodoMPdivtenD#1\else
> \ifnum#1> 9 \dodoMPdivtenE#1\else
> \ifnum#1> 0 \dodoMPdivtenF#1\else
> \ifnum#1<-9999 \dodoMPdivtenA#1\else
> \ifnum#1< -999 \dodoMPdivtenB#1\else
> \ifnum#1< -99 \dodoMPdivtenC#1\else
> \ifnum#1< -9 \dodoMPdivtenD#1\else
> \ifnum#1< 0 \dodoMPdivtenE#1\else
> 0 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
> 
> \def\dodoMPdivtenA#1#2#3#4#5#6{#1#2#3#4#5.#6}
> \def\dodoMPdivtenB #1#2#3#4#5{#1#2#3#4.#5}
> \def\dodoMPdivtenC #1#2#3#4{#1#2#3.#4}
> \def\dodoMPdivtenD #1#2#3{#1#2.#3}
> \def\dodoMPdivtenE #1#2{#1.#2}
> \def\dodoMPdivtenF #1{.#1}
> \protect 
> 
> Thanks here to Wolfgang Schuster you just helped to figure out this howto.

some real old (expandable) macro, this one, from before the etex time ...

this is a cleaner variant

\def\MPdivten[#1]{\withoutpt\the\dimexpr#1pt/10\relax}

i added it to the core (mkii and mkiv)

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


More information about the ntg-context mailing list