ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Math help needed
@ 2002-02-03  0:31 Bruce Horrocks
  2002-02-03 12:56 ` Tobias Burnus
  2002-02-03 18:40 ` Hans Hagen
  0 siblings, 2 replies; 4+ messages in thread
From: Bruce Horrocks @ 2002-02-03  0:31 UTC (permalink / raw)


Is there a math manual available? (I couldn't find one)

For example, how can I do the following plain TeX in ConTeX:

\starttext
 From this relation we can derive:
$$\eqalignno{\sin(x)^2 &= 1-\cos(x)^2 &(1) \cr
             \noalign{\hbox{and also}}
             \cos(x)^2 &= 1-\sin(x)^2 &(2) \cr}$$
\stoptext

I am assuming/hoping that ConTeXt can help with the fiddly thinks like 
keeping track of the equation numbers?

Regards,
-- 
Bruce Horrocks
Hampshire
England
bh@granby.demon.co.uk


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

* Re: Math help needed
  2002-02-03  0:31 Math help needed Bruce Horrocks
@ 2002-02-03 12:56 ` Tobias Burnus
  2002-02-03 18:06   ` Bruce Horrocks
  2002-02-03 18:40 ` Hans Hagen
  1 sibling, 1 reply; 4+ messages in thread
From: Tobias Burnus @ 2002-02-03 12:56 UTC (permalink / raw)
  Cc: ntg-context

Hi Bruce,

On Sun, 3 Feb 2002, Bruce Horrocks wrote:
> Is there a math manual available? (I couldn't find one)
Unfortunally no good math manual exists for ConTeXt, but one can use
(nearly) all plain TeX commands.

> For example, how can I do the following plain TeX in ConTeX:
> $$\eqalignno{\sin(x)^2 &= 1-\cos(x)^2 &(1) \cr
>              \noalign{\hbox{and also}}
>              \cos(x)^2 &= 1-\sin(x)^2 &(2) \cr}$$
Your plain TeX version works, but how about this:
(ConTeXt used to count, noalign doesn't need a(n extra) \hbox{})

\placeformula
\startformula
\eqalignno{
  \sin^2 x &= 1-\cos^2 x & \formulanumber[sin]\cr
\noalign{and also}
  \cos^2 x &= 1-\sin^2 x & \formulanumber[cos]\cr
}\stopformula

or alternative:

\placeformula[cos-sin]
\startformula
\eqalignno{
  \sin^2 x &= 1-\cos^2 x & \formulanumber[sin2]{a}\cr
\noalign{and also}
  \cos^2 x &= 1-\sin^2 x & \subformulanumber[cos2]{b}\cr
}\stopformula

Then you can refer to these equation by using:
\in[sin] produces 1
\in[cos] produces 2
\in[cos-sin] produces 3
\in[sin2] produces 3a
\in[cos2] produces 3b

Tobias


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

* Re: Math help needed
  2002-02-03 12:56 ` Tobias Burnus
@ 2002-02-03 18:06   ` Bruce Horrocks
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce Horrocks @ 2002-02-03 18:06 UTC (permalink / raw)


In message 
<Pine.BSF.4.30.0202031354360.68530-100000@tom.physik.fu-berlin.de>,
on Sun, 3 Feb 2002 at 13:56:26, Tobias Burnus wrote:

>Your plain TeX version works, but how about this:
>(ConTeXt used to count, noalign doesn't need a(n extra) \hbox{})
>
>\placeformula
>\startformula
>\eqalignno{
>  \sin^2 x &= 1-\cos^2 x & \formulanumber[sin]\cr
>\noalign{and also}
>  \cos^2 x &= 1-\sin^2 x & \formulanumber[cos]\cr
>}\stopformula

Thank-you very much: the \formulanumber was what I was looking for. I 
assume that the \placeformula just means put the formula here rather 
than allowing it to float?

>Then you can refer to these equation by using:
>\in[sin] produces 1
[snip]
This would have been my next question :-)

Regards,

-- 
Bruce Horrocks
Hampshire
England
bh@granby.demon.co.uk


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

* Re: Math help needed
  2002-02-03  0:31 Math help needed Bruce Horrocks
  2002-02-03 12:56 ` Tobias Burnus
@ 2002-02-03 18:40 ` Hans Hagen
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2002-02-03 18:40 UTC (permalink / raw)
  Cc: ntg-context

At 12:31 AM 2/3/2002 +0000, Bruce Horrocks wrote:
>Is there a math manual available? (I couldn't find one)
>
>For example, how can I do the following plain TeX in ConTeX:
>
>\starttext
> From this relation we can derive:
>$$\eqalignno{\sin(x)^2 &= 1-\cos(x)^2 &(1) \cr
>             \noalign{\hbox{and also}}
>             \cos(x)^2 &= 1-\sin(x)^2 &(2) \cr}$$
>\stoptext
>
>I am assuming/hoping that ConTeXt can help with the fiddly thinks like 
>keeping track of the equation numbers?

\startformula
\eqalign {....}
\stopformula

\placeformula [label]
   \startformula
   .....
   \stopformula

you can always use \formulanumber and \subformulanumber in there if needed;

you can (see core-mat.tex) predefine classes or formulas that have their 
own spacing, number placement, alignment / margins etc

some of it is is new [we're moving some functionality to the core and it 
will be in the main docu]

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-pod.nl
-------------------------------------------------------------------------


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

end of thread, other threads:[~2002-02-03 18:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-03  0:31 Math help needed Bruce Horrocks
2002-02-03 12:56 ` Tobias Burnus
2002-02-03 18:06   ` Bruce Horrocks
2002-02-03 18:40 ` Hans Hagen

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