This question may seem a little insane! :) but I am inclined to align all of my equations in a document at the = sign. In fact, I want a general format for all of the equations like below

The distance of equality sign from the left margin which I want to be fixed = right side

and if the left side or right side of the equation are long they should break down to next line aligning from the left.

Here is simple example


This example shows text and  equations within
an \verb|align| environment.
a &= b + c + d\\
  &+ e + f + g
\intertext{A small amount of text can go here with $x=2$ inline math
But not a lot of text.}
k &= l + m + n + m + n + m + n\\
  &+ o + p + q


But not exactly what I want since

  • the distance of = is not fixed form the left margin
  • if I use this method I should write all of my document in one align environment which will be too confusing!
  • I cannot write too much text between equations

Is there any possible solution for this?

  • What are you currently using to align or write your equations? – Werner Dec 13 '16 at 20:23
  • @Werner: I usually use align environment for aligning equations – H. R. Dec 13 '16 at 20:25
  • @Werner: Do you think that there may be a solution? :) – H. R. Dec 13 '16 at 20:33
  • 1
    What if you have \sin^2 x+\cos^2x=1 somewhere? I mean, what's the reason for aligning completely unrelated equations at the same point? – egreg Dec 13 '16 at 20:50
  • @egreg: I think that the only reason I can refer to is beauty! :) In some documents I prefer it to be this way. Or maybe the reason is my aligmentoholic disease! ;) – H. R. Dec 14 '16 at 14:59

I only considered implementing a global alignment as egreg hinted in comments that it was a bad idea. Alignment is supposed to highlight the corresponding parts of a display and that meaning is destroyed if you align everything. But...

enter image description here




\def\a{One two three four five six seven. }
\def\b{\a\a\a Red yellow blue green. \a\a\a\a}

  1+2+3+4 &=4\\
x+y &=z





the macros here are not particularly general or robust but show a basic idea of using a flush left but very indented setting along with hiding the width of the first column.

  • (+1) Thanks. Yeah it may look bad for some purposes and look nice for another things! I mentioned at the beginning of my question that it may look insane! :D – H. R. Dec 14 '16 at 14:20

Equations can be left aligned by option fleqn. The left indentation can be controlled by register \mathindent (package amsmath). Then the left part of the equation can be written via \llap in the indentation space:

  \ml{a} = b + c + d\\
  {} + e + f + g
\intertext{A small amount of text can go htere with $x=2$ inline math,
but not a lot of text.}
  \ml{k} = l + m + n + m + n + m + n\\
  {} + o + p + q\\
  \ml{r + s} = t + u


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.