MAJOR=4 MINOR=20 DEVNAME=tty20 5ˆl–Ãa¾””†»â‚Àµq—ÔÅ£�þB@>³l„#¢ ¡ ?ŸÍ ƒt.»ÌÂÊ %D \module %D [ file=math-frc, %D version=2007.07.19, %D title=\CONTEXT\ Math Macros, %D subtitle=Fractions, %D author={Hans Hagen \& Taco Hoekwater \& Aditya Mahajan}, %D date=\currentdate, %D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. \writestatus{loading}{ConTeXt Math Macros / Fractions} \unprotect \unexpanded\def\exmthfont#1% {\symbolicsizedfont#1\plusone{MathExtension}} \def\domthfrac#1#2#3#4#5#6#7% {\begingroup \mathsurround\zeropoint \setbox0\hbox{$#1 #6$}% \setbox2\hbox{$#1 #7$}% \dimen0\wd0 \ifdim\wd2>\dimen0 \dimen0\wd2 \fi \setbox4\hbox to \dimen0{\exmthfont#2#3\leaders\hbox{#4}\hss#5}% \mathord{\vcenter{{\offinterlineskip \hbox to \dimen0{\hss\box0\hss}% \kern \ht4% \hbox to \dimen0{\hss\copy4\hss}% \kern \ht4% \hbox to \dimen0{\hss\box2\hss}}}}% \endgroup} \def\domthsqrt#1#2#3#4#5% {\begingroup \mathsurround\zeropoint \setbox0\hbox{$#1 #5$}% \dimen0=1.05\ht0 \advance\dimen0 1pt \ht0 \dimen0 \dimen0=1.05\dp0 \advance\dimen0 1pt \dp0 \dimen0 \dimen0\wd0 \setbox4\hbox to \dimen0{\exmthfont#2\leaders\hbox{#3}\hfill#4}% \delimitershortfall=0pt \nulldelimiterspace=0pt \setbox2\hbox{$\left\delimiter"0270370 \vrule height\ht0 depth \dp0 width0pt \right.$}% \mathord{\vcenter{\hbox{\copy2 \rlap{\raise\dimexpr\ht2-\ht4\relax\copy4}\copy0}}}% \endgroup} \unexpanded\def\mthfrac#1#2#3#4#5{\mathchoice {\domthfrac\displaystyle \textface {#1}{#2}{#3}{#4}{#5}} {\domthfrac\textstyle \textface {#1}{#2}{#3}{#4}{#5}} {\domthfrac\scriptstyle \scriptface {#1}{#2}{#3}{#4}{#5}} {\domthfrac\scriptscriptstyle\scriptscriptface{#1}{#2}{#3}{#4}{#5}}} \unexpanded\def\mthsqrt#1#2#3{\mathchoice {\domthsqrt\displaystyle \textface {#1}{#2}{#3}} {\domthsqrt\textstyle \textface {#1}{#2}{#3}} {\domthsqrt\scriptstyle \textface {#1}{#2}{#3}} {\domthsqrt\scriptscriptstyle\textface {#1}{#2}{#3}}} %D Moved from math-new.tex (not that new anyway: %D \macros %D {genfrac} %D %D [TH] The definition of \type {\genfrac} \& co. is not %D trivial, because it allows some flexibility. This is %D supposed to be a user||level command, but will fail quite %D desparately if called outside math mode (\CONTEXT\ redefines %D \type {\over}) %D %D [HH] We clean up this macro a bit and (try) to make it %D understandable. The expansion is needed for generating %D the second argument to \type {\dogenfrac}, which is to %D be a control sequence like \type {\over}. \unexpanded\def\genfrac#1#2#3#4% {\edef\!!stringa {#1#2}% \expanded {\dogenfrac{#4}% \csname \ifx @#3@% \ifx\!!stringa\empty \strippedcsname\normalover \else \strippedcsname\normaloverwithdelims \fi \else \ifx\!!stringa\empty \strippedcsname\normalabove \else \strippedcsname\normalabovewithdelims \fi \fi \endcsname}% {#1#2#3}} \def\dogenfrac#1#2#3#4#5% {{#1{\begingroup#4\endgroup#2#3\relax#5}}} %D \macros %D {dfrac, tfrac, frac, dbinom, tbinom, binom} %D %D \startbuffer %D $\dfrac {1}{2} \tfrac {1}{2} \frac {1}{2}$ %D $\dbinom{1}{2} \tbinom{1}{2} \binom{1}{2}$ %D \stopbuffer %D %D \typebuffer %D %D \getbuffer \unexpanded\def\dfrac {\genfrac\empty\empty{}\displaystyle} \unexpanded\def\tfrac {\genfrac\empty\empty{}\textstyle} \unexpanded\def\frac {\genfrac\empty\empty{}\donothing} \unexpanded\def\dbinom{\genfrac()\zeropoint\displaystyle} \unexpanded\def\tbinom{\genfrac()\zeropoint\textstyle} \unexpanded\def\binom {\genfrac()\zeropoint\donothing} \unexpanded\def\xfrac {\genfrac\empty\empty{}\scriptstyle} \unexpanded\def\xxfrac{\gen