From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/77843 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: math formula linebreak Date: Thu, 9 Aug 2012 14:53:28 -0400 (EDT) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1344538311 20896 80.91.229.3 (9 Aug 2012 18:51:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Aug 2012 18:51:51 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 09 20:51:52 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 1SzXpm-0004qg-J6 for gctc-ntg-context-518@m.gmane.org; Thu, 09 Aug 2012 20:51:50 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8548B10221; Thu, 9 Aug 2012 20:51:49 +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 3--YJBFz76Bk; Thu, 9 Aug 2012 20:51:47 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E9ACD101F9; Thu, 9 Aug 2012 20:51:46 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E50E2101F9 for ; Thu, 9 Aug 2012 20:51:45 +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 8kzlJUid6CJK for ; Thu, 9 Aug 2012 20:51:44 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id A791E101EC for ; Thu, 9 Aug 2012 20:51:44 +0200 (CEST) Original-Received: from hellskitchen.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.82]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q79Iqmo5031680 for ; Thu, 9 Aug 2012 20:52:49 +0200 Original-Received: FROM Decentralized.ECE.McGill.CA (Decentralized.ECE.McGill.CA [132.206.69.142]) By hellskitchen.mr.itd.umich.edu ID 502406BD.FE19.10557 ; Authuser adityam; 9 Aug 2012 14:51:41 EDT In-Reply-To: User-Agent: Alpine 2.02 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0085 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.14.82; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01HIGQNyd - 4393abf71eef - 20120809 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.72 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:77843 Archived-At: On Thu, 9 Aug 2012, Sietse Brouwer wrote: > Steffen Wolfrum wrote: >>> them to break automatically ... is there a handy solution? > > Aditya Mahajan wrote: >> Short answer: No easy solution exists. > > Is this because allowing automatic line breaks in math mode is itself > hard to implement, or is the basic mechanism possible but preventing > stupid/ugly breakpoints is hard? Because I can imagine a 70 percent > solution being a big help already. Partly both. The question is not so much the difficulty in choosing break-points (which is easy: before all \mathbin atoms, after \mathpunct if needed, etc). The hard part is how to align the split up portions, and choosing different alignments changes the line widths, and therefore affect future line-breaks. The old manual of breqn (the one by Michel Jones) had some discussion on the different alignment of display math. They are also explained nicely in the book on typesetting math by AMS (I forget the author's name). In principle, one can follow the same approach as Knuth did for line-breaking text (define penalties and then solve a dynamic program to find the layout that gives the lowest score). The breqn package does implement such an algorithm that works well in most cases. I wish that the breqn algorithm were described somethere; then one could play around implementing it in luatex. Trying to read breqn code to understand the algorithm is very difficult. 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________