ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: math formula linebreak
Date: Thu, 9 Aug 2012 14:53:28 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LNX.2.02.1208091445230.22158@qrpragenyvmrq> (raw)
In-Reply-To: <CAF=dkzyGx-S_WWMab2vBm2o9rbo+rtQq+p9tS8C8bP2eJrM9Rw@mail.gmail.com>

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
___________________________________________________________________________________


  reply	other threads:[~2012-08-09 18:53 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 [this message]
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

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=alpine.LNX.2.02.1208091445230.22158@qrpragenyvmrq \
    --to=adityam@umich.edu \
    --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).