From: Steffen Wolfrum <context@st.estfiles.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: math formula linebreak
Date: Thu, 9 Aug 2012 23:14:29 +0200 [thread overview]
Message-ID: <8CA4E048-0534-41C8-A95B-A7AC920AC287@st.estfiles.de> (raw)
In-Reply-To: <50241BB0.6050007@gmail.com>
Am 09.08.2012 um 22:21 schrieb Prashanth:
>
> On 09/08/12 09:37, Steffen Wolfrum wrote:
>> Hi,
>>
>> for nice linebreaking we can adjust math formulas by the use of NC, NR alignment.
>>
>> But if someone only wants long formulas to fit in a defined area, and want them to break automatically ... is there a handy solution?
>>
>> (Below are examples that don't work)
>>
>> Thanks,
>> Steffen
>> -------
>>
>>
>> \starttext
>>
>>
>> \placeformula
>> \startformula[9pt]
>> I=\big\{\lambda u(x_0-\pi^H K)+(1-\lambda)[\pi^L u(x_0-K+(1-\pi^L)Z_{L'})
>> +(1-\pi^L)u(x_0-\pi^L Z_{L'})]\big\}-\big\{\pi^U u(x_0-K+(1-\pi^U)Z_{U'})
>> +(1-\pi^U)u(x_0-\pi^U Z_{U'})\big\}.
>> \stopformula
>>
>>
>>
>> \defineframedtext
>> [defbackground]
>> [width=10cm,
>> frame=on,
>> location=paragraph]
>>
>>
>> \startdefbackground
>> \placeformula
>> \startformula[9pt]
>> I=\big\{\lambda u(x_0-\pi^H K)+(1-\lambda)[\pi^L u(x_0-K+(1-\pi^L)Z_{L'})
>> +(1-\pi^L)u(x_0-\pi^L Z_{L'})]\big\} -\big\{\pi^U u(x_0-K+(1-\pi^U)Z_{U'})
>> +(1-\pi^U)u(x_0-\pi^U Z_{U'})\big\}.
>> \stopformula
>> \stopdefbackground
>>
>>
>>
>>
>>
>> \definelayer[mylayer]
>>
>>
>> \setlayerframed
>> [mylayer]
>> [x=25mm,
>> y=85mm,
>> height=43.5mm,
>> width=10cm,align=block]
>> {
>> \placeformula
>> \startformula[9pt]
>> I=\big\{\lambda u(x_0-\pi^H K)+(1-\lambda)[\pi^L u(x_0-K+(1-\pi^L)Z_{L'})
>> +(1-\pi^L)u(x_0-\pi^L Z_{L'})]\big\} -\big\{\pi^U u(x_0-K+(1-\pi^U)Z_{U'})
>> +(1-\pi^U)u(x_0-\pi^U Z_{U'})\big\}.
>> \stopformula
>> }
>>
>> \setupbackgrounds[page][background=mylayer]
>>
>>
>>
>>
>>
>>
>> \stoptext
>>
> When I needed something like that, I used \allowbreak with inlinemath. In your case, you could do:
> \bTABLE[frame=on,align=right,width=10cm]
> \bTR
> \bTD
> $I=\big\{\lambda u(x_0-\pi^H K)\allowbreak+(1-\lambda)[\pi^L u(x_0-K+(1-\pi^L)Z_{L'})\allowbreak+(1-\pi^L)u(x_0-\pi^L Z_{L'})]\big\}\allowbreak -\big\{\pi^U u(x_0-K+(1-\pi^U)Z_{U'})\allowbreak+(1-\pi^U)u(x_0-\pi^U Z_{U'})\big\}.$
> \eTD
> \eTR
> \eTABLE
>
> This will just flow it like regular text. I don't know if this is good enough for your needs. If not, you can add another way to your list of ways ;-).
Hey, you skipped start/stopformula and used a $$ environment?!
Why not, that's a quite clever approach (... actually, it's a quite efficient workaround for my needs).
Thank you Prash, thank you very much!
Steffen
___________________________________________________________________________________
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
prev parent reply other threads:[~2012-08-09 21:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-09 7:37 Steffen Wolfrum
2012-08-09 17:31 ` Aditya Mahajan
2012-08-09 18:19 ` Sietse Brouwer
2012-08-09 18:53 ` Aditya Mahajan
2012-08-09 19:41 ` Sietse Brouwer
2012-08-09 20:31 ` Sietse Brouwer
2012-08-09 21:07 ` Hans Hagen
2012-08-09 20:21 ` Prashanth
2012-08-09 21:14 ` Steffen Wolfrum [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=8CA4E048-0534-41C8-A95B-A7AC920AC287@st.estfiles.de \
--to=context@st.estfiles.de \
--cc=ntg-context@ntg.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).