[NTG-context] The \frac macro.
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 ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] The \frac macro.
On 4/22/07, John R. Culleton <[EMAIL PROTECTED]> 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. 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 ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] The \frac macro.
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 ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] The \frac macro.
> Is there another macro in Context called \frac and if so how is it > called? I use (e)grep in this situations, it's more texnician. luigi ___ 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 ___