ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: math formula linebreak
Date: Thu, 09 Aug 2012 23:07:42 +0200	[thread overview]
Message-ID: <5024269E.70209@wxs.nl> (raw)
In-Reply-To: <alpine.LNX.2.02.1208091445230.22158@qrpragenyvmrq>

On 9-8-2012 20:53, Aditya Mahajan wrote:
> 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.

When I'm done ceaning up the pending tex and lua code, I'll look into 
these issues. It's probably not that hard to come up with a solution in 
lua (one of the pet projects on my list).

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


  parent reply	other threads:[~2012-08-09 21:07 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 [this message]
2012-08-09 20:21 ` Prashanth
2012-08-09 21:14   ` Steffen Wolfrum

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=5024269E.70209@wxs.nl \
    --to=pragma@wxs.nl \
    --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).