From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/77845 Path: news.gmane.org!not-for-mail From: Prashanth Newsgroups: gmane.comp.tex.context Subject: Re: math formula linebreak Date: Thu, 09 Aug 2012 22:21:04 +0200 Message-ID: <50241BB0.6050007@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1723782057==" X-Trace: dough.gmane.org 1344543684 376 80.91.229.3 (9 Aug 2012 20:21:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Aug 2012 20:21:24 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 09 22:21:25 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SzZEM-0004w0-1k for gctc-ntg-context-518@m.gmane.org; Thu, 09 Aug 2012 22:21:18 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C43151020F; Thu, 9 Aug 2012 22:21:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id feF8C-n0ki7k; Thu, 9 Aug 2012 22:21:15 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 14A0B101F9; Thu, 9 Aug 2012 22:21:15 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 08B2D101F9 for ; Thu, 9 Aug 2012 22:21:14 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id JW3LFzGyM4NH for ; Thu, 9 Aug 2012 22:21:07 +0200 (CEST) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id B88B4101EC for ; Thu, 9 Aug 2012 22:21:07 +0200 (CEST) Original-Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com [209.85.214.41]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q79KL6rb021728 for ; Thu, 9 Aug 2012 22:21:06 +0200 Original-Received: by bkcjc3 with SMTP id jc3so450265bkc.14 for ; Thu, 09 Aug 2012 13:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=QABOnDGfmWU7bHgDQtp4yNpMw5nxi5INYIZA0StZRn8=; b=zefmGq7RoW09RTaJFN/oZIFxa53AHoYB6sWZvdK2le2UPnPEFvFtGcAOeZTaW23Us4 Y54zOyKWVyZRP2T00oDzptAgnjVTzrARTxFCTTKRVNPcEHBs9l/GR0Xz9Vvfzt/WQMF+ OP5ywnIcVB8zw0tqAY7csHIAI85wLOfuSR2pk9NB9QdmO+neN+nml8RzS+kRZ8QwWBqd LYOsiXtmpJYaMtrXa7Nqk4VPyFK0X08OMs4TKKQjJUuesvCy1gT+d3mkgyuO9hTRqket NcADPcrIWjBTmJyNcJpjynfcDZb2KPzDq6xmEmgr3OOKm0Vgc02YHDPxgSoFEf+dwHE7 z2qQ== Original-Received: by 10.204.148.83 with SMTP id o19mr275256bkv.74.1344543666225; Thu, 09 Aug 2012 13:21:06 -0700 (PDT) Original-Received: from [192.168.2.107] (p50817726.dip.t-dialin.net. [80.129.119.38]) by mx.google.com with ESMTPS id 25sm1180021bkx.9.2012.08.09.13.21.05 (version=SSLv3 cipher=OTHER); Thu, 09 Aug 2012 13:21:05 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/16.0 Thunderbird/16.0a2 In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07HIIl61S - dc97a6ad861c - 20120809 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:77845 Archived-At: This is a multi-part message in MIME format. --===============1723782057== Content-Type: multipart/alternative; boundary="------------010209000809080102010006" This is a multi-part message in MIME format. --------------010209000809080102010006 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 ;-). -- Prash --------------010209000809080102010006 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
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 ;-).

-- Prash
--------------010209000809080102010006-- --===============1723782057== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============1723782057==--