Hi Aditya,
I wish that the breqn algorithm were described somethere; then one could play around implementing it in luatex.
Have you seen the new User's Guide yet? It's from last May, very recent, so it may not have been there yet when last you looked. It includes the entire source code, and comments that quite thoroughly: the ratio works out to 16 lines of comment per 26 lines of code. (A page is about 42 lines.) And the comments go into the "how", and not just the "what". Might be useful at some point in the future, if it is indeed new. http://ctan.unixbrain.com/macros/latex/contrib/mh/breqn.pdf --Sietse P.s. The lack of an index and a table of contents is criminal, although probably due to this being a beta version (v0.98b) of the manual. I've extracted the sections and subsection titles, albeit without the page numbers. == User's guide == 1 A bit of history 2 Package loading 3 To do 4 Introduction 5 Principal features 6 Shortcomings of the package 6.1 Incompatibilities 6.2 Indention of delimited fragments 6.3 Math symbol subversion 6.4 Subscripts and superscripts 7 Incomplete 8 Package options 9 Environments and commands 9.1 Environments 9.2 Commands 10 Various environment options 11 The \@exisym package 12 Caution! Warning! 13 Examples == Implementation == 14 Introduction 15 Strategy 16 Prelim 17 Package options 18 Required packages 19 Some useful tools 20 Debugging 21 The \listwidth variable 22 Parameters 23 Measuring equation components 24 The dmath and dmath* environments 25 Special processing for end-of-equation 26 Preprocessing the equation body 27 Choosing optimal line breaks 28 Equation layout options 29 Centered Right-Number Equations 30 Framing an equation 31 Delimiter handling 32 Series of expressions 33 Equation groups 34 The darray environment 35 Miscellaneous 36 Wrap-up 37 To do