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
\documentclass{article}
\usepackage{amsmath}
\begin{document}
This example shows text and equations within
an \verb|align| environment.
\begin{align*}
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
\end{align*}
\end{document}
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?
Best Answer
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...
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.