Knuth defines a macro for simple fractions such as 3/4 etc. and calls it \frac: \def\frac#1/#2{\leavevmode \kern.1em \raise .5ex \hbox{\the\scriptfont0 #1}% \kern-.1em $/$% \kern -.15em \lower .25ex \hbox{\the\scriptfont0 #2}}% The call is e.g., \frac 3/4. This works fine in Context. However if I undefine the Knuth macro and still use the same \frac call I don't get an error message but the results are quite different. I get both a stroke and a bar between the 3 and the 4. Is there another macro in Context called \frac and if so how is it called? -- John Culleton Able Indexing and Typesetting Precision typesetting (tm) at reasonable cost. Satisfaction guaranteed. http://wexfordpress.com
On 4/22/07, John R. Culleton
Knuth defines a macro for simple fractions such as 3/4 etc. and calls it \frac: \def\frac#1/#2{\leavevmode \kern.1em \raise .5ex \hbox{\the\scriptfont0 #1}% \kern-.1em $/$% \kern -.15em \lower .25ex \hbox{\the\scriptfont0 #2}}%
The call is e.g., \frac 3/4.
This works fine in Context. However if I undefine the Knuth macro and still use the same \frac call I don't get an error message but the results are quite different. I get both a stroke and a bar between the 3 and the 4.
Because what you type is then equal to "\frac{3}{/}4", similar to the standard command in LaTeX. \frac already exists and accepts two arguments. Mojca
On Sun, 22 Apr 2007, John R. Culleton wrote:
Knuth defines a macro for simple fractions such as 3/4 etc. and calls it \frac: \def\frac#1/#2{\leavevmode \kern.1em \raise .5ex \hbox{\the\scriptfont0 #1}% \kern-.1em $/$% \kern -.15em \lower .25ex \hbox{\the\scriptfont0 #2}}%
The call is e.g., \frac 3/4.
This works fine in Context. However if I undefine the Knuth macro and still use the same \frac call I don't get an error message but the results are quite different. I get both a stroke and a bar between the 3 and the 4.
Is there another macro in Context called \frac and if so how is it called?
\frac {a}{b} is equivalent to plain tex's {a \over b}. There is also a command similar to what you want to define in ConTeXt. It is called vulgar fraction. From core-mis.tex %D \starttabulate %D \HL %D \NC \bf method \NC \bf visualization \NC\NR %D \HL %D \NC 0 \NC \chardef\vulgarfractionmethod0\vulgarfraction{1}{2} \NC\NR %D \NC 1 \NC \chardef\vulgarfractionmethod1\vulgarfraction{1}{2} \NC\NR %D \NC 2 \NC \chardef\vulgarfractionmethod2\vulgarfraction{1}{2} \NC\NR %D \NC 3 \NC \chardef\vulgarfractionmethod3\vulgarfraction{1}{2} \NC\NR %D \HL %D \stoptabulate However, if you plan to use such fractions in serious work, do read the introduction of xfrac (ftp://tug.ctan.org/pub/tex-archive/macros/latex/exptl/xfrac/doc/xfrac.pdf) I think that the vigrule vs solidus argument also applies to ConTeXt's definition. Aditya
participants (4)
-
Aditya Mahajan
-
John R. Culleton
-
luigi scarso
-
Mojca Miklavec