4

This question is basically a combination of two previous posts: How can I add left aligned text to an equation? and AMS align / Align multiple “=”, too much space (the latter being my own question).

What I need is a multicolumn align, as discussed (and solved) in the second post linked above, plus a left aligned label (text and/or math), as discussed in the first post. And if possible some indent for the left aligned text would be nice. So, basically, an itemized list with custom text/math instead of bullets and nicely aligned equations as items...

I tried

\begin{flalign}
 &aaaa & bbb &= cccccc && = d\\    &ee & f &= g && = hh
\end{flalign}

and that gives me the left aligned labels and the other stuff aligned at the equal signs. But the third column is flushed all the way to the right. I guess that's the feature of flalign. Or am I doing something wrong here?

enter image description here

So: how can I get the desired format? Is there a way to combine flalign and alignat? Or are there other ways to do this? (I guess tables, etc. wouldn't really work here).

CarLaTeX
  • 62,716
janitor048
  • 1,038

2 Answers2

1

It is a bit tricky...

\documentclass{article}
\usepackage{amsmath}
\begin{document}

    \noindent\hrulefill
    \begin{flalign*}
    \begin{aligned}
    \rlap{aaaa}\\    \rlap{ee}
    \end{aligned} 
    &&\arraycolsep=1.4pt
    \begin{array}{rll}
    bbb &= cccccc &= d\\[\jot]
    f   &= g      &= hh   
    \end{array} 
    &&
    \begin{aligned}
    \refstepcounter{equation}(\theequation)\\   \refstepcounter{equation}(\theequation)
    \end{aligned} 
    \end{flalign*}

\end{document}

enter image description here

CarLaTeX
  • 62,716
  • Not bad, but the horizontal alignment is not OK. I guess you need some struts. (And I think the OP really wants left aligned labels; this also comes out if you compile his code.) – Hendrik Vogt Feb 04 '11 at 21:43
  • @Hendrik: thanks, the \jot was missing ... –  Feb 04 '11 at 21:52
0

Since alignat allows you to specify the spacing, what about:

\begin{alignat}
 &aaaa \qquad\qquad& bbb &= cccccc && = d\\
 &ee & f &= g && = hh
\end{alignat}

Not perfect (the labels are not left flushed) but...

Another solution is to replace the normal equation numbering by your labels:

\begin{alignat}{2}
\tag*{aaaa}   bbb &= cccccc && = d\\
\tag*{ee}   f &= g && = hh
\end{alignat}

EDIT: note that the latest solution requires to pass the leqno option to the amsmath package...

Sylvain
  • 731