ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Non-square roots?
@ 2005-07-31  8:36 Brooks Moses
  2005-07-31 20:25 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Brooks Moses @ 2005-07-31  8:36 UTC (permalink / raw)


LaTeX offers the following way to write a cube root: $\sqrt[3]{x}$.  Is 
there a way to do this in ConTeXt other than the TeX way of $\root 3\of x$?

Also, Hans, if there isn't a direct way to do this, the following code is 
pretty much how LaTeX implements it, with an extra line at the top to make 
it work in ConTeXt.  Would it be reasonable to put something like this (or 
something that implements this syntax) in m-newmat?

    \let\sqrtsign=\sqrt
    \def\sqrt{\@ifnextchar[\@sqrt\sqrtsign}
    \def\@sqrt[#1]{\root #1\of}

- Brooks

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Non-square roots?
  2005-07-31  8:36 Non-square roots? Brooks Moses
@ 2005-07-31 20:25 ` Hans Hagen
  2005-07-31 20:49   ` Brooks Moses
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2005-07-31 20:25 UTC (permalink / raw)


Brooks Moses wrote:

> LaTeX offers the following way to write a cube root: $\sqrt[3]{x}$.  
> Is there a way to do this in ConTeXt other than the TeX way of $\root 
> 3\of x$?
>
> Also, Hans, if there isn't a direct way to do this, the following code 
> is pretty much how LaTeX implements it, with an extra line at the top 
> to make it work in ConTeXt.  Would it be reasonable to put something 
> like this (or something that implements this syntax) in m-newmat?
>
>    \let\sqrtsign=\sqrt
>    \def\sqrt{\@ifnextchar[\@sqrt\sqrtsign}
>    \def\@sqrt[#1]{\root #1\of}

\let\normalsqrt\sqrt % \dohandlemathtoken {sqrt}

\def\sqrt{\doifnextcharelse[\notsosqrt\normalsqrt}
\def\notsosqrt[#1]{\root#1\of}

$\sqrt[3]{10}$

Do you want this in the kernel? 

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Non-square roots?
  2005-07-31 20:25 ` Hans Hagen
@ 2005-07-31 20:49   ` Brooks Moses
  0 siblings, 0 replies; 3+ messages in thread
From: Brooks Moses @ 2005-07-31 20:49 UTC (permalink / raw)


At 01:25 PM 7/31/2005, Hans Hagen wrote:
>\let\normalsqrt\sqrt % \dohandlemathtoken {sqrt}
>
>\def\sqrt{\doifnextcharelse[\notsosqrt\normalsqrt}
>\def\notsosqrt[#1]{\root#1\of}
>
>$\sqrt[3]{10}$
>
>Do you want this in the kernel?

I'd like to have it there, yes.  Thanks!

- Brooks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-31 20:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-31  8:36 Non-square roots? Brooks Moses
2005-07-31 20:25 ` Hans Hagen
2005-07-31 20:49   ` Brooks Moses

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).