ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: WN <wneimeijer@tiscali.nl>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Math align question
Date: Sun, 26 Aug 2007 15:39:41 -0400 (EDT)	[thread overview]
Message-ID: <alpine.WNT.0.999.0708261527230.3236@nqvgln> (raw)
In-Reply-To: <46D19B8C.9040107@tiscali.nl>

On Sun, 26 Aug 2007, WN wrote:

> Aditya,
>
> This confuses me, I thought when using 3 columns I have to set n=3 otherwise 
> I get errors about extra tab found etc.
> However doing as you suggested, seems to work.

This is due to the m key. m=2 tells context that there are two blocks
of equations. n=2 says that each block has two columns. So, in all 
there should be n*m = 4 \NC in the equation (I had only put three, 
which led to the wrong equation number alignment).

> Then another question, the formula numbering is not aligned with the other 
> formula's in my text
> like in the code below. How can I force the sub formula numbering to be right 
> aligned ?

See above: This was due to mistake in my code. This works. (Though it 
will be nice if such mistakes do not cause these kinds of errors)

\def\ms{\,}
\starttext

\placeformula[calcb-chapter4-eqn2]
\startformula
f(x) = \sum_{n = - \infty}^{+\infty} c_{n} e^{\displaystyle i n
\frac{\pi}{L} x} \quad \text{,} \quad c_{n} = \frac{1}{2L}
\int\limits_{-L}^{L} f(x) \ms e^{- \displaystyle in\frac{\pi}{L} x } 
dx
\stopformula

Formula number is not right aligned with the previous formula
\placesubformula
\startformula
\startalign[n=2,m=2,distance=2em]
%\startalign[n=3]
\NC f(x) \NC = \frac{1}{2\pi} \int\limits_{-\infty}^{+\infty} g(y) \ms
e^{i y x} \ms dy \NC\NC (x \in \reals) \NR[calcb-chapter4-eqn5:i][i]
\NC g(y) \NC = \int\limits_{-\infty}^{+\infty} f(x) \ms e^{-i y x} d x
\NC\NC ( y \in \reals) \NR[calcb-chapter4-eqn5:ii][ii]
\NC \int\limits_{-\infty}^{+\infty} |f(x)|^{2} dx \NC = 
\frac{1}{2\pi}
\int\limits_{-\infty}^{+\infty} \Big| g(y) \Big|^{2} \ms d y \NC\NC
\quad
\NR[calcb-chapter4-eqn5:iii][iii]
\stopalign
\stopformula
\stoptext


Do you know about subformulas? For example,

\setupsubformulas[conversion=romannumerals]
\def\ms{\,}

\starttext

\startsubformulas[calcb-chapter-4-eqn5]
   \placeformula
   \startformula \startalign[n=2,m=2,distance=2em]
       \NC f(x) \EQ \frac{1}{2\pi} \int\limits_{-\infty}^{+\infty} g(y) \ms
           e^{i y x} \ms dy
       \NC\NC (x \in \reals)
           \NR[calcb-chapter4-eqn5:i]
       \NC g(y) \EQ \int\limits_{-\infty}^{+\infty} f(x) \ms e^{-i y x} d x
       \NC\NC ( y \in \reals)
           \NR[calcb-chapter4-eqn5:ii]
       \NC \int\limits_{-\infty}^{+\infty} |f(x)|^{2} dx
       \EQ \frac{1}{2\pi} \int\limits_{-\infty}^{+\infty}
           \Big| g(y) \Big|^{2} \ms d y
       \NC\NC
           \NR[calcb-chapter4-eqn5:iii]
   \stopalign \stopformula
\stopsubformulas

You can also refer to the whole equation~\in[calcb-chapter-4-eqn5], or 
an individual number~\in[calcb-chapter4-eqn5:iii].

\stoptext

BTW, why no \ms before dx, and a \ms before dy?

Aditya



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


      reply	other threads:[~2007-08-26 19:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-25 16:20 WN
2007-08-25 18:07 ` Aditya Mahajan
2007-08-26 15:26   ` WN
2007-08-26 19:39     ` Aditya Mahajan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.WNT.0.999.0708261527230.3236@nqvgln \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    --cc=wneimeijer@tiscali.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).