4

I have an equation that I would like to align like this (the x is actually \times):

A = BBBBB CCCCCCC
          x DDDDD
  = EEEEEEE FFFFF

I have tried the align environment, align with nested aligned, and alignat with two columns.

The best I can do with plain align is:

A =&~ widersum &BBBBB &CCCCCCC
   &           &      &x DDDDD
  =&~ sum      &BBBBB &FFFFF

Which in my current case is fine, because the second sum is only a fraction less wide. But is there any decent way to ignore a second alignment & in one row?

PS: I seem to need extra spaces ~ when I place the alignment after an equals sign. How come?

EDIT: a realistic example

f_ &= \sum_{\mu, \lambda=-\infty}^\infty &blabla bla bla \notag \\
                                         &&\times blabla \notag \\
   &= \sum_{\lambda=-\infty}^\infty blabla bla blabla

is what I'm after

1
  • ad "~ at equals sign": There are two options: A &= B or A = {}& B, choose whichever you prefer. But ~ will create certaily a too long space.
    – yo'
    Feb 13, 2014 at 15:42

3 Answers 3

2

You could use alignat instead of align:

enter image description here

Additionally you could use \rlap from the mathtools package to not have the last line effect the alignment of the previous lines:

enter image description here

Notes:

  • I inserted an additional {} to ensure that the \times is treated as a binary operator.

Code: alignat

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{alignat}{3}
    f &= \sum_{\mu, \lambda=-\infty}^\infty   & blabla bla bla  \notag \\
      &                                       & {}\times blabla \notag \\
      &= \sum_{\lambda=-\infty}^\infty blabla bla blabla
\end{alignat}
\end{document}

Code: alignat and rlap:

\documentclass{article}
\usepackage{math tools} % Already includes amsmath

\begin{document}
\begin{alignat}{3}
    f &= \sum_{\mu, \lambda=-\infty}^\infty   & blabla bla bla  \notag \\
      &                                       & {}\times blabla \notag \\
      &= \rlap{$\displaystyle\sum_{\lambda=-\infty}^\infty blabla bla blabla$}
\end{alignat}
\end{document}
0

One can do that with alignat:

        \documentclass[a4paper]{article}
        \usepackage[utf8]{inputenc}
        \usepackage{mathtools}

        \pagestyle{empty}

        \begin{document}

            \begin{subequations}
                \begin{alignat}{2}
                  f_0 & = & \sum_{\mu, \lambda=-\infty}^\infty blabla bla bla & {}\\
                   & & \times blabla & \notag\\
                  & = & \sum_{\lambda=-\infty}^\infty blabla bla blabla & {}
               \end{alignat}
            \end{subequations}

        \end{document}

Resulting in:

0

You could use an array environment inside an align or align* environment. The first row of the array material should be left-justified, and the second row should be right-justified; the {} and @{} terms in the code below are there to help fine-tune the alignment. A (probably advantageous) side-effect of this approach is that the middle line -- i.e., the second line of the array -- will be a bit closer to the first line than it is to the final line.

enter image description here

\documentclass{article}
\usepackage{amsmath} 
\begin{document}
\begin{align*}
A &= \begin{array}[t]{@{}l}
     BBBBB\ CCCCCCC\\
     \multicolumn{1}{r}{{}\times DDDDD}
     \end{array}\\
  &= EEEEEEE\ FFFFF
\end{align*}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .