3

I am preparing a class and I ran into this problem... Is it possible to use align inside a array environment?

I was thinking of putting 4 equations as the elements of a matrix. But the first element contains 2 rows, aligned as below

\begin{array}{ll}
\begin{align*}
d_1 &=\frac{ ln\left(\frac{F^P_{t,T}(S)}{F^P_{t,T}(K)}\right) + \left(\frac{ \sigma^2}{2}\right) (T-t)} {\sigma \sqrt{T-t}}\\
&= \frac{ ln\left(\frac{90.1242}{90.3668}\right) + \left(\frac{ 0.25^2}{2}\right) (1)} {0.25 \sqrt{1}}=0.1142
\end{align*}                                               &            N(d_1)=\\ 
d_2=0.1142 - 0.25 = -0.1358                               &         N(d_2)= \] 

Probably it is not possible because both use the symbol &. Any suggestions?

Thanks

2
  • 1
    Why don't you use alignedat?
    – user11232
    Commented Sep 14, 2014 at 3:38
  • Thanks I have never heard of it but now I have searched and it seems to work for my purposes.
    – feanor22
    Commented Sep 14, 2014 at 4:04

2 Answers 2

2

amsmath provides many environments like aligned, alignedat etc which may be handy for such cases. For details, refer to amsldoc (texdoc amsldoc from terminal)

Here is a shot using aligned:

 \documentclass{article}
\usepackage{amsmath}
\begin{document}
  \[\begin{array}{ll}
\begin{aligned}%[t]
d_1 &=\frac{ \ln\left(\frac{F^P_{t,T}(S)}{F^P_{t,T}(K)}\right) + \left(\frac{ \sigma^2}{2}\right) (T-t)} {σ\sqrt{T-t}}\\
&= \frac{ \ln\left(\frac{90.1242}{90.3668}\right) + \left(\frac{ 0.25^2}{2}\right) (1)} {0.25 \sqrt{1}}=0.1142
\end{aligned}                                               &            N(d_1)=\\
d_2=0.1142 - 0.25 = -0.1358                               &         N(d_2)=
\end{array}
\]
\end{document}

enter image description here

If you want to align at more than one point, you may consider using alignedat.

A better way would be to use alignedat alone without array.

1
  • I agree with you. All = signs would be aligned, and there would be a better vertical spacing.
    – Bernard
    Commented Sep 14, 2014 at 11:24
1

In my experience, the benefits of constructing complicated layouts often do not exceed their drawbacks. For instance, your students might completely overlook the N(d_1) and N(d_2) parts if they're stuck far to the right of the other material. Your students may be better off, I suspect, if the material is presented with a single vertical alignment axis, which may be constructed with an align* environment. To improve the intelligibility of the typeset material, I'd spend time getting consistent sizes of the large parentheses in each of the major parts of the math material.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
d_1 
&=\frac{ \ln\Bigl(\frac{F^P_{t,T}(S)}{F^P_{t,T}(K)}\Bigr)  % use \Big[lr] instead of \left and \right
    + \left(\frac{ \sigma^2}{2}\right) (T-t)} {\sigma \sqrt{T-t}}\\
&= \frac{ \ln\left(\frac{90.1242}{90.3668}\right) 
    + \bigl(\frac{ 0.25^2}{2}\bigr) (1)} {0.25 \sqrt{1}}=0.1142\\ % use \big[lr] instead of \left and \right
N(d_1) &= \dots\\[2ex]  % provide a bit more vertical space
d_2 &=0.1142 - 0.25 = -0.1358\\
N(d_2) &= \dots\\
\end{align*}
\end{document}

You must log in to answer this question.

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