I have a set of equations, where each line consists of a formula and an explanation (info about indices). Now, let's say the structure looks like this:

    &\framebox[0.4\lw]{Formula 1} & \framebox[0.3\lw]{Info 1}& \\
    &\framebox[0.7\lw]{Formula 1} & \framebox[0.1\lw]{Info 1}& \\
    &\framebox[0.5\lw]{Formula 1} & \framebox[0.2\lw]{Info 1}&

This results in two columns of widths 0.7\lw and 0.3\lw, so the equation will be too wide for the page: output of the example code (too wide)

Yet, no single line is wider than 0.8\lw, so there is enough space if the two columns could "slide into each other", like this: desired output

In essence, I need some equiv. of \hfill between the two parts - but \hfill does not work here...

My question is whether there is a way to do this, i.e. to create a flexible space that would keep the left and right aligns. Note that the first align would typically be somewhere inside the formula, not in front of it.


I wouldn't put the conditions flush right, but if you really insist, you can use flalign:

\qquad A&=\mathrlap{B} &\text{condition}\\
\qquad C&=\mathrlap{D} &\text{cond}\\
\qquad E&=\mathrlap{F} &\text{some longer condition}

Change the \qquad into some other spacing command that suits your needs.

This needs the package mathtools

  • Thanks, this helped! (Ironically, I looked at mathtools today, to check \smashoperator, but have not thought of this..) – Michal Kaut Oct 27 '11 at 13:23

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.