ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Math equation with indentation
@ 2008-05-14 11:29 302302
  2008-05-14 14:45 ` Aditya Mahajan
  0 siblings, 1 reply; 4+ messages in thread
From: 302302 @ 2008-05-14 11:29 UTC (permalink / raw)
  To: ntg-context

>On Tue, 13 May 2008, 302302 wrote:
>
>> Hi,
>> I need to use a multieqaution in this form ( http://img233.imageshack.us/img233/2372/eqsx3.png ). I am mostly interested in the right brace and >the indentation after the "subject to". I tried to use mathmatrix but without success. Can you help me with it?>
>
>I am using nested matrices, but this is one case which will be best solved 
>by something equivalent for gathered and aligned. It has been on my todo 
>list for a long time.
>
>Here is a solution using nested matrices, where I use \noalign to fake 
>correct spacing after the first line (and changed the \cdots in the last 
>condition to \dots).
>
>\definemathmatrix[rightbrace][left={\left.},right={\,\right\}},n=1,align=left]
>
>\starttext
>
>\placeformula[+] \startformula
>\startrightbrace
>   \NC \min \{c_1 x_1 + c_2 x_2 + \cdots + c_n x_n \} \NR
>       \noalign{\vskip 0.2em}
>   \NC \text{subject to} \NR
>   \NC \quad
>       \startmathmatrix[n=9,align={middle,middle,middle,
>         middle,middle,middle,right,middle,middle},
>         distance=0.3em]
>         \NC a_{11} x_1 \NC + \NC a_{12} x_2 \NC +
>         \NC \cdots \NC + \NC a_{1n} x_n \NC = \NC b_1 \NR
>         \NC a_{21} x_1 \NC + \NC a_{22} x_2 \NC +
>         \NC \cdots \NC + \NC a_{2n} x_n \NC = \NC b_2 \NR
>         \NC            \NC   \NC  \vdots    \NC
>         \NC        \NC   \NC            \NC   \NC \vdots \NR
>         \NC a_{m1} x_1 \NC + \NC a_{m2} x_2 \NC +
>         \NC \cdots \NC + \NC a_{mn} x_n \NC = \NC b_m \NR
>         \NC            \NC   \NC            \NC
>         \NC        \NC
>         \NC \llap{x_1,x_2,\dots,x_n} \NC \ge \NC 0.
>       \stopmathmatrix \NR
>   \stoprightbrace
>\stopformula
>
>\stoptext
>
>
>Aditya

Great, thanks a lot! And is there any way how to get in the first line \min_{x \in X} with the parameter exactly below the "min"? Because in this  solution the parameter {x \in X} is on the right bottom, like in a line.

Czenek

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


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

* Re: Math equation with indentation
  2008-05-14 11:29 Math equation with indentation 302302
@ 2008-05-14 14:45 ` Aditya Mahajan
  0 siblings, 0 replies; 4+ messages in thread
From: Aditya Mahajan @ 2008-05-14 14:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 14 May 2008, 302302 wrote:

>> On Tue, 13 May 2008, 302302 wrote:
>>
>>> Hi,
>>> I need to use a multieqaution in this form ( http://img233.imageshack.us/img233/2372/eqsx3.png ). I am mostly interested in the right brace and >the indentation after the "subject to". I tried to use mathmatrix but without success. Can you help me with it?>
>>
>> I am using nested matrices, but this is one case which will be best solved
>> by something equivalent for gathered and aligned. It has been on my todo
>> list for a long time.
>>
>> Here is a solution using nested matrices, where I use \noalign to fake
>> correct spacing after the first line (and changed the \cdots in the last
>> condition to \dots).
>>
>> \definemathmatrix[rightbrace][left={\left.},right={\,\right\}},n=1,align=left]
>>
>> \starttext
>>
>> \placeformula[+] \startformula
>> \startrightbrace
>>   \NC \min \{c_1 x_1 + c_2 x_2 + \cdots + c_n x_n \} \NR
>>       \noalign{\vskip 0.2em}
>>   \NC \text{subject to} \NR
>>   \NC \quad
>>       \startmathmatrix[n=9,align={middle,middle,middle,
>>         middle,middle,middle,right,middle,middle},
>>         distance=0.3em]
>>         \NC a_{11} x_1 \NC + \NC a_{12} x_2 \NC +
>>         \NC \cdots \NC + \NC a_{1n} x_n \NC = \NC b_1 \NR
>>         \NC a_{21} x_1 \NC + \NC a_{22} x_2 \NC +
>>         \NC \cdots \NC + \NC a_{2n} x_n \NC = \NC b_2 \NR
>>         \NC            \NC   \NC  \vdots    \NC
>>         \NC        \NC   \NC            \NC   \NC \vdots \NR
>>         \NC a_{m1} x_1 \NC + \NC a_{m2} x_2 \NC +
>>         \NC \cdots \NC + \NC a_{mn} x_n \NC = \NC b_m \NR
>>         \NC            \NC   \NC            \NC
>>         \NC        \NC
>>         \NC \llap{x_1,x_2,\dots,x_n} \NC \ge \NC 0.
>>       \stopmathmatrix \NR
>>   \stoprightbrace
>> \stopformula
>>
>> \stoptext
>>
>>
>> Aditya
>
> Great, thanks a lot! And is there any way how to get in the first line \min_{x \in X} with the parameter exactly below the "min"? Because in this  solution the parameter {x \in X} is on the right bottom, like in a line.

Add style=\displaystyle as an option in the definition of rightbrace.

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
___________________________________________________________________________________


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

* Re: Math equation with indentation
  2008-05-13 20:57 302302
@ 2008-05-13 23:44 ` Aditya Mahajan
  0 siblings, 0 replies; 4+ messages in thread
From: Aditya Mahajan @ 2008-05-13 23:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, 13 May 2008, 302302 wrote:

> Hi,
> I need to use a multieqaution in this form ( http://img233.imageshack.us/img233/2372/eqsx3.png ). I am mostly interested in the right brace and the indentation after the "subject to". I tried to use mathmatrix but without success. Can you help me with it?

I am using nested matrices, but this is one case which will be best solved 
by something equivalent for gathered and aligned. It has been on my todo 
list for a long time.

Here is a solution using nested matrices, where I use \noalign to fake 
correct spacing after the first line (and changed the \cdots in the last 
condition to \dots).

\definemathmatrix[rightbrace][left={\left.},right={\,\right\}},n=1,align=left]

\starttext

\placeformula[+] \startformula
\startrightbrace
   \NC \min \{c_1 x_1 + c_2 x_2 + \cdots + c_n x_n \} \NR
       \noalign{\vskip 0.2em}
   \NC \text{subject to} \NR
   \NC \quad
       \startmathmatrix[n=9,align={middle,middle,middle,
         middle,middle,middle,right,middle,middle},
         distance=0.3em]
         \NC a_{11} x_1 \NC + \NC a_{12} x_2 \NC +
         \NC \cdots \NC + \NC a_{1n} x_n \NC = \NC b_1 \NR
         \NC a_{21} x_1 \NC + \NC a_{22} x_2 \NC +
         \NC \cdots \NC + \NC a_{2n} x_n \NC = \NC b_2 \NR
         \NC            \NC   \NC  \vdots    \NC
         \NC        \NC   \NC            \NC   \NC \vdots \NR
         \NC a_{m1} x_1 \NC + \NC a_{m2} x_2 \NC +
         \NC \cdots \NC + \NC a_{mn} x_n \NC = \NC b_m \NR
         \NC            \NC   \NC            \NC
         \NC        \NC
         \NC \llap{x_1,x_2,\dots,x_n} \NC \ge \NC 0.
       \stopmathmatrix \NR
   \stoprightbrace
\stopformula

\stoptext


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
___________________________________________________________________________________


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

* Math equation with indentation
@ 2008-05-13 20:57 302302
  2008-05-13 23:44 ` Aditya Mahajan
  0 siblings, 1 reply; 4+ messages in thread
From: 302302 @ 2008-05-13 20:57 UTC (permalink / raw)
  To: ntg-context

Hi,
I need to use a multieqaution in this form ( http://img233.imageshack.us/img233/2372/eqsx3.png ). I am mostly interested in the right brace and the indentation after the "subject to". I tried to use mathmatrix but without success. Can you help me with it?
Thanks
Czenek

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


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

end of thread, other threads:[~2008-05-14 14:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-14 11:29 Math equation with indentation 302302
2008-05-14 14:45 ` Aditya Mahajan
  -- strict thread matches above, loose matches on Subject: below --
2008-05-13 20:57 302302
2008-05-13 23:44 ` Aditya Mahajan

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