4

This

\begin{alignat*}{2}
f(a) &= \lim_{s} \frac{1}{2 z} \int_{-w}^{+e}\int_{-r}^{+t} g(q)\cdot h(q) d x d y  &\\
    &= \lim_{s} \frac{1}{3s} &\Bigg\{  \sum_{w} \int_{-r}^{+t} g(q+e)\cdot h(q) d x d y d x d y &\\
    & &  \sum_{w} \int_{-r}^{+t} g(q)\cdot h(q) d x d y d x d y &\Bigg\} \\ 
\end{alignat*}

Produces this: enter image description here

Obviously, the space between the fraction and curly bracket is not intended, what I wanted to do was to align the second sum under the first one like it is done here. What is incorrect? (I want to do it with alignat without getting too complex like nested alignemets)

  • 1
    While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Dec 18 '18 at 19:28
4

A combination of an \hphantom{\Bigg\{} and some additional alignment points gives good results:

enter image description here

Notes:

  • The alignat*= environment produces as many rl (right/left) pairs as specified in the first parameter and does not insert additional space that the align environment does, so you need to insert the space that is desired between the alignment points (this was not needed in this case).
  • The double && ensure that the subsequent columns are also left aligned.

Code

\documentclass{article}
\usepackage{mathtools}% include amsmath

\begin{document}
\begin{alignat*}{4}
f(a) 
    &= \lim_{s} \frac{1}{2 z} &&                    \int_{-w}^{+e}\int_{-r}^{+t} g(q)\cdot h(q) d x d y      & \\
    &= \lim_{s} \frac{1}{3s}  &&           \Bigg\{  \sum_{w} \int_{-r}^{+t} g(q+e)\cdot h(q) d x d y d x d y & \\
    &                         && \hphantom{\Bigg\{} \sum_{w} \int_{-r}^{+t} g(q)\cdot h(q) d x d y d x d y   & \Bigg\} \\ 
\end{alignat*}
\end{document}
  • Why does the solution with simple alignat not work, since i merely copied what works from the link that I mention in the question and just used different content? – leosenko Dec 18 '18 at 21:31
  • @leosenko: The solution you linked to employs \mathrlap so what you have here is not really identical to that solution. There are lots of different way to do alignments -- I only presented what came naturally to me: Select the desired alighnemt points and use a single & where you want the text before to be r aligned and the text following to be l aligned. A double &&skips the r align component and make the text following l aligned. Also updated answer to attempt to explain this. – Peter Grill Dec 18 '18 at 22:07
4

This is a case for split with a nested aligned or multlined environment.

A couple of notes

  1. dx should be preceded by a thin space; it's easy to forget it, so I provide a \diff command that adds it automatically;

  2. \Bigg is too large and it should be in the \Biggl and \Biggr varieties anyhow; I used \biggl and \biggr;

  3. in the aligned solution, there should be a \! before \sum to avoid an unwanted thin space.

\documentclass{article}
\usepackage{amsmath,mathtools}

\newcommand\diff{\mathop{}\!d}

\begin{document}

\begin{equation*}
\begin{split}
f(a)
&= \lim_{s} \frac{1}{2z} \int_{-w}^{+e}\int_{-r}^{+t} g(q)\cdot h(q)\diff x\diff y
\\
&= \lim_{s} \frac{1}{3s} \biggl\{
   \begin{aligned}[t]
     &\!\sum_{w} \int_{-r}^{+t} g(q+e)\cdot h(q) \diff x \diff y \diff x \diff y \\
     &\!\sum_{w} \int_{-r}^{+t} g(q)\cdot h(q) \diff x \diff y \diff x \diff y 
   \biggr\}
   \end{aligned}
\end{split}
\end{equation*}

\begin{equation*}
\begin{split}
f(a)
&= \lim_{s} \frac{1}{2z} \int_{-w}^{+e}\int_{-r}^{+t} g(q)\cdot h(q)\diff x\diff y
\\
&= \lim_{s} \frac{1}{3s} \biggl\{
   \begin{multlined}[t]
     \sum_{w} \int_{-r}^{+t} g(q+e)\cdot h(q) \diff x \diff y \diff x \diff y \\
     \sum_{w} \int_{-r}^{+t} g(q)\cdot h(q) \diff x \diff y \diff x \diff y 
   \biggr\}
   \end{multlined}
\end{split}
\end{equation*}

\end{document}

enter image description here

1

A solution with an aligned environment nested in a align*. I also propose a different alignment, and an improvement for the spacing of differential symbols:

    \documentclass{article}
    \usepackage{amsmath}

     \begin{document}

   \begin{align*}
    f(a) &= \lim_{s} \frac{1}{2 z} \int_{-w}^{+e}\int_{-r}^{+t} g(q)\cdot h(q)\, d x\,d y &\\
        &= \lim_{s} \frac{1}{3s}\begin{aligned}[t]\Bigg\{ & \sum_{w} \int_{-r}^{+t} g(q+e)\cdot h(q) \,d x\,d y\,d x\,d y \\
        & \sum_{w} \int_{-r}^{+t} g(q)\cdot h(q) \,d x\, d y \, d x\, d y\, \Bigg\}\end{aligned}
    \end{align*}
    \bigskip

   \begin{align*}
    f(a) &= \lim_{s} \frac{1}{2 z} \int_{-w}^{+e}\int_{-r}^{+t} g(q)\cdot h(q) \,d x\,d y &\\
    &= \lim_{s} \frac{1}{3s}\begin{aligned}[t]\Bigg\{\sum_{w} \int_{-r}^{+t} g(q+e)\cdot h(q) \,d x\,d y\,d x\,d y & \\
   \sum_{w} \int_{-r}^{+t} g(q)\cdot h(q)\,d x\,d y\,d x\,d y &\,\Bigg\}\end{aligned}
    \end{align*}

     \end{document}

enter image description here

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.