# Align multiline equation with expression after equal sign

I am trying to align a multiline equation using array within the equation but it turns out it doesn't do very well. The code I am using is as follows:

$$\ \begin{array}{lcl} \mathcal{L}^{-1}\left\{f(d)\right\} &= \mathcal{L}^{-1}\left\{f_1(\delta).f_2(\delta)\right\} \\ & = exp(mt) \star \left\{\frac{l}{2\sqrt{\pi t^3}} exp(-l^2/{4t})\right\} \\ & = F_1 * F_2 \end{array}$$


Can anyone suggest better way to deal with it ?

-

array is not designed for aligning equations, it is designed for arrays and matrices. The amsmath package has a host of alignment environments, I give a couple of examples:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align}
\mathcal{L}^{-1}\left\{f(d)\right\} &= \mathcal{L}^{-1}\left\{f_1(\delta).f_2(\delta)\right\} \\
& = \exp(mt) \star \left\{\frac{l}{2\sqrt{\pi t^3}} \exp(-l^2/{4t})\right\} \\
& = F_1 * F_2
\end{align}

or

\begin{aligned} \mathcal{L}^{-1}\left\{f(d)\right\} &= \mathcal{L}^{-1}\left\{f_1(\delta).f_2(\delta)\right\} \\ & = \exp(mt) \star \left\{\frac{l}{2\sqrt{\pi t^3}} exp(-l^2/{4t})\right\} \\ & = F_1 * F_2 \end{aligned}

\end{document}


note that exp is a multi-letter identifier so shouldn't be set in math italic.

-
@ David: That was very quick and works perfect. Thank you so much for your time and effort. I found this post and tried to follow that kogler.wordpress.com/2008/03/21/… –  Jdbaba Mar 27 at 23:00
The second example works better in this case. If I use \begin{align} then it would put three equations on three lines. I just want only one. –  Jdbaba Mar 27 at 23:02
@Jdbaba yes you can suppress two of the three numbers in aligned (\notag) sometimes things are clearly one long equation that you need to wrap, for chained = you can think of it as lots of equations or one long one, anyway it's your document you can get to choose (there are other choices such as gathered and split as well...) –  David Carlisle Mar 27 at 23:08
The following equation do not align using aligned. Is there any reason ? \begin{aligned} F_1 \star F_2 = \int_0^t e^{m(t-\tau)} \frac{l}{2\sqrt{\pi t^3}} e^{\frac{-l^2}{4t}} \\ & = \frac{l e^{mt}}{2\pi^{1/2}}\int_0^t \frac{e^{(-(m\tau+l^2/{4t}))}}{\tau ^{3/2}} \end{aligned} –  Jdbaba Mar 27 at 23:12
don't you want a & before the first = ? –  David Carlisle Mar 27 at 23:14
show 1 more comment

David's solution is the correct way to go for this case, but you can use array for this and sometimes it does come in handy:

So, the changes required are:

• Your second column should have been left aligned, not right aligned.
• You need to eliminate the inter column spacing using @{}, and use &{}= to get the proper math spacing around the equal signs.
• You should use \exp instead of exp as that is an operator and not a variable.
• Perhaps use \cdot instead of . (unless the lower dot notation is something I am not familiar with).

As David Carlisle commented, this formulas are displayed in the cramped \textstyle. If you desire the \displaystyle you need to add \displaystyle where it is needed (in this case the second line) to obtain:

Or, if you include the array pacakge then you can include the >{\displaystyle} style to the column specification (as illustrated in last part of MWE).

## Code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{array}

\begin{document}\noindent
Without \verb|\displaystyle|:
$$\begin{array}{l@{}l} \mathcal{L}^{-1}\left\{f(d)\right\} &{}= \mathcal{L}^{-1}\left\{f_1(\delta) \cdot f_2(\delta)\right\} \\ &{}= \exp(mt) \star \left\{\frac{l}{2\sqrt{\pi t^3}} \exp(-l^2/{4t})\right\} \\ &{}= F_1 * F_2 \end{array}$$
With \verb|\displaystyle|:
$$\begin{array}{l@{}l} \mathcal{L}^{-1}\left\{f(d)\right\} &{}= \mathcal{L}^{-1}\left\{f_1(\delta) \cdot f_2(\delta)\right\} \\ &{}= \displaystyle\exp(mt) \star \left\{\frac{l}{2\sqrt{\pi t^3}} \exp(-l^2/{4t})\right\} \\ &{}= F_1 * F_2 \end{array}$$
With \verb|\displaystyle| and \verb|array| package:
$$\begin{array}{l@{}>{\displaystyle}l} \mathcal{L}^{-1}\left\{f(d)\right\} &{}= \mathcal{L}^{-1}\left\{f_1(\delta) \cdot f_2(\delta)\right\} \\ &{}= \exp(mt) \star \left\{\frac{l}{2\sqrt{\pi t^3}} \exp(-l^2/{4t})\right\} \\ &{}= F_1 * F_2 \end{array}$$
\end{document}


You can eliminate the need for using &{}= by burying that in the array column spec:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$$\begin{array}{l@{{}={}}l} \mathcal{L}^{-1}\left\{f(d)\right\} & \mathcal{L}^{-1}\left\{f_1(\delta).f_2(\delta)\right\} \\ & \exp(mt) \star \left\{\frac{l}{2\sqrt{\pi t^3}} \exp(-l^2/{4t})\right\} \\ & F_1 * F_2 \end{array}$$
\end{document}

-
Note that this will set the equation in \textstyle not \displaystyle –  David Carlisle Mar 27 at 23:13
@DavidCarlisle: Wow, can't believe I have never noticed that yet. I got me some checking to do in my docs. :-) –  Peter Grill Mar 27 at 23:16
You can use array package and >{\displaystyle}l... –  David Carlisle Mar 27 at 23:17